diff options
Diffstat (limited to 'extras/vom/vom/route_cmds.hpp')
-rw-r--r-- | extras/vom/vom/route_cmds.hpp | 63 |
1 files changed, 14 insertions, 49 deletions
diff --git a/extras/vom/vom/route_cmds.hpp b/extras/vom/vom/route_cmds.hpp index 6db7b5894ef..3c43208f120 100644 --- a/extras/vom/vom/route_cmds.hpp +++ b/extras/vom/vom/route_cmds.hpp @@ -18,7 +18,7 @@ #include "vom/dump_cmd.hpp" #include "vom/route.hpp" -#include "vom/rpc_cmd.hpp" +#include "vom/srpc_cmd.hpp" #include <vapi/ip.api.vapi.hpp> @@ -29,16 +29,16 @@ namespace ip_route_cmds { /** * A command class that creates or updates the route */ -class update_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_add_del_route> +class update_cmd : public srpc_cmd<vapi::Ip_route_add_del> { public: /** * Constructor */ - update_cmd(HW::item<bool>& item, + update_cmd(HW::item<handle_t>& item, table_id_t id, const prefix_t& prefix, - const path& path); + const path_list_t& pl); /** * Issue the command to VPP/HW @@ -58,22 +58,19 @@ public: private: route::table_id_t m_id; prefix_t m_prefix; - const path m_path; + const path_list_t& m_pl; }; /** * A cmd class that deletes a route */ -class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_add_del_route> +class delete_cmd : public rpc_cmd<HW::item<handle_t>, vapi::Ip_route_add_del> { public: /** * Constructor */ - delete_cmd(HW::item<bool>& item, - table_id_t id, - const prefix_t& prefix, - const path& path); + delete_cmd(HW::item<handle_t>& item, table_id_t id, const prefix_t& prefix); /** * Issue the command to VPP/HW @@ -93,20 +90,19 @@ public: private: route::table_id_t m_id; prefix_t m_prefix; - const path m_path; }; /** - * A cmd class that Dumps ipv4 fib + * A cmd class that Dumps ip fib routes */ -class dump_v4_cmd : public VOM::dump_cmd<vapi::Ip_fib_dump> +class dump_cmd : public VOM::dump_cmd<vapi::Ip_route_dump> { public: /** * Constructor */ - dump_v4_cmd(); - dump_v4_cmd(const dump_cmd& d); + dump_cmd(route::table_id_t id, const l3_proto_t& proto); + dump_cmd(const dump_cmd& d); /** * Issue the command to VPP/HW @@ -120,46 +116,15 @@ public: /** * Comparison operator - only used for UT */ - bool operator==(const dump_v4_cmd& i) const; - -private: - /** - * HW reutrn code - */ - HW::item<bool> item; -}; - -/** - * A cmd class that Dumps ipv6 fib - */ -class dump_v6_cmd : public VOM::dump_cmd<vapi::Ip6_fib_dump> -{ -public: - /** - * Constructor - */ - dump_v6_cmd(); - dump_v6_cmd(const dump_cmd& d); - - /** - * 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 dump_v6_cmd& i) const; + bool operator==(const dump_cmd& i) const; private: /** * HW reutrn code */ HW::item<bool> item; + route::table_id_t m_id; + const l3_proto_t& m_proto; }; }; // namespace ip_route_cmds |