OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
xmpp_dns_agent.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef _xmpp_dns_agent_h_
6 #define _xmpp_dns_agent_h_
7 
9 #define DNS_XMPP_TRACE(obj, arg) \
10 do { \
11  std::ostringstream _str; \
12  _str << arg; \
13  obj::TraceMsg(AgentXmppTraceBuf, __FILE__, __LINE__, _str.str()); \
14 } while (false) \
15 
16 class XmppChannel;
17 
18 namespace pugi {
19  class xml_node;
20 } // namespace pugi
21 
22 struct DnsItem;
23 struct DnsUpdateData;
24 
25 class DnsAgentXmpp {
26 public:
27  static const uint16_t max_dns_xmpp_msg_len = 8192;
28 
29  enum XmppType {
34  };
35 
36  static std::size_t DnsAgentXmppEncode(XmppChannel *channel, XmppType type,
37  uint32_t trans_id, uint32_t resp_code,
38  DnsUpdateData *xmpp_data,
39  uint8_t *data);
40  static bool DnsAgentXmppDecode(const pugi::xml_node dns,
41  XmppType &type, uint32_t &xid,
42  uint16_t &resp_code, DnsUpdateData *data, std::string source_name="");
43 
44 private:
45  static void EncodeDnsData(pugi::xml_node *node, DnsUpdateData *xmpp_data);
46  static void EncodeDnsItem(pugi::xml_node *node, DnsItem &entry);
47  static bool DecodeDns(const pugi::xml_node node, XmppType &type,
48  bool is_resp, DnsUpdateData *data, std::string source_name);
49  static bool DecodeDnsItems(const pugi::xml_node dnsdata,
50  DnsUpdateData *data, std::string source_name);
51 };
52 
53 #endif // _xmpp_dns_agent_h_
static bool DecodeDns(const pugi::xml_node node, XmppType &type, bool is_resp, DnsUpdateData *data, std::string source_name)
static void EncodeDnsItem(pugi::xml_node *node, DnsItem &entry)
static const uint16_t max_dns_xmpp_msg_len
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:18
uint8_t type
Definition: load_balance.h:109
static bool DecodeDnsItems(const pugi::xml_node dnsdata, DnsUpdateData *data, std::string source_name)
static std::size_t DnsAgentXmppEncode(XmppChannel *channel, XmppType type, uint32_t trans_id, uint32_t resp_code, DnsUpdateData *xmpp_data, uint8_t *data)
SandeshTraceBufferPtr AgentXmppTraceBuf
static bool DnsAgentXmppDecode(const pugi::xml_node dns, XmppType &type, uint32_t &xid, uint16_t &resp_code, DnsUpdateData *data, std::string source_name="")
static void EncodeDnsData(pugi::xml_node *node, DnsUpdateData *xmpp_data)