Public Member Functions |
|
DnsMessage () | |
constructor |
|
~DnsMessage () | |
destructor |
|
stl_list (DnsQuestion) questions | |
question section |
|
stl_list (DnsRR) answers | |
answer section |
|
stl_list (DnsRR) authority | |
authority section |
|
stl_list (DnsRR) additional | |
additional section |
|
void | read_from_data (char *data, int len) |
read DNS message |
|
message_buff | compile (int maxlen) |
compile DNS message |
|
Public Attributes |
|
u_int16 | ID |
message ID |
|
bool | QR |
query bit |
|
u_int4 | OPCODE |
operation |
|
bool | AA |
authoritative answer |
|
bool | TC |
truncated |
|
bool | RD |
recursion desired |
|
bool | RA |
recursion available |
|
u_int3 | Z |
reserved bits |
|
u_int4 | RCODE |
return code |
|
Protected Member Functions |
|
void | write_section (stl_list(DnsRR)§ion, int lenpos, stl_string &message, stl_slist(dom_compr_info)&comprinfo, int maxlen, bool is_additional=false) |
void | read_section (stl_list(DnsRR)§ion, int count, message_buff &buff, int &pos) |
This structure holds a DNS message, the message type with which DNS servers talk to each other. It has member functions for reading data from binary DNS messages, and to create a binary DNS message from the structure.
Definition at line 314 of file dnsmessage.h.
|
constructor This constructs an empty DNS message, with all fields set to defaults. |
|
destructor This destroys the DNS message. |
|
compile DNS message This function will compile the DNS message into the binary format sent over UDP or TCP connections.
|
|
read DNS message This function will read DNS message information from the binary DNS message pointed to by data.
|
|
additional section This section contains additional information that might be interesting for the client, for example addresses for NS or MX records in the answer or authority sections. |
|
authority section This section contains pointers to authoritative sources for the information. Most nameservers put the nameserver list for the domain names in the section here. |
|
answer section This section, filled by the server, contains the Resource Records that form a direct answer to the query. |
|
question section This section should contain exactly one DnsQuestion object for common DNS queries. This query is usually copied into the response by the server. |
|
authoritative answer This is set to Definition at line 365 of file dnsmessage.h. |
|
message ID This is the message ID field of the DNS message. This number is set by client software, and is copied into the response by the server in order for clients to be able to track queries. Note that the Posadis resolver sets this value for you, so there's no need to do that yourself in client applications. Definition at line 339 of file dnsmessage.h. |
|
operation This is the type of operation the query is. The most common are OPCODE_QUERY for queries, OPCODE_UPDATE for dynamic updates, and OPCODE_NOTIFY for DNS notifications. Possible values are in dnsdefs.h. Definition at line 355 of file dnsmessage.h. |
|
query bit This bit is set to Definition at line 346 of file dnsmessage.h. |
|
recursion available Set to the server indicating whether it is willing to provide recursive service. Note that, even if recursion was not desired (see RD), this value might still be set. Definition at line 392 of file dnsmessage.h. |
|
return code Code indicating whether the query was succesful. Some famous RCODEs, which are #defined in dnsdefs.h, are: RCODE_NOERROR to indicate success, RCODE_NXDOMAIN if the domain name queried for didn't exist, or RCODE_SERVFAIL in case of a server failure. Definition at line 411 of file dnsmessage.h. |
|
recursion desired Set this to Definition at line 383 of file dnsmessage.h. |
|
truncated Set to Definition at line 374 of file dnsmessage.h. |
|
reserved bits This the value of three currently reserved bits in the DNS message. Though these bits currently have no meaning and servers might require them to be zero, Poslib is able to read and write them. Definition at line 401 of file dnsmessage.h. |