rdataclass.h 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581
  1. ///////////////
  2. ///////////////
  3. /////////////// THIS FILE IS AUTOMATICALLY GENERATED BY gen-rdatacode.py.
  4. /////////////// DO NOT EDIT!
  5. ///////////////
  6. ///////////////
  7. #ifndef DNS_RDATACLASS_H
  8. #define DNS_RDATACLASS_H 1
  9. #include <dns/master_loader.h>
  10. namespace isc {
  11. namespace dns {
  12. class Name;
  13. class MasterLexer;
  14. class MasterLoaderCallbacks;
  15. }
  16. }
  17. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  18. //
  19. // This Source Code Form is subject to the terms of the Mozilla Public
  20. // License, v. 2.0. If a copy of the MPL was not distributed with this
  21. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  22. #ifndef ANY_TSIG_250_H
  23. #define ANY_TSIG_250_H 1
  24. #include <stdint.h>
  25. #include <string>
  26. #include <dns/name.h>
  27. #include <dns/rdata.h>
  28. namespace isc {
  29. namespace util {
  30. class InputBuffer;
  31. class OutputBuffer;
  32. }
  33. namespace dns {
  34. // BEGIN_COMMON_DECLARATIONS
  35. class AbstractMessageRenderer;
  36. // END_COMMON_DECLARATIONS
  37. namespace rdata {
  38. namespace any {
  39. struct TSIGImpl;
  40. /// \brief \c rdata::TSIG class represents the TSIG RDATA as defined %in
  41. /// RFC2845.
  42. ///
  43. /// This class implements the basic interfaces inherited from the abstract
  44. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  45. /// TSIG RDATA.
  46. class TSIG : public Rdata {
  47. public:
  48. // BEGIN_COMMON_MEMBERS
  49. explicit TSIG(const std::string& type_str);
  50. TSIG(isc::util::InputBuffer& buffer, size_t rdata_len);
  51. TSIG(const TSIG& other);
  52. TSIG(
  53. MasterLexer& lexer, const Name* name,
  54. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  55. virtual std::string toText() const;
  56. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  57. virtual void toWire(AbstractMessageRenderer& renderer) const;
  58. virtual int compare(const Rdata& other) const;
  59. // END_COMMON_MEMBERS
  60. /// \brief Constructor from RDATA field parameters.
  61. ///
  62. /// The parameters are a straightforward mapping of %TSIG RDATA
  63. /// fields as defined %in RFC2845, but there are some implementation
  64. /// specific notes as follows.
  65. ///
  66. /// \c algorithm is a \c Name object that specifies the algorithm.
  67. /// For example, if the algorithm is HMAC-SHA256, \c algorithm would be
  68. /// \c Name("hmac-sha256").
  69. ///
  70. /// \c time_signed corresponds to the Time Signed field, which is of
  71. /// 48-bit unsigned integer type, and therefore cannot exceed 2^48-1;
  72. /// otherwise, an exception of type \c OutOfRange will be thrown.
  73. ///
  74. /// \c mac_size and \c mac correspond to the MAC Size and MAC fields,
  75. /// respectively. When the MAC field is empty, \c mac must be NULL.
  76. /// \c mac_size and \c mac must be consistent %in that \c mac_size is 0 if
  77. /// and only if \c mac is NULL; otherwise an exception of type
  78. /// InvalidParameter will be thrown.
  79. ///
  80. /// The same restriction applies to \c other_len and \c other_data,
  81. /// which correspond to the Other Len and Other Data fields, respectively.
  82. ///
  83. /// This constructor internally involves resource allocation, and if
  84. /// it fails, a corresponding standard exception will be thrown.
  85. TSIG(const Name& algorithm, uint64_t time_signed, uint16_t fudge,
  86. uint16_t mac_size, const void* mac, uint16_t original_id,
  87. uint16_t error, uint16_t other_len, const void* other_data);
  88. /// \brief Assignment operator.
  89. ///
  90. /// It internally allocates a resource, and if it fails a corresponding
  91. /// standard exception will be thrown.
  92. /// This operator never throws an exception otherwise.
  93. ///
  94. /// This operator provides the strong exception guarantee: When an
  95. /// exception is thrown the content of the assignment target will be
  96. /// intact.
  97. TSIG& operator=(const TSIG& source);
  98. /// \brief The destructor.
  99. ~TSIG();
  100. /// \brief Return the algorithm name.
  101. ///
  102. /// This method never throws an exception.
  103. const Name& getAlgorithm() const;
  104. /// \brief Return the value of the Time Signed field.
  105. ///
  106. /// The returned value does not exceed 2^48-1.
  107. ///
  108. /// This method never throws an exception.
  109. uint64_t getTimeSigned() const;
  110. /// \brief Return the value of the Fudge field.
  111. ///
  112. /// This method never throws an exception.
  113. uint16_t getFudge() const;
  114. /// \brief Return the value of the MAC Size field.
  115. ///
  116. /// This method never throws an exception.
  117. uint16_t getMACSize() const;
  118. /// \brief Return the value of the MAC field.
  119. ///
  120. /// If the MAC field is empty, it returns NULL.
  121. /// Otherwise, the memory region beginning at the address returned by
  122. /// this method is valid up to the bytes specified by the return value
  123. /// of \c getMACSize().
  124. /// The memory region is only valid while the corresponding \c TSIG
  125. /// object is valid. The caller must hold the \c TSIG object while
  126. /// it needs to refer to the region or it must make a local copy of the
  127. /// region.
  128. ///
  129. /// This method never throws an exception.
  130. const void* getMAC() const;
  131. /// \brief Return the value of the Original ID field.
  132. ///
  133. /// This method never throws an exception.
  134. uint16_t getOriginalID() const;
  135. /// \brief Return the value of the Error field.
  136. ///
  137. /// This method never throws an exception.
  138. uint16_t getError() const;
  139. /// \brief Return the value of the Other Len field.
  140. ///
  141. /// This method never throws an exception.
  142. uint16_t getOtherLen() const;
  143. /// \brief Return the value of the Other Data field.
  144. ///
  145. /// The same note as \c getMAC() applies.
  146. ///
  147. /// This method never throws an exception.
  148. const void* getOtherData() const;
  149. private:
  150. TSIGImpl* constructFromLexer(MasterLexer& lexer, const Name* origin);
  151. TSIGImpl* impl_;
  152. };
  153. } // end of namespace "any"
  154. } // end of namespace "rdata"
  155. } // end of namespace "dns"
  156. } // end of namespace "isc"
  157. #endif // ANY_TSIG_250_H
  158. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  159. //
  160. // This Source Code Form is subject to the terms of the Mozilla Public
  161. // License, v. 2.0. If a copy of the MPL was not distributed with this
  162. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  163. #ifndef CH_A_1_H
  164. #define CH_A_1_H 1
  165. #include <string>
  166. #include <dns/rdata.h>
  167. namespace isc {
  168. namespace util {
  169. class InputBuffer;
  170. class OutputBuffer;
  171. }
  172. namespace dns {
  173. // BEGIN_COMMON_DECLARATIONS
  174. class AbstractMessageRenderer;
  175. // END_COMMON_DECLARATIONS
  176. namespace rdata {
  177. namespace ch {
  178. class A : public Rdata {
  179. public:
  180. // BEGIN_COMMON_MEMBERS
  181. explicit A(const std::string& type_str);
  182. A(isc::util::InputBuffer& buffer, size_t rdata_len);
  183. A(const A& other);
  184. A(
  185. MasterLexer& lexer, const Name* name,
  186. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  187. virtual std::string toText() const;
  188. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  189. virtual void toWire(AbstractMessageRenderer& renderer) const;
  190. virtual int compare(const Rdata& other) const;
  191. // END_COMMON_MEMBERS
  192. };
  193. } // end of namespace "ch"
  194. } // end of namespace "rdata"
  195. } // end of namespace "dns"
  196. } // end of namespace "isc"
  197. #endif // CH_A_1_H
  198. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  199. //
  200. // This Source Code Form is subject to the terms of the Mozilla Public
  201. // License, v. 2.0. If a copy of the MPL was not distributed with this
  202. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  203. #ifndef GENERIC_AFSDB_18_H
  204. #define GENERIC_AFSDB_18_H 1
  205. #include <stdint.h>
  206. #include <string>
  207. #include <dns/name.h>
  208. #include <dns/rdata.h>
  209. namespace isc {
  210. namespace util {
  211. class InputBuffer;
  212. class OutputBuffer;
  213. }
  214. namespace dns {
  215. // BEGIN_COMMON_DECLARATIONS
  216. class AbstractMessageRenderer;
  217. // END_COMMON_DECLARATIONS
  218. namespace rdata {
  219. namespace generic {
  220. /// \brief \c rdata::AFSDB class represents the AFSDB RDATA as defined %in
  221. /// RFC1183.
  222. ///
  223. /// This class implements the basic interfaces inherited from the abstract
  224. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  225. /// AFSDB RDATA.
  226. class AFSDB : public Rdata {
  227. public:
  228. // BEGIN_COMMON_MEMBERS
  229. explicit AFSDB(const std::string& type_str);
  230. AFSDB(isc::util::InputBuffer& buffer, size_t rdata_len);
  231. AFSDB(const AFSDB& other);
  232. AFSDB(
  233. MasterLexer& lexer, const Name* name,
  234. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  235. virtual std::string toText() const;
  236. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  237. virtual void toWire(AbstractMessageRenderer& renderer) const;
  238. virtual int compare(const Rdata& other) const;
  239. // END_COMMON_MEMBERS
  240. /// \brief Assignment operator.
  241. ///
  242. /// This method never throws an exception.
  243. AFSDB& operator=(const AFSDB& source);
  244. ///
  245. /// Specialized methods
  246. ///
  247. /// \brief Return the value of the server field.
  248. ///
  249. /// \return A reference to a \c Name class object corresponding to the
  250. /// internal server name.
  251. ///
  252. /// This method never throws an exception.
  253. const Name& getServer() const;
  254. /// \brief Return the value of the subtype field.
  255. ///
  256. /// This method never throws an exception.
  257. uint16_t getSubtype() const;
  258. private:
  259. void createFromLexer(MasterLexer& lexer, const Name* origin);
  260. uint16_t subtype_;
  261. Name server_;
  262. };
  263. } // end of namespace "generic"
  264. } // end of namespace "rdata"
  265. } // end of namespace "dns"
  266. } // end of namespace "isc"
  267. #endif // GENERIC_AFSDB_18_H
  268. // Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
  269. //
  270. // This Source Code Form is subject to the terms of the Mozilla Public
  271. // License, v. 2.0. If a copy of the MPL was not distributed with this
  272. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  273. #ifndef GENERIC_CAA_257_H
  274. #define GENERIC_CAA_257_H 1
  275. #include <stdint.h>
  276. #include <dns/name.h>
  277. #include <dns/rdata.h>
  278. #include <string>
  279. #include <vector>
  280. namespace isc {
  281. namespace util {
  282. class InputBuffer;
  283. class OutputBuffer;
  284. }
  285. namespace dns {
  286. // BEGIN_COMMON_DECLARATIONS
  287. class AbstractMessageRenderer;
  288. // END_COMMON_DECLARATIONS
  289. namespace rdata {
  290. namespace generic {
  291. struct CAAImpl;
  292. class CAA : public Rdata {
  293. public:
  294. // BEGIN_COMMON_MEMBERS
  295. explicit CAA(const std::string& caa_str);
  296. CAA(isc::util::InputBuffer& buffer, size_t rdata_len);
  297. CAA(const CAA& other);
  298. CAA(
  299. MasterLexer& lexer, const Name* name,
  300. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  301. virtual std::string toText() const;
  302. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  303. virtual void toWire(AbstractMessageRenderer& renderer) const;
  304. virtual int compare(const Rdata& other) const;
  305. // END_COMMON_MEMBERS
  306. CAA(uint8_t flags, const std::string& tag, const std::string& value);
  307. CAA& operator=(const CAA& source);
  308. ~CAA();
  309. ///
  310. /// Specialized methods
  311. ///
  312. /// \brief Return the Flags field of the CAA RDATA.
  313. uint8_t getFlags() const;
  314. /// \brief Return the Tag field of the CAA RDATA.
  315. const std::string& getTag() const;
  316. /// \brief Return the Value field of the CAA RDATA.
  317. ///
  318. /// Note: The const reference which is returned is valid only during
  319. /// the lifetime of this \c generic::CAA object. It should not be
  320. /// used afterwards.
  321. const std::vector<uint8_t>& getValue() const;
  322. private:
  323. CAAImpl* constructFromLexer(MasterLexer& lexer);
  324. CAAImpl* impl_;
  325. };
  326. } // end of namespace "generic"
  327. } // end of namespace "rdata"
  328. } // end of namespace "dns"
  329. } // end of namespace "isc"
  330. #endif // GENERIC_CAA_257_H
  331. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  332. //
  333. // This Source Code Form is subject to the terms of the Mozilla Public
  334. // License, v. 2.0. If a copy of the MPL was not distributed with this
  335. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  336. #ifndef GENERIC_CNAME_5_H
  337. #define GENERIC_CNAME_5_H 1
  338. #include <string>
  339. #include <dns/name.h>
  340. #include <dns/rdata.h>
  341. namespace isc {
  342. namespace util {
  343. class InputBuffer;
  344. class OutputBuffer;
  345. }
  346. namespace dns {
  347. // BEGIN_COMMON_DECLARATIONS
  348. class AbstractMessageRenderer;
  349. // END_COMMON_DECLARATIONS
  350. namespace rdata {
  351. namespace generic {
  352. class CNAME : public Rdata {
  353. public:
  354. // BEGIN_COMMON_MEMBERS
  355. explicit CNAME(const std::string& type_str);
  356. CNAME(isc::util::InputBuffer& buffer, size_t rdata_len);
  357. CNAME(const CNAME& other);
  358. CNAME(
  359. MasterLexer& lexer, const Name* name,
  360. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  361. virtual std::string toText() const;
  362. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  363. virtual void toWire(AbstractMessageRenderer& renderer) const;
  364. virtual int compare(const Rdata& other) const;
  365. // END_COMMON_MEMBERS
  366. // CNAME specific methods
  367. CNAME(const Name& cname);
  368. const Name& getCname() const;
  369. private:
  370. Name cname_;
  371. };
  372. } // end of namespace "generic"
  373. } // end of namespace "rdata"
  374. } // end of namespace "dns"
  375. } // end of namespace "isc"
  376. #endif // GENERIC_CNAME_5_H
  377. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  378. //
  379. // This Source Code Form is subject to the terms of the Mozilla Public
  380. // License, v. 2.0. If a copy of the MPL was not distributed with this
  381. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  382. #ifndef GENERIC_DLV_32769_H
  383. #define GENERIC_DLV_32769_H 1
  384. #include <stdint.h>
  385. #include <string>
  386. #include <dns/name.h>
  387. #include <dns/rrtype.h>
  388. #include <dns/rrttl.h>
  389. #include <dns/rdata.h>
  390. namespace isc {
  391. namespace util {
  392. class InputBuffer;
  393. class OutputBuffer;
  394. }
  395. namespace dns {
  396. // BEGIN_COMMON_DECLARATIONS
  397. class AbstractMessageRenderer;
  398. // END_COMMON_DECLARATIONS
  399. namespace rdata {
  400. namespace generic {
  401. namespace detail {
  402. template <class Type, uint16_t typeCode> class DSLikeImpl;
  403. }
  404. /// \brief \c rdata::generic::DLV class represents the DLV RDATA as defined in
  405. /// RFC4431.
  406. ///
  407. /// This class implements the basic interfaces inherited from the abstract
  408. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  409. /// DLV RDATA.
  410. class DLV : public Rdata {
  411. public:
  412. // BEGIN_COMMON_MEMBERS
  413. explicit DLV(const std::string& type_str);
  414. DLV(isc::util::InputBuffer& buffer, size_t rdata_len);
  415. DLV(const DLV& other);
  416. DLV(
  417. MasterLexer& lexer, const Name* name,
  418. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  419. virtual std::string toText() const;
  420. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  421. virtual void toWire(AbstractMessageRenderer& renderer) const;
  422. virtual int compare(const Rdata& other) const;
  423. // END_COMMON_MEMBERS
  424. /// \brief Assignment operator.
  425. ///
  426. /// It internally allocates a resource, and if it fails a corresponding
  427. /// standard exception will be thrown.
  428. /// This operator never throws an exception otherwise.
  429. ///
  430. /// This operator provides the strong exception guarantee: When an
  431. /// exception is thrown the content of the assignment target will be
  432. /// intact.
  433. DLV& operator=(const DLV& source);
  434. /// \brief The destructor.
  435. ~DLV();
  436. /// \brief Return the value of the Tag field.
  437. ///
  438. /// This method never throws an exception.
  439. uint16_t getTag() const;
  440. private:
  441. typedef detail::DSLikeImpl<DLV, 32769> DLVImpl;
  442. DLVImpl* impl_;
  443. };
  444. } // end of namespace "generic"
  445. } // end of namespace "rdata"
  446. } // end of namespace "dns"
  447. } // end of namespace "isc"
  448. #endif // GENERIC_DLV_32769_H
  449. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  450. //
  451. // This Source Code Form is subject to the terms of the Mozilla Public
  452. // License, v. 2.0. If a copy of the MPL was not distributed with this
  453. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  454. #ifndef GENERIC_DNAME_39_H
  455. #define GENERIC_DNAME_39_H 1
  456. #include <string>
  457. #include <dns/name.h>
  458. #include <dns/rdata.h>
  459. namespace isc {
  460. namespace util {
  461. class InputBuffer;
  462. class OutputBuffer;
  463. }
  464. namespace dns {
  465. // BEGIN_COMMON_DECLARATIONS
  466. class AbstractMessageRenderer;
  467. // END_COMMON_DECLARATIONS
  468. namespace rdata {
  469. namespace generic {
  470. class DNAME : public Rdata {
  471. public:
  472. // BEGIN_COMMON_MEMBERS
  473. explicit DNAME(const std::string& type_str);
  474. DNAME(isc::util::InputBuffer& buffer, size_t rdata_len);
  475. DNAME(const DNAME& other);
  476. DNAME(
  477. MasterLexer& lexer, const Name* name,
  478. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  479. virtual std::string toText() const;
  480. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  481. virtual void toWire(AbstractMessageRenderer& renderer) const;
  482. virtual int compare(const Rdata& other) const;
  483. // END_COMMON_MEMBERS
  484. // DNAME specific methods
  485. DNAME(const Name& dname);
  486. const Name& getDname() const;
  487. private:
  488. Name dname_;
  489. };
  490. } // end of namespace "generic"
  491. } // end of namespace "rdata"
  492. } // end of namespace "dns"
  493. } // end of namespace "isc"
  494. #endif // GENERIC_DNAME_39_H
  495. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  496. //
  497. // This Source Code Form is subject to the terms of the Mozilla Public
  498. // License, v. 2.0. If a copy of the MPL was not distributed with this
  499. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  500. #include <stdint.h>
  501. #include <string>
  502. #include <dns/name.h>
  503. #include <dns/rrtype.h>
  504. #include <dns/rrttl.h>
  505. #include <dns/rdata.h>
  506. #include <dns/master_lexer.h>
  507. #ifndef GENERIC_DNSKEY_48_H
  508. #define GENERIC_DNSKEY_48_H 1
  509. namespace isc {
  510. namespace util {
  511. class InputBuffer;
  512. class OutputBuffer;
  513. }
  514. namespace dns {
  515. // BEGIN_COMMON_DECLARATIONS
  516. class AbstractMessageRenderer;
  517. // END_COMMON_DECLARATIONS
  518. namespace rdata {
  519. namespace generic {
  520. struct DNSKEYImpl;
  521. class DNSKEY : public Rdata {
  522. public:
  523. // BEGIN_COMMON_MEMBERS
  524. explicit DNSKEY(const std::string& type_str);
  525. DNSKEY(isc::util::InputBuffer& buffer, size_t rdata_len);
  526. DNSKEY(const DNSKEY& other);
  527. DNSKEY(
  528. MasterLexer& lexer, const Name* name,
  529. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  530. virtual std::string toText() const;
  531. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  532. virtual void toWire(AbstractMessageRenderer& renderer) const;
  533. virtual int compare(const Rdata& other) const;
  534. // END_COMMON_MEMBERS
  535. DNSKEY& operator=(const DNSKEY& source);
  536. ~DNSKEY();
  537. ///
  538. /// Specialized methods
  539. ///
  540. /// \brief Returns the key tag
  541. ///
  542. /// \throw isc::OutOfRange if the key data for RSA/MD5 is too short
  543. /// to support tag extraction.
  544. uint16_t getTag() const;
  545. uint16_t getFlags() const;
  546. uint8_t getAlgorithm() const;
  547. private:
  548. DNSKEYImpl* constructFromLexer(isc::dns::MasterLexer& lexer);
  549. DNSKEYImpl* impl_;
  550. };
  551. } // end of namespace "generic"
  552. } // end of namespace "rdata"
  553. } // end of namespace "dns"
  554. } // end of namespace "isc"
  555. #endif // GENERIC_DNSKEY_48_H
  556. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  557. //
  558. // This Source Code Form is subject to the terms of the Mozilla Public
  559. // License, v. 2.0. If a copy of the MPL was not distributed with this
  560. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  561. #ifndef GENERIC_DS_43_H
  562. #define GENERIC_DS_43_H 1
  563. #include <stdint.h>
  564. #include <string>
  565. #include <dns/name.h>
  566. #include <dns/rrtype.h>
  567. #include <dns/rrttl.h>
  568. #include <dns/rdata.h>
  569. namespace isc {
  570. namespace util {
  571. class InputBuffer;
  572. class OutputBuffer;
  573. }
  574. namespace dns {
  575. // BEGIN_COMMON_DECLARATIONS
  576. class AbstractMessageRenderer;
  577. // END_COMMON_DECLARATIONS
  578. namespace rdata {
  579. namespace generic {
  580. namespace detail {
  581. template <class Type, uint16_t typeCode> class DSLikeImpl;
  582. }
  583. /// \brief \c rdata::generic::DS class represents the DS RDATA as defined in
  584. /// RFC3658.
  585. ///
  586. /// This class implements the basic interfaces inherited from the abstract
  587. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  588. /// DS RDATA.
  589. class DS : public Rdata {
  590. public:
  591. // BEGIN_COMMON_MEMBERS
  592. explicit DS(const std::string& type_str);
  593. DS(isc::util::InputBuffer& buffer, size_t rdata_len);
  594. DS(const DS& other);
  595. DS(
  596. MasterLexer& lexer, const Name* name,
  597. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  598. virtual std::string toText() const;
  599. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  600. virtual void toWire(AbstractMessageRenderer& renderer) const;
  601. virtual int compare(const Rdata& other) const;
  602. // END_COMMON_MEMBERS
  603. /// \brief Assignment operator.
  604. ///
  605. /// It internally allocates a resource, and if it fails a corresponding
  606. /// standard exception will be thrown.
  607. /// This operator never throws an exception otherwise.
  608. ///
  609. /// This operator provides the strong exception guarantee: When an
  610. /// exception is thrown the content of the assignment target will be
  611. /// intact.
  612. DS& operator=(const DS& source);
  613. /// \brief The destructor.
  614. ~DS();
  615. /// \brief Return the value of the Tag field.
  616. ///
  617. /// This method never throws an exception.
  618. uint16_t getTag() const;
  619. private:
  620. typedef detail::DSLikeImpl<DS, 43> DSImpl;
  621. DSImpl* impl_;
  622. };
  623. } // end of namespace "generic"
  624. } // end of namespace "rdata"
  625. } // end of namespace "dns"
  626. } // end of namespace "isc"
  627. #endif // GENERIC_DS_43_H
  628. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  629. //
  630. // This Source Code Form is subject to the terms of the Mozilla Public
  631. // License, v. 2.0. If a copy of the MPL was not distributed with this
  632. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  633. #ifndef GENERIC_HINFO_13_H
  634. #define GENERIC_HINFO_13_H 1
  635. #include <stdint.h>
  636. #include <string>
  637. #include <boost/scoped_ptr.hpp>
  638. #include <boost/noncopyable.hpp>
  639. #include <dns/name.h>
  640. #include <dns/rdata.h>
  641. #include <util/buffer.h>
  642. namespace isc {
  643. namespace util {
  644. class InputBuffer;
  645. class OutputBuffer;
  646. }
  647. namespace dns {
  648. // BEGIN_COMMON_DECLARATIONS
  649. class AbstractMessageRenderer;
  650. // END_COMMON_DECLARATIONS
  651. namespace rdata {
  652. namespace generic {
  653. class HINFOImpl;
  654. /// \brief \c HINFO class represents the HINFO rdata defined in
  655. /// RFC1034, RFC1035
  656. ///
  657. /// This class implements the basic interfaces inherited from the
  658. /// \c rdata::Rdata class, and provides accessors specific to the
  659. /// HINFO rdata.
  660. class HINFO : public Rdata {
  661. public:
  662. // BEGIN_COMMON_MEMBERS
  663. explicit HINFO(const std::string& type_str);
  664. HINFO(isc::util::InputBuffer& buffer, size_t rdata_len);
  665. HINFO(const HINFO& other);
  666. HINFO(
  667. MasterLexer& lexer, const Name* name,
  668. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  669. virtual std::string toText() const;
  670. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  671. virtual void toWire(AbstractMessageRenderer& renderer) const;
  672. virtual int compare(const Rdata& other) const;
  673. // END_COMMON_MEMBERS
  674. // HINFO specific methods
  675. ~HINFO();
  676. HINFO& operator=(const HINFO&);
  677. const std::string getCPU() const;
  678. const std::string getOS() const;
  679. private:
  680. /// Helper template function for toWire()
  681. ///
  682. /// \param outputer Where to write data in
  683. template <typename T>
  684. void toWireHelper(T& outputer) const;
  685. boost::scoped_ptr<HINFOImpl> impl_;
  686. };
  687. } // end of namespace "generic"
  688. } // end of namespace "rdata"
  689. } // end of namespace "dns"
  690. } // end of namespace "isc"
  691. #endif // GENERIC_HINFO_13_H
  692. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  693. //
  694. // This Source Code Form is subject to the terms of the Mozilla Public
  695. // License, v. 2.0. If a copy of the MPL was not distributed with this
  696. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  697. #ifndef GENERIC_MINFO_14_H
  698. #define GENERIC_MINFO_14_H 1
  699. #include <string>
  700. #include <dns/name.h>
  701. #include <dns/rdata.h>
  702. namespace isc {
  703. namespace util {
  704. class InputBuffer;
  705. class OutputBuffer;
  706. }
  707. namespace dns {
  708. // BEGIN_COMMON_DECLARATIONS
  709. class AbstractMessageRenderer;
  710. // END_COMMON_DECLARATIONS
  711. namespace rdata {
  712. namespace generic {
  713. /// \brief \c rdata::generic::MINFO class represents the MINFO RDATA as
  714. /// defined in RFC1035.
  715. ///
  716. /// This class implements the basic interfaces inherited from the abstract
  717. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  718. /// MINFO RDATA.
  719. class MINFO : public Rdata {
  720. public:
  721. // BEGIN_COMMON_MEMBERS
  722. explicit MINFO(const std::string& type_str);
  723. MINFO(isc::util::InputBuffer& buffer, size_t rdata_len);
  724. MINFO(const MINFO& other);
  725. MINFO(
  726. MasterLexer& lexer, const Name* name,
  727. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  728. virtual std::string toText() const;
  729. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  730. virtual void toWire(AbstractMessageRenderer& renderer) const;
  731. virtual int compare(const Rdata& other) const;
  732. // END_COMMON_MEMBERS
  733. /// \brief Define the assignment operator.
  734. ///
  735. /// \exception std::bad_alloc Memory allocation fails in copying
  736. /// internal member variables (this should be very rare).
  737. MINFO& operator=(const MINFO& source);
  738. /// \brief Return the value of the rmailbox field.
  739. ///
  740. /// \throw std::bad_alloc If resource allocation for the returned
  741. /// \c Name fails.
  742. ///
  743. /// \note
  744. /// Unlike the case of some other RDATA classes (such as
  745. /// \c NS::getNSName()), this method constructs a new \c Name object
  746. /// and returns it, instead of returning a reference to a \c Name object
  747. /// internally maintained in the class (which is a private member).
  748. /// This is based on the observation that this method will be rarely
  749. /// used and even when it's used it will not be in a performance context
  750. /// (for example, a recursive resolver won't need this field in its
  751. /// resolution process). By returning a new object we have flexibility
  752. /// of changing the internal representation without the risk of changing
  753. /// the interface or method property.
  754. /// The same note applies to the \c getEmailbox() method.
  755. Name getRmailbox() const { return (rmailbox_); }
  756. /// \brief Return the value of the emailbox field.
  757. ///
  758. /// \throw std::bad_alloc If resource allocation for the returned
  759. /// \c Name fails.
  760. Name getEmailbox() const { return (emailbox_); }
  761. private:
  762. Name rmailbox_;
  763. Name emailbox_;
  764. };
  765. } // end of namespace "generic"
  766. } // end of namespace "rdata"
  767. } // end of namespace "dns"
  768. } // end of namespace "isc"
  769. #endif // GENERIC_MINFO_14_H
  770. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  771. //
  772. // This Source Code Form is subject to the terms of the Mozilla Public
  773. // License, v. 2.0. If a copy of the MPL was not distributed with this
  774. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  775. #ifndef GENERIC_MX_15_H
  776. #define GENERIC_MX_15_H 1
  777. #include <stdint.h>
  778. #include <string>
  779. #include <dns/name.h>
  780. #include <dns/rdata.h>
  781. namespace isc {
  782. namespace util {
  783. class InputBuffer;
  784. class OutputBuffer;
  785. }
  786. namespace dns {
  787. // BEGIN_COMMON_DECLARATIONS
  788. class AbstractMessageRenderer;
  789. // END_COMMON_DECLARATIONS
  790. namespace rdata {
  791. namespace generic {
  792. class MX : public Rdata {
  793. public:
  794. // BEGIN_COMMON_MEMBERS
  795. explicit MX(const std::string& type_str);
  796. MX(isc::util::InputBuffer& buffer, size_t rdata_len);
  797. MX(const MX& other);
  798. MX(
  799. MasterLexer& lexer, const Name* name,
  800. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  801. virtual std::string toText() const;
  802. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  803. virtual void toWire(AbstractMessageRenderer& renderer) const;
  804. virtual int compare(const Rdata& other) const;
  805. // END_COMMON_MEMBERS
  806. MX(uint16_t preference, const Name& mxname);
  807. ///
  808. /// Specialized methods
  809. ///
  810. const Name& getMXName() const;
  811. uint16_t getMXPref() const;
  812. private:
  813. void constructFromLexer(isc::dns::MasterLexer& lexer,
  814. const isc::dns::Name* origin);
  815. /// Note: this is a prototype version; we may reconsider
  816. /// this representation later.
  817. uint16_t preference_;
  818. Name mxname_;
  819. };
  820. } // end of namespace "generic"
  821. } // end of namespace "rdata"
  822. } // end of namespace "dns"
  823. } // end of namespace "isc"
  824. #endif // GENERIC_MX_15_H
  825. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  826. //
  827. // This Source Code Form is subject to the terms of the Mozilla Public
  828. // License, v. 2.0. If a copy of the MPL was not distributed with this
  829. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  830. #ifndef GENERIC_NAPTR_35_H
  831. #define GENERIC_NAPTR_35_H 1
  832. #include <string>
  833. #include <boost/scoped_ptr.hpp>
  834. #include <dns/name.h>
  835. #include <dns/rdata.h>
  836. #include <util/buffer.h>
  837. namespace isc {
  838. namespace util {
  839. class InputBuffer;
  840. class OutputBuffer;
  841. }
  842. namespace dns {
  843. // BEGIN_COMMON_DECLARATIONS
  844. class AbstractMessageRenderer;
  845. // END_COMMON_DECLARATIONS
  846. namespace rdata {
  847. namespace generic {
  848. class NAPTRImpl;
  849. /// \brief \c NAPTR class represents the NAPTR rdata defined in
  850. /// RFC2915, RFC2168 and RFC3403
  851. ///
  852. /// This class implements the basic interfaces inherited from the
  853. /// \c rdata::Rdata class, and provides accessors specific to the
  854. /// NAPTR rdata.
  855. class NAPTR : public Rdata {
  856. public:
  857. // BEGIN_COMMON_MEMBERS
  858. explicit NAPTR(const std::string& type_str);
  859. NAPTR(isc::util::InputBuffer& buffer, size_t rdata_len);
  860. NAPTR(const NAPTR& other);
  861. NAPTR(
  862. MasterLexer& lexer, const Name* name,
  863. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  864. virtual std::string toText() const;
  865. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  866. virtual void toWire(AbstractMessageRenderer& renderer) const;
  867. virtual int compare(const Rdata& other) const;
  868. // END_COMMON_MEMBERS
  869. // NAPTR specific methods
  870. ~NAPTR();
  871. NAPTR& operator=(const NAPTR& source);
  872. uint16_t getOrder() const;
  873. uint16_t getPreference() const;
  874. const std::string getFlags() const;
  875. const std::string getServices() const;
  876. const std::string getRegexp() const;
  877. const Name& getReplacement() const;
  878. private:
  879. /// Helper template function for toWire()
  880. ///
  881. /// \param outputer Where to write data in
  882. template <typename T>
  883. void toWireHelper(T& outputer) const;
  884. boost::scoped_ptr<NAPTRImpl> impl_;
  885. };
  886. } // end of namespace "generic"
  887. } // end of namespace "rdata"
  888. } // end of namespace "dns"
  889. } // end of namespace "isc"
  890. #endif // GENERIC_NAPTR_35_H
  891. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  892. //
  893. // This Source Code Form is subject to the terms of the Mozilla Public
  894. // License, v. 2.0. If a copy of the MPL was not distributed with this
  895. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  896. #ifndef GENERIC_NS_2_H
  897. #define GENERIC_NS_2_H 1
  898. #include <string>
  899. #include <dns/name.h>
  900. #include <dns/rdata.h>
  901. namespace isc {
  902. namespace util {
  903. class InputBuffer;
  904. class OutputBuffer;
  905. }
  906. namespace dns {
  907. // BEGIN_COMMON_DECLARATIONS
  908. class AbstractMessageRenderer;
  909. // END_COMMON_DECLARATIONS
  910. namespace rdata {
  911. namespace generic {
  912. class NS : public Rdata {
  913. public:
  914. // BEGIN_COMMON_MEMBERS
  915. explicit NS(const std::string& type_str);
  916. NS(isc::util::InputBuffer& buffer, size_t rdata_len);
  917. NS(const NS& other);
  918. NS(
  919. MasterLexer& lexer, const Name* name,
  920. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  921. virtual std::string toText() const;
  922. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  923. virtual void toWire(AbstractMessageRenderer& renderer) const;
  924. virtual int compare(const Rdata& other) const;
  925. // END_COMMON_MEMBERS
  926. ///
  927. /// Specialized constructor
  928. ///
  929. explicit NS(const Name& nsname) : nsname_(nsname) {}
  930. ///
  931. /// Specialized methods
  932. ///
  933. const Name& getNSName() const;
  934. private:
  935. Name nsname_;
  936. };
  937. } // end of namespace "generic"
  938. } // end of namespace "rdata"
  939. } // end of namespace "dns"
  940. } // end of namespace "isc"
  941. #endif // GENERIC_NS_2_H
  942. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  943. //
  944. // This Source Code Form is subject to the terms of the Mozilla Public
  945. // License, v. 2.0. If a copy of the MPL was not distributed with this
  946. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  947. #include <stdint.h>
  948. #include <string>
  949. #include <vector>
  950. #include <dns/name.h>
  951. #include <dns/rrtype.h>
  952. #include <dns/rrttl.h>
  953. #include <dns/rdata.h>
  954. #include <dns/master_lexer.h>
  955. #ifndef GENERIC_NSEC3_50_H
  956. #define GENERIC_NSEC3_50_H 1
  957. namespace isc {
  958. namespace util {
  959. class InputBuffer;
  960. class OutputBuffer;
  961. }
  962. namespace dns {
  963. // BEGIN_COMMON_DECLARATIONS
  964. class AbstractMessageRenderer;
  965. // END_COMMON_DECLARATIONS
  966. namespace rdata {
  967. namespace generic {
  968. struct NSEC3Impl;
  969. class NSEC3 : public Rdata {
  970. public:
  971. // BEGIN_COMMON_MEMBERS
  972. explicit NSEC3(const std::string& type_str);
  973. NSEC3(isc::util::InputBuffer& buffer, size_t rdata_len);
  974. NSEC3(const NSEC3& other);
  975. NSEC3(
  976. MasterLexer& lexer, const Name* name,
  977. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  978. virtual std::string toText() const;
  979. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  980. virtual void toWire(AbstractMessageRenderer& renderer) const;
  981. virtual int compare(const Rdata& other) const;
  982. // END_COMMON_MEMBERS
  983. NSEC3& operator=(const NSEC3& source);
  984. ~NSEC3();
  985. uint8_t getHashalg() const;
  986. uint8_t getFlags() const;
  987. uint16_t getIterations() const;
  988. const std::vector<uint8_t>& getSalt() const;
  989. const std::vector<uint8_t>& getNext() const;
  990. private:
  991. NSEC3Impl* constructFromLexer(isc::dns::MasterLexer& lexer);
  992. NSEC3Impl* impl_;
  993. };
  994. } // end of namespace "generic"
  995. } // end of namespace "rdata"
  996. } // end of namespace "dns"
  997. } // end of namespace "isc"
  998. #endif // GENERIC_NSEC3_50_H
  999. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1000. //
  1001. // This Source Code Form is subject to the terms of the Mozilla Public
  1002. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1003. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1004. #include <stdint.h>
  1005. #include <string>
  1006. #include <vector>
  1007. #include <dns/name.h>
  1008. #include <dns/rrtype.h>
  1009. #include <dns/rrttl.h>
  1010. #include <dns/rdata.h>
  1011. #include <dns/master_lexer.h>
  1012. #ifndef GENERIC_NSEC3PARAM_51_H
  1013. #define GENERIC_NSEC3PARAM_51_H 1
  1014. namespace isc {
  1015. namespace util {
  1016. class InputBuffer;
  1017. class OutputBuffer;
  1018. }
  1019. namespace dns {
  1020. // BEGIN_COMMON_DECLARATIONS
  1021. class AbstractMessageRenderer;
  1022. // END_COMMON_DECLARATIONS
  1023. namespace rdata {
  1024. namespace generic {
  1025. struct NSEC3PARAMImpl;
  1026. class NSEC3PARAM : public Rdata {
  1027. public:
  1028. // BEGIN_COMMON_MEMBERS
  1029. explicit NSEC3PARAM(const std::string& type_str);
  1030. NSEC3PARAM(isc::util::InputBuffer& buffer, size_t rdata_len);
  1031. NSEC3PARAM(const NSEC3PARAM& other);
  1032. NSEC3PARAM(
  1033. MasterLexer& lexer, const Name* name,
  1034. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1035. virtual std::string toText() const;
  1036. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1037. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1038. virtual int compare(const Rdata& other) const;
  1039. // END_COMMON_MEMBERS
  1040. NSEC3PARAM& operator=(const NSEC3PARAM& source);
  1041. ~NSEC3PARAM();
  1042. ///
  1043. /// Specialized methods
  1044. ///
  1045. uint8_t getHashalg() const;
  1046. uint8_t getFlags() const;
  1047. uint16_t getIterations() const;
  1048. const std::vector<uint8_t>& getSalt() const;
  1049. private:
  1050. NSEC3PARAMImpl* constructFromLexer(isc::dns::MasterLexer& lexer);
  1051. NSEC3PARAMImpl* impl_;
  1052. };
  1053. } // end of namespace "generic"
  1054. } // end of namespace "rdata"
  1055. } // end of namespace "dns"
  1056. } // end of namespace "isc"
  1057. #endif // GENERIC_NSEC3PARAM_51_H
  1058. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1059. //
  1060. // This Source Code Form is subject to the terms of the Mozilla Public
  1061. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1062. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1063. #include <stdint.h>
  1064. #include <string>
  1065. #include <dns/name.h>
  1066. #include <dns/rrtype.h>
  1067. #include <dns/rrttl.h>
  1068. #include <dns/rdata.h>
  1069. #ifndef GENERIC_NSEC_47_H
  1070. #define GENERIC_NSEC_47_H 1
  1071. namespace isc {
  1072. namespace util {
  1073. class InputBuffer;
  1074. class OutputBuffer;
  1075. }
  1076. namespace dns {
  1077. // BEGIN_COMMON_DECLARATIONS
  1078. class AbstractMessageRenderer;
  1079. // END_COMMON_DECLARATIONS
  1080. namespace rdata {
  1081. namespace generic {
  1082. struct NSECImpl;
  1083. class NSEC : public Rdata {
  1084. public:
  1085. // BEGIN_COMMON_MEMBERS
  1086. explicit NSEC(const std::string& type_str);
  1087. NSEC(isc::util::InputBuffer& buffer, size_t rdata_len);
  1088. NSEC(const NSEC& other);
  1089. NSEC(
  1090. MasterLexer& lexer, const Name* name,
  1091. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1092. virtual std::string toText() const;
  1093. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1094. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1095. virtual int compare(const Rdata& other) const;
  1096. // END_COMMON_MEMBERS
  1097. NSEC& operator=(const NSEC& source);
  1098. ~NSEC();
  1099. // specialized methods
  1100. /// Return the next domain name.
  1101. ///
  1102. /// \exception std::bad_alloc Resource allocation failure in name copy.
  1103. ///
  1104. /// \return The next domain name field in the form of \c Name object.
  1105. const Name& getNextName() const;
  1106. private:
  1107. NSECImpl* impl_;
  1108. };
  1109. } // end of namespace "generic"
  1110. } // end of namespace "rdata"
  1111. } // end of namespace "dns"
  1112. } // end of namespace "isc"
  1113. #endif // GENERIC_NSEC_47_H
  1114. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1115. //
  1116. // This Source Code Form is subject to the terms of the Mozilla Public
  1117. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1118. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1119. #ifndef GENERIC_OPT_41_H
  1120. #define GENERIC_OPT_41_H 1
  1121. #include <string>
  1122. #include <dns/rdata.h>
  1123. #include <boost/shared_ptr.hpp>
  1124. #include <vector>
  1125. namespace isc {
  1126. namespace util {
  1127. class InputBuffer;
  1128. class OutputBuffer;
  1129. }
  1130. namespace dns {
  1131. // BEGIN_COMMON_DECLARATIONS
  1132. class AbstractMessageRenderer;
  1133. // END_COMMON_DECLARATIONS
  1134. namespace rdata {
  1135. namespace generic {
  1136. struct OPTImpl;
  1137. class OPT : public Rdata {
  1138. public:
  1139. // BEGIN_COMMON_MEMBERS
  1140. explicit OPT(const std::string& type_str);
  1141. OPT(isc::util::InputBuffer& buffer, size_t rdata_len);
  1142. OPT(const OPT& other);
  1143. OPT(
  1144. MasterLexer& lexer, const Name* name,
  1145. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1146. virtual std::string toText() const;
  1147. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1148. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1149. virtual int compare(const Rdata& other) const;
  1150. // END_COMMON_MEMBERS
  1151. // The default constructor makes sense for OPT as it can be empty.
  1152. OPT();
  1153. OPT& operator=(const OPT& source);
  1154. ~OPT();
  1155. /// \brief A class representing a pseudo RR (or option) within an
  1156. /// OPT RR (see RFC 6891).
  1157. class PseudoRR {
  1158. public:
  1159. /// \brief Constructor.
  1160. /// \param code The OPTION-CODE field of the pseudo RR.
  1161. /// \param data The OPTION-DATA field of the pseudo
  1162. /// RR. OPTION-LENGTH is set to the length of this vector.
  1163. PseudoRR(uint16_t code,
  1164. boost::shared_ptr<std::vector<uint8_t> >& data);
  1165. /// \brief Return the option code of this pseudo RR.
  1166. uint16_t getCode() const;
  1167. /// \brief Return the option data of this pseudo RR.
  1168. const uint8_t* getData() const;
  1169. /// \brief Return the length of the option data of this
  1170. /// pseudo RR.
  1171. uint16_t getLength() const;
  1172. private:
  1173. uint16_t code_;
  1174. boost::shared_ptr<std::vector<uint8_t> > data_;
  1175. };
  1176. /// \brief Append a pseudo RR (option) in this OPT RR.
  1177. ///
  1178. /// \param code The OPTION-CODE field of the pseudo RR.
  1179. /// \param data The OPTION-DATA field of the pseudo RR.
  1180. /// \param length The size of the \c data argument. OPTION-LENGTH is
  1181. /// set to this size.
  1182. /// \throw isc::InvalidParameter if this pseudo RR would cause
  1183. /// the OPT RDATA to overflow its RDLENGTH.
  1184. void appendPseudoRR(uint16_t code, const uint8_t* data, uint16_t length);
  1185. /// \brief Return a vector of the pseudo RRs (options) in this
  1186. /// OPT RR.
  1187. ///
  1188. /// Note: The returned reference is only valid during the lifetime
  1189. /// of this \c generic::OPT object. It should not be used
  1190. /// afterwards.
  1191. const std::vector<PseudoRR>& getPseudoRRs() const;
  1192. private:
  1193. OPTImpl* impl_;
  1194. };
  1195. } // end of namespace "generic"
  1196. } // end of namespace "rdata"
  1197. } // end of namespace "dns"
  1198. } // end of namespace "isc"
  1199. #endif // GENERIC_OPT_41_H
  1200. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1201. //
  1202. // This Source Code Form is subject to the terms of the Mozilla Public
  1203. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1204. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1205. #ifndef GENERIC_PTR_12_H
  1206. #define GENERIC_PTR_12_H 1
  1207. #include <string>
  1208. #include <dns/name.h>
  1209. #include <dns/rdata.h>
  1210. namespace isc {
  1211. namespace util {
  1212. class InputBuffer;
  1213. class OutputBuffer;
  1214. }
  1215. namespace dns {
  1216. // BEGIN_COMMON_DECLARATIONS
  1217. class AbstractMessageRenderer;
  1218. // END_COMMON_DECLARATIONS
  1219. namespace rdata {
  1220. namespace generic {
  1221. class PTR : public Rdata {
  1222. public:
  1223. // BEGIN_COMMON_MEMBERS
  1224. explicit PTR(const std::string& type_str);
  1225. PTR(isc::util::InputBuffer& buffer, size_t rdata_len);
  1226. PTR(const PTR& other);
  1227. PTR(
  1228. MasterLexer& lexer, const Name* name,
  1229. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1230. virtual std::string toText() const;
  1231. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1232. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1233. virtual int compare(const Rdata& other) const;
  1234. // END_COMMON_MEMBERS
  1235. ///
  1236. /// Specialized constructor
  1237. ///
  1238. explicit PTR(const Name& ptr_name) : ptr_name_(ptr_name) {}
  1239. ///
  1240. /// Specialized methods
  1241. ///
  1242. const Name& getPTRName() const;
  1243. private:
  1244. Name ptr_name_;
  1245. };
  1246. } // end of namespace "generic"
  1247. } // end of namespace "rdata"
  1248. } // end of namespace "dns"
  1249. } // end of namespace "isc"
  1250. #endif // GENERIC_PTR_12_H
  1251. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  1252. //
  1253. // This Source Code Form is subject to the terms of the Mozilla Public
  1254. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1255. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1256. #ifndef GENERIC_RP_17_H
  1257. #define GENERIC_RP_17_H 1
  1258. #include <string>
  1259. #include <dns/name.h>
  1260. #include <dns/rdata.h>
  1261. namespace isc {
  1262. namespace util {
  1263. class InputBuffer;
  1264. class OutputBuffer;
  1265. }
  1266. namespace dns {
  1267. // BEGIN_COMMON_DECLARATIONS
  1268. class AbstractMessageRenderer;
  1269. // END_COMMON_DECLARATIONS
  1270. namespace rdata {
  1271. namespace generic {
  1272. /// \brief \c rdata::generic::RP class represents the RP RDATA as defined in
  1273. /// RFC1183.
  1274. ///
  1275. /// This class implements the basic interfaces inherited from the abstract
  1276. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  1277. /// RP RDATA.
  1278. class RP : public Rdata {
  1279. public:
  1280. // BEGIN_COMMON_MEMBERS
  1281. explicit RP(const std::string& type_str);
  1282. RP(isc::util::InputBuffer& buffer, size_t rdata_len);
  1283. RP(const RP& other);
  1284. RP(
  1285. MasterLexer& lexer, const Name* name,
  1286. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1287. virtual std::string toText() const;
  1288. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1289. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1290. virtual int compare(const Rdata& other) const;
  1291. // END_COMMON_MEMBERS
  1292. /// We use the default copy constructor and assignment operator.
  1293. /// \brief Constructor from RDATA field parameters.
  1294. ///
  1295. /// The parameters are a straightforward mapping of %RP RDATA
  1296. /// fields as defined in RFC1183.
  1297. RP(const Name& mailbox, const Name& text) :
  1298. mailbox_(mailbox), text_(text)
  1299. {}
  1300. /// \brief Return the value of the mailbox field.
  1301. ///
  1302. /// \throw std::bad_alloc If resource allocation for the returned
  1303. /// \c Name fails.
  1304. ///
  1305. /// \note
  1306. /// Unlike the case of some other RDATA classes (such as
  1307. /// \c NS::getNSName()), this method constructs a new \c Name object
  1308. /// and returns it, instead of returning a reference to a \c Name object
  1309. /// internally maintained in the class (which is a private member).
  1310. /// This is based on the observation that this method will be rarely used
  1311. /// and even when it's used it will not be in a performance context
  1312. /// (for example, a recursive resolver won't need this field in its
  1313. /// resolution process). By returning a new object we have flexibility of
  1314. /// changing the internal representation without the risk of changing
  1315. /// the interface or method property.
  1316. /// The same note applies to the \c getText() method.
  1317. Name getMailbox() const { return (mailbox_); }
  1318. /// \brief Return the value of the text field.
  1319. ///
  1320. /// \throw std::bad_alloc If resource allocation for the returned
  1321. /// \c Name fails.
  1322. Name getText() const { return (text_); }
  1323. private:
  1324. Name mailbox_;
  1325. Name text_;
  1326. };
  1327. } // end of namespace "generic"
  1328. } // end of namespace "rdata"
  1329. } // end of namespace "dns"
  1330. } // end of namespace "isc"
  1331. #endif // GENERIC_RP_17_H
  1332. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1333. //
  1334. // This Source Code Form is subject to the terms of the Mozilla Public
  1335. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1336. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1337. #include <stdint.h>
  1338. #include <string>
  1339. #include <dns/name.h>
  1340. #include <dns/rrtype.h>
  1341. #include <dns/rdata.h>
  1342. #ifndef GENERIC_RRSIG_46_H
  1343. #define GENERIC_RRSIG_46_H 1
  1344. namespace isc {
  1345. namespace util {
  1346. class InputBuffer;
  1347. class OutputBuffer;
  1348. }
  1349. namespace dns {
  1350. // BEGIN_COMMON_DECLARATIONS
  1351. class AbstractMessageRenderer;
  1352. // END_COMMON_DECLARATIONS
  1353. namespace rdata {
  1354. namespace generic {
  1355. struct RRSIGImpl;
  1356. /// \brief \c rdata::RRSIG class represents the RRSIG RDATA as defined %in
  1357. /// RFC4034.
  1358. ///
  1359. /// This class implements the basic interfaces inherited from the abstract
  1360. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  1361. /// RRSIG RDATA.
  1362. class RRSIG : public Rdata {
  1363. public:
  1364. // BEGIN_COMMON_MEMBERS
  1365. explicit RRSIG(const std::string& type_str);
  1366. RRSIG(isc::util::InputBuffer& buffer, size_t rdata_len);
  1367. RRSIG(const RRSIG& other);
  1368. RRSIG(
  1369. MasterLexer& lexer, const Name* name,
  1370. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1371. virtual std::string toText() const;
  1372. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1373. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1374. virtual int compare(const Rdata& other) const;
  1375. // END_COMMON_MEMBERS
  1376. RRSIG& operator=(const RRSIG& source);
  1377. ~RRSIG();
  1378. // specialized methods
  1379. const RRType& typeCovered() const;
  1380. private:
  1381. // helper function for string and lexer constructors
  1382. RRSIGImpl* constructFromLexer(MasterLexer& lexer, const Name* origin);
  1383. RRSIGImpl* impl_;
  1384. };
  1385. } // end of namespace "generic"
  1386. } // end of namespace "rdata"
  1387. } // end of namespace "dns"
  1388. } // end of namespace "isc"
  1389. #endif // GENERIC_RRSIG_46_H
  1390. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1391. //
  1392. // This Source Code Form is subject to the terms of the Mozilla Public
  1393. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1394. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1395. #ifndef GENERIC_SOA_6_H
  1396. #define GENERIC_SOA_6_H 1
  1397. #include <string>
  1398. #include <dns/name.h>
  1399. #include <dns/rdata.h>
  1400. #include <dns/serial.h>
  1401. namespace isc {
  1402. namespace util {
  1403. class InputBuffer;
  1404. class OutputBuffer;
  1405. }
  1406. namespace dns {
  1407. // BEGIN_COMMON_DECLARATIONS
  1408. class AbstractMessageRenderer;
  1409. // END_COMMON_DECLARATIONS
  1410. namespace rdata {
  1411. namespace generic {
  1412. class SOA : public Rdata {
  1413. public:
  1414. // BEGIN_COMMON_MEMBERS
  1415. explicit SOA(const std::string& type_str);
  1416. SOA(isc::util::InputBuffer& buffer, size_t rdata_len);
  1417. SOA(const SOA& other);
  1418. SOA(
  1419. MasterLexer& lexer, const Name* name,
  1420. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1421. virtual std::string toText() const;
  1422. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1423. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1424. virtual int compare(const Rdata& other) const;
  1425. // END_COMMON_MEMBERS
  1426. SOA(const Name& mname, const Name& rname, uint32_t serial,
  1427. uint32_t refresh, uint32_t retry, uint32_t expire,
  1428. uint32_t minimum);
  1429. /// \brief Returns the serial stored in the SOA.
  1430. Serial getSerial() const;
  1431. /// brief Returns the minimum TTL field value of the SOA.
  1432. uint32_t getMinimum() const;
  1433. private:
  1434. /// Note: this is a prototype version; we may reconsider
  1435. /// this representation later.
  1436. Name mname_;
  1437. Name rname_;
  1438. /// serial, refresh, retry, expire, minimum, stored in network byte order
  1439. uint8_t numdata_[20];
  1440. };
  1441. } // end of namespace "generic"
  1442. } // end of namespace "rdata"
  1443. } // end of namespace "dns"
  1444. } // end of namespace "isc"
  1445. #endif // GENERIC_SOA_6_H
  1446. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1447. //
  1448. // This Source Code Form is subject to the terms of the Mozilla Public
  1449. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1450. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1451. #ifndef GENERIC_SPF_99_H
  1452. #define GENERIC_SPF_99_H 1
  1453. #include <stdint.h>
  1454. #include <string>
  1455. #include <vector>
  1456. #include <dns/rdata.h>
  1457. namespace isc {
  1458. namespace util {
  1459. class InputBuffer;
  1460. class OutputBuffer;
  1461. }
  1462. namespace dns {
  1463. // BEGIN_COMMON_DECLARATIONS
  1464. class AbstractMessageRenderer;
  1465. // END_COMMON_DECLARATIONS
  1466. namespace rdata {
  1467. namespace generic {
  1468. namespace detail {
  1469. template<class Type, uint16_t typeCode> class TXTLikeImpl;
  1470. }
  1471. /// \brief \c rdata::SPF class represents the SPF RDATA as defined %in
  1472. /// RFC4408.
  1473. ///
  1474. /// This class implements the basic interfaces inherited from the abstract
  1475. /// \c rdata::Rdata class. The semantics of the class is provided by
  1476. /// a copy of instantiated TXTLikeImpl class common to both TXT and SPF.
  1477. class SPF : public Rdata {
  1478. public:
  1479. // BEGIN_COMMON_MEMBERS
  1480. explicit SPF(const std::string& type_str);
  1481. SPF(isc::util::InputBuffer& buffer, size_t rdata_len);
  1482. SPF(const SPF& other);
  1483. SPF(
  1484. MasterLexer& lexer, const Name* name,
  1485. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1486. virtual std::string toText() const;
  1487. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1488. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1489. virtual int compare(const Rdata& other) const;
  1490. // END_COMMON_MEMBERS
  1491. /// \brief Assignment operator.
  1492. ///
  1493. /// It internally allocates a resource, and if it fails a corresponding
  1494. /// standard exception will be thrown.
  1495. /// This operator never throws an exception otherwise.
  1496. ///
  1497. /// This operator provides the strong exception guarantee: When an
  1498. /// exception is thrown the content of the assignment target will be
  1499. /// intact.
  1500. SPF& operator=(const SPF& source);
  1501. /// \brief The destructor.
  1502. ~SPF();
  1503. ///
  1504. /// Specialized methods
  1505. ///
  1506. /// \brief Return a reference to the data strings
  1507. ///
  1508. /// This method never throws an exception.
  1509. const std::vector<std::vector<uint8_t> >& getString() const;
  1510. private:
  1511. typedef isc::dns::rdata::generic::detail::TXTLikeImpl<SPF, 99> SPFImpl;
  1512. SPFImpl* impl_;
  1513. };
  1514. } // end of namespace "generic"
  1515. } // end of namespace "rdata"
  1516. } // end of namespace "dns"
  1517. } // end of namespace "isc"
  1518. #endif // GENERIC_SPF_99_H
  1519. // Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
  1520. //
  1521. // This Source Code Form is subject to the terms of the Mozilla Public
  1522. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1523. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1524. #ifndef GENERIC_SSHFP_44_H
  1525. #define GENERIC_SSHFP_44_H 1
  1526. #include <stdint.h>
  1527. #include <string>
  1528. #include <vector>
  1529. #include <dns/name.h>
  1530. #include <dns/rdata.h>
  1531. namespace isc {
  1532. namespace util {
  1533. class InputBuffer;
  1534. class OutputBuffer;
  1535. }
  1536. namespace dns {
  1537. // BEGIN_COMMON_DECLARATIONS
  1538. class AbstractMessageRenderer;
  1539. // END_COMMON_DECLARATIONS
  1540. namespace rdata {
  1541. namespace generic {
  1542. struct SSHFPImpl;
  1543. class SSHFP : public Rdata {
  1544. public:
  1545. // BEGIN_COMMON_MEMBERS
  1546. explicit SSHFP(const std::string& type_str);
  1547. SSHFP(isc::util::InputBuffer& buffer, size_t rdata_len);
  1548. SSHFP(const SSHFP& other);
  1549. SSHFP(
  1550. MasterLexer& lexer, const Name* name,
  1551. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1552. virtual std::string toText() const;
  1553. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1554. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1555. virtual int compare(const Rdata& other) const;
  1556. // END_COMMON_MEMBERS
  1557. SSHFP(uint8_t algorithm, uint8_t fingerprint_type,
  1558. const std::string& fingerprint);
  1559. SSHFP& operator=(const SSHFP& source);
  1560. ~SSHFP();
  1561. ///
  1562. /// Specialized methods
  1563. ///
  1564. uint8_t getAlgorithmNumber() const;
  1565. uint8_t getFingerprintType() const;
  1566. const std::vector<uint8_t>& getFingerprint() const;
  1567. size_t getFingerprintLength() const;
  1568. private:
  1569. SSHFPImpl* constructFromLexer(MasterLexer& lexer);
  1570. SSHFPImpl* impl_;
  1571. };
  1572. } // end of namespace "generic"
  1573. } // end of namespace "rdata"
  1574. } // end of namespace "dns"
  1575. } // end of namespace "isc"
  1576. #endif // GENERIC_SSHFP_44_H
  1577. // Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
  1578. //
  1579. // This Source Code Form is subject to the terms of the Mozilla Public
  1580. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1581. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1582. #ifndef GENERIC_TLSA_52_H
  1583. #define GENERIC_TLSA_52_H 1
  1584. #include <stdint.h>
  1585. #include <dns/name.h>
  1586. #include <dns/rdata.h>
  1587. #include <string>
  1588. #include <vector>
  1589. namespace isc {
  1590. namespace util {
  1591. class InputBuffer;
  1592. class OutputBuffer;
  1593. }
  1594. namespace dns {
  1595. // BEGIN_COMMON_DECLARATIONS
  1596. class AbstractMessageRenderer;
  1597. // END_COMMON_DECLARATIONS
  1598. namespace rdata {
  1599. namespace generic {
  1600. struct TLSAImpl;
  1601. class TLSA : public Rdata {
  1602. public:
  1603. // BEGIN_COMMON_MEMBERS
  1604. explicit TLSA(const std::string& tlsa_str);
  1605. TLSA(isc::util::InputBuffer& buffer, size_t rdata_len);
  1606. TLSA(const TLSA& other);
  1607. TLSA(
  1608. MasterLexer& lexer, const Name* name,
  1609. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1610. virtual std::string toText() const;
  1611. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1612. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1613. virtual int compare(const Rdata& other) const;
  1614. // END_COMMON_MEMBERS
  1615. TLSA(uint8_t certificate_usage, uint8_t selector,
  1616. uint8_t matching_type, const std::string& certificate_assoc_data);
  1617. TLSA& operator=(const TLSA& source);
  1618. ~TLSA();
  1619. ///
  1620. /// Specialized methods
  1621. ///
  1622. uint8_t getCertificateUsage() const;
  1623. uint8_t getSelector() const;
  1624. uint8_t getMatchingType() const;
  1625. const std::vector<uint8_t>& getData() const;
  1626. size_t getDataLength() const;
  1627. private:
  1628. TLSAImpl* constructFromLexer(MasterLexer& lexer);
  1629. TLSAImpl* impl_;
  1630. };
  1631. } // end of namespace "generic"
  1632. } // end of namespace "rdata"
  1633. } // end of namespace "dns"
  1634. } // end of namespace "isc"
  1635. #endif // GENERIC_TLSA_52_H
  1636. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1637. //
  1638. // This Source Code Form is subject to the terms of the Mozilla Public
  1639. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1640. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1641. #ifndef GENERIC_TXT_16_H
  1642. #define GENERIC_TXT_16_H 1
  1643. #include <stdint.h>
  1644. #include <string>
  1645. #include <vector>
  1646. #include <dns/rdata.h>
  1647. namespace isc {
  1648. namespace util {
  1649. class InputBuffer;
  1650. class OutputBuffer;
  1651. }
  1652. namespace dns {
  1653. // BEGIN_COMMON_DECLARATIONS
  1654. class AbstractMessageRenderer;
  1655. // END_COMMON_DECLARATIONS
  1656. namespace rdata {
  1657. namespace generic {
  1658. namespace detail {
  1659. template<class Type, uint16_t typeCode> class TXTLikeImpl;
  1660. }
  1661. class TXT : public Rdata {
  1662. public:
  1663. // BEGIN_COMMON_MEMBERS
  1664. explicit TXT(const std::string& type_str);
  1665. TXT(isc::util::InputBuffer& buffer, size_t rdata_len);
  1666. TXT(const TXT& other);
  1667. TXT(
  1668. MasterLexer& lexer, const Name* name,
  1669. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1670. virtual std::string toText() const;
  1671. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1672. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1673. virtual int compare(const Rdata& other) const;
  1674. // END_COMMON_MEMBERS
  1675. TXT& operator=(const TXT& source);
  1676. ~TXT();
  1677. private:
  1678. typedef isc::dns::rdata::generic::detail::TXTLikeImpl<TXT, 16> TXTImpl;
  1679. TXTImpl* impl_;
  1680. };
  1681. } // end of namespace "generic"
  1682. } // end of namespace "rdata"
  1683. } // end of namespace "dns"
  1684. } // end of namespace "isc"
  1685. #endif // GENERIC_TXT_16_H
  1686. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1687. //
  1688. // This Source Code Form is subject to the terms of the Mozilla Public
  1689. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1690. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1691. #ifndef HS_A_1_H
  1692. #define HS_A_1_H 1
  1693. #include <string>
  1694. #include <dns/rdata.h>
  1695. namespace isc {
  1696. namespace util {
  1697. class InputBuffer;
  1698. class OutputBuffer;
  1699. }
  1700. namespace dns {
  1701. // BEGIN_COMMON_DECLARATIONS
  1702. class AbstractMessageRenderer;
  1703. // END_COMMON_DECLARATIONS
  1704. namespace rdata {
  1705. namespace hs {
  1706. class A : public Rdata {
  1707. public:
  1708. // BEGIN_COMMON_MEMBERS
  1709. explicit A(const std::string& type_str);
  1710. A(isc::util::InputBuffer& buffer, size_t rdata_len);
  1711. A(const A& other);
  1712. A(
  1713. MasterLexer& lexer, const Name* name,
  1714. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1715. virtual std::string toText() const;
  1716. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1717. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1718. virtual int compare(const Rdata& other) const;
  1719. // END_COMMON_MEMBERS
  1720. };
  1721. } // end of namespace "hs"
  1722. } // end of namespace "rdata"
  1723. } // end of namespace "dns"
  1724. } // end of namespace "isc"
  1725. #endif // HS_A_1_H
  1726. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1727. //
  1728. // This Source Code Form is subject to the terms of the Mozilla Public
  1729. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1730. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1731. #ifndef IN_A_1_H
  1732. #define IN_A_1_H 1
  1733. #include <string>
  1734. #include <dns/rdata.h>
  1735. namespace isc {
  1736. namespace util {
  1737. class InputBuffer;
  1738. class OutputBuffer;
  1739. }
  1740. namespace dns {
  1741. // BEGIN_COMMON_DECLARATIONS
  1742. class AbstractMessageRenderer;
  1743. // END_COMMON_DECLARATIONS
  1744. namespace rdata {
  1745. namespace in {
  1746. class A : public Rdata {
  1747. public:
  1748. // BEGIN_COMMON_MEMBERS
  1749. explicit A(const std::string& type_str);
  1750. A(isc::util::InputBuffer& buffer, size_t rdata_len);
  1751. A(const A& other);
  1752. A(
  1753. MasterLexer& lexer, const Name* name,
  1754. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1755. virtual std::string toText() const;
  1756. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1757. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1758. virtual int compare(const Rdata& other) const;
  1759. // END_COMMON_MEMBERS
  1760. //We can use the default destructor.
  1761. //virtual ~A() {}
  1762. // notyet:
  1763. //const struct in_addr& getAddress() const { return (addr_); }
  1764. private:
  1765. uint32_t addr_; // raw IPv4 address (network byte order)
  1766. };
  1767. } // end of namespace "in"
  1768. } // end of namespace "rdata"
  1769. } // end of namespace "dns"
  1770. } // end of namespace "isc"
  1771. #endif // IN_A_1_H
  1772. // Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
  1773. //
  1774. // This Source Code Form is subject to the terms of the Mozilla Public
  1775. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1776. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1777. #ifndef IN_AAAA_28_H
  1778. #define IN_AAAA_28_H 1
  1779. #include <stdint.h>
  1780. #include <string>
  1781. #include <dns/rdata.h>
  1782. namespace isc {
  1783. namespace util {
  1784. class InputBuffer;
  1785. class OutputBuffer;
  1786. }
  1787. namespace dns {
  1788. // BEGIN_COMMON_DECLARATIONS
  1789. class AbstractMessageRenderer;
  1790. // END_COMMON_DECLARATIONS
  1791. namespace rdata {
  1792. namespace in {
  1793. class AAAA : public Rdata {
  1794. public:
  1795. // BEGIN_COMMON_MEMBERS
  1796. explicit AAAA(const std::string& type_str);
  1797. AAAA(isc::util::InputBuffer& buffer, size_t rdata_len);
  1798. AAAA(const AAAA& other);
  1799. AAAA(
  1800. MasterLexer& lexer, const Name* name,
  1801. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1802. virtual std::string toText() const;
  1803. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1804. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1805. virtual int compare(const Rdata& other) const;
  1806. // END_COMMON_MEMBERS
  1807. // notyet:
  1808. //const struct in6_addr& getAddress() const { return (addr_); }
  1809. private:
  1810. uint8_t addr_[16]; // raw IPv6 address (network byte order)
  1811. };
  1812. } // end of namespace "in"
  1813. } // end of namespace "rdata"
  1814. } // end of namespace "dns"
  1815. } // end of namespace "isc"
  1816. #endif // IN_AAAA_28_H
  1817. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  1818. //
  1819. // This Source Code Form is subject to the terms of the Mozilla Public
  1820. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1821. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1822. #ifndef IN_DHCID_49_H
  1823. #define IN_DHCID_49_H 1
  1824. #include <string>
  1825. #include <vector>
  1826. #include <dns/rdata.h>
  1827. namespace isc {
  1828. namespace util {
  1829. class InputBuffer;
  1830. class OutputBuffer;
  1831. }
  1832. namespace dns {
  1833. // BEGIN_COMMON_DECLARATIONS
  1834. class AbstractMessageRenderer;
  1835. // END_COMMON_DECLARATIONS
  1836. namespace rdata {
  1837. namespace in {
  1838. /// \brief \c rdata::DHCID class represents the DHCID RDATA as defined %in
  1839. /// RFC4701.
  1840. ///
  1841. /// This class implements the basic interfaces inherited from the abstract
  1842. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  1843. /// DHCID RDATA.
  1844. class DHCID : public Rdata {
  1845. public:
  1846. // BEGIN_COMMON_MEMBERS
  1847. explicit DHCID(const std::string& type_str);
  1848. DHCID(isc::util::InputBuffer& buffer, size_t rdata_len);
  1849. DHCID(const DHCID& other);
  1850. DHCID(
  1851. MasterLexer& lexer, const Name* name,
  1852. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1853. virtual std::string toText() const;
  1854. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1855. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1856. virtual int compare(const Rdata& other) const;
  1857. // END_COMMON_MEMBERS
  1858. /// \brief Return the digest.
  1859. ///
  1860. /// This method never throws an exception.
  1861. const std::vector<uint8_t>& getDigest() const;
  1862. private:
  1863. // helper for string and lexer constructors
  1864. void constructFromLexer(MasterLexer& lexer);
  1865. /// \brief Private data representation
  1866. ///
  1867. /// Opaque data at least 3 octets long as per RFC4701.
  1868. ///
  1869. std::vector<uint8_t> digest_;
  1870. };
  1871. } // end of namespace "in"
  1872. } // end of namespace "rdata"
  1873. } // end of namespace "dns"
  1874. } // end of namespace "isc"
  1875. #endif // IN_DHCID_49_H
  1876. // Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
  1877. //
  1878. // This Source Code Form is subject to the terms of the Mozilla Public
  1879. // License, v. 2.0. If a copy of the MPL was not distributed with this
  1880. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1881. #ifndef IN_SRV_33_H
  1882. #define IN_SRV_33_H 1
  1883. #include <stdint.h>
  1884. #include <dns/name.h>
  1885. #include <dns/rdata.h>
  1886. namespace isc {
  1887. namespace util {
  1888. class InputBuffer;
  1889. class OutputBuffer;
  1890. }
  1891. namespace dns {
  1892. // BEGIN_COMMON_DECLARATIONS
  1893. class AbstractMessageRenderer;
  1894. // END_COMMON_DECLARATIONS
  1895. namespace rdata {
  1896. namespace in {
  1897. struct SRVImpl;
  1898. /// \brief \c rdata::SRV class represents the SRV RDATA as defined %in
  1899. /// RFC2782.
  1900. ///
  1901. /// This class implements the basic interfaces inherited from the abstract
  1902. /// \c rdata::Rdata class, and provides trivial accessors specific to the
  1903. /// SRV RDATA.
  1904. class SRV : public Rdata {
  1905. public:
  1906. // BEGIN_COMMON_MEMBERS
  1907. explicit SRV(const std::string& type_str);
  1908. SRV(isc::util::InputBuffer& buffer, size_t rdata_len);
  1909. SRV(const SRV& other);
  1910. SRV(
  1911. MasterLexer& lexer, const Name* name,
  1912. MasterLoader::Options options, MasterLoaderCallbacks& callbacks);
  1913. virtual std::string toText() const;
  1914. virtual void toWire(isc::util::OutputBuffer& buffer) const;
  1915. virtual void toWire(AbstractMessageRenderer& renderer) const;
  1916. virtual int compare(const Rdata& other) const;
  1917. // END_COMMON_MEMBERS
  1918. /// \brief Assignment operator.
  1919. ///
  1920. /// It internally allocates a resource, and if it fails a corresponding
  1921. /// standard exception will be thrown.
  1922. /// This operator never throws an exception otherwise.
  1923. ///
  1924. /// This operator provides the strong exception guarantee: When an
  1925. /// exception is thrown the content of the assignment target will be
  1926. /// intact.
  1927. SRV& operator=(const SRV& source);
  1928. /// \brief The destructor.
  1929. ~SRV();
  1930. ///
  1931. /// Specialized methods
  1932. ///
  1933. /// \brief Return the value of the priority field.
  1934. ///
  1935. /// This method never throws an exception.
  1936. uint16_t getPriority() const;
  1937. /// \brief Return the value of the weight field.
  1938. ///
  1939. /// This method never throws an exception.
  1940. uint16_t getWeight() const;
  1941. /// \brief Return the value of the port field.
  1942. ///
  1943. /// This method never throws an exception.
  1944. uint16_t getPort() const;
  1945. /// \brief Return the value of the target field.
  1946. ///
  1947. /// \return A reference to a \c Name class object corresponding to the
  1948. /// internal target name.
  1949. ///
  1950. /// This method never throws an exception.
  1951. const Name& getTarget() const;
  1952. private:
  1953. SRVImpl* impl_;
  1954. };
  1955. } // end of namespace "in"
  1956. } // end of namespace "rdata"
  1957. } // end of namespace "dns"
  1958. } // end of namespace "isc"
  1959. #endif // IN_SRV_33_H
  1960. #endif // DNS_RDATACLASS_H
  1961. // Local Variables:
  1962. // mode: c++
  1963. // End: