Go to the source code of this file.
Classes |
|
struct | rr_type |
Resource Record information. More... |
|
Enumerations |
|
enum | _rr_flags { R_NONE = 0, R_ASP = 1, R_COMPRESS = 2, R_ASPCOMPRESS = 3 } |
flags for Resource Record types More... |
|
Functions |
|
rr_type * | rrtype_getinfo (u_int16 type) |
retrieves RR information |
|
rr_type * | rrtype_getinfo (const char *name) |
retrieves RR information by name |
|
char * | rrtype_getname (u_int16 type) |
retrieves RR name |
|
uint16_t | qtype_getcode (const char *name) |
retrieves qtype code |
|
bool | answers_qtype (uint16_t rrtype, uint16_t qtype) |
check whether RR type answers QTYPE |
|
bool | is_common_rr (uint16_t rrtype) |
check whether the RR type is a common RR |
|
void | rr_read (u_int16 RRTYPE, char *&RDATA, uint16_t &RDLEN, message_buff &buff, int ix, int len) |
read a Resource Record from a DNS message |
|
void | rr_write (u_int16 RRTYPE, char *RDATA, uint16_t RDLEN, stl_string &dnsmessage, stl_slist(dom_compr_info)&comprinfo) |
write a Resource Record to a DNS message |
|
stl_string | rr_tostring (u_int16 RRTYPE, const char *RDATA, int RDLENGTH) |
convert a binary RR to string |
|
stl_string | rr_fromstring (u_int16 RRTYPE, const char *data, _domain origin="") |
convert a string to binary RR data |
|
stl_string | rr_fromstring (u_int16 RRTYPE, const char *data, domainname origin) |
convert a string to binary RR data |
|
_domain | rr_getbindomain (const char *RDATA, u_int16 RRTYPE, int ix=0) |
reads a domain name from RR data |
|
domainname | rr_getdomain (const char *RDATA, u_int16 RRTYPE, int ix=0) |
reads a domain name from RR data |
|
char * | rr_getbinmail (const char *RDATA, u_int16 RRTYPE, int ix=0) |
reads an email address from RR data |
|
domainname | rr_getmail (const char *RDATA, u_int16 RRTYPE, int ix=0) |
reads a domain name from RR data |
|
u_int16 | rr_getshort (const char *RDATA, u_int16 RRTYPE, int ix=0) |
read a 16-bit value from RR data |
|
u_int32 | rr_getlong (const char *RDATA, u_int16 RRTYPE, int ix=0) |
read a 32-bit value from RR data |
|
char * | rr_getip4 (const char *RDATA, u_int16 RRTYPE, int ix=0) |
read an IP address from RR data |
|
char * | rr_getip6 (const char *RDATA, u_int16 RRTYPE, int ix=0) |
read an IPv6 addres from RR data |
|
stl_string | read_entry (char *&data) |
read next item in a space-delimited string |
|
void | read_line (char *buff, FILE *f, int *linenum=NULL, int *linenum2=NULL, int buffsz=1024) |
read line from master/configuration file |
|
Variables |
|
const int | n_rr_types |
number of supported rr types |
|
const rr_type | rr_types [] |
array of supported rr types |
This file contains functions to deal with Resource Records, the information chunks contained by DNS messages. It has functions for converting RRs to text and back, and to extract information from them.
Definition in file rr.h.
|
flags for Resource Record types These are flags for the rr_type::flags member for Resource Record information. |
|
check whether RR type answers QTYPE This function checks whether the given RR type provides an answer to the given QTYPE. This is the case if qtype matches rrtype, or if qtype is
|
|
check whether the RR type is a common RR This function returns true if rrtype is a common RR type (that is, not a query type like
|
|
retrieves qtype code This function tries to return the QTYPE code for a given string, that can either be a RR, "any", "ixfr", "axfr", "maila" or "mailb", or a numeric value.
|
|
read next item in a space-delimited string This function reads the next item from a space-delimited string. It will raise an exception if none is found, and it will update the char pointer on the way. Quotes, unless escaped by a backslash, will not be included in the resulting string. Note that currently the maximum length of an entry is 256 bytes.
|
|
read line from master/configuration file This function attempts to read a line from the file pointed to by f, placing the results in the "buff" buffer of "buffsz" bytes. This function, which is suitable for reading entries in a DNS master file, can automagically detect escaping characters with special meaning, and it can read multi-line lines with "(" and ")". The results that are placed in the buffer are suitable for use in the read_entry function. One important thing in this context is the line number counter: as you can see there are two line number counters, which is nessecary because the line read function will always go to the beginning of the next source line before exiting. Thus, the line number counter would point to the beginning of the next (non-read) line. To prevent this, another pointer is given which is at the beginning of the function set to the current, accurate, line number. For this, a right value of the first pointer is required, though. Note that linenum should be initially set to 1 before the first read_line call.
|
|
convert a string to binary RR data This function converts a string describing a Resource Record to binary RR data. The string should be in master file format - that is, if multiple arguments are to be put in the RR data, they should be separated by any number of spaces and tabs. For example, MX data might be "10 mail.yo.net.". You can specify an origin to which domain names are considered relative by means of the origin parameter.
|
|
convert a string to binary RR data This function converts a string describing a Resource Record to binary RR data. The string should be in master file format - that is, if multiple arguments are to be put in the RR data, they should be separated by any number of spaces and tabs. For example, MX data might be "10 mail.yo.net.". You can specify an origin to which domain names are considered relative by means of the origin parameter.
|
|
reads a domain name from RR data This function will read a domain name, in binary for, from RR data. The _domain it returns is dynamically allocated. The index is the property index in the RR data, beginning with 0, e.g. the domain name in the
|
|
reads an email address from RR data This is currently an alias for rr_getdomain(). |
|
reads a domain name from RR data Variant of the rr_getbindomain() function returning a domainname structure. |
|
read an IP address from RR data For details, see rr_getdomain(). Data is dynamically allocated. |
|
read an IPv6 addres from RR data For details, see rr_getdomain(). Data is dynamically allocated. |
|
read a 32-bit value from RR data For details, see rr_getdomain(). |
|
reads a domain name from RR data Variant of the rr_getbinmail() function returning a domainname structure. |
|
read a 16-bit value from RR data For details, see rr_getdomain(). |
|
read a Resource Record from a DNS message This function reads a Resource Record from a DNS message or other binary data source. It will decompress compressed domain names in the RR on the way, and return the data in the RDLEN and RDATA arguments.
|
|
convert a binary RR to string This function converts the binary RR to a human-readable string in master file format.
|
|
write a Resource Record to a DNS message This function writes a Resource Record to a DNS message. It will compress domain names along the way.
|
|
retrieves RR information by name This function retrieves information a Resource Record by its name. If no matching RR type is found, this function returns
|
|
retrieves RR information This function retrieves information about a Resource Record by its 16-bit unique identifier as found in DNS messages. If no matching RR type is found, this function returnes
|
|
retrieves RR name This function returns the name for a RR type by its 16-bit code. If no matching RR type is found, this function returns
|
|
number of supported rr types This is the number of RR types supported by Poslib. Thus, it is also the number of entries in the rr_types array.
|
|
array of supported rr types This array contains information for all RR types supported by Poslib. For information about the meaning of the fields, see the rr_type documentation. This array contains exactly n_rr_types elements.
|