 |
Kea
1.5.0
|
Go to the documentation of this file.
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);
156 zone_.reset(
new D2Zone(question->getName(), question->getClass()));
173 D2UpdateMessage::ddnsToDnsSection(
const UpdateMsgSection section) {
194 "unknown message section " << section);
198 D2UpdateMessage::validateResponse()
const {
205 isc_throw(NotUpdateMessage,
"received message is not a DDNS update,"
206 <<
" received message code is "
212 isc_throw(InvalidQRFlag,
"received message should have QR flag set,"
213 " to indicate that it is a RESPONSE message; the QR"
214 <<
" flag in received message is unset");
221 isc_throw(InvalidZoneSection,
"received message contains "
223 <<
" it should contain at most 1 record");
boost::shared_ptr< Question > QuestionPtr
A pointer-like type pointing to an Question object.
@ SECTION_AUTHORITY
Authority section.
const dns::Rcode & getRcode() const
Returns an object representing message RCode.
const RRClass & getClass() const
Returns the RR Type of the Question.
boost::shared_ptr< AbstractRRset > RRsetPtr
A pointer-like type pointing to an RRset object.
The Opcode class objects represent standard OPCODEs of the header section of DNS messages as defined ...
void setRcode(const dns::Rcode &rcode)
Sets message RCode.
void fromWire(const void *received_data, size_t bytes_received, dns::TSIGContext *const tsig_context=NULL)
Decode incoming message from the wire format.
void setZone(const dns::Name &zone, const dns::RRClass &rrclass)
Sets the Zone record.
unsigned int getRRCount(const UpdateMsgSection section) const
Returns number of RRsets in the specified message section.
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.
@ HEADERFLAG_QR
Query (if cleared) or response (if set)
qid_t getQid() const
Return the query ID given in the header section of the message.
unsigned int getRRCount(const Section section) const
Returns the number of RRs contained in the given section.
@ UPDATE_CODE
5: Dynamic update (RFC2136)
@ SECTION_ADDITIONAL
Additional section.
const Name & getName() const
Returns the owner name of the Question.
static const Rcode & NOERROR()
A constant object for the NOERROR Rcode (see Rcode::NOERROR_CODE).
bool getHeaderFlag(const HeaderFlag flag) const
Return whether the specified header flag bit is set in the header section.
SectionIterator is a templated class to provide standard-compatible iterators for Questions and RRset...
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...
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
void setQid(qid_t qid)
Set the query ID of the header section of the message.
uint16_t getId() const
Returns message ID.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void fromWire(isc::util::InputBuffer &buffer, ParseOptions options=PARSE_DEFAULT)
(Re)build a Message object from wire-format data.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
static const TSIGError & NOERROR()
A constant TSIG error object derived from Rcode::NOERROR()
The Question class encapsulates the common search key of DNS lookup, consisting of owner name,...
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
@ SECTION_QUESTION
Question section
The Name class encapsulates DNS names.
void setOpcode(const Opcode &opcode)
Set the OPCODE of the header section of the message.
QRFlag getQRFlag() const
Returns enum value indicating if the message is a REQUEST or RESPONSE.
const RRsetIterator beginSection(const Section section) const
Return an iterator corresponding to the beginning of the given section (other than Question) of the m...
A standard DNS module exception that is thrown if a section iterator is being constructed for an inco...
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 QuestionIterator beginQuestion() const
Return an iterator corresponding to the beginning of the Question section of the message.
const Rcode & getRcode() const
Return the Response Code of the message.
void toWire(dns::AbstractMessageRenderer &renderer, dns::TSIGContext *const tsig_ctx=NULL)
Encode outgoing message into wire format.
void addRRset(const UpdateMsgSection section, const dns::RRsetPtr &rrset)
Adds an RRset to the specified section.
D2UpdateMessage(const Direction direction=OUTBOUND)
Constructor used to create an instance of the DNS Update Message (either outgoing or incoming).
void setId(const uint16_t id)
Sets message ID.
Direction
Indicates if the D2UpdateMessage object encapsulates Inbound or Outbound message.
const TSIGRecord * getTSIGRecord() const
Return, if any, the TSIG record contained in the received message.
void addRRset(const Section section, RRsetPtr rrset)
Add a (pointer like object of) RRset to the given section of the message.
Exception indicating that QR flag has invalid value.
void setRcode(const Rcode &rcode)
Set the Response Code of the message.
Exception indicating that a signed, inbound message failed to verify.
std::string toText() const
Convert the TSIGError to a string.
CodeValue getCode() const
Returns the Opcode code value.
The Message class encapsulates a standard DNS message.
void clearSection(const Section section)
Remove all RRSets from the given Section.
TSIGError verify(const TSIGRecord *const record, const void *const data, const size_t data_len)
Verify a DNS message.
The D2Zone encapsulates the Zone section in DNS Update message.
void toWire(AbstractMessageRenderer &renderer, TSIGContext *tsig_ctx=NULL)
Render the message in wire formant into a message renderer object with (or without) TSIG.
void setHeaderFlag(const HeaderFlag flag, const bool on=true)
Set or clear the specified header flag bit in the header section.
@ SECTION_ANSWER
Answer section.
Exception indicating that Zone section contains invalid content.
static const Opcode & UPDATE()
A constant object for the UPDATE Opcode.
UpdateMsgSection
Identifies sections in the DNS Update Message.
const Opcode & getOpcode() const
Return the OPCODE given in the header section of the message.
D2ZonePtr getZone() const
Returns a pointer to the object representing Zone record.
Section
Constants to specify sections of a DNS message.
The RRClass class encapsulates DNS resource record classes.
boost::shared_ptr< D2Zone > D2ZonePtr
DNS Response Codes (RCODEs) class.
static const RRType & SOA()
void addQuestion(QuestionPtr question)
Add a (pointer like object of) Question to the message.
QRFlag
Indicates whether DNS Update message is a REQUEST or RESPONSE.