551 std::string
toText()
const;
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
A standard DNS module exception that is thrown if a Message class method is called that is prohibited...
InvalidMessageOperation(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if a section iterator is being constructed for an inco...
InvalidMessageSection(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if a UDP buffer size smaller than the standard default...
InvalidMessageUDPSize(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if a wire format message parser encounters a short len...
MessageTooShort(const char *file, size_t line, const char *what)
The Message class encapsulates a standard DNS message.
const QuestionIterator beginQuestion() const
Return an iterator corresponding to the beginning of the Question section of the message.
const QuestionIterator endQuestion() const
Return an iterator corresponding to the end of the Question section of the message.
static const uint16_t DEFAULT_MAX_EDNS0_UDPSIZE
The default maximum size of UDP DNS messages we can handle.
void toWire(AbstractMessageRenderer &renderer, TSIGContext *tsig_ctx=0)
Render the message in wire formant into a message renderer object with (or without) TSIG.
const Rcode & getRcode() const
Return the Response Code of the message.
bool getHeaderFlag(const HeaderFlag flag) const
Return whether the specified header flag bit is set in the header section.
~Message()=default
The destructor.
void clear(Mode mode)
Clear the message content (if any) and reinitialize it in the specified mode.
static const uint16_t DEFAULT_MAX_UDPSIZE
The default maximum size of UDP DNS messages that don't cause truncation.
void clearSection(const Section section)
Remove all RRSets from the given Section.
Section
Constants to specify sections of a DNS message.
ParseOptions
Parse options.
Mode
Constants to specify the operation mode of the Message.
unsigned int getRRCount(const Section section) const
Returns the number of RRs contained in the given section.
void setOpcode(const Opcode &opcode)
Set the OPCODE of the header section of the message.
bool removeRRset(const Section section, RRsetIterator &iterator)
Remove RRSet from Message.
void addRRset(const Section section, RRsetPtr rrset)
Add a (pointer like object of) RRset to the given section of the message.
void fromWire(isc::util::InputBuffer &buffer, ParseOptions options=PARSE_DEFAULT)
(Re)build a Message object from wire-format data.
HeaderFlag
Constants for flag bit fields of a DNS message header.
const RRsetIterator endSection(const Section section) const
Return an iterator corresponding to the end of the given section (other than Question) of the message...
const TSIGRecord * getTSIGRecord() const
Return, if any, the TSIG record contained in the received message.
std::string toText() const
Convert the Message to a string.
void makeResponse()
Prepare for making a response from a request.
void setHeaderFlag(const HeaderFlag flag, const bool on=true)
Set or clear the specified header flag bit in the header section.
ConstEDNSPtr getEDNS() const
Return, if any, the EDNS associated with the message.
const Opcode & getOpcode() const
Return the OPCODE given in the header section of the message.
void parseHeader(isc::util::InputBuffer &buffer)
Parse the header section of the Message.
bool hasRRset(const Section section, const Name &name, const RRClass &rrclass, const RRType &rrtype) const
Determine whether the given section already has an RRset matching the given name, RR class and RR typ...
void appendSection(const Section section, const Message &source)
Adds all rrsets from the source the given section in the source message to the same section of this m...
void addQuestion(QuestionPtr question)
Add a (pointer like object of) Question to the message.
void setQid(qid_t qid)
Set the query ID of the header section of the message.
qid_t getQid() const
Return the query ID given in the header section of the message.
const RRsetIterator beginSection(const Section section) const
Return an iterator corresponding to the beginning of the given section (other than Question) of the m...
void setRcode(const Rcode &rcode)
Set the Response Code of the message.
Message(Mode mode)
The constructor.
void setEDNS(ConstEDNSPtr edns)
Set EDNS for the message.
The Name class encapsulates DNS names.
The Opcode class objects represent standard OPCODEs of the header section of DNS messages as defined ...
The Question class encapsulates the common search key of DNS lookup, consisting of owner name,...
The RRClass class encapsulates DNS resource record classes.
The RRType class encapsulates DNS resource record types.
DNS Response Codes (RCODEs) class.
SectionIterator is a templated class to provide standard-compatible iterators for Questions and RRset...
const T & operator*() const
const T * operator->() const
bool operator!=(const SectionIterator< T > &other) const
std::ptrdiff_t difference_type
bool operator==(const SectionIterator< T > &other) const
SectionIterator< T > & operator++()
void operator=(const SectionIterator< T > &source)
std::input_iterator_tag iterator_category
boost::shared_ptr< MessageImpl > MessageImplPtr
Pointer to the MessageImpl object.
boost::shared_ptr< const Message > ConstMessagePtr
boost::shared_ptr< Question > QuestionPtr
A pointer-like type pointing to an Question object.
SectionIterator< QuestionPtr > QuestionIterator
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
boost::shared_ptr< Message > MessagePtr
Pointer-like type pointing to a Message.
boost::shared_ptr< const EDNS > ConstEDNSPtr
A pointer-like type pointing to an immutable EDNS object.
SectionIterator< RRsetPtr > RRsetIterator
Defines the logger used by the top-level component of kea-lfc.
Template version of Section Iterator.