odtone::dns::frame
// In header: </home/carlos/Projectos/odtone/inc/odtone/net/dns/frame.hpp> struct frame { // public static functions static frame * cast(void *, size_t); static const frame * cast(const void *, size_t); // 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 nquery(uint16); void nanswer(uint16); void nauth(uint16); void nadd(uint16); 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; uint8 * payload(); const uint8 * payload() const; uint8 * get(); const uint8 * get() const; // public data members static const uint8 mask_qr; static const uint8 mask_opcode; static const uint8 mask_aa; static const uint8 mask_tc; static const uint8 mask_rd; static const uint8 mask_ra; static const uint8 mask_z; static const uint8 mask_rcode; uint8 hdr; };
DNS message frame. This class provides access to all fields of the DNS message header.
frame
public static functionsstatic frame * cast(void * buff, size_t len);
Convert a byte buffer to a frame.
Parameters: |
|
||||
Returns: |
The pointer of the returning frame. |
static const frame * cast(const void * buff, size_t len);
Convert a byte buffer to a frame.
Parameters: |
|
||||
Returns: |
The pointer of the returning frame. |
frame
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 nquery(uint16 nquery);
Set the DNS Message Question Count.
Parameters: |
|
void nanswer(uint16 nanswer);
Set the DNS Message Answer Record Count.
Parameters: |
|
void nauth(uint16 nauth);
Set the DNS Message Authority Record Count.
Parameters: |
|
void nadd(uint16 nadd);
Set the DNS Message Additional Record Count.
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. |
uint8 * payload();
Get the pointer of the message payload.
Returns: |
The pointer of the message payload. |
const uint8 * payload() const;
Get the pointer of the message payload.
Returns: |
The pointer of the message payload. |
uint8 * get();
Get the pointer of the message payload.
Returns: |
The pointer of the message payload. |
const uint8 * get() const;
Get the pointer of the message payload.
Returns: |
The pointer of the message payload. |
frame
public
public data membersstatic const uint8 mask_qr;
DNS Message Query/Response Flag mask.
static const uint8 mask_opcode;
DNS Message Operation Code mask.
static const uint8 mask_aa;
DNS Message Authoritative Answer Flag mask.
static const uint8 mask_tc;
DNS Message Truncation Flag mask.
static const uint8 mask_rd;
DNS Message Recursion Desired mask.
static const uint8 mask_ra;
DNS Message Recursion Available mask.
static const uint8 mask_z;
DNS Message Zero mask.
static const uint8 mask_rcode;
DNS Message Response Code mask.
uint8 hdr;
Frame bytes.