X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Finterface_cmds.hpp;h=2ee892fc0f8ca98cdb62bc50a708f040440b29a2;hb=1bcb31102fbbf4a960c70f517b18f697d4fd1132;hp=1d0c4f543bc7ce13a8c5824df85f0bdf4900f2d3;hpb=9aca7b5ee915b8035fb5b690b7520ab155fcb36e;p=vpp.git diff --git a/extras/vom/vom/interface_cmds.hpp b/extras/vom/vom/interface_cmds.hpp index 1d0c4f543bc..2ee892fc0f8 100644 --- a/extras/vom/vom/interface_cmds.hpp +++ b/extras/vom/vom/interface_cmds.hpp @@ -25,8 +25,7 @@ #include #include -#include -#include +#include #include #include @@ -39,6 +38,30 @@ namespace interface_cmds { std::unique_ptr new_interface( const vapi_payload_sw_interface_details& vd); +/** + * A command class to create bvi interfaces in VPP + */ +class bvi_create_cmd : public interface::create_cmd +{ +public: + /** + * Constructor taking the HW::item to update + * and the name of the interface to create + */ + bvi_create_cmd(HW::item& item, const std::string& name); + ~bvi_create_cmd() = default; + + /** + * Issue the command to VPP/HW + */ + rc_t issue(connection& con); + + /** + * convert to string format for debug purposes + */ + std::string to_string() const; +}; + /** * A command class to create Loopback interfaces in VPP */ @@ -110,6 +133,27 @@ private: const std::string m_tag; }; +/** + * A command class to delete bvi interfaces in VPP + */ +class bvi_delete_cmd : public interface::delete_cmd +{ +public: + /** + * Constructor taking the HW::item to update + */ + bvi_delete_cmd(HW::item& item); + + /** + * Issue the command to VPP/HW + */ + rc_t issue(connection& con); + /** + * convert to string format for debug purposes + */ + std::string to_string() const; +}; + /** * A command class to delete loopback interfaces in VPP */ @@ -177,7 +221,7 @@ public: * A command class to set tag on interfaces */ class set_tag - : public rpc_cmd, rc_t, vapi::Sw_interface_tag_add_del> + : public rpc_cmd, vapi::Sw_interface_tag_add_del> { public: /** @@ -211,7 +255,6 @@ private: * A cmd class that changes the admin state */ class state_change_cmd : public rpc_cmd, - rc_t, vapi::Sw_interface_set_flags> { public: @@ -246,9 +289,8 @@ private: /** * A command class that binds an interface to an L3 table */ -class set_table_cmd : public rpc_cmd, - rc_t, - vapi::Sw_interface_set_table> +class set_table_cmd + : public rpc_cmd, vapi::Sw_interface_set_table> { public: /** @@ -289,9 +331,8 @@ private: /** * A command class that changes the MAC address on an interface */ -class set_mac_cmd : public rpc_cmd, - rc_t, - vapi::Sw_interface_set_mac_address> +class set_mac_cmd + : public rpc_cmd, vapi::Sw_interface_set_mac_address> { public: /** @@ -327,7 +368,6 @@ private: */ class collect_detail_stats_change_cmd : public rpc_cmd, - rc_t, vapi::Collect_detailed_interface_stats> { public: @@ -410,103 +450,6 @@ private: interface::event_listener& m_listener; }; -/** - * A command class represents our desire to recieve interface stats - */ -class stats_enable_cmd - : public event_cmd -{ -public: - /** - * Constructor taking the listner to notify - */ - stats_enable_cmd(interface::stat_listener& el, const handle_t& handle); - - /** - * Issue the command to VPP/HW - */ - rc_t issue(connection& con); - - /** - * Retires the command - unsubscribe from the stats. - */ - void retire(connection& con); - - /** - * convert to string format for debug purposes - */ - std::string to_string() const; - - /** - * (re)set status - */ - void set(const rc_t& rc); - - /** - * get listener - */ - interface::stat_listener& listener() const; - - /** - * Comparison operator - only used for UT - */ - bool operator==(const stats_enable_cmd& i) const; - - /** - * Called when it's time to poke the listeners - */ - void notify(); - -private: - /** - * The listeners to notify when data/stats arrive - */ - interface::stat_listener& m_listener; - - /** - * The interface on which we are enabling states - */ - const handle_t& m_swifindex; -}; - -/** - * A command class represents our desire to recieve interface stats - */ -class stats_disable_cmd - : public rpc_cmd, - rc_t, - vapi::Want_per_interface_combined_stats> -{ -public: - /** - * Constructor taking the listner to notify - */ - stats_disable_cmd(const handle_t& handle); - - /** - * Issue the command to VPP/HW - */ - rc_t issue(connection& con); - - /** - * convert to string format for debug purposes - */ - std::string to_string() const; - - /** - * Comparison operator - only used for UT - */ - bool operator==(const stats_disable_cmd& i) const; - -private: - HW::item m_res; - /** - * The interface on which we are disabling states - */ - handle_t m_swifindex; -}; - /** * A cmd class that Dumps all the Vpp interfaces */