OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BindUtil Class Reference

#include <bind_util.h>

Public Types

enum  Operation { ADD_UPDATE, CHANGE_UPDATE, DELETE_UPDATE }
 

Static Public Member Functions

static uint16_t DnsClass (const std::string &cl)
 
static std::string DnsClass (uint16_t cl)
 
static uint16_t DnsType (const std::string &tp)
 
static std::string DnsType (uint16_t tp)
 
static const std::string & DnsResponseCode (uint16_t code)
 
static uint8_t * AddName (uint8_t *ptr, const std::string &addr, uint16_t plen, uint16_t offset, uint16_t &length)
 
static bool ParseDnsQuery (uint8_t *dns, uint16_t dnslen, uint16_t *parsed_length, DnsItems &items)
 
static bool ParseDnsResponse (uint8_t *dns, uint16_t dnslen, uint16_t &xid, dns_flags &flags, DnsItems &ques, DnsItems &ans, DnsItems &auth, DnsItems &add)
 
static bool ParseDnsUpdate (uint8_t *dns, uint16_t dnslen, DnsUpdateData &data)
 
static int BuildDnsQuery (uint8_t *buf, uint16_t xid, const std::string &domain, const DnsItems &items)
 
static int BuildDnsUpdate (uint8_t *buf, Operation op, uint16_t xid, const std::string &domain, const std::string &zone, const DnsItems &items)
 
static uint8_t * AddQuestionSection (uint8_t *ptr, const std::string &name, uint16_t type, uint16_t cl, uint16_t &length)
 
static uint8_t * AddAnswerSection (uint8_t *ptr, const DnsItem &item, uint16_t &length)
 
static uint8_t * AddUpdate (uint8_t *ptr, const DnsItem &item, uint16_t cl, uint32_t ttl, uint16_t &length)
 
static void BuildDnsHeader (dnshdr *dns, uint16_t xid, DnsReq req, DnsOpcode op, bool rd, bool ra, uint8_t ret, uint16_t ques_count)
 
static uint16_t DataLength (uint16_t plen, uint16_t offset, uint16_t size)
 
static bool IsIP (const std::string &name, IpAddress &addr)
 
static bool IsReverseZone (const std::string &name)
 
static void GetReverseZoneList (const IpAddress &mask, uint32_t plen, ZoneList &zones)
 
static void GetReverseZone (const Ip4Address &addr, uint32_t plen, std::string &zone)
 
static void GetReverseZone (const Ip6Address &addr, uint32_t plen, std::string &zone)
 
static void GetReverseZone (const IpAddress &addr, uint32_t plen, std::string &zone)
 
static bool GetAddrFromPtrName (std::string &ptr_name, IpAddress &mask)
 
static std::string GetPtrNameFromAddr (const Ip4Address &ip)
 
static std::string GetPtrNameFromAddr (const Ip6Address &ip6)
 
static std::string GetFQDN (const std::string &name, const std::string &domain, const std::string &match)
 
static bool HasSpecialChars (const std::string &name)
 
static void RemoveSpecialChars (std::string &name)
 

Static Private Member Functions

static bool ReadByte (uint8_t *dns, uint16_t dnslen, int *remlen, uint8_t &value)
 
static bool ReadShort (uint8_t *dns, uint16_t dnslen, int *remlen, uint16_t &value)
 
static bool ReadWord (uint8_t *dns, uint16_t dnslen, int *remlen, uint32_t &value)
 
static uint8_t * WriteByte (uint8_t *ptr, uint8_t value)
 
static uint8_t * WriteShort (uint8_t *ptr, uint16_t value)
 
static uint8_t * WriteWord (uint8_t *ptr, uint32_t value)
 
static uint8_t * AddData (uint8_t *ptr, const DnsItem &item, uint16_t &length)
 
static uint8_t * AddAdditionalSection (uint8_t *ptr, const std::string name, uint16_t type, uint16_t cl, uint32_t ttl, const std::string &data, uint16_t &length)
 
static bool ReadName (uint8_t *dns, uint16_t dnslen, int *remlen, std::string &name, uint16_t &plen, uint16_t &offset)
 
static bool ReadData (uint8_t *dns, uint16_t dnslen, int *remlen, DnsItem &item)
 
static bool ReadQuestionEntry (uint8_t *dns, uint16_t dnslen, int *remlen, DnsItem &item)
 
static bool ReadAnswerEntry (uint8_t *dns, uint16_t dnslen, int *remlen, DnsItem &item)
 
static bool IsReverseZoneV4 (const std::string &name)
 
static bool IsReverseZoneV6 (const std::string &name)
 
