OpenSDN source code
|
#include <dns_proto.h>
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< IpAddress > | DefaultServerList |
![]() | |
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 () |
ProtoHandler * | AllocProtoHandler (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 DnsUpdateSet & | update_set () const |
void | AddUpdateRequest (DnsUpdateIpc *ipc) |
void | DelUpdateRequest (DnsUpdateIpc *ipc) |
DnsUpdateIpc * | FindUpdateRequest (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) |
DnsHandler * | GetDnsQueryHandler (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 DnsStats & | GetStats () const |
void | ClearStats () |
const VmDataMap & | all_vms () const |
const DnsFipSet & | fip_list () const |
![]() | |
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 |
Agent * | agent () const |
const ProtoWorkQueue * | work_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) | |
Static Private Attributes | |
static const Ip4Address | ip4_unspec_ |
static const Ip6Address | ip6_unspec_ = Ip6Address::from_string("::") |
Additional Inherited Members | |
![]() | |
Agent * | agent_ |
PktHandler::PktModuleName | module_ |
bool | trace_ |
bool | free_buffer_ |
boost::asio::io_context & | io_ |
ProtoWorkQueue | work_queue_ |
Definition at line 15 of file dns_proto.h.
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.
typedef std::set<DnsFipEntryPtr, DnsFipEntryCmp> DnsProto::DnsFipSet |
Definition at line 138 of file dns_proto.h.
typedef std::set<DnsUpdateIpc *, UpdateCompare> DnsProto::DnsUpdateSet |
Definition at line 142 of file dns_proto.h.
typedef std::set<DnsHandler::QueryKey> DnsProto::DnsVmRequestSet |
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.
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.
DnsProto::DnsProto | ( | Agent * | agent, |
boost::asio::io_context & | io | ||
) |
|
virtual |
Definition at line 100 of file dns_proto.cc.
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.
|
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.
|
inline |
Definition at line 223 of file dns_proto.h.
|
virtual |
Implements Proto.
Definition at line 122 of file dns_proto.cc.
bool DnsProto::BuildDefaultServerList | ( | ) |
DnsProto::DefaultServerList DnsProto::BuildDefaultServerListImpl | ( | ) |
|
private |
|
private |
|
inline |
void DnsProto::ConfigInit | ( | ) |
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.
|
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.
|
private |
|
inline |
Definition at line 185 of file dns_proto.h.
|
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.
|
private |
|
inline |
Definition at line 221 of file dns_proto.h.
uint16_t DnsProto::GetTransId | ( | ) |
Definition at line 637 of file dns_proto.cc.
|
private |
|
inline |
Definition at line 220 of file dns_proto.h.
|
inline |
Definition at line 219 of file dns_proto.h.
|
inline |
Definition at line 215 of file dns_proto.h.
|
inline |
Definition at line 217 of file dns_proto.h.
|
inline |
Definition at line 216 of file dns_proto.h.
|
inline |
Definition at line 218 of file dns_proto.h.
|
private |
void DnsProto::IoShutdown | ( | ) |
void DnsProto::IpamNotify | ( | IFMapNode * | node | ) |
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.
|
inline |
Definition at line 212 of file dns_proto.h.
|
private |
|
private |
void DnsProto::SendDnsIpc | ( | uint8_t * | pkt, |
std::size_t | length | ||
) |
void DnsProto::SendDnsIpc | ( | InterTaskMessage | cmd, |
uint16_t | xid, | ||
uint8_t * | msg, | ||
DnsHandler * | handler | ||
) |
void DnsProto::SendDnsUpdateIpc | ( | DnsUpdateData * | data, |
DnsAgentXmpp::XmppType | type, | ||
const VmInterface * | vm, | ||
bool | floating | ||
) |
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 | ||
) |
void DnsProto::SendDnsUpdateIpc | ( | AgentDnsXmppChannel * | channel | ) |
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 | ||
) |
|
inline |
Definition at line 213 of file dns_proto.h.
|
inline |
void DnsProto::Shutdown | ( | ) |
|
inline |
Definition at line 210 of file dns_proto.h.
|
inline |
Definition at line 182 of file dns_proto.h.
|
private |
bool DnsProto::UpdateFloatingIp | ( | const VmInterface * | vmitf, |
const VnEntry * | vn, | ||
const IpAddress & | ip, | ||
bool | is_deleted | ||
) |
void DnsProto::VdnsNotify | ( | IFMapNode * | node | ) |
|
private |
|
private |
|
private |
Definition at line 266 of file dns_proto.h.
|
private |
Definition at line 258 of file dns_proto.h.
|
private |
Definition at line 260 of file dns_proto.h.
|
private |
Definition at line 264 of file dns_proto.h.
|
private |
Definition at line 259 of file dns_proto.h.
|
private |
Definition at line 257 of file dns_proto.h.
|
private |
Definition at line 267 of file dns_proto.h.
|
staticprivate |
Definition at line 17 of file dns_proto.h.
|
staticprivate |
Definition at line 18 of file dns_proto.h.
|
static |
Definition at line 22 of file dns_proto.h.
|
static |
Definition at line 21 of file dns_proto.h.
|
private |
Definition at line 268 of file dns_proto.h.
|
private |
Definition at line 263 of file dns_proto.h.
|
private |
Definition at line 261 of file dns_proto.h.
|
private |
Definition at line 262 of file dns_proto.h.
|
private |
Definition at line 256 of file dns_proto.h.
|
private |
Definition at line 269 of file dns_proto.h.
|
private |
Definition at line 270 of file dns_proto.h.
|
private |
Definition at line 255 of file dns_proto.h.