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

#include <DNSUpdate.h>

+ Collaboration diagram for DNSUpdate:

Public Types

enum  DnsUpdateProtocol { DNSUPDATE_TCP, DNSUPDATE_UDP, DNSUPDATE_ANY }

Public Member Functions

 DNSUpdate (const std::string &dns_address, const std::string &zonename, const std::string &hostname, std::string hostip, DnsUpdateMode updateMode, DnsUpdateProtocol proto)
 max difference between us signing and they are receiving
virtual ~DNSUpdate ()
void addDHCID (const char *duid, int duidlen)
DnsUpdateResult run (int timeout)
void setTSIG (const std::string &keyname, const std::string &base64encoded, const std::string &algro, uint32_t fudge=600)
 sets keys used for Transaction Signature (TSIG)
void showResult (int result)

Protected Member Functions

virtual void sendMsg (unsigned int timeout)

Protected Attributes

std::string Algorithm_
 the actual key, specified as encoded64 string
std::string DnsAddr_
uint32_t Fudge_
 specify algorithm used for the key
std::string Hostip_
std::string Hostname_
std::string Key_
 plain text name of the key
std::string Keyname_
DnsMessageMessage_
DnsUpdateProtocol Proto_
std::string TTL_
DnsUpdateMode UpdateMode_
domainname Zoneroot_

Private Member Functions

void addinMsg_delOldRR ()
void addinMsg_newAAAA ()
void addinMsg_newPTR ()
void createSOAMsg ()
void deleteAAAARecordFromRRSet ()
void deletePTRRecordFromRRSet ()
bool DnsRR_avail (DnsMessage *msg, DnsRR &RemoteDnsRR)
DnsRRget_oldDnsRR ()
std::string protoToString ()
void sendMsgTCP (unsigned int timeout)
void sendMsgUDP (unsigned int timeout)
void splitHostDomain (std::string fqdnName)

Member Enumeration Documentation

Enumerator:
DNSUPDATE_TCP 
DNSUPDATE_UDP 
DNSUPDATE_ANY 

Constructor & Destructor Documentation

DNSUpdate::DNSUpdate ( const std::string &  dns_address,
const std::string &  zonename,
const std::string &  hostname,
std::string  hostip,
DnsUpdateMode  updateMode,
DnsUpdateProtocol  proto 
)

max difference between us signing and they are receiving

DNSUpdate::~DNSUpdate ( )
virtual

Member Function Documentation

void DNSUpdate::addDHCID ( const char *  duid,
int  duidlen 
)
void DNSUpdate::addinMsg_delOldRR ( )
private

insert a delete-RR entry in message for deleting old entry

void DNSUpdate::addinMsg_newAAAA ( )
private

insert a new-AAAA entry in message

void DNSUpdate::addinMsg_newPTR ( )
private

insert a new-PTR entry in message

void DNSUpdate::createSOAMsg ( )
private

create new message for Dns Update

void DNSUpdate::deleteAAAARecordFromRRSet ( )
private

delete a single rr from rrset. If no such RRs exist, then this Update RR will be silently ignored by the primary master.

void DNSUpdate::deletePTRRecordFromRRSet ( )
private
bool DNSUpdate::DnsRR_avail ( DnsMessage msg,
DnsRR RemoteDnsRR 
)
private

check hostname-RR entry is available in response message(xfr) from server

Parameters
msg- DnsMessage response from server
RemoteDnsRR- if DnsRR entry is available set RR record in RemoteDnsRR
Returns
true - if RR record available, otherwise returns false
DnsRR * DNSUpdate::get_oldDnsRR ( )
private

get old RR entry from Dns Server

Todo:
: Make this over UDP or TCP, not always TCP (TCP blocks on connect())
std::string DNSUpdate::protoToString ( )
private
DnsUpdateResult DNSUpdate::run ( int  timeout)
void DNSUpdate::sendMsg ( unsigned int  timeout)
protectedvirtual
void DNSUpdate::sendMsgTCP ( unsigned int  timeout)
private

send Update Message to server

void DNSUpdate::sendMsgUDP ( unsigned int  timeout)
private
void DNSUpdate::setTSIG ( const std::string &  keyname,
const std::string &  base64encoded,
const std::string &  algo,
uint32_t  fudge = 600 
)

sets keys used for Transaction Signature (TSIG)

One can use dnssec-keygen from bind9 to generate such a key

Parameters
keynamename of the key (e.g. "ddns-key")
base64encodedthe actual key (e.g. 9SYMLnjK2ohb1N/56GZ5Jg==)
algoAlgorithm name
fudgemax difference between us signing and they are receiving
void DNSUpdate::showResult ( int  result)

prints status reported by result

Parameters
result
void DNSUpdate::splitHostDomain ( std::string  fqdnName)
private

splits fqdn (e.g. malcolm.example.com) into hostname (e.g. malcolm) and domain (e.g. example.com)

Parameters
fqdnName

Member Data Documentation

std::string DNSUpdate::Algorithm_
protected

the actual key, specified as encoded64 string

std::string DNSUpdate::DnsAddr_
protected
uint32_t DNSUpdate::Fudge_
protected

specify algorithm used for the key

std::string DNSUpdate::Hostip_
protected
std::string DNSUpdate::Hostname_
protected
std::string DNSUpdate::Key_
protected

plain text name of the key

std::string DNSUpdate::Keyname_
protected
DnsMessage* DNSUpdate::Message_
protected
DnsUpdateProtocol DNSUpdate::Proto_
protected
std::string DNSUpdate::TTL_
protected
DnsUpdateMode DNSUpdate::UpdateMode_
protected
domainname DNSUpdate::Zoneroot_
protected

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