static void GetReverseZoneList (const Ip4Address &mask, uint32_t plen, ZoneList &zones)
 
static void GetReverseZoneList (const Ip6Address &mask, uint32_t plen, ZoneList &zones)
 
static bool GetAddrFromPtrName (std::string &ptr_name, Ip4Address &ip)
 
static bool GetAddrFromPtrName (std::string &ptr_name, Ip6Address &ip)
 
static uint8_t GetNibble (const Ip6Address::bytes_type &addr, size_t bit)
 
static std::string BuildIp6ArpaSuffix (const Ip6Address::bytes_type &addr, uint32_t plen)
 

Detailed Description

Definition at line 280 of file bind_util.h.

Member Enumeration Documentation

Enumerator
ADD_UPDATE 
CHANGE_UPDATE 
DELETE_UPDATE 

Definition at line 282 of file bind_util.h.

Member Function Documentation

uint8_t * BindUtil::AddAdditionalSection ( uint8_t *  ptr,
const std::string  name,
uint16_t  type,
uint16_t  cl,
uint32_t  ttl,
const std::string &  data,
uint16_t &  length 
)
staticprivate

Definition at line 283 of file bind_util.cc.

uint8_t * BindUtil::AddAnswerSection ( uint8_t *  ptr,
const DnsItem item,
uint16_t &  length 
)
static

Definition at line 271 of file bind_util.cc.

uint8_t * BindUtil::AddData ( uint8_t *  ptr,
const DnsItem item,
uint16_t &  length 
)
staticprivate

Definition at line 189 of file bind_util.cc.

uint8_t * BindUtil::AddName ( uint8_t *  ptr,
const std::string &  addr,
uint16_t  plen,
uint16_t  offset,
uint16_t &  length 
)
static

Definition at line 146 of file bind_util.cc.

uint8_t * BindUtil::AddQuestionSection ( uint8_t *  ptr,
const std::string &  name,
uint16_t  type,
uint16_t  cl,
uint16_t &  length 
)
static

Definition at line 178 of file bind_util.cc.

uint8_t * BindUtil::AddUpdate ( uint8_t *  ptr,
const DnsItem item,
uint16_t  cl,
uint32_t  ttl,
uint16_t &  length 
)
static

Definition at line 300 of file bind_util.cc.

void BindUtil::BuildDnsHeader ( dnshdr dns,
uint16_t  xid,
DnsReq  req,
DnsOpcode  op,
bool  rd,
bool  ra,
uint8_t  ret,
uint16_t  ques_count 
)
static

Definition at line 608 of file bind_util.cc.

int BindUtil::BuildDnsQuery ( uint8_t *  buf,
uint16_t  xid,
const std::string &  domain,
const DnsItems items 
)
static

Definition at line 628 of file bind_util.cc.

int BindUtil::BuildDnsUpdate ( uint8_t *  buf,
Operation  op,
uint16_t  xid,
const std::string &  domain,
const std::string &  zone,
const DnsItems items 
)
static

Definition at line 653 of file bind_util.cc.

std::string BindUtil::BuildIp6ArpaSuffix ( const Ip6Address::bytes_type &  addr,
uint32_t  plen 
)
staticprivate

Definition at line 731 of file bind_util.cc.

static uint16_t BindUtil::DataLength ( uint16_t  plen,
uint16_t  offset,
uint16_t  size 
)
inlinestatic

Definition at line 320 of file bind_util.h.

uint16_t BindUtil::DnsClass ( const std::string &  cl)
static

Definition at line 112 of file bind_util.cc.

std::string BindUtil::DnsClass ( uint16_t  cl)
static

Definition at line 118 of file bind_util.cc.

Here is the call graph for this function:

const std::string & BindUtil::DnsResponseCode ( uint16_t  code)
static

Definition at line 139 of file bind_util.cc.

uint16_t BindUtil::DnsType ( const std::string &  tp)
static

Definition at line 125 of file bind_util.cc.

std::string BindUtil::DnsType ( uint16_t  tp)
static

Definition at line 132 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::GetAddrFromPtrName ( std::string &  ptr_name,
IpAddress mask 
)
static

Definition at line 933 of file bind_util.cc.

bool BindUtil::GetAddrFromPtrName ( std::string &  ptr_name,
Ip4Address ip 
)
staticprivate

Definition at line 861 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::GetAddrFromPtrName ( std::string &  ptr_name,
Ip6Address ip 
)
staticprivate

Definition at line 885 of file bind_util.cc.

Here is the call graph for this function:

std::string BindUtil::GetFQDN ( const std::string &  name,
const std::string &  domain,
const std::string &  match 
)
static

