7 #include <pugixml/pugixml.hpp>
22 #include <controller/controller_types.h>
28 uint8_t cnt) : channel_(channel),
76 pugi->LoadXmlDoc(msg_pugi->
doc());
90 LOG(WARN,
"IFMap config on non primary channel");
95 pugi::xml_node node =
pugi->FindNode(
"config");
135 boost::static_pointer_cast<ControllerWorkQueueData>(data);
152 if (active_index == -1) {
195 UuidList::const_iterator vmi_it = std::find(info->
vmi_list_.begin(),
217 "Peer NULL skipped Unsubscribe ");
225 "Channel NULL skipped Unsubscribe ");
240 info = vm_it->second;
248 UuidList::const_iterator vmi_it = std::find(info->
vmi_list_.begin(),
293 VmMap::iterator vm_it;
309 agent_ifmap_vm_export();
310 vm_it = agent_ifmap_vm_export->
vm_map_.begin();
311 for(; vm_it != agent_ifmap_vm_export->
vm_map_.end(); vm_it++) {
312 info = vm_it->second;
317 std::stringstream vmid;
318 vmid << vm_it->first;
337 VmMap::iterator vm_it;
342 info = vm_it->second;
void NotifyAll(AgentXmppChannel *peer)
void VmiAdd(const ControllerVmiSubscribeData *entry)
AgentIfMapVmExport(Agent *agent)
void VmiEvent(const ControllerVmiSubscribeData *entry)
void VmiDelete(const ControllerVmiSubscribeData *entry)
static uint64_t GetSeqNumber()
void ProcessEndOfConfig()
void StopEndOfConfigTimer()
void StopConfigCleanupTimer()
boost::scoped_ptr< EndOfConfigTimer > end_of_config_timer_
static uint64_t NewSeqNumber()
void EnqueueEndOfConfig()
virtual void ReceiveUpdate(const XmppStanza::XmppMessage *msg)
AgentIfMapXmppChannel(Agent *agent, XmppChannel *channel, uint8_t count)
void ReceiveInternal(const XmppStanza::XmppMessage *msg)
boost::shared_ptr< EndOfConfigData > EndOfConfigDataPtr
uint8_t GetXmppServerIdx()
virtual void WriteReadyCb(const boost::system::error_code &ec)
virtual std::string ToString() const
boost::scoped_ptr< ConfigCleanupTimer > config_cleanup_timer_
virtual ~AgentIfMapXmppChannel()
void StartEndOfConfigTimer()
ConfigCleanupTimer * config_cleanup_timer()
virtual bool SendUpdate(const std::string &msg)
EndOfConfigTimer * end_of_config_timer()
void ReceiveConfigMessage(std::unique_ptr< XmlBase > impl)
void StartConfigCleanupTimer()
static uint64_t seq_number_
void incr_xmpp_config_in_msgs(uint8_t idx)
static bool IsBgpPeerActive(const Agent *agent, AgentXmppChannel *peer)
static bool ControllerSendVmCfgSubscribe(AgentXmppChannel *peer, const boost::uuids::uuid &vm_id, bool subscribe)
AgentXmppChannel * controller_xmpp_channel(uint8_t idx) const
VNController * controller() const
IFMapAgentParser * ifmap_parser() const
AgentStats * stats() const
AgentIfMapXmppChannel * ifmap_xmpp_channel(uint8_t idx) const
const int8_t & ifmap_active_xmpp_server_index() const
boost::uuids::uuid vm_uuid_
boost::uuids::uuid vmi_uuid_
EndOfConfigData(AgentIfMapXmppChannel *ch)
void ConfigParse(const pugi::xml_node config, uint64_t seq)
boost::shared_ptr< ControllerWorkQueueData > ControllerWorkQueueDataType
void StartEndOfRibTxTimer()
void Enqueue(ControllerWorkQueueDataType data)
const pugi::xml_document & doc()
virtual void RegisterReceive(xmps::PeerId, ReceiveCb)=0
virtual void UnRegisterReceive(xmps::PeerId)=0
virtual const std::string & ToString() const =0
virtual void UnRegisterWriteReady(xmps::PeerId id)=0
virtual bool Send(const uint8_t *, size_t, xmps::PeerId, SendReadyCb)=0
std::unique_ptr< XmlBase > dom
static AgentIfMapXmppChannel * GetActiveChannel(Agent *agent, struct AgentIfMapVmExport::VmExportInfo *info)
static AgentXmppChannel * GetActivePeer(Agent *agent)
#define CONTROLLER_TRACE(obj,...)
#define LOG(_Level, _Msg)
static std::string UuidToString(const boost::uuids::uuid &id)
virtual void Start(AgentXmppChannel *agent_xmpp_channel)
virtual void Start(AgentXmppChannel *agent_xmpp_channel)
uint64_t end_of_config_processed_time_
uint64_t last_config_receive_time_
static XmppXmlImplFactory * Instance()
static uint64_t UTCTimestampUsec()