~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to pdns/dnsrecords.hh

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Mohlmann, Matthijs Mohlmann, Christoph Haas
  • Date: 2007-04-15 23:23:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415232339-5x3scc8gx04e50um
Tags: 2.9.21-1
[ Matthijs Mohlmann ]
* New upstream release. (Closes: #420294)
* Remove meta pdns package.
* Added new sqlite3 backend package.
* Months and minutes where mixed up. (Closes: #406462)
* Case sensitivity in bind backend caused PowerDNS to not serve a certain
  zone. (Closes: #406461)
* Bind backend forgot about zones on a notify. (Closes: #398213)

[ Christoph Haas ]
* Documented incorporated backend bind. (Closes: #415471)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
    You should have received a copy of the GNU General Public License
15
15
    along with this program; if not, write to the Free Software
16
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
*/
18
18
 
19
19
#ifndef PDNS_DNSRECORDS_HH
31
31
#define includeboilerplate(RNAME)   RNAME##RecordContent(const DNSRecord& dr, PacketReader& pr); \
32
32
  RNAME##RecordContent(const string& zoneData);                                                  \
33
33
  static void report(void);                                                                      \
 
34
  static void unreport(void);                                                                    \
34
35
  static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);                          \
35
36
  static DNSRecordContent* make(const string& zonedata);                                         \
36
37
  string getZoneRepresentation() const;                                                          \
132
133
  string d_content;
133
134
};
134
135
 
 
136
class MRRecordContent : public DNSRecordContent
 
137
{
 
138
public:
 
139
  includeboilerplate(MR)
 
140
 
 
141
private:
 
142
  string d_alias;
 
143
};
 
144
 
135
145
 
136
146
class OPTRecordContent : public DNSRecordContent
137
147
{
185
195
  string d_digest;
186
196
};
187
197
 
 
198
class SSHFPRecordContent : public DNSRecordContent
 
199
{
 
200
public:
 
201
  includeboilerplate(SSHFP)
 
202
 
 
203
private:
 
204
  uint8_t d_algorithm, d_fptype;
 
205
  string d_fingerprint;
 
206
};
 
207
 
 
208
class KEYRecordContent : public DNSRecordContent
 
209
{
 
210
public:
 
211
  includeboilerplate(KEY)
 
212
 
 
213
private:
 
214
  uint16_t d_flags;
 
215
  uint8_t d_protocol, d_algorithm;
 
216
  string d_certificate;
 
217
};
 
218
 
 
219
class AFSDBRecordContent : public DNSRecordContent
 
220
{
 
221
public:
 
222
  includeboilerplate(AFSDB)
 
223
 
 
224
private:
 
225
  uint16_t d_subtype;
 
226
  string d_hostname;
 
227
};
 
228
 
 
229
 
 
230
class CERTRecordContent : public DNSRecordContent
 
231
{
 
232
public:
 
233
  includeboilerplate(CERT)
 
234
 
 
235
private:
 
236
  uint16_t d_type, d_tag;
 
237
  uint8_t d_algorithm;
 
238
  string d_certificate;
 
239
};
188
240
 
189
241
class RRSIGRecordContent : public DNSRecordContent
190
242
{
242
294
private:
243
295
};
244
296
 
245
 
 
 
297
class LOCRecordContent : public DNSRecordContent
 
298
{
 
299
public:
 
300
  static void report(void);
 
301
  LOCRecordContent() : DNSRecordContent(ns_t_loc)
 
302
  {}
 
303
  LOCRecordContent(const string& content, const string& zone="");
 
304
 
 
305
  static DNSRecordContent* make(const DNSRecord &dr, PacketReader& pr);
 
306
  static DNSRecordContent* make(const string& content);
 
307
  string getZoneRepresentation() const;
 
308
  void toPacket(DNSPacketWriter& pw);
 
309
 
 
310
  uint8_t d_version, d_size, d_horizpre, d_vertpre;
 
311
  uint32_t d_latitude, d_longitude, d_altitude;
 
312
  
 
313
private:
 
314
};
246
315
 
247
316
#define boilerplate(RNAME, RTYPE)                                                                         \
248
317
RNAME##RecordContent::DNSRecordContent* RNAME##RecordContent::make(const DNSRecord& dr, PacketReader& pr) \
270
339
{                                                                                                  \
271
340
  regist(1, RTYPE, &RNAME##RecordContent::make, &RNAME##RecordContent::make, #RNAME);              \
272
341
}                                                                                                  \
 
342
void RNAME##RecordContent::unreport(void)                                                          \
 
343
{                                                                                                  \
 
344
  unregist(1, RTYPE);                                                                              \
 
345
}                                                                                                  \
273
346
                                                                                                   \
274
347
RNAME##RecordContent::RNAME##RecordContent(const string& zoneData) : DNSRecordContent(RTYPE)       \
275
348
{                                                                                                  \
276
 
  RecordTextReader rtr(zoneData);                                                                  \
277
 
  xfrPacket(rtr);                                                                                  \
 
349
  try {                                                                                            \
 
350
    RecordTextReader rtr(zoneData);                                                                \
 
351
    xfrPacket(rtr);                                                                                \
 
352
  }                                                                                                \
 
353
  catch(RecordTextException& rtr) {                                                                \
 
354
    throw MOADNSException("Parsing record content: "+string(rtr.what()));                          \
 
355
  }                                                                                                \
278
356
}                                                                                                  \
279
357
                                                                                                   \
280
358
string RNAME##RecordContent::getZoneRepresentation() const                                         \