21 : message_(direction == INBOUND ?
40 return (message_.
getQid());
61 return (message_.
getRRCount(ddnsToDnsSection(section)));
66 return (message_.
beginSection(ddnsToDnsSection(section)));
71 return (message_.
endSection(ddnsToDnsSection(section)));
99 " of the DNS Update message, use setZone instead");
101 message_.
addRRset(ddnsToDnsSection(section), rrset);
112 " DNS Update message");
118 " must comprise exactly one record (RFC2136, section 2.3)");
120 message_.
toWire(renderer, tsig_context);
131 message_.
fromWire(received_data_buffer);
136 received_data, bytes_received);
158 zone_.reset(
new D2Zone(question->getName(), question->getClass()));
196 "unknown message section " << section);
200 D2UpdateMessage::validateResponse()
const {
208 <<
" received message code is " 215 " to indicate that it is a RESPONSE message; the QR" 216 <<
" flag in received message is unset");
225 <<
" it should contain at most 1 record");
The Name class encapsulates DNS names.
uint16_t getId() const
Returns message ID.
const dns::RRsetIterator beginSection(const UpdateMsgSection section) const
Return iterators pointing to the beginning of the list of RRsets, which belong to the specified secti...
unsigned int getRRCount(const Section section) const
Returns the number of RRs contained in the given section.
void toWire(AbstractMessageRenderer &renderer, TSIGContext *tsig_ctx=NULL)
Render the message in wire formant into a message renderer object with (or without) TSIG...
qid_t getQid() const
Return the query ID given in the header section of the message.
const Opcode & getOpcode() const
Return the OPCODE given in the header section of the message.
Exception indicating that QR flag has invalid value.
The Question class encapsulates the common search key of DNS lookup, consisting of owner name...
unsigned int getRRCount(const UpdateMsgSection section) const
Returns number of RRsets in the specified message section.
static const Rcode & NOERROR()
A constant object for the NOERROR Rcode (see Rcode::NOERROR_CODE).
const TSIGRecord * getTSIGRecord() const
Return, if any, the TSIG record contained in the received message.
Exception indicating that the parsed message is not DNS Update.
5: Dynamic update (RFC2136)
void toWire(dns::AbstractMessageRenderer &renderer, dns::TSIGContext *const tsig_ctx=NULL)
Encode outgoing message into wire format.
static const RRType & SOA()
const QuestionIterator beginQuestion() const
Return an iterator corresponding to the beginning of the Question section of the message.
void clearSection(const Section section)
Remove all RRSets from the given Section.
boost::shared_ptr< D2Zone > D2ZonePtr
void setRcode(const Rcode &rcode)
Set the Response Code of the message.
DNS Response Codes (RCODEs) class.
void setHeaderFlag(const HeaderFlag flag, const bool on=true)
Set or clear the specified header flag bit in the header section.
void fromWire(const void *received_data, size_t bytes_received, dns::TSIGContext *const tsig_context=NULL)
Decode incoming message from the wire format.
The Message class encapsulates a standard DNS message.
std::string toText() const
Convert the TSIGError to a string.
void setRcode(const dns::Rcode &rcode)
Sets message RCode.
The RRClass class encapsulates DNS resource record classes.
Exception indicating that Zone section contains invalid content.
static const Opcode & UPDATE()
A constant object for the UPDATE Opcode.
void setZone(const dns::Name &zone, const dns::RRClass &rrclass)
Sets the Zone record.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A standard DNS module exception that is thrown if a section iterator is being constructed for an inco...
void fromWire(isc::util::InputBuffer &buffer, ParseOptions options=PARSE_DEFAULT)
(Re)build a Message object from wire-format data.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
void addQuestion(QuestionPtr question)
Add a (pointer like object of) Question to the message.
void addRRset(const UpdateMsgSection section, const dns::RRsetPtr &rrset)
Adds an RRset to the specified section.
A generic exception that is thrown when an unexpected error condition occurs.
The D2Zone encapsulates the Zone section in DNS Update message.
const Name & getName() const
Returns the owner name of the Question.
D2UpdateMessage(const Direction direction=OUTBOUND)
Constructor used to create an instance of the DNS Update Message (either outgoing or incoming)...
bool getHeaderFlag(const HeaderFlag flag) const
Return whether the specified header flag bit is set in the header section.
QRFlag
Indicates whether DNS Update message is a REQUEST or RESPONSE.
const RRsetIterator endSection(const Section section) const
Return an iterator corresponding to the end of the given section (other than Question) of the message...
Query (if cleared) or response (if set)
const dns::RRsetIterator endSection(const UpdateMsgSection section) const
Return iterators pointing to the end of the list of RRsets, which belong to the specified section...
const Rcode & getRcode() const
Return the Response Code of the message.
Defines the logger used by the top-level component of kea-lfc.
SectionIterator is a templated class to provide standard-compatible iterators for Questions and RRset...
void setOpcode(const Opcode &opcode)
Set the OPCODE of the header section of the message.
Section
Constants to specify sections of a DNS message.
const RRClass & getClass() const
Returns the RR Type of the Question.
UpdateMsgSection
Identifies sections in the DNS Update Message.
void setId(const uint16_t id)
Sets message ID.
const dns::Rcode & getRcode() const
Returns an object representing message RCode.
void setQid(qid_t qid)
Set the query ID of the header section of the message.
Direction
Indicates if the D2UpdateMessage object encapsulates Inbound or Outbound message. ...
D2ZonePtr getZone() const
Returns a pointer to the object representing Zone record.
virtual TSIGError verify(const TSIGRecord *const record, const void *const data, const size_t data_len)
Verify a DNS message.
QRFlag getQRFlag() const
Returns enum value indicating if the message is a REQUEST or RESPONSE.
CodeValue getCode() const
Returns the Opcode code value.
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
Exception indicating that a signed, inbound message failed to verify.
The Opcode class objects represent standard OPCODEs of the header section of DNS messages as defined ...
const RRsetIterator beginSection(const Section section) const
Return an iterator corresponding to the beginning of the given section (other than Question) of the m...
boost::shared_ptr< Question > QuestionPtr
A pointer-like type pointing to an Question object.
void addRRset(const Section section, RRsetPtr rrset)
Add a (pointer like object of) RRset to the given section of the message.
static const TSIGError & NOERROR()
A constant TSIG error object derived from Rcode::NOERROR()