Definition at line 991 of file bind_util.cc.

uint8_t BindUtil::GetNibble ( const Ip6Address::bytes_type &  addr,
size_t  bit 
)
inlinestaticprivate

Definition at line 721 of file bind_util.cc.

std::string BindUtil::GetPtrNameFromAddr ( const Ip4Address ip)
static

Definition at line 959 of file bind_util.cc.

std::string BindUtil::GetPtrNameFromAddr ( const Ip6Address ip6)
static

Definition at line 968 of file bind_util.cc.

void BindUtil::GetReverseZone ( const Ip4Address addr,
uint32_t  plen,
std::string &  zone 
)
static

Definition at line 812 of file bind_util.cc.

void BindUtil::GetReverseZone ( const Ip6Address addr,
uint32_t  plen,
std::string &  zone 
)
static

Definition at line 832 of file bind_util.cc.

Here is the call graph for this function:

void BindUtil::GetReverseZone ( const IpAddress addr,
uint32_t  plen,
std::string &  zone 
)
static

Definition at line 852 of file bind_util.cc.

void BindUtil::GetReverseZoneList ( const IpAddress mask,
uint32_t  plen,
ZoneList zones 
)
static

Definition at line 803 of file bind_util.cc.

void BindUtil::GetReverseZoneList ( const Ip4Address mask,
uint32_t  plen,
ZoneList zones 
)
staticprivate

Definition at line 749 of file bind_util.cc.

void BindUtil::GetReverseZoneList ( const Ip6Address mask,
uint32_t  plen,
ZoneList zones 
)
staticprivate

Definition at line 777 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::HasSpecialChars ( const std::string &  name)
static

Definition at line 999 of file bind_util.cc.

bool BindUtil::IsIP ( const std::string &  name,
IpAddress addr 
)
static

Definition at line 715 of file bind_util.cc.

bool BindUtil::IsReverseZone ( const std::string &  name)
static

Definition at line 711 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::IsReverseZoneV4 ( const std::string &  name)
staticprivate

Definition at line 698 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::IsReverseZoneV6 ( const std::string &  name)
staticprivate

Definition at line 705 of file bind_util.cc.

Here is the call graph for this function:

bool BindUtil::ParseDnsQuery ( uint8_t *  dns,
uint16_t  dnslen,
uint16_t *  parsed_length,
DnsItems items 
)
static

Definition at line 445 of file bind_util.cc.

bool BindUtil::ParseDnsResponse ( uint8_t *  dns,
uint16_t  dnslen,
uint16_t &  xid,
dns_flags flags,
DnsItems ques,
DnsItems ans,
DnsItems auth,
DnsItems add 
)
static

Definition at line 476 of file bind_util.cc.

bool BindUtil::ParseDnsUpdate ( uint8_t *  dns,
uint16_t  dnslen,
DnsUpdateData data 
)
static

Definition at line 546 of file bind_util.cc.

bool BindUtil::ReadAnswerEntry ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
DnsItem item 
)
staticprivate

Definition at line 434 of file bind_util.cc.

static bool BindUtil::ReadByte ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
uint8_t &  value 
)
inlinestaticprivate

Definition at line 345 of file bind_util.h.

bool BindUtil::ReadData ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
DnsItem item 
)
staticprivate

Definition at line 343 of file bind_util.cc.

bool BindUtil::ReadName ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
std::string &  name,
uint16_t &  plen,
uint16_t &  offset 
)
staticprivate

Definition at line 310 of file bind_util.cc.

bool BindUtil::ReadQuestionEntry ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
DnsItem item 
)
staticprivate

Definition at line 422 of file bind_util.cc.

static bool BindUtil::ReadShort ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
uint16_t &  value 
)
inlinestaticprivate

Definition at line 356 of file bind_util.h.

static bool BindUtil::ReadWord ( uint8_t *  dns,
uint16_t  dnslen,
int *  remlen,
uint32_t &  value 
)
inlinestaticprivate

Definition at line 367 of file bind_util.h.

void BindUtil::RemoveSpecialChars ( std::string &  name)
static

Definition at line 1009 of file bind_util.cc.

static uint8_t* BindUtil::WriteByte ( uint8_t *  ptr,
uint8_t  value 
)
inlinestaticprivate

Definition at line 378 of file bind_util.h.

static uint8_t* BindUtil::WriteShort ( uint8_t *  ptr,
uint16_t  value 
)
inlinestaticprivate

Definition at line 385 of file bind_util.h.

static uint8_t* BindUtil::WriteWord ( uint8_t *  ptr,
uint32_t  value 
)
inlinestaticprivate

Definition at line 392 of file bind_util.h.


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