X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Finterface.hpp;h=42dfa67e03d468a273cf13d3141dda07bb0466f1;hb=8c8acc0;hp=a46b114833e4436119e91da645de8156f3d38e45;hpb=208c29aac523231af2420a95ba7e5d361698780b;p=vpp.git diff --git a/extras/vom/vom/interface.hpp b/extras/vom/vom/interface.hpp index a46b114833e..42dfa67e03d 100644 --- a/extras/vom/vom/interface.hpp +++ b/extras/vom/vom/interface.hpp @@ -94,10 +94,6 @@ public: * Local interface type (specific to VPP) */ const static type_t LOCAL; - /** - * TAP interface type - */ - const static type_t TAP; /** * TAPv2 interface type @@ -322,7 +318,8 @@ public: int sw_if_index = reply.get_response().get_payload().sw_if_index; int retval = reply.get_response().get_payload().retval; - VOM_LOG(log_level_t::DEBUG) << this->to_string() << " " << retval; + VOM_LOG(log_level_t::DEBUG) << this->to_string() << " res:" << retval + << " sw-if-index:" << sw_if_index; rc_t rc = rc_t::from_vpp_retval(retval); handle_t handle = handle_t::INVALID; @@ -392,6 +389,18 @@ public: const std::string m_name; }; + struct event + { + event(const interface& itf, const interface::oper_state_t& state) + : itf(itf) + , state(state) + { + } + + const interface& itf; + interface::oper_state_t state; + }; + /** * A class that listens to interface Events */ @@ -407,7 +416,7 @@ public: * Virtual function called on the listener when the command has data * ready to process */ - virtual void handle_interface_event(interface_cmds::events_cmd* cmd) = 0; + virtual void handle_interface_event(std::vector es) = 0; /** * Return the HW::item representing the status @@ -472,6 +481,16 @@ public: void enable_stats(stat_listener& el, const stats_type_t& st = stats_type_t::NORMAL); + /** + * Enable the reception of events of all interfaces + */ + static void enable_events(interface::event_listener& el); + + /** + * disable the reception of events of all interfaces + */ + static void disable_events(); + protected: /** * Set the handle of an interface object. Only called by the interface @@ -661,6 +680,8 @@ private: */ template friend class delete_cmd; + + static std::shared_ptr m_events_cmd; }; }; /*