/////////////// /////////////// /////////////// THIS FILE IS AUTOMATICALLY GENERATED BY gen-rdatacode.py. /////////////// DO NOT EDIT! /////////////// /////////////// #ifndef DNS_RDATACLASS_H #define DNS_RDATACLASS_H #include namespace isc { namespace dns { class Name; class MasterLexer; class MasterLoaderCallbacks; } } // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef ANY_TSIG_250_H #define ANY_TSIG_250_H #include #include #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace any { struct TSIGImpl; /// \brief \c rdata::TSIG class represents the TSIG RDATA as defined %in /// RFC2845. /// /// This class implements the basic interfaces inherited from the abstract /// \c rdata::Rdata class, and provides trivial accessors specific to the /// TSIG RDATA. class TSIG : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit TSIG(const std::string& type_str); TSIG(isc::util::InputBuffer& buffer, size_t rdata_len); TSIG(const TSIG& other); TSIG( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS /// \brief Constructor from RDATA field parameters. /// /// The parameters are a straightforward mapping of %TSIG RDATA /// fields as defined %in RFC2845, but there are some implementation /// specific notes as follows. /// /// \c algorithm is a \c Name object that specifies the algorithm. /// For example, if the algorithm is HMAC-SHA256, \c algorithm would be /// \c Name("hmac-sha256"). /// /// \c time_signed corresponds to the Time Signed field, which is of /// 48-bit unsigned integer type, and therefore cannot exceed 2^48-1; /// otherwise, an exception of type \c OutOfRange will be thrown. /// /// \c mac_size and \c mac correspond to the MAC Size and MAC fields, /// respectively. When the MAC field is empty, \c mac must be NULL. /// \c mac_size and \c mac must be consistent %in that \c mac_size is 0 if /// and only if \c mac is NULL; otherwise an exception of type /// InvalidParameter will be thrown. /// /// The same restriction applies to \c other_len and \c other_data, /// which correspond to the Other Len and Other Data fields, respectively. /// /// This constructor internally involves resource allocation, and if /// it fails, a corresponding standard exception will be thrown. TSIG(const Name& algorithm, uint64_t time_signed, uint16_t fudge, uint16_t mac_size, const void* mac, uint16_t original_id, uint16_t error, uint16_t other_len, const void* other_data); /// \brief Assignment operator. /// /// It internally allocates a resource, and if it fails a corresponding /// standard exception will be thrown. /// This operator never throws an exception otherwise. /// /// This operator provides the strong exception guarantee: When an /// exception is thrown the content of the assignment target will be /// intact. TSIG& operator=(const TSIG& source); /// \brief The destructor. ~TSIG(); /// \brief Return the algorithm name. /// /// This method never throws an exception. const Name& getAlgorithm() const; /// \brief Return the value of the Time Signed field. /// /// The returned value does not exceed 2^48-1. /// /// This method never throws an exception. uint64_t getTimeSigned() const; /// \brief Return the value of the Fudge field. /// /// This method never throws an exception. uint16_t getFudge() const; /// \brief Return the value of the MAC Size field. /// /// This method never throws an exception. uint16_t getMACSize() const; /// \brief Return the value of the MAC field. /// /// If the MAC field is empty, it returns NULL. /// Otherwise, the memory region beginning at the address returned by /// this method is valid up to the bytes specified by the return value /// of \c getMACSize(). /// The memory region is only valid while the corresponding \c TSIG /// object is valid. The caller must hold the \c TSIG object while /// it needs to refer to the region or it must make a local copy of the /// region. /// /// This method never throws an exception. const void* getMAC() const; /// \brief Return the value of the Original ID field. /// /// This method never throws an exception. uint16_t getOriginalID() const; /// \brief Return the value of the Error field. /// /// This method never throws an exception. uint16_t getError() const; /// \brief Return the value of the Other Len field. /// /// This method never throws an exception. uint16_t getOtherLen() const; /// \brief Return the value of the Other Data field. /// /// The same note as \c getMAC() applies. /// /// This method never throws an exception. const void* getOtherData() const; private: boost::shared_ptr constructFromLexer(MasterLexer& lexer, const Name* origin); boost::shared_ptr impl_; }; } // end of namespace "any" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // ANY_TSIG_250_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef GENERIC_OPT_41_H #define GENERIC_OPT_41_H #include #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace generic { struct OPTImpl; class OPT : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit OPT(const std::string& type_str); OPT(isc::util::InputBuffer& buffer, size_t rdata_len); OPT(const OPT& other); OPT( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS // The default constructor makes sense for OPT as it can be empty. OPT(); OPT& operator=(const OPT& source); ~OPT(); /// \brief A class representing a pseudo RR (or option) within an /// OPT RR (see RFC 6891). class PseudoRR { public: /// \brief Constructor. /// \param code The OPTION-CODE field of the pseudo RR. /// \param data The OPTION-DATA field of the pseudo /// RR. OPTION-LENGTH is set to the length of this vector. PseudoRR(uint16_t code, boost::shared_ptr >& data); /// \brief Return the option code of this pseudo RR. uint16_t getCode() const; /// \brief Return the option data of this pseudo RR. const uint8_t* getData() const; /// \brief Return the length of the option data of this /// pseudo RR. uint16_t getLength() const; private: uint16_t code_; boost::shared_ptr > data_; }; /// \brief Append a pseudo RR (option) in this OPT RR. /// /// \param code The OPTION-CODE field of the pseudo RR. /// \param data The OPTION-DATA field of the pseudo RR. /// \param length The size of the \c data argument. OPTION-LENGTH is /// set to this size. /// \throw isc::InvalidParameter if this pseudo RR would cause /// the OPT RDATA to overflow its RDLENGTH. void appendPseudoRR(uint16_t code, const uint8_t* data, uint16_t length); /// \brief Return a vector of the pseudo RRs (options) in this /// OPT RR. /// /// Note: The returned reference is only valid during the lifetime /// of this \c generic::OPT object. It should not be used /// afterwards. const std::vector& getPseudoRRs() const; private: boost::shared_ptr impl_; }; } // end of namespace "generic" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // GENERIC_OPT_41_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef GENERIC_PTR_12_H #define GENERIC_PTR_12_H #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace generic { class PTR : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit PTR(const std::string& type_str); PTR(isc::util::InputBuffer& buffer, size_t rdata_len); PTR(const PTR& other); PTR( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS /// /// Specialized constructor /// explicit PTR(const Name& ptr_name) : ptr_name_(ptr_name) { } /// /// Specialized methods /// const Name& getPTRName() const; private: Name ptr_name_; }; } // end of namespace "generic" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // GENERIC_PTR_12_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include #include #include #include #include #include #ifndef GENERIC_RRSIG_46_H #define GENERIC_RRSIG_46_H namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace generic { struct RRSIGImpl; /// \brief \c rdata::RRSIG class represents the RRSIG RDATA as defined %in /// RFC4034. /// /// This class implements the basic interfaces inherited from the abstract /// \c rdata::Rdata class, and provides trivial accessors specific to the /// RRSIG RDATA. class RRSIG : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit RRSIG(const std::string& type_str); RRSIG(isc::util::InputBuffer& buffer, size_t rdata_len); RRSIG(const RRSIG& other); RRSIG( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS RRSIG& operator=(const RRSIG& source); ~RRSIG(); // specialized methods const RRType& typeCovered() const; private: // helper function for string and lexer constructors boost::shared_ptr constructFromLexer(MasterLexer& lexer, const Name* origin); boost::shared_ptr impl_; }; } // end of namespace "generic" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // GENERIC_RRSIG_46_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef GENERIC_SOA_6_H #define GENERIC_SOA_6_H #include #include #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace generic { class SOA : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit SOA(const std::string& type_str); SOA(isc::util::InputBuffer& buffer, size_t rdata_len); SOA(const SOA& other); SOA( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS SOA(const Name& mname, const Name& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum); /// \brief Returns the serial stored in the SOA. Serial getSerial() const; /// brief Returns the minimum TTL field value of the SOA. uint32_t getMinimum() const; private: /// Note: this is a prototype version; we may reconsider /// this representation later. Name mname_; Name rname_; /// serial, refresh, retry, expire, minimum, stored in network byte order uint8_t numdata_[20]; }; } // end of namespace "generic" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // GENERIC_SOA_6_H #endif // DNS_RDATACLASS_H // Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef GENERIC_TKEY_249_H #define GENERIC_TKEY_249_H #include #include #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace generic { struct TKEYImpl; /// \brief \c rdata::TKEY class represents the TKEY RDATA as defined %in /// RFC2930. /// /// This class implements the basic interfaces inherited from the abstract /// \c rdata::Rdata class, and provides trivial accessors specific to the /// TKEY RDATA. class TKEY : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit TKEY(const std::string& type_str); TKEY(isc::util::InputBuffer& buffer, size_t rdata_len); TKEY(const TKEY& other); TKEY( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS /// \brief Constructor from RDATA field parameters. /// /// The parameters are a straightforward mapping of %TKEY RDATA /// fields as defined %in RFC2930. /// /// This RR is pretty close to the TSIG RR with 32 bit timestamps, /// or the RRSIG RR with a second "other" data field. /// /// This constructor internally involves resource allocation, and if /// it fails, a corresponding standard exception will be thrown. /// /// \param algorithm The DNS name of the algorithm e.g. gss-tsig. /// \param inception The inception time (in seconds since 1970). /// \param expire The expire time (in seconds since 1970). /// \param mode The mode e.g. Diffie-Hellman (2) or GSS-API (3). /// \param error The error code (extended error space shared with TSIG). /// \param key_len The key length (0 means no key). /// \param key The key (can be 0). /// \param other_len The other data length (0 means no other data). /// \param other_data The other data (can be and usually is 0). TKEY(const Name& algorithm, uint32_t inception, uint32_t expire, uint16_t mode, uint16_t error, uint16_t key_len, const void* key, uint16_t other_len, const void* other_data); /// \brief Assignment operator. /// /// It internally allocates a resource, and if it fails a corresponding /// standard exception will be thrown. /// This operator never throws an exception otherwise. /// /// This operator provides the strong exception guarantee: When an /// exception is thrown the content of the assignment target will be /// intact. TKEY& operator=(const TKEY& source); /// \brief The destructor. ~TKEY(); /// \brief Return the algorithm name. /// /// This method never throws an exception. const Name& getAlgorithm() const; /// \brief Return the value of the Inception field as a number. /// /// This method never throws an exception. uint32_t getInception() const; /// \brief Return the value of the Inception field as a string. std::string getInceptionDate() const; /// \brief Return the value of the Expire field as a number. /// /// This method never throws an exception. uint32_t getExpire() const; /// \brief Return the value of the Expire field as a string. std::string getExpireDate() const; /// \brief Return the value of the Mode field. /// /// This method never throws an exception. uint16_t getMode() const; /// \brief Return the value of the Error field. /// /// This method never throws an exception. uint16_t getError() const; /// \brief Return the value of the Key Len field. /// /// This method never throws an exception. uint16_t getKeyLen() const; /// \brief Return the value of the Key field. /// /// This method never throws an exception. const void* getKey() const; /// \brief Return the value of the Other Len field. /// /// This method never throws an exception. uint16_t getOtherLen() const; /// \brief Return the value of the Other Data field. /// /// The same note as \c getMAC() applies. /// /// This method never throws an exception. const void* getOtherData() const; /// \brief The GSS_API constant for the Mode field. static const uint16_t GSS_API_MODE; private: boost::shared_ptr constructFromLexer(MasterLexer& lexer, const Name* origin); boost::shared_ptr impl_; }; } // end of namespace "generic" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // GENERIC_TKEY_249_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef IN_A_1_H #define IN_A_1_H #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace in { class A : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit A(const std::string& type_str); A(isc::util::InputBuffer& buffer, size_t rdata_len); A(const A& other); A( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS //We can use the default destructor. //virtual ~A() {} // notyet: //const struct in_addr& getAddress() const { return (addr_); } private: uint32_t addr_; // raw IPv4 address (network byte order) }; } // end of namespace "in" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // IN_A_1_H // Copyright (C) 2010-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef IN_AAAA_28_H #define IN_AAAA_28_H #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace in { class AAAA : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit AAAA(const std::string& type_str); AAAA(isc::util::InputBuffer& buffer, size_t rdata_len); AAAA(const AAAA& other); AAAA( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS // notyet: //const struct in6_addr& getAddress() const { return (addr_); } private: uint8_t addr_[16]; // raw IPv6 address (network byte order) }; } // end of namespace "in" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // IN_AAAA_28_H // Copyright (C) 2011-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef IN_DHCID_49_H #define IN_DHCID_49_H #include #include #include #include namespace isc { namespace dns { // BEGIN_COMMON_DECLARATIONS class AbstractMessageRenderer; // END_COMMON_DECLARATIONS namespace rdata { namespace in { /// \brief \c rdata::DHCID class represents the DHCID RDATA as defined %in /// RFC4701. /// /// This class implements the basic interfaces inherited from the abstract /// \c rdata::Rdata class, and provides trivial accessors specific to the /// DHCID RDATA. class DHCID : public Rdata { public: // BEGIN_COMMON_MEMBERS explicit DHCID(const std::string& type_str); DHCID(isc::util::InputBuffer& buffer, size_t rdata_len); DHCID(const DHCID& other); DHCID( MasterLexer& lexer, const Name* name, MasterLoader::Options options, MasterLoaderCallbacks& callbacks); virtual std::string toText() const; virtual void toWire(isc::util::OutputBuffer& buffer) const; virtual void toWire(AbstractMessageRenderer& renderer) const; virtual int compare(const Rdata& other) const; // END_COMMON_MEMBERS /// \brief Return the digest. /// /// This method never throws an exception. const std::vector& getDigest() const; private: // helper for string and lexer constructors void constructFromLexer(MasterLexer& lexer); /// \brief Private data representation /// /// Opaque data at least 3 octets long as per RFC4701. /// std::vector digest_; }; } // end of namespace "in" } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" #endif // IN_DHCID_49_H