VOM: mroutes
[vpp.git] / extras / vom / vom / interface_cmds.hpp
index 7a0040d..13a47e6 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <vapi/af_packet.api.vapi.hpp>
 #include <vapi/interface.api.vapi.hpp>
-#include <vapi/stats.api.vapi.hpp>
 #include <vapi/tap.api.vapi.hpp>
 #include <vapi/vhost_user.api.vapi.hpp>
 #include <vapi/vpe.api.vapi.hpp>
@@ -86,30 +85,6 @@ public:
   std::string to_string() const;
 };
 
-/**
-* A command class to create TAP interfaces in VPP
-*/
-class tap_create_cmd : public interface::create_cmd<vapi::Tap_connect>
-{
-public:
-  /**
-   * Constructor taking the HW::item to update
-   * and the name of the interface to create
-   */
-  tap_create_cmd(HW::item<handle_t>& item, const std::string& name);
-  ~tap_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 functor class that creates an interface
  */
@@ -178,27 +153,6 @@ public:
   std::string to_string() const;
 };
 
-/**
-* A command class to delete TAP interfaces in VPP
-*/
-class tap_delete_cmd : public interface::delete_cmd<vapi::Tap_delete>
-{
-public:
-  /**
-   * Constructor taking the HW::item to update
-   */
-  tap_delete_cmd(HW::item<handle_t>& 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 functor class that deletes a Vhost interface
  */
@@ -222,7 +176,7 @@ public:
  * A command class to set tag on interfaces
  */
 class set_tag
-  : public rpc_cmd<HW::item<handle_t>, rc_t, vapi::Sw_interface_tag_add_del>
+  : public rpc_cmd<HW::item<handle_t>, vapi::Sw_interface_tag_add_del>
 {
 public:
   /**
@@ -256,7 +210,6 @@ private:
  * A cmd class that changes the admin state
  */
 class state_change_cmd : public rpc_cmd<HW::item<interface::admin_state_t>,
-                                        rc_t,
                                         vapi::Sw_interface_set_flags>
 {
 public:
@@ -291,9 +244,8 @@ private:
 /**
  * A command class that binds an interface to an L3 table
  */
-class set_table_cmd : public rpc_cmd<HW::item<route::table_id_t>,
-                                     rc_t,
-                                     vapi::Sw_interface_set_table>
+class set_table_cmd
+  : public rpc_cmd<HW::item<route::table_id_t>, vapi::Sw_interface_set_table>
 {
 public:
   /**
@@ -334,9 +286,8 @@ private:
 /**
  * A command class that changes the MAC address on an interface
  */
-class set_mac_cmd : public rpc_cmd<HW::item<l2_address_t>,
-                                   rc_t,
-                                   vapi::Sw_interface_set_mac_address>
+class set_mac_cmd
+  : public rpc_cmd<HW::item<l2_address_t>, vapi::Sw_interface_set_mac_address>
 {
 public:
   /**
@@ -372,7 +323,6 @@ private:
  */
 class collect_detail_stats_change_cmd
   : public rpc_cmd<HW::item<interface::stats_type_t>,
-                   rc_t,
                    vapi::Collect_detailed_interface_stats>
 {
 public:
@@ -456,84 +406,20 @@ private:
 };
 
 /**
- * A command class represents our desire to recieve interface stats
- */
-class stats_enable_cmd
-  : public event_cmd<vapi::Want_per_interface_combined_stats,
-                     vapi::Vnet_per_interface_combined_counters>
-{
-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
+ * A cmd class that Dumps all the Vpp interfaces
  */
-class stats_disable_cmd
-  : public rpc_cmd<HW::item<bool>,
-                   rc_t,
-                   vapi::Want_per_interface_combined_stats>
+class dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_dump>
 {
 public:
   /**
-   * Constructor taking the listner to notify
+   * Default Constructor
    */
-  stats_disable_cmd(const handle_t& handle);
+  dump_cmd();
 
   /**
    * Issue the command to VPP/HW
    */
   rc_t issue(connection& con);
-
   /**
    * convert to string format for debug purposes
    */
@@ -542,26 +428,19 @@ public:
   /**
    * Comparison operator - only used for UT
    */
-  bool operator==(const stats_disable_cmd& i) const;
-
-private:
-  HW::item<bool> m_res;
-  /**
-   * The interface on which we are disabling states
-   */
-  handle_t m_swifindex;
+  bool operator==(const dump_cmd& i) const;
 };
 
 /**
- * A cmd class that Dumps all the Vpp interfaces
+ * A cmd class that Dumps all the Vpp Interfaces
  */
-class dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_dump>
+class vhost_dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_vhost_user_dump>
 {
 public:
   /**
    * Default Constructor
    */
-  dump_cmd();
+  vhost_dump_cmd();
 
   /**
    * Issue the command to VPP/HW
@@ -575,19 +454,19 @@ public:
   /**
    * Comparison operator - only used for UT
    */
-  bool operator==(const dump_cmd& i) const;
+  bool operator==(const vhost_dump_cmd& i) const;
 };
 
 /**
- * A cmd class that Dumps all the Vpp Interfaces
+ * A cmd class that Dumps all the Vpp interfaces
  */
-class vhost_dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_vhost_user_dump>
+class af_packet_dump_cmd : public VOM::dump_cmd<vapi::Af_packet_dump>
 {
 public:
   /**
    * Default Constructor
    */
-  vhost_dump_cmd();
+  af_packet_dump_cmd() = default;
 
   /**
    * Issue the command to VPP/HW
@@ -601,7 +480,7 @@ public:
   /**
    * Comparison operator - only used for UT
    */
-  bool operator==(const vhost_dump_cmd& i) const;
+  bool operator==(const af_packet_dump_cmd& i) const;
 };
 };
 };