7 #include <pugixml/pugixml.hpp>
22 #include <controller/controller_types.h>
28 uint8_t cnt) : channel_(channel),
90 LOG(WARN,
"IFMap config on non primary channel");
95 pugi::xml_node node = pugi->
FindNode(
"config");
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;
AgentIfMapXmppChannel(Agent *agent, XmppChannel *channel, uint8_t count)
IFMapAgentParser * ifmap_parser() const
pugi::xml_node FindNode(const std::string &name)
virtual std::string ToString() const
virtual void RegisterReceive(xmps::PeerId, ReceiveCb)=0
void VmiAdd(const ControllerVmiSubscribeData *entry)
virtual void WriteReadyCb(const boost::system::error_code &ec)
void incr_xmpp_config_in_msgs(uint8_t idx)
boost::scoped_ptr< ConfigCleanupTimer > config_cleanup_timer_
AgentStats * stats() const
AgentIfMapVmExport(Agent *agent)
boost::shared_ptr< EndOfConfigData > EndOfConfigDataPtr
const pugi::xml_document & doc()
void ReceiveInternal(const XmppStanza::XmppMessage *msg)
virtual ~AgentIfMapXmppChannel()
virtual void Start(AgentXmppChannel *agent_xmpp_channel)
static std::string UuidToString(const boost::uuids::uuid &id)
static bool ControllerSendVmCfgSubscribe(AgentXmppChannel *peer, const boost::uuids::uuid &vm_id, bool subscribe)
void StopEndOfConfigTimer()
AgentXmppChannel * controller_xmpp_channel(uint8_t idx) const
void Enqueue(ControllerWorkQueueDataType data)
virtual void ReceiveUpdate(const XmppStanza::XmppMessage *msg)
AgentIfMapXmppChannel * ifmap_xmpp_channel(uint8_t idx) const
EndOfConfigTimer * end_of_config_timer()
void StartEndOfRibTxTimer()
virtual bool Send(const uint8_t *, size_t, xmps::PeerId, SendReadyCb)=0
virtual bool SendUpdate(const std::string &msg)
std::unique_ptr< XmlBase > dom
boost::uuids::uuid vm_uuid_
void StopConfigCleanupTimer()
EndOfConfigData(AgentIfMapXmppChannel *ch)
void NotifyAll(AgentXmppChannel *peer)
VNController * controller() const
virtual void Start(AgentXmppChannel *agent_xmpp_channel)
void ProcessEndOfConfig()
void VmiDelete(const ControllerVmiSubscribeData *entry)
void LoadXmlDoc(const pugi::xml_document &doc)
virtual const std::string & ToString() const =0
virtual void UnRegisterReceive(xmps::PeerId)=0
boost::uuids::uuid vmi_uuid_
uint8_t GetXmppServerIdx()
void EnqueueEndOfConfig()
void StartConfigCleanupTimer()
void ConfigParse(const pugi::xml_node config, uint64_t seq)
uint64_t end_of_config_processed_time_
boost::shared_ptr< ControllerWorkQueueData > ControllerWorkQueueDataType
static uint64_t UTCTimestampUsec()
static AgentIfMapXmppChannel * GetActiveChannel(Agent *agent, struct AgentIfMapVmExport::VmExportInfo *info)
boost::scoped_ptr< EndOfConfigTimer > end_of_config_timer_
uint64_t last_config_receive_time_
#define LOG(_Level, _Msg)
static uint64_t GetSeqNumber()
void ReceiveConfigMessage(std::unique_ptr< XmlBase > impl)
virtual void UnRegisterWriteReady(xmps::PeerId id)=0
void StartEndOfConfigTimer()
static XmppXmlImplFactory * Instance()
static uint64_t seq_number_
static uint64_t NewSeqNumber()
#define CONTROLLER_TRACE(obj,...)
const int8_t & ifmap_active_xmpp_server_index() const
void VmiEvent(const ControllerVmiSubscribeData *entry)
static AgentXmppChannel * GetActivePeer(Agent *agent)
static bool IsBgpPeerActive(const Agent *agent, AgentXmppChannel *peer)
ConfigCleanupTimer * config_cleanup_timer()