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)));
86 zone_.reset(
new D2Zone(question.getName(), question.getClass()));
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()));
175D2UpdateMessage::ddnsToDnsSection(
const UpdateMsgSection section) {
196 "unknown message section " << section);
200D2UpdateMessage::validateResponse()
const {
207 isc_throw(NotUpdateMessage,
"received message is not a DDNS update,"
208 <<
" received message code is "
214 isc_throw(InvalidQRFlag,
"received message should have QR flag set,"
215 " to indicate that it is a RESPONSE message; the QR"
216 <<
" flag in received message is unset");
223 isc_throw(InvalidZoneSection,
"received message contains "
225 <<
" it should contain at most 1 record");
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
A generic exception that is thrown when an unexpected error condition occurs.
D2ZonePtr getZone() const
Returns a pointer to the object representing Zone record.
void setId(const uint16_t id)
Sets message ID.
UpdateMsgSection
Identifies sections in the DNS Update Message.
QRFlag
Indicates whether DNS Update message is a REQUEST or RESPONSE.
unsigned int getRRCount(const UpdateMsgSection section) const
Returns number of RRsets in the specified message section.
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...
void fromWire(const void *received_data, size_t bytes_received, dns::TSIGContext *const tsig_context=NULL)
Decode incoming message from the wire format.
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.
void toWire(dns::AbstractMessageRenderer &renderer, dns::TSIGContext *const tsig_ctx=NULL)
Encode outgoing message into wire format.
Direction
Indicates if the D2UpdateMessage object encapsulates Inbound or Outbound message.
QRFlag getQRFlag() const
Returns enum value indicating if the message is a REQUEST or RESPONSE.
void setRcode(const dns::Rcode &rcode)
Sets message RCode.
D2UpdateMessage(const Direction direction=OUTBOUND)
Constructor used to create an instance of the DNS Update Message (either outgoing or incoming).
uint16_t getId() const
Returns message ID.
void addRRset(const UpdateMsgSection section, const dns::RRsetPtr &rrset)
Adds an RRset to the specified section.
void setZone(const dns::Name &zone, const dns::RRClass &rrclass)
Sets the Zone record.
const dns::Rcode & getRcode() const
Returns an object representing message RCode.
The D2Zone encapsulates the Zone section in DNS Update message.
Exception indicating that QR flag has invalid value.
Exception indicating that Zone section contains invalid content.
Exception indicating that a signed, inbound message failed to verify.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
A standard DNS module exception that is thrown if a section iterator is being constructed for an inco...
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.
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.
void clearSection(const Section section)
Remove all RRSets from the given Section.
Section
Constants to specify sections of a DNS 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.
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.
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.
void setHeaderFlag(const HeaderFlag flag, const bool on=true)
Set or clear the specified header flag bit in the header section.
const Opcode & getOpcode() const
Return the OPCODE given in the header section of the message.
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.
The Name class encapsulates DNS names.
The Opcode class objects represent standard OPCODEs of the header section of DNS messages as defined ...
static const Opcode & UPDATE()
A constant object for the UPDATE Opcode.
@ UPDATE_CODE
5: Dynamic update (RFC2136)
The Question class encapsulates the common search key of DNS lookup, consisting of owner name,...
The RRClass class encapsulates DNS resource record classes.
static const RRType & SOA()
DNS Response Codes (RCODEs) class.
static const Rcode & NOERROR()
A constant object for the NOERROR Rcode (see Rcode::NOERROR_CODE).
SectionIterator is a templated class to provide standard-compatible iterators for Questions and RRset...
static const TSIGError & NOERROR()
A constant TSIG error object derived from Rcode::NOERROR()
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< D2Zone > D2ZonePtr
boost::shared_ptr< Question > QuestionPtr
A pointer-like type pointing to an Question object.
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
Defines the logger used by the top-level component of kea-lfc.