odtone::dns::message
// In header: </home/carlos/Projectos/odtone/inc/odtone/net/dns/message.hpp> class message { public: // construct/copy/destruct message(); message(const frame &); message& operator=(const frame &); ~message(); // public member functions void tid(uint16); void qr(bool); void opcode(uint8); void aa(bool); void tc(bool); void rd(bool); void ra(bool); void z(bool); void rcode(uint8); void query(std::vector< question >); void answer(std::vector< resource_record >); void auth(std::vector< resource_record >); void add(std::vector< resource_record >); uint16 tid() const; bool qr() const; uint8 opcode() const; bool aa() const; bool tc() const; bool rd() const; bool ra() const; bool z() const; uint8 rcode() const; uint16 nquery() const; uint16 nanswer() const; uint16 nauth() const; uint16 nadd() const; std::vector< question > query(); std::vector< resource_record > answer(); std::vector< resource_record > auth(); std::vector< resource_record > add(); void get_frame(frame_vla &) const; };
DNS Message
The odtone::dns::message is high level representation of an DNS message. It provides access to all fields of the DNS message header and to all resource records presented on the DNS Message.
The odtone::dns::message can be set from an odtone::dns::frame that was received or it can create an odtone::dns::frame ready to be sent.
message
public
construct/copy/destructmessage();
Construct a default DNS Message.
The defaults for each field are: tid = 0; qr = false; opcode = 0; aa = false; tc = false; rd = false; ra = false; z = false; rcode = false; nquery = false; nanswer = false; nauth = false; nadd = false;
message(const frame & fm);
Construct a DNS Message parsing all fields from a frame.
Parameters: |
|
message& operator=(const frame & fm);
Extract the DNS Message fields from a given odtone::dns::frame
.
Parameters: |
|
||
Returns: |
odtone::dns::message with the fields updated. |
~message();
Destruct a DNS Message.
message
public member functionsvoid tid(uint16 tid);
Set the DNS Message Transaction Identifier.
Parameters: |
|
void qr(bool qr);
Set the DNS Message Query/Response Flag.
Parameters: |
|
void opcode(uint8 opcode);
Set the DNS Message Operation Code.
Parameters: |
|
void aa(bool aa);
Set the DNS Message Authoritative Answer Flag.
Parameters: |
|
void tc(bool tc);
Set the DNS Message Truncation Flag.
Parameters: |
|
void rd(bool rd);
Set the DNS Message Recursion Desired.
Parameters: |
|
void ra(bool ra);
Set the DNS Message Recursion Available.
Parameters: |
|
void z(bool z);
Set the DNS Message Zero.
Parameters: |
|
void rcode(uint8 rcode);
Set the DNS Message Response Code.
Parameters: |
|
void query(std::vector< question > query);
Set the DNS Message Question list.
Parameters: |
|
void answer(std::vector< resource_record > answer);
Set the DNS Message Answer Record list.
Parameters: |
|
void auth(std::vector< resource_record > auth);
Set the DNS Message Authority Record list.
Parameters: |
|
void add(std::vector< resource_record > add);
Set the DNS Message Additional Record list.
Parameters: |
|
uint16 tid() const;
Get the DNS Message Transaction Identifier.
Returns: |
The value of the DNS Message Transaction Identifier field. |
bool qr() const;
Get the DNS Message Query/Response Flag.
Returns: |
The value of the DNS Message Query/Response Flag field. |
uint8 opcode() const;
Get the DNS Message Operation Code.
Returns: |
The value of the DNS Message Operation Code field. |
bool aa() const;
Get the DNS Message Authoritative Answer Flag.
Returns: |
The value of the DNS Message Authoritative Answer Flag field. |
bool tc() const;
Get the DNS Message Truncation Flag.
Returns: |
The value of the DNS Message Truncation Flag field. |
bool rd() const;
Get the DNS Message Recursion Desired.
Returns: |
The value of the DNS Message Recursion Desired field. |
bool ra() const;
Get the DNS Message Recursion Available.
Returns: |
The value of the DNS Message Recursion Available field. |
bool z() const;
Get the DNS Message Zero.
Returns: |
The value of the DNS Message Zero field. |
uint8 rcode() const;
Get the DNS Message Response Code.
Returns: |
The value of the DNS Message Response Code field. |
uint16 nquery() const;
Get the DNS Message Question Count.
Returns: |
The value of the DNS Message Question Count field. |
uint16 nanswer() const;
Get the DNS Message Answer Record Count.
Returns: |
The value of the DNS Message Answer Record Count field. |
uint16 nauth() const;
Get the DNS Message Authority Record Count.
Returns: |
The value of the DNS Message Authority Record Count field. |
uint16 nadd() const;
Get the DNS Message Additional Record Count.
Returns: |
The value of the DNS Message Additional Record Count field. |
std::vector< question > query();
Get the DNS Message Question list.
Returns: |
The DNS Message Question list. |
std::vector< resource_record > answer();
Get the DNS Message Answer Record list.
Returns: |
The DNS Message Answer Record list. |
std::vector< resource_record > auth();
Get the DNS Message Authority Record list.
Returns: |
The DNS Message Authority Record list. |
std::vector< resource_record > add();
Get the DNS Message Additional Record list.
Returns: |
The DNS Message Additional Record Count list. |
void get_frame(frame_vla & fm) const;
Get the DNS Message Frame.
Parameters: |
|