Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DnsRR Class Reference

resource record More...

#include <dnsmessage.h>

+ Collaboration diagram for DnsRR:

Public Member Functions

 DnsRR ()
 constructor
 DnsRR (domainname NAME, u_int16 TYPE, u_int16 CLASS, u_int32 TTL)
 constructor taking some fields
 DnsRR (domainname NAME, u_int16 TYPE, u_int16 CLASS, u_int32 TTL, unsigned short RDLENGTH, const unsigned char *RDATA)
 constructor taking some fields
 DnsRR (const DnsRR &rr)
 copy constructor
 ~DnsRR ()
 destructor
int compareTo (const DnsRR &other) const
 sort comparison function
bool operator< (const DnsRR &rr) const
bool operator<= (const DnsRR &rr) const
DnsRRoperator= (const DnsRR &rr)
 assignment operator
bool operator== (const DnsRR &other)
 comparator
bool operator> (const DnsRR &rr) const
bool operator>= (const DnsRR &rr) const

Public Attributes

u_int16 CLASS
 class
domainname NAME
 domain name
unsigned char * presign_RDATA
unsigned short presign_RDLENGTH
unsigned char * RDATA
 RR data.
u_int16 RDLENGTH
 length of RR data
u_int32 TTL
 time to live
u_int16 TYPE
 RR type.

Detailed Description

resource record

This class represents a resource record (RR), the fundamental building block of the DNS. A RR contains type-dependent information in its RDATA field, as well as some general information on the RR itself, such as its TTL.

Constructor & Destructor Documentation

DnsRR::DnsRR ( )

constructor

This is the default constructor.

< Internet class

DnsRR::DnsRR ( domainname  NAME,
u_int16  TYPE,
u_int16  CLASS,
u_int32  TTL 
)

constructor taking some fields

This constructor sets the values of many of the class members, but not for the RR data.

Parameters
NAMEThe domain name
TYPEResource Record type
CLASSClass the RR is in
TTLTime To Live for the RR
DnsRR::DnsRR ( domainname  NAME,
u_int16  TYPE,
u_int16  CLASS,
u_int32  TTL,
unsigned short  RDLENGTH,
const unsigned char *  RDATA 
)

constructor taking some fields

This constructor sets the values of all class members, including the RR data.

Parameters
NAMEThe domain name
TYPEResource Record type
CLASSClass the RR is in
TTLTime To Live for the RR
RDLENGTHLength of RR data
RDATARR data (this is copied into the RR)
DnsRR::DnsRR ( const DnsRR rr)

copy constructor

This constructor copies the given RR. It dynamically allocates its own copy of the RRs RDATA field.

Parameters
rrResource Record to copy
DnsRR::~DnsRR ( )

destructor

Frees all memory associated with the RR, including the RDATA.

Member Function Documentation

int DnsRR::compareTo ( const DnsRR other) const

sort comparison function

This function defines an order on DnsRRs, returning -1 if the current item is smaller, 0 if two DnsRRs are equal, and 1 otherwise. The items are sorted, in order, by their CLASS, NAME, TYPE (SOA going before other types), TTL and RDATA fields.

Parameters
otherOther RR
Returns
Result of the comparison

< Start of Authority RR type

< Start of Authority RR type

< Start of Authority RR type

< Start of Authority RR type

bool DnsRR::operator< ( const DnsRR rr) const
bool DnsRR::operator<= ( const DnsRR rr) const
DnsRR & DnsRR::operator= ( const DnsRR rr)

assignment operator

The assignment operator works the same as the copy constructor.

Parameters
rrResource Record to copy
bool DnsRR::operator== ( const DnsRR other)

comparator

bool DnsRR::operator> ( const DnsRR rr) const
bool DnsRR::operator>= ( const DnsRR rr) const

Member Data Documentation

u_int16 DnsRR::CLASS

class

The DNS class the RR is in. See DnsQuestion::QCLASS for a list, except that it can not be QCLASS_ALL in this case. Defaults to CLASS_IN.

domainname DnsRR::NAME

domain name

The domain name the Resource Record is bound to. Defaults to the root domain.

unsigned char* DnsRR::presign_RDATA
unsigned short DnsRR::presign_RDLENGTH
unsigned char* DnsRR::RDATA

RR data.

Binary data for the RR. Use the RR functions from rr.h to interpret this field. Automatically freed upon destruction.

See Also
rr_tostring(), rr_getdomain(), rr_getmail(), ...
u_int16 DnsRR::RDLENGTH

length of RR data

The length in bytes of the data pointed to by RDATA.

u_int32 DnsRR::TTL

time to live

The time to live for the RR - that is, the time in seconds it may be stored in cache.

u_int16 DnsRR::TYPE

RR type.

The type of the RR. One of the constants defined in dnsdefs.h, for example DNS_TYPE_A or DNS_TYPE_MX (or the value of the rr_type.type field).


The documentation for this class was generated from the following files: