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

#include <dns_proto.h>

Inheritance diagram for DnsProto:
Collaboration diagram for DnsProto:

Classes

struct  DnsFipEntry
 
class  DnsFipEntryCmp
 
struct  DnsIpc
 
struct  DnsStats
 
struct  DnsUpdateAllIpc
 
struct  DnsUpdateIpc
 
struct  UpdateCompare
 

Public Types

enum  InterTaskMessage {
  DNS_NONE, DNS_DEFAULT_RESPONSE, DNS_BIND_RESPONSE, DNS_TIMER_EXPIRED,
  DNS_XMPP_SEND_UPDATE, DNS_XMPP_SEND_UPDATE_ALL, DNS_XMPP_UPDATE_RESPONSE, DNS_XMPP_MODIFY_VDNS
}
 
typedef boost::shared_ptr
< DnsFipEntry
DnsFipEntryPtr
 
typedef std::set
< DnsFipEntryPtr,
DnsFipEntryCmp
DnsFipSet
 
typedef std::map< uint32_t,
DnsHandler * > 
DnsBindQueryMap
 
typedef std::pair< uint32_t,
DnsHandler * > 
DnsBindQueryPair
 
typedef std::set
< DnsHandler::QueryKey
DnsVmRequestSet
 
typedef std::set< DnsUpdateIpc
*, UpdateCompare
DnsUpdateSet
 
typedef std::map< uint32_t,
std::string > 
IpVdnsMap
 
typedef std::pair< uint32_t,
std::string > 
IpVdnsPair
 
typedef std::map< const
VmInterface *, IpVdnsMap
VmDataMap
 
typedef std::pair< const
VmInterface *, IpVdnsMap
VmDataPair
 
typedef std::map< uint32_t,
int16_t > 
DnsBindQueryIndexMap
 
typedef std::pair< uint32_t,
int16_t > 
DnsBindQueryIndexPair
 
typedef std::vector< IpAddressDefaultServerList
 
- Public Types inherited from Proto
typedef WorkQueue
< boost::shared_ptr< PktInfo > > 
ProtoWorkQueue
 

Public Member Functions

void ConfigInit ()
 
void Shutdown ()
 
void IoShutdown ()
 
 DnsProto (Agent *agent, boost::asio::io_context &io)
 
virtual ~DnsProto ()
 
ProtoHandlerAllocProtoHandler (boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
 
bool SendUpdateDnsEntry (const VmInterface *vmitf, const std::string &name, const Ip4Address &ip, uint32_t plen, const Ip6Address &ip6, uint32_t plen6, const std::string &vdns_name, const autogen::VirtualDnsType &vdns_type, bool is_floating, bool is_delete)
 
bool UpdateFloatingIp (const VmInterface *vmitf, const VnEntry *vn, const IpAddress &ip, bool is_deleted)
 
void IpamNotify (IFMapNode *node)
 
void VdnsNotify (IFMapNode *node)
 
uint16_t GetTransId ()
 
void SendDnsIpc (uint8_t *pkt, std::size_t length)
 
void SendDnsIpc (InterTaskMessage cmd, uint16_t xid, uint8_t *msg, DnsHandler *handler)
 
void SendDnsUpdateIpc (DnsUpdateData *data, DnsAgentXmpp::XmppType type, const VmInterface *vm, bool floating)
 
void SendDnsUpdateIpc (const VmInterface *vm, const std::string &new_vdns, const std::string &old_vdns, const std::string &new_dom, uint32_t ttl, bool is_floating)
 
void SendDnsUpdateIpc (AgentDnsXmppChannel *channel)
 
const DnsUpdateSetupdate_set () const
 
void AddUpdateRequest (DnsUpdateIpc *ipc)
 
void DelUpdateRequest (DnsUpdateIpc *ipc)
 
DnsUpdateIpcFindUpdateRequest (DnsUpdateIpc *ipc)
 
void AddDnsQuery (uint16_t xid, DnsHandler *handler)
 
void DelDnsQuery (uint16_t xid)
 
void DelDnsQueryHandler (DnsHandler *handler)
 
bool IsDnsQueryInProgress (uint16_t xid)
 
bool IsDnsHandlerInUse (DnsHandler *handler)
 
DnsHandlerGetDnsQueryHandler (uint16_t xid)
 
bool BuildDefaultServerList ()
 
DefaultServerList BuildDefaultServerListImpl ()
 
DefaultServerList GetDefaultServerList ()
 
void AddDnsQueryIndex (uint16_t xid, int16_t srv_idx)
 
void DelDnsQueryIndex (uint16_t xid)
 
int16_t GetDnsQueryServerIndex (uint16_t xid)
 
void AddVmRequest (DnsHandler::QueryKey *key)
 
void DelVmRequest (DnsHandler::QueryKey *key)
 
bool IsVmRequestDuplicate (DnsHandler::QueryKey *key)
 
uint32_t timeout () const
 
void set_timeout (uint32_t timeout)
 
uint32_t max_retries () const
 
void set_max_retries (uint32_t retries)
 
void IncrStatsReq ()
 
void IncrStatsRetransmitReq ()
 
void IncrStatsRes ()
 
void IncrStatsUnsupp ()
 
void IncrStatsFail ()
 
void IncrStatsDrop ()
 
const DnsStatsGetStats () const
 
void ClearStats ()
 
const VmDataMapall_vms () const
 
const DnsFipSetfip_list () const
 
- Public Member Functions inherited from Proto
 Proto (Agent *agent, const char *task_name, PktHandler::PktModuleName mod, boost::asio::io_context &io)
 
virtual ~Proto ()
 
virtual bool Validate (PktInfo *msg)
 
virtual bool Enqueue (boost::shared_ptr< PktInfo > msg)
 
virtual void ProcessStats (PktStatsType::Type type)
 
void FreeBuffer (PktInfo *msg)
 
bool ProcessProto (boost::shared_ptr< PktInfo > msg_info)
 
bool RunProtoHandler (ProtoHandler *handler)
 
void set_trace (bool val)
 
void set_free_buffer (bool val)
 
boost::asio::io_context & get_io_service () const
 
Agentagent () const
 
const ProtoWorkQueuework_queue () const
 
virtual void TokenAvailable (TokenPool *pool)
 

Static Public Attributes

static const uint32_t kDnsDefaultTtl = 84600
 
static const uint32_t kDnsDefaultSlistInterval
 

Private Member Functions

void InterfaceNotify (DBEntryBase *entry)
 
void VnNotify (DBEntryBase *entry)
 
void VrfNotify (DBEntryBase *entry)
 
void ProcessNotify (std::string name, bool is_deleted, bool is_ipam)
 
void CheckForUpdate (IpVdnsMap &ipvdns, const VmInterface *vmitf, const VnEntry *vn, const Ip4Address &ip, const Ip6Address &ip6, std::string &vdns_name, const autogen::VirtualDnsType &vdns_type)
 
void CheckForFipUpdate (DnsFipEntry *entry, std::string &vdns_name, const autogen::VirtualDnsType &vdns_type)
 
bool UpdateDnsEntry (const VmInterface *vmitf, const VnEntry *vn, const std::string &vm_name, const std::string &vdns_name, const Ip4Address &ip, const Ip6Address &ip6, bool is_floating, bool is_deleted)
 
bool MoveVDnsEntry (const VmInterface *vmitf, std::string &new_vdns_name, std::string &old_vdns_name, const autogen::VirtualDnsType &vdns_type, bool is_floating)
 
bool GetVdnsData (const VnEntry *vn, const Ip4Address &v4_addr, const Ip6Address &v6_addr, std::string &vdns_name, autogen::VirtualDnsType &vdns_type)
 
bool GetFipName (const VmInterface *vmitf, const autogen::VirtualDnsType &vdns_type, const IpAddress &ip, std::string &fip_name) const
 
 DISALLOW_COPY_AND_ASSIGN (DnsProto)
 

Private Attributes

uint16_t xid_
 
DnsUpdateSet update_set_
 
DnsBindQueryMap dns_query_map_
 
DnsVmRequestSet curr_vm_requests_
 
DnsBindQueryIndexMap dns_query_index_map_
 
DefaultServerList def_server_list_
 
DnsStats stats_
 
uint32_t timeout_
 
uint32_t max_retries_
 
Timerdefault_slist_timer_
 
VmDataMap all_vms_
 
DnsFipSet fip_list_
 
DBTableBase::ListenerId lid_
 
DBTableBase::ListenerId Vnlid_
 
DBTableBase::ListenerId vrf_table_listener_id_
 

Static Private Attributes

static const Ip4Address ip4_unspec_
 
static const Ip6Address ip6_unspec_ = Ip6Address::from_string("::")
 

Additional Inherited Members

- Protected Attributes inherited from Proto
Agentagent_
 
PktHandler::PktModuleName module_
 
bool trace_
 
bool free_buffer_
 
boost::asio::io_context & io_
 
ProtoWorkQueue work_queue_
 

Detailed Description

Definition at line 15 of file dns_proto.h.

Member Typedef Documentation

typedef std::vector<IpAddress> DnsProto::DefaultServerList

Definition at line 150 of file dns_proto.h.

typedef std::map<uint32_t, int16_t> DnsProto::DnsBindQueryIndexMap

Definition at line 148 of file dns_proto.h.

typedef std::pair<uint32_t, int16_t> DnsProto::DnsBindQueryIndexPair

Definition at line 149 of file dns_proto.h.

typedef std::map<uint32_t, DnsHandler *> DnsProto::DnsBindQueryMap

Definition at line 139 of file dns_proto.h.

typedef std::pair<uint32_t, DnsHandler *> DnsProto::DnsBindQueryPair

Definition at line 140 of file dns_proto.h.

typedef boost::shared_ptr<DnsFipEntry> DnsProto::DnsFipEntryPtr

Definition at line 132 of file dns_proto.h.

Definition at line 138 of file dns_proto.h.

Definition at line 142 of file dns_proto.h.

Definition at line 141 of file dns_proto.h.

typedef std::map<uint32_t, std::string> DnsProto::IpVdnsMap

Definition at line 143 of file dns_proto.h.

typedef std::pair<uint32_t, std::string> DnsProto::IpVdnsPair

Definition at line 144 of file dns_proto.h.

typedef std::map<const VmInterface *, IpVdnsMap> DnsProto::VmDataMap

Definition at line 145 of file dns_proto.h.

typedef std::pair<const VmInterface *, IpVdnsMap> DnsProto::VmDataPair

Definition at line 146 of file dns_proto.h.

Member Enumeration Documentation

Enumerator
DNS_NONE 
DNS_DEFAULT_RESPONSE 
DNS_BIND_RESPONSE 
DNS_TIMER_EXPIRED 
DNS_XMPP_SEND_UPDATE 
DNS_XMPP_SEND_UPDATE_ALL 
DNS_XMPP_UPDATE_RESPONSE 
DNS_XMPP_MODIFY_VDNS 

Definition at line 25 of file dns_proto.h.

Constructor & Destructor Documentation

DnsProto::DnsProto ( Agent agent,
boost::asio::io_context &  io 
)

Definition at line 66 of file dns_proto.cc.

Here is the call graph for this function:

DnsProto::~DnsProto ( )
virtual

Definition at line 100 of file dns_proto.cc.

Member Function Documentation

void DnsProto::AddDnsQuery ( uint16_t  xid,
DnsHandler handler 
)

Definition at line 674 of file dns_proto.cc.

void DnsProto::AddDnsQueryIndex ( uint16_t  xid,
int16_t  srv_idx 
)

Definition at line 714 of file dns_proto.cc.

void DnsProto::AddUpdateRequest ( DnsUpdateIpc ipc)
inline

Definition at line 183 of file dns_proto.h.

void DnsProto::AddVmRequest ( DnsHandler::QueryKey key)

Definition at line 730 of file dns_proto.cc.

const VmDataMap& DnsProto::all_vms ( ) const
inline

Definition at line 223 of file dns_proto.h.

ProtoHandler * DnsProto::AllocProtoHandler ( boost::shared_ptr< PktInfo info,
boost::asio::io_context &  io 
)
virtual

Implements Proto.

Definition at line 122 of file dns_proto.cc.

Here is the call graph for this function:

bool DnsProto::BuildDefaultServerList ( )

Definition at line 113 of file dns_proto.cc.

Here is the call graph for this function:

DnsProto::DefaultServerList DnsProto::BuildDefaultServerListImpl ( )

Definition at line 4 of file default_dns_list_builder.cc.

Here is the call graph for this function:

void DnsProto::CheckForFipUpdate ( DnsFipEntry entry,
std::string &  vdns_name,
const autogen::VirtualDnsType &  vdns_type 
)
private

Definition at line 345 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::CheckForUpdate ( IpVdnsMap ipvdns,
const VmInterface vmitf,
const VnEntry vn,
const Ip4Address ip,
const Ip6Address ip6,
std::string &  vdns_name,
const autogen::VirtualDnsType &  vdns_type 
)
private

Definition at line 321 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::ClearStats ( )
inline

Definition at line 222 of file dns_proto.h.

Here is the call graph for this function:

void DnsProto::ConfigInit ( )

Definition at line 41 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::DelDnsQuery ( uint16_t  xid)

Definition at line 678 of file dns_proto.cc.

void DnsProto::DelDnsQueryHandler ( DnsHandler handler)

Definition at line 696 of file dns_proto.cc.

void DnsProto::DelDnsQueryIndex ( uint16_t  xid)

Definition at line 718 of file dns_proto.cc.

void DnsProto::DelUpdateRequest ( DnsUpdateIpc ipc)
inline

Definition at line 184 of file dns_proto.h.

void DnsProto::DelVmRequest ( DnsHandler::QueryKey key)

Definition at line 734 of file dns_proto.cc.

DnsProto::DISALLOW_COPY_AND_ASSIGN ( DnsProto  )
private
DnsUpdateIpc* DnsProto::FindUpdateRequest ( DnsUpdateIpc ipc)
inline

Definition at line 185 of file dns_proto.h.

const DnsFipSet& DnsProto::fip_list ( ) const
inline

Definition at line 224 of file dns_proto.h.

std::vector< IpAddress > DnsProto::GetDefaultServerList ( )

Definition at line 118 of file dns_proto.cc.

DnsHandler * DnsProto::GetDnsQueryHandler ( uint16_t  xid)

Definition at line 707 of file dns_proto.cc.

int16_t DnsProto::GetDnsQueryServerIndex ( uint16_t  xid)

Definition at line 722 of file dns_proto.cc.

bool DnsProto::GetFipName ( const VmInterface vmitf,
const autogen::VirtualDnsType &  vdns_type,
const IpAddress ip,
std::string &  fip_name 
) const
private

Definition at line 609 of file dns_proto.cc.

Here is the call graph for this function:

const DnsStats& DnsProto::GetStats ( ) const
inline

Definition at line 221 of file dns_proto.h.

uint16_t DnsProto::GetTransId ( )

Definition at line 637 of file dns_proto.cc.

bool DnsProto::GetVdnsData ( const VnEntry vn,
const Ip4Address v4_addr,
const Ip6Address v6_addr,
std::string &  vdns_name,
autogen::VirtualDnsType &  vdns_type 
)
private

Definition at line 588 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::IncrStatsDrop ( )
inline

Definition at line 220 of file dns_proto.h.

void DnsProto::IncrStatsFail ( )
inline

Definition at line 219 of file dns_proto.h.

void DnsProto::IncrStatsReq ( )
inline

Definition at line 215 of file dns_proto.h.

void DnsProto::IncrStatsRes ( )
inline

Definition at line 217 of file dns_proto.h.

void DnsProto::IncrStatsRetransmitReq ( )
inline

Definition at line 216 of file dns_proto.h.

void DnsProto::IncrStatsUnsupp ( )
inline

Definition at line 218 of file dns_proto.h.

void DnsProto::InterfaceNotify ( DBEntryBase entry)
private

Definition at line 127 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::IoShutdown ( )

Definition at line 25 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::IpamNotify ( IFMapNode node)

Definition at line 267 of file dns_proto.cc.

Here is the call graph for this function:

bool DnsProto::IsDnsHandlerInUse ( DnsHandler handler)

Definition at line 686 of file dns_proto.cc.

bool DnsProto::IsDnsQueryInProgress ( uint16_t  xid)

Definition at line 682 of file dns_proto.cc.

bool DnsProto::IsVmRequestDuplicate ( DnsHandler::QueryKey key)

Definition at line 738 of file dns_proto.cc.

uint32_t DnsProto::max_retries ( ) const
inline

Definition at line 212 of file dns_proto.h.

bool DnsProto::MoveVDnsEntry ( const VmInterface vmitf,
std::string &  new_vdns_name,
std::string &  old_vdns_name,
const autogen::VirtualDnsType &  vdns_type,
bool  is_floating 
)
private

Definition at line 571 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::ProcessNotify ( std::string  name,
bool  is_deleted,
bool  is_ipam 
)
private

Definition at line 287 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::SendDnsIpc ( uint8_t *  pkt,
std::size_t  length 
)

Definition at line 641 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::SendDnsIpc ( InterTaskMessage  cmd,
uint16_t  xid,
uint8_t *  msg,
DnsHandler handler 
)

Definition at line 646 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::SendDnsUpdateIpc ( DnsUpdateData data,
DnsAgentXmpp::XmppType  type,
const VmInterface vm,
bool  floating 
)

Definition at line 652 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::SendDnsUpdateIpc ( const VmInterface vm,
const std::string &  new_vdns,
const std::string &  old_vdns,
const std::string &  new_dom,
uint32_t  ttl,
bool  is_floating 
)

Definition at line 659 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::SendDnsUpdateIpc ( AgentDnsXmppChannel channel)

Definition at line 669 of file dns_proto.cc.

Here is the call graph for this function:

bool DnsProto::SendUpdateDnsEntry ( const VmInterface vmitf,
const std::string &  name,
const Ip4Address ip,
uint32_t  plen,
const Ip6Address ip6,
uint32_t  plen6,
const std::string &  vdns_name,
const autogen::VirtualDnsType &  vdns_type,
bool  is_floating,
bool  is_delete 
)

Definition at line 375 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::set_max_retries ( uint32_t  retries)
inline

Definition at line 213 of file dns_proto.h.

void DnsProto::set_timeout ( uint32_t  timeout)
inline

Definition at line 211 of file dns_proto.h.

Here is the call graph for this function:

void DnsProto::Shutdown ( )

Definition at line 103 of file dns_proto.cc.

Here is the call graph for this function:

uint32_t DnsProto::timeout ( ) const
inline

Definition at line 210 of file dns_proto.h.

const DnsUpdateSet& DnsProto::update_set ( ) const
inline

Definition at line 182 of file dns_proto.h.

bool DnsProto::UpdateDnsEntry ( const VmInterface vmitf,
const VnEntry vn,
const std::string &  vm_name,
const std::string &  vdns_name,
const Ip4Address ip,
const Ip6Address ip6,
bool  is_floating,
bool  is_deleted 
)
private

Definition at line 508 of file dns_proto.cc.

Here is the call graph for this function:

bool DnsProto::UpdateFloatingIp ( const VmInterface vmitf,
const VnEntry vn,
const IpAddress ip,
bool  is_deleted 
)

Definition at line 466 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::VdnsNotify ( IFMapNode node)

Definition at line 274 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::VnNotify ( DBEntryBase entry)
private

Definition at line 186 of file dns_proto.cc.

Here is the call graph for this function:

void DnsProto::VrfNotify ( DBEntryBase entry)
private

Definition at line 246 of file dns_proto.cc.

Here is the call graph for this function:

Member Data Documentation

VmDataMap DnsProto::all_vms_
private

Definition at line 266 of file dns_proto.h.

DnsVmRequestSet DnsProto::curr_vm_requests_
private

Definition at line 258 of file dns_proto.h.

DefaultServerList DnsProto::def_server_list_
private

Definition at line 260 of file dns_proto.h.

Timer* DnsProto::default_slist_timer_
private

Definition at line 264 of file dns_proto.h.

DnsBindQueryIndexMap DnsProto::dns_query_index_map_
private

Definition at line 259 of file dns_proto.h.

DnsBindQueryMap DnsProto::dns_query_map_
private

Definition at line 257 of file dns_proto.h.

DnsFipSet DnsProto::fip_list_
private

Definition at line 267 of file dns_proto.h.

const Ip4Address DnsProto::ip4_unspec_
staticprivate

Definition at line 17 of file dns_proto.h.

const Ip6Address DnsProto::ip6_unspec_ = Ip6Address::from_string("::")
staticprivate

Definition at line 18 of file dns_proto.h.

const uint32_t DnsProto::kDnsDefaultSlistInterval
static
Initial value:
=
10 * 60 * 1000

Definition at line 22 of file dns_proto.h.

const uint32_t DnsProto::kDnsDefaultTtl = 84600
static

Definition at line 21 of file dns_proto.h.

DBTableBase::ListenerId DnsProto::lid_
private

Definition at line 268 of file dns_proto.h.

uint32_t DnsProto::max_retries_
private

Definition at line 263 of file dns_proto.h.

DnsStats DnsProto::stats_
private

Definition at line 261 of file dns_proto.h.

uint32_t DnsProto::timeout_
private

Definition at line 262 of file dns_proto.h.

DnsUpdateSet DnsProto::update_set_
private

Definition at line 256 of file dns_proto.h.

DBTableBase::ListenerId DnsProto::Vnlid_
private

Definition at line 269 of file dns_proto.h.

DBTableBase::ListenerId DnsProto::vrf_table_listener_id_
private

Definition at line 270 of file dns_proto.h.

uint16_t DnsProto::xid_
private

Definition at line 255 of file dns_proto.h.


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