diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-03 04:39:05 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-06 17:44:21 +0000 |
commit | 9ef1c0adbf9399c55deeede3cf629dd4e8c20304 (patch) | |
tree | 0eeed8f869eee35a48797b6b837c16222a627e46 /test/ext/vom_test.cpp | |
parent | addb55b9e0533c5f720b1cc1bdeeb4bbd0e6bf2a (diff) |
VOM reshuffle
split the VOM into two halves; a top/front-end and a bottom/backend.
Only the backend includes the auto-generated VAPI.
This serves two purposes:
1 - improves ompile times for VOM, since the VAPI is included
only in the backend.
2 - does not expose VAPI to users of VOM
Change-Id: I17b93aeaef10c0eba8612016d9034aca5628d9f7
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'test/ext/vom_test.cpp')
-rw-r--r-- | test/ext/vom_test.cpp | 587 |
1 files changed, 305 insertions, 282 deletions
diff --git a/test/ext/vom_test.cpp b/test/ext/vom_test.cpp index 4c72fbc1aaa..5bec3a49583 100644 --- a/test/ext/vom_test.cpp +++ b/test/ext/vom_test.cpp @@ -19,28 +19,47 @@ #include "vom/om.hpp" #include "vom/interface.hpp" +#include "vom/interface_cmds.hpp" #include "vom/l2_binding.hpp" +#include "vom/l2_binding_cmds.hpp" #include "vom/l3_binding.hpp" +#include "vom/l3_binding_cmds.hpp" #include "vom/bridge_domain.hpp" #include "vom/bridge_domain_entry.hpp" #include "vom/bridge_domain_arp_entry.hpp" +#include "vom/bridge_domain_cmds.hpp" +#include "vom/bridge_domain_entry_cmds.hpp" +#include "vom/bridge_domain_arp_entry_cmds.hpp" #include "vom/prefix.hpp" #include "vom/route.hpp" +#include "vom/route_cmds.hpp" #include "vom/route_domain.hpp" +#include "vom/route_domain_cmds.hpp" #include "vom/vxlan_tunnel.hpp" +#include "vom/vxlan_tunnel_cmds.hpp" #include "vom/sub_interface.hpp" +#include "vom/sub_interface_cmds.hpp" #include "vom/acl_list.hpp" #include "vom/acl_binding.hpp" +#include "vom/acl_list_cmds.hpp" +#include "vom/acl_binding_cmds.hpp" #include "vom/acl_l3_rule.hpp" #include "vom/acl_l2_rule.hpp" #include "vom/arp_proxy_config.hpp" #include "vom/arp_proxy_binding.hpp" +#include "vom/arp_proxy_config_cmds.hpp" +#include "vom/arp_proxy_binding_cmds.hpp" #include "vom/ip_unnumbered.hpp" +#include "vom/ip_unnumbered_cmds.hpp" #include "vom/interface_ip6_nd.hpp" #include "vom/interface_span.hpp" +#include "vom/interface_span_cmds.hpp" #include "vom/neighbour.hpp" +#include "vom/neighbour_cmds.hpp" #include "vom/nat_static.hpp" +#include "vom/nat_static_cmds.hpp" #include "vom/nat_binding.hpp" +#include "vom/nat_binding_cmds.hpp" using namespace boost; using namespace VOM; @@ -61,10 +80,10 @@ public: class MockListener : public interface::event_listener, public interface::stat_listener { - void handle_interface_stat(interface::stats_cmd *cmd) + void handle_interface_stat(interface_cmds::stats_cmd *cmd) { } - void handle_interface_event(interface::events_cmd *cmd) + void handle_interface_event(interface_cmds::events_cmd *cmd) { } }; @@ -145,177 +164,177 @@ public: throw ExpException(1); } - if (typeid(*f_exp) == typeid(interface::af_packet_create_cmd)) + if (typeid(*f_exp) == typeid(interface_cmds::af_packet_create_cmd)) { - rc = handle_derived<interface::af_packet_create_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::af_packet_create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::loopback_create_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::loopback_create_cmd)) { - rc = handle_derived<interface::loopback_create_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::loopback_create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::loopback_delete_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::loopback_delete_cmd)) { - rc = handle_derived<interface::loopback_delete_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::loopback_delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::af_packet_delete_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::af_packet_delete_cmd)) { - rc = handle_derived<interface::af_packet_delete_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::af_packet_delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::state_change_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::state_change_cmd)) { - rc = handle_derived<interface::state_change_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::state_change_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::set_table_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::set_table_cmd)) { - rc = handle_derived<interface::set_table_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::set_table_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::set_mac_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::set_mac_cmd)) { - rc = handle_derived<interface::set_mac_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::set_mac_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::set_tag)) + else if (typeid(*f_exp) == typeid(interface_cmds::set_tag)) { - rc = handle_derived<interface::set_tag>(f_exp, f_act); + rc = handle_derived<interface_cmds::set_tag>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(route_domain::create_cmd)) + else if (typeid(*f_exp) == typeid(route_domain_cmds::create_cmd)) { - rc = handle_derived<route_domain::create_cmd>(f_exp, f_act); + rc = handle_derived<route_domain_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(route_domain::delete_cmd)) + else if (typeid(*f_exp) == typeid(route_domain_cmds::delete_cmd)) { - rc = handle_derived<route_domain::delete_cmd>(f_exp, f_act); + rc = handle_derived<route_domain_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(route::ip_route::update_cmd)) + else if (typeid(*f_exp) == typeid(route::ip_route_cmds::update_cmd)) { - rc = handle_derived<route::ip_route::update_cmd>(f_exp, f_act); + rc = handle_derived<route::ip_route_cmds::update_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(route::ip_route::delete_cmd)) + else if (typeid(*f_exp) == typeid(route::ip_route_cmds::delete_cmd)) { - rc = handle_derived<route::ip_route::delete_cmd>(f_exp, f_act); + rc = handle_derived<route::ip_route_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(neighbour::create_cmd)) + else if (typeid(*f_exp) == typeid(neighbour_cmds::create_cmd)) { - rc = handle_derived<neighbour::create_cmd>(f_exp, f_act); + rc = handle_derived<neighbour_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(neighbour::delete_cmd)) + else if (typeid(*f_exp) == typeid(neighbour_cmds::delete_cmd)) { - rc = handle_derived<neighbour::delete_cmd>(f_exp, f_act); + rc = handle_derived<neighbour_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(l3_binding::bind_cmd)) + else if (typeid(*f_exp) == typeid(l3_binding_cmds::bind_cmd)) { - rc = handle_derived<l3_binding::bind_cmd>(f_exp, f_act); + rc = handle_derived<l3_binding_cmds::bind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(l3_binding::unbind_cmd)) + else if (typeid(*f_exp) == typeid(l3_binding_cmds::unbind_cmd)) { - rc = handle_derived<l3_binding::unbind_cmd>(f_exp, f_act); + rc = handle_derived<l3_binding_cmds::unbind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain::create_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_cmds::create_cmd)) { - rc = handle_derived<bridge_domain::create_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain::delete_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_cmds::delete_cmd)) { - rc = handle_derived<bridge_domain::delete_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain_entry::create_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_entry_cmds::create_cmd)) { - rc = handle_derived<bridge_domain_entry::create_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_entry_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain_entry::delete_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_entry_cmds::delete_cmd)) { - rc = handle_derived<bridge_domain_entry::delete_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_entry_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain_arp_entry::create_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_arp_entry_cmds::create_cmd)) { - rc = handle_derived<bridge_domain_arp_entry::create_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_arp_entry_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(bridge_domain_arp_entry::delete_cmd)) + else if (typeid(*f_exp) == typeid(bridge_domain_arp_entry_cmds::delete_cmd)) { - rc = handle_derived<bridge_domain_arp_entry::delete_cmd>(f_exp, f_act); + rc = handle_derived<bridge_domain_arp_entry_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(l2_binding::bind_cmd)) + else if (typeid(*f_exp) == typeid(l2_binding_cmds::bind_cmd)) { - rc = handle_derived<l2_binding::bind_cmd>(f_exp, f_act); + rc = handle_derived<l2_binding_cmds::bind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(l2_binding::unbind_cmd)) + else if (typeid(*f_exp) == typeid(l2_binding_cmds::unbind_cmd)) { - rc = handle_derived<l2_binding::unbind_cmd>(f_exp, f_act); + rc = handle_derived<l2_binding_cmds::unbind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(l2_binding::set_vtr_op_cmd)) + else if (typeid(*f_exp) == typeid(l2_binding_cmds::set_vtr_op_cmd)) { - rc = handle_derived<l2_binding::set_vtr_op_cmd>(f_exp, f_act); + rc = handle_derived<l2_binding_cmds::set_vtr_op_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(vxlan_tunnel::create_cmd)) + else if (typeid(*f_exp) == typeid(vxlan_tunnel_cmds::create_cmd)) { - rc = handle_derived<vxlan_tunnel::create_cmd>(f_exp, f_act); + rc = handle_derived<vxlan_tunnel_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(vxlan_tunnel::delete_cmd)) + else if (typeid(*f_exp) == typeid(vxlan_tunnel_cmds::delete_cmd)) { - rc = handle_derived<vxlan_tunnel::delete_cmd>(f_exp, f_act); + rc = handle_derived<vxlan_tunnel_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(sub_interface::create_cmd)) + else if (typeid(*f_exp) == typeid(sub_interface_cmds::create_cmd)) { - rc = handle_derived<sub_interface::create_cmd>(f_exp, f_act); + rc = handle_derived<sub_interface_cmds::create_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(sub_interface::delete_cmd)) + else if (typeid(*f_exp) == typeid(sub_interface_cmds::delete_cmd)) { - rc = handle_derived<sub_interface::delete_cmd>(f_exp, f_act); + rc = handle_derived<sub_interface_cmds::delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l3_list::update_cmd)) + else if (typeid(*f_exp) == typeid(ACL::list_cmds::l3_update_cmd)) { - rc = handle_derived<ACL::l3_list::update_cmd>(f_exp, f_act); + rc = handle_derived<ACL::list_cmds::l3_update_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l3_list::delete_cmd)) + else if (typeid(*f_exp) == typeid(ACL::list_cmds::l3_delete_cmd)) { - rc = handle_derived<ACL::l3_list::delete_cmd>(f_exp, f_act); + rc = handle_derived<ACL::list_cmds::l3_delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l3_binding::bind_cmd)) + else if (typeid(*f_exp) == typeid(ACL::binding_cmds::l3_bind_cmd)) { - rc = handle_derived<ACL::l3_binding::bind_cmd>(f_exp, f_act); + rc = handle_derived<ACL::binding_cmds::l3_bind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l3_binding::unbind_cmd)) + else if (typeid(*f_exp) == typeid(ACL::binding_cmds::l3_unbind_cmd)) { - rc = handle_derived<ACL::l3_binding::unbind_cmd>(f_exp, f_act); + rc = handle_derived<ACL::binding_cmds::l3_unbind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l2_list::update_cmd)) + else if (typeid(*f_exp) == typeid(ACL::list_cmds::l2_update_cmd)) { - rc = handle_derived<ACL::l2_list::update_cmd>(f_exp, f_act); + rc = handle_derived<ACL::list_cmds::l2_update_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l2_list::delete_cmd)) + else if (typeid(*f_exp) == typeid(ACL::list_cmds::l2_delete_cmd)) { - rc = handle_derived<ACL::l2_list::delete_cmd>(f_exp, f_act); + rc = handle_derived<ACL::list_cmds::l2_delete_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l2_binding::bind_cmd)) + else if (typeid(*f_exp) == typeid(ACL::binding_cmds::l2_bind_cmd)) { - rc = handle_derived<ACL::l2_binding::bind_cmd>(f_exp, f_act); + rc = handle_derived<ACL::binding_cmds::l2_bind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ACL::l2_binding::unbind_cmd)) + else if (typeid(*f_exp) == typeid(ACL::binding_cmds::l2_unbind_cmd)) { - rc = handle_derived<ACL::l2_binding::unbind_cmd>(f_exp, f_act); + rc = handle_derived<ACL::binding_cmds::l2_unbind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(arp_proxy_binding::bind_cmd)) + else if (typeid(*f_exp) == typeid(arp_proxy_binding_cmds::bind_cmd)) { - rc = handle_derived<arp_proxy_binding::bind_cmd>(f_exp, f_act); + rc = handle_derived<arp_proxy_binding_cmds::bind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(arp_proxy_binding::unbind_cmd)) + else if (typeid(*f_exp) == typeid(arp_proxy_binding_cmds::unbind_cmd)) { - rc = handle_derived<arp_proxy_binding::unbind_cmd>(f_exp, f_act); + rc = handle_derived<arp_proxy_binding_cmds::unbind_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(arp_proxy_config::config_cmd)) + else if (typeid(*f_exp) == typeid(arp_proxy_config_cmds::config_cmd)) { - rc = handle_derived<arp_proxy_config::config_cmd>(f_exp, f_act); + rc = handle_derived<arp_proxy_config_cmds::config_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(arp_proxy_config::unconfig_cmd)) + else if (typeid(*f_exp) == typeid(arp_proxy_config_cmds::unconfig_cmd)) { - rc = handle_derived<arp_proxy_config::unconfig_cmd>(f_exp, f_act); + rc = handle_derived<arp_proxy_config_cmds::unconfig_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ip_unnumbered::config_cmd)) + else if (typeid(*f_exp) == typeid(ip_unnumbered_cmds::config_cmd)) { - rc = handle_derived<ip_unnumbered::config_cmd>(f_exp, f_act); + rc = handle_derived<ip_unnumbered_cmds::config_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(ip_unnumbered::unconfig_cmd)) + else if (typeid(*f_exp) == typeid(ip_unnumbered_cmds::unconfig_cmd)) { - rc = handle_derived<ip_unnumbered::unconfig_cmd>(f_exp, f_act); + rc = handle_derived<ip_unnumbered_cmds::unconfig_cmd>(f_exp, f_act); } else if (typeid(*f_exp) == typeid(ip6nd_ra_config::config_cmd)) { @@ -333,33 +352,33 @@ public: { rc = handle_derived<ip6nd_ra_prefix::unconfig_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface_span::config_cmd)) + else if (typeid(*f_exp) == typeid(interface_span_cmds::config_cmd)) { - rc = handle_derived<interface_span::config_cmd>(f_exp, f_act); + rc = handle_derived<interface_span_cmds::config_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface_span::unconfig_cmd)) + else if (typeid(*f_exp) == typeid(interface_span_cmds::unconfig_cmd)) { - rc = handle_derived<interface_span::unconfig_cmd>(f_exp, f_act); + rc = handle_derived<interface_span_cmds::unconfig_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(nat_static::create_44_cmd)) + else if (typeid(*f_exp) == typeid(nat_static_cmds::create_44_cmd)) { - rc = handle_derived<nat_static::create_44_cmd>(f_exp, f_act); + rc = handle_derived<nat_static_cmds::create_44_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(nat_static::delete_44_cmd)) + else if (typeid(*f_exp) == typeid(nat_static_cmds::delete_44_cmd)) { - rc = handle_derived<nat_static::delete_44_cmd>(f_exp, f_act); + rc = handle_derived<nat_static_cmds::delete_44_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(nat_binding::bind_44_input_cmd)) + else if (typeid(*f_exp) == typeid(nat_binding_cmds::bind_44_input_cmd)) { - rc = handle_derived<nat_binding::bind_44_input_cmd>(f_exp, f_act); + rc = handle_derived<nat_binding_cmds::bind_44_input_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(nat_binding::unbind_44_input_cmd)) + else if (typeid(*f_exp) == typeid(nat_binding_cmds::unbind_44_input_cmd)) { - rc = handle_derived<nat_binding::unbind_44_input_cmd>(f_exp, f_act); + rc = handle_derived<nat_binding_cmds::unbind_44_input_cmd>(f_exp, f_act); } - else if (typeid(*f_exp) == typeid(interface::events_cmd)) + else if (typeid(*f_exp) == typeid(interface_cmds::events_cmd)) { - rc = handle_derived<interface::events_cmd>(f_exp, f_act); + rc = handle_derived<interface_cmds::events_cmd>(f_exp, f_act); } else { @@ -504,16 +523,16 @@ BOOST_AUTO_TEST_CASE(test_interface) { * 2 is the interface handle VPP [mock] assigns */ HW::item<handle_t> hw_ifh(2, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1)); HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(go)); @@ -525,56 +544,56 @@ BOOST_AUTO_TEST_CASE(test_interface) { interface::type_t::AFPACKET, interface::admin_state_t::DOWN); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); TRY_CHECK_RC(OM::write(js, itf1b)); TRY_CHECK(OM::remove(go)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(js)); /* * George adds an interface, then we flush all of Geroge's state */ - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1)); TRY_CHECK(OM::mark(go)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::sweep(go)); /* * George adds an interface. mark stale. update the same interface. sweep * and expect no delete */ - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1b)); TRY_CHECK(OM::mark(go)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1)); TRY_CHECK(OM::sweep(go)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(go)); /* * George adds an insterface, then we mark that state. Add a second interface * an flush the first that is now stale. */ - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(go, itf1)); TRY_CHECK(OM::mark(go)); @@ -585,18 +604,18 @@ BOOST_AUTO_TEST_CASE(test_interface) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh2(3, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2)); TRY_CHECK_RC(OM::write(go, itf2)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::sweep(go)); TRY_CHECK(OM::mark(go)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name)); TRY_CHECK(OM::sweep(go)); } @@ -624,15 +643,15 @@ BOOST_AUTO_TEST_CASE(test_bvi) { HW::item<handle_t> hw_ifh(4, rc_t::OK); HW::item<route::prefix_t> hw_pfx_10(pfx_10, rc_t::OK); - ADD_EXPECT(interface::loopback_create_cmd(hw_ifh, bvi_name)); - ADD_EXPECT(interface::set_tag(hw_ifh, bvi_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::loopback_create_cmd(hw_ifh, bvi_name)); + ADD_EXPECT(interface_cmds::set_tag(hw_ifh, bvi_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(ernest, itf)); l3 = new l3_binding(itf, pfx_10); HW::item<bool> hw_l3_bind(true, rc_t::OK); HW::item<bool> hw_l3_unbind(false, rc_t::OK); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); TRY_CHECK_RC(OM::write(ernest, *l3)); // change the MAC address on the BVI @@ -642,7 +661,7 @@ BOOST_AUTO_TEST_CASE(test_bvi) { l2_address_t l2_addr({0,1,2,3,4,5}); HW::item<l2_address_t> hw_mac(l2_addr, rc_t::OK); itf_new_mac.set(l2_addr); - ADD_EXPECT(interface::set_mac_cmd(hw_mac, hw_ifh)); + ADD_EXPECT(interface_cmds::set_mac_cmd(hw_mac, hw_ifh)); TRY_CHECK_RC(OM::write(ernest, itf_new_mac)); // create/write the interface to the OM again but with an unset MAC @@ -656,13 +675,13 @@ BOOST_AUTO_TEST_CASE(test_bvi) { l2_address_t l2_addr2({0,1,2,3,4,6}); HW::item<l2_address_t> hw_mac2(l2_addr2, rc_t::OK); itf_new_mac2.set(l2_addr2); - ADD_EXPECT(interface::set_mac_cmd(hw_mac2, hw_ifh)); + ADD_EXPECT(interface_cmds::set_mac_cmd(hw_mac2, hw_ifh)); TRY_CHECK_RC(OM::write(ernest, itf_new_mac2)); delete l3; - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::loopback_delete_cmd(hw_ifh)); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::loopback_delete_cmd(hw_ifh)); TRY_CHECK(OM::remove(ernest)); /* @@ -677,8 +696,8 @@ BOOST_AUTO_TEST_CASE(test_bvi) { HW::item<route::table_id_t> hw_rd4_unbind(route::DEFAULT_TABLE, rc_t::OK); HW::item<route::table_id_t> hw_rd6_bind(1, rc_t::OK); HW::item<route::table_id_t> hw_rd6_unbind(route::DEFAULT_TABLE, rc_t::OK); - ADD_EXPECT(route_domain::create_cmd(hw_rd4_create, l3_proto_t::IPV4, 1)); - ADD_EXPECT(route_domain::create_cmd(hw_rd6_create, l3_proto_t::IPV6, 1)); + ADD_EXPECT(route_domain_cmds::create_cmd(hw_rd4_create, l3_proto_t::IPV4, 1)); + ADD_EXPECT(route_domain_cmds::create_cmd(hw_rd6_create, l3_proto_t::IPV6, 1)); TRY_CHECK_RC(OM::write(graham, rd)); const std::string bvi2_name = "bvi2"; @@ -688,28 +707,28 @@ BOOST_AUTO_TEST_CASE(test_bvi) { rd); HW::item<handle_t> hw_ifh2(5, rc_t::OK); - ADD_EXPECT(interface::loopback_create_cmd(hw_ifh2, bvi2_name)); - ADD_EXPECT(interface::set_tag(hw_ifh2, bvi2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd4_bind, l3_proto_t::IPV4, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd6_bind, l3_proto_t::IPV6, hw_ifh2)); + ADD_EXPECT(interface_cmds::loopback_create_cmd(hw_ifh2, bvi2_name)); + ADD_EXPECT(interface_cmds::set_tag(hw_ifh2, bvi2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd4_bind, l3_proto_t::IPV4, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd6_bind, l3_proto_t::IPV6, hw_ifh2)); TRY_CHECK_RC(OM::write(graham, *itf2)); l3 = new l3_binding(*itf2, pfx_10); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_bind, hw_ifh2.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_bind, hw_ifh2.data(), pfx_10)); TRY_CHECK_RC(OM::write(graham, *l3)); delete l3; delete itf2; - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_unbind, hw_ifh2.data(), pfx_10)); - ADD_EXPECT(interface::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV4, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd6_unbind, l3_proto_t::IPV6, hw_ifh2)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh2)); - ADD_EXPECT(interface::loopback_delete_cmd(hw_ifh2)); - ADD_EXPECT(route_domain::delete_cmd(hw_rd4_delete, l3_proto_t::IPV4, 1)); - ADD_EXPECT(route_domain::delete_cmd(hw_rd6_delete, l3_proto_t::IPV6, 1)); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_unbind, hw_ifh2.data(), pfx_10)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV4, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd6_unbind, l3_proto_t::IPV6, hw_ifh2)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2)); + ADD_EXPECT(interface_cmds::loopback_delete_cmd(hw_ifh2)); + ADD_EXPECT(route_domain_cmds::delete_cmd(hw_rd4_delete, l3_proto_t::IPV4, 1)); + ADD_EXPECT(route_domain_cmds::delete_cmd(hw_rd6_delete, l3_proto_t::IPV6, 1)); TRY_CHECK(OM::remove(graham)); } @@ -732,8 +751,8 @@ BOOST_AUTO_TEST_CASE(test_bridge) { HW::item<handle_t> hw_ifh(3, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(franz, itf1)); @@ -741,7 +760,7 @@ BOOST_AUTO_TEST_CASE(test_bridge) { bridge_domain bd1(33); HW::item<uint32_t> hw_bd(33, rc_t::OK); - ADD_EXPECT(bridge_domain::create_cmd(hw_bd)); + ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd)); TRY_CHECK_RC(OM::write(franz, bd1)); @@ -751,7 +770,7 @@ BOOST_AUTO_TEST_CASE(test_bridge) { l2_binding *l2itf = new l2_binding(itf1, bd1); HW::item<bool> hw_l2_bind(true, rc_t::OK); - ADD_EXPECT(l2_binding::bind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false)); + ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false)); TRY_CHECK_RC(OM::write(franz, *l2itf)); /* @@ -763,8 +782,8 @@ BOOST_AUTO_TEST_CASE(test_bridge) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh2(4, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2)); TRY_CHECK_RC(OM::write(dante, itf2)); // BD add is a no-op since it exists @@ -774,15 +793,15 @@ BOOST_AUTO_TEST_CASE(test_bridge) { HW::item<l2_binding::l2_vtr_op_t> hw_set_vtr(l2_binding::l2_vtr_op_t::L2_VTR_POP_1, rc_t::OK); l2itf2->set(l2_binding::l2_vtr_op_t::L2_VTR_POP_1, 68); - ADD_EXPECT(l2_binding::bind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false)); - ADD_EXPECT(l2_binding::set_vtr_op_cmd(hw_set_vtr, hw_ifh2.data(), 68)); + ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false)); + ADD_EXPECT(l2_binding_cmds::set_vtr_op_cmd(hw_set_vtr, hw_ifh2.data(), 68)); TRY_CHECK_RC(OM::write(dante, *l2itf2)); // Add some static entries to the bridge-domain HW::item<bool> hw_be1(true, rc_t::OK); mac_address_t mac1({0,1,2,3,4,5}); bridge_domain_entry *be1 = new bridge_domain_entry(bd1, mac1, itf2); - ADD_EXPECT(bridge_domain_entry::create_cmd(hw_be1, mac1, bd1.id(), hw_ifh2.data())); + ADD_EXPECT(bridge_domain_entry_cmds::create_cmd(hw_be1, mac1, bd1.id(), hw_ifh2.data())); TRY_CHECK_RC(OM::write(dante, *be1)); // Add some entries to the bridge-domain ARP termination table @@ -790,16 +809,16 @@ BOOST_AUTO_TEST_CASE(test_bridge) { boost::asio::ip::address ip1 = boost::asio::ip::address::from_string("10.10.10.10"); bridge_domain_arp_entry *bea1 = new bridge_domain_arp_entry(bd1, mac1, ip1); - ADD_EXPECT(bridge_domain_arp_entry::create_cmd(hw_be1, bd1.id(), mac1, ip1)); + ADD_EXPECT(bridge_domain_arp_entry_cmds::create_cmd(hw_be1, bd1.id(), mac1, ip1)); TRY_CHECK_RC(OM::write(dante, *bea1)); // flush Franz's state delete l2itf; HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(l2_binding::unbind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_ifh.data(), hw_bd.data(), false)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(franz)); // flush Dante's state - the order the interface and BD are deleted @@ -808,12 +827,12 @@ BOOST_AUTO_TEST_CASE(test_bridge) { delete be1; delete bea1; STRICT_ORDER_OFF(); - ADD_EXPECT(l2_binding::unbind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(bridge_domain_entry::delete_cmd(hw_be1, mac1, bd1.id())); - ADD_EXPECT(bridge_domain_arp_entry::delete_cmd(hw_be1, bd1.id(), mac1, ip1)); - ADD_EXPECT(bridge_domain::delete_cmd(hw_bd)); + ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_ifh2.data(), hw_bd.data(), false)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(bridge_domain_entry_cmds::delete_cmd(hw_be1, mac1, bd1.id())); + ADD_EXPECT(bridge_domain_arp_entry_cmds::delete_cmd(hw_be1, bd1.id(), mac1, ip1)); + ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd)); TRY_CHECK(OM::remove(dante)); } @@ -834,7 +853,7 @@ BOOST_AUTO_TEST_CASE(test_vxlan) { vxlan_tunnel vxt(ep.src, ep.dst, ep.vni); HW::item<handle_t> hw_vxt(3, rc_t::OK); - ADD_EXPECT(vxlan_tunnel::create_cmd(hw_vxt, "don't-care", ep)); + ADD_EXPECT(vxlan_tunnel_cmds::create_cmd(hw_vxt, "don't-care", ep)); TRY_CHECK_RC(OM::write(franz, vxt)); @@ -842,7 +861,7 @@ BOOST_AUTO_TEST_CASE(test_vxlan) { bridge_domain bd1(33); HW::item<uint32_t> hw_bd(33, rc_t::OK); - ADD_EXPECT(bridge_domain::create_cmd(hw_bd)); + ADD_EXPECT(bridge_domain_cmds::create_cmd(hw_bd)); TRY_CHECK_RC(OM::write(franz, bd1)); @@ -852,16 +871,16 @@ BOOST_AUTO_TEST_CASE(test_vxlan) { l2_binding *l2itf = new l2_binding(vxt, bd1); HW::item<bool> hw_l2_bind(true, rc_t::OK); - ADD_EXPECT(l2_binding::bind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false)); + ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false)); TRY_CHECK_RC(OM::write(franz, *l2itf)); // flush Franz's state delete l2itf; HW::item<handle_t> hw_vxtdel(3, rc_t::NOOP); STRICT_ORDER_OFF(); - ADD_EXPECT(l2_binding::unbind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false)); - ADD_EXPECT(bridge_domain::delete_cmd(hw_bd)); - ADD_EXPECT(vxlan_tunnel::delete_cmd(hw_vxtdel, ep)); + ADD_EXPECT(l2_binding_cmds::unbind_cmd(hw_l2_bind, hw_vxt.data(), hw_bd.data(), false)); + ADD_EXPECT(bridge_domain_cmds::delete_cmd(hw_bd)); + ADD_EXPECT(vxlan_tunnel_cmds::delete_cmd(hw_vxtdel, ep)); TRY_CHECK(OM::remove(franz)); } @@ -876,10 +895,10 @@ BOOST_AUTO_TEST_CASE(test_vlan) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(2, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(noam, itf1)); @@ -888,18 +907,18 @@ BOOST_AUTO_TEST_CASE(test_vlan) { 33); HW::item<handle_t> hw_vl33(3, rc_t::OK); - ADD_EXPECT(sub_interface::create_cmd(hw_vl33, itf1_name+".33", hw_ifh.data(), 33)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_vl33)); + ADD_EXPECT(sub_interface_cmds::create_cmd(hw_vl33, itf1_name+".33", hw_ifh.data(), 33)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_vl33)); TRY_CHECK_RC(OM::write(noam, *vl33)); delete vl33; HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); HW::item<handle_t> hw_vl33_down(3, rc_t::NOOP); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_vl33)); - ADD_EXPECT(sub_interface::delete_cmd(hw_vl33_down)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_vl33)); + ADD_EXPECT(sub_interface_cmds::delete_cmd(hw_vl33_down)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(noam)); } @@ -919,8 +938,8 @@ BOOST_AUTO_TEST_CASE(test_acl) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(fyodor, itf1)); route::prefix_t src("10.10.10.10", 32); @@ -934,13 +953,13 @@ BOOST_AUTO_TEST_CASE(test_acl) { ACL::l3_list::rules_t rules = {r1, r2}; HW::item<handle_t> hw_acl(2, rc_t::OK); - ADD_EXPECT(ACL::l3_list::update_cmd(hw_acl, acl_name, rules)); + ADD_EXPECT(ACL::list_cmds::l3_update_cmd(hw_acl, acl_name, rules)); TRY_CHECK_RC(OM::write(fyodor, acl1)); ACL::l3_binding *l3b = new ACL::l3_binding(direction_t::INPUT, itf1, acl1); HW::item<bool> hw_binding(true, rc_t::OK); - ADD_EXPECT(ACL::l3_binding::bind_cmd(hw_binding, direction_t::INPUT, - hw_ifh.data(), hw_acl.data())); + ADD_EXPECT(ACL::binding_cmds::l3_bind_cmd(hw_binding, direction_t::INPUT, + hw_ifh.data(), hw_acl.data())); TRY_CHECK_RC(OM::write(fyodor, *l3b)); /** @@ -961,30 +980,30 @@ BOOST_AUTO_TEST_CASE(test_acl) { ACL::l2_list::rules_t l2_rules = {l2_r1, l2_r2}; HW::item<handle_t> l2_hw_acl(3, rc_t::OK); - ADD_EXPECT(ACL::l2_list::update_cmd(l2_hw_acl, l2_acl_name, l2_rules)); + ADD_EXPECT(ACL::list_cmds::l2_update_cmd(l2_hw_acl, l2_acl_name, l2_rules)); TRY_CHECK_RC(OM::write(leo, l2_acl)); ACL::l2_binding *l2b = new ACL::l2_binding(direction_t::OUTPUT, itf1, l2_acl); HW::item<bool> l2_hw_binding(true, rc_t::OK); - ADD_EXPECT(ACL::l2_binding::bind_cmd(l2_hw_binding, direction_t::OUTPUT, + ADD_EXPECT(ACL::binding_cmds::l2_bind_cmd(l2_hw_binding, direction_t::OUTPUT, hw_ifh.data(), l2_hw_acl.data())); TRY_CHECK_RC(OM::write(leo, *l2b)); delete l2b; - ADD_EXPECT(ACL::l2_binding::unbind_cmd(l2_hw_binding, direction_t::OUTPUT, - hw_ifh.data(), l2_hw_acl.data())); - ADD_EXPECT(ACL::l2_list::delete_cmd(l2_hw_acl)); + ADD_EXPECT(ACL::binding_cmds::l2_unbind_cmd(l2_hw_binding, direction_t::OUTPUT, + hw_ifh.data(), l2_hw_acl.data())); + ADD_EXPECT(ACL::list_cmds::l2_delete_cmd(l2_hw_acl)); TRY_CHECK(OM::remove(leo)); delete l3b; HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); STRICT_ORDER_OFF(); - ADD_EXPECT(ACL::l3_binding::unbind_cmd(hw_binding, direction_t::INPUT, + ADD_EXPECT(ACL::binding_cmds::l3_unbind_cmd(hw_binding, direction_t::INPUT, hw_ifh.data(), hw_acl.data())); - ADD_EXPECT(ACL::l3_list::delete_cmd(hw_acl)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(ACL::list_cmds::l3_delete_cmd(hw_acl)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(fyodor)); } @@ -999,7 +1018,7 @@ BOOST_AUTO_TEST_CASE(test_arp_proxy) { arp_proxy_config ap(low, high); HW::item<bool> hw_ap_cfg(true, rc_t::OK); - ADD_EXPECT(arp_proxy_config::config_cmd(hw_ap_cfg, low, high)); + ADD_EXPECT(arp_proxy_config_cmds::config_cmd(hw_ap_cfg, low, high)); TRY_CHECK_RC(OM::write(kurt, ap)); std::string itf3_name = "host3"; @@ -1008,13 +1027,13 @@ BOOST_AUTO_TEST_CASE(test_arp_proxy) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf3_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf3_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(kurt, itf3)); arp_proxy_binding *apb = new arp_proxy_binding(itf3, ap); HW::item<bool> hw_binding(true, rc_t::OK); - ADD_EXPECT(arp_proxy_binding::bind_cmd(hw_binding, hw_ifh.data())); + ADD_EXPECT(arp_proxy_binding_cmds::bind_cmd(hw_binding, hw_ifh.data())); TRY_CHECK_RC(OM::write(kurt, *apb)); delete apb; @@ -1022,10 +1041,10 @@ BOOST_AUTO_TEST_CASE(test_arp_proxy) { HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); STRICT_ORDER_OFF(); - ADD_EXPECT(arp_proxy_binding::unbind_cmd(hw_binding, hw_ifh.data())); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf3_name)); - ADD_EXPECT(arp_proxy_config::unconfig_cmd(hw_ap_cfg, low, high)); + ADD_EXPECT(arp_proxy_binding_cmds::unbind_cmd(hw_binding, hw_ifh.data())); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf3_name)); + ADD_EXPECT(arp_proxy_config_cmds::unconfig_cmd(hw_ap_cfg, low, high)); TRY_CHECK(OM::remove(kurt)); } @@ -1044,15 +1063,15 @@ BOOST_AUTO_TEST_CASE(test_ip_unnumbered) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(eric, itf1)); route::prefix_t pfx_10("10.10.10.10", 24); l3_binding *l3 = new l3_binding(itf1, pfx_10); HW::item<bool> hw_l3_bind(true, rc_t::OK); HW::item<bool> hw_l3_unbind(false, rc_t::OK); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); TRY_CHECK_RC(OM::write(eric, *l3)); /* @@ -1064,14 +1083,14 @@ BOOST_AUTO_TEST_CASE(test_ip_unnumbered) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh2(4, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh2)); TRY_CHECK_RC(OM::write(eric, itf2)); ip_unnumbered *ipun = new ip_unnumbered(itf2, itf1); HW::item<bool> hw_ip_cfg(true, rc_t::OK); HW::item<bool> hw_ip_uncfg(false, rc_t::OK); - ADD_EXPECT(ip_unnumbered::config_cmd(hw_ip_cfg, hw_ifh2.data(), hw_ifh.data())); + ADD_EXPECT(ip_unnumbered_cmds::config_cmd(hw_ip_cfg, hw_ifh2.data(), hw_ifh.data())); TRY_CHECK_RC(OM::write(eric, *ipun)); delete l3; @@ -1079,12 +1098,12 @@ BOOST_AUTO_TEST_CASE(test_ip_unnumbered) { HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); STRICT_ORDER_OFF(); - ADD_EXPECT(ip_unnumbered::unconfig_cmd(hw_ip_uncfg, hw_ifh2.data(), hw_ifh.data())); - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(ip_unnumbered_cmds::unconfig_cmd(hw_ip_uncfg, hw_ifh2.data(), hw_ifh.data())); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); TRY_CHECK(OM::remove(eric)); } @@ -1103,15 +1122,15 @@ BOOST_AUTO_TEST_CASE(test_ip6nd) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(3, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(paulo, itf)); route::prefix_t pfx_10("fd8f:69d8:c12c:ca62::3", 128); l3_binding *l3 = new l3_binding(itf, pfx_10); HW::item<bool> hw_l3_bind(true, rc_t::OK); HW::item<bool> hw_l3_unbind(false, rc_t::OK); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_bind, hw_ifh.data(), pfx_10)); TRY_CHECK_RC(OM::write(paulo, *l3)); ra_config ra(0, 1, 0, 4); @@ -1142,9 +1161,9 @@ BOOST_AUTO_TEST_CASE(test_ip6nd) { STRICT_ORDER_OFF(); ADD_EXPECT(ip6nd_ra_config::unconfig_cmd(hw_ip6nd_ra_config_unconfig, hw_ifh.data(), ra)); - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf_name)); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_unbind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf_name)); TRY_CHECK(OM::remove(paulo)); } @@ -1163,8 +1182,8 @@ BOOST_AUTO_TEST_CASE(test_interface_span) { interface::admin_state_t::UP); HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(elif, itf1)); /* @@ -1178,14 +1197,14 @@ BOOST_AUTO_TEST_CASE(test_interface_span) { HW::item<handle_t> hw_ifh2(4, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up2(interface::admin_state_t::UP, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up2, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up2, hw_ifh2)); TRY_CHECK_RC(OM::write(elif, itf2)); interface_span *itf_span = new interface_span(itf1, itf2, interface_span::state_t::TX_RX_ENABLED); HW::item<bool> hw_is_cfg(true, rc_t::OK); HW::item<bool> hw_is_uncfg(true, rc_t::OK); - ADD_EXPECT(interface_span::config_cmd(hw_is_cfg, hw_ifh.data(), hw_ifh2.data(), interface_span::state_t::TX_RX_ENABLED)); + ADD_EXPECT(interface_span_cmds::config_cmd(hw_is_cfg, hw_ifh.data(), hw_ifh2.data(), interface_span::state_t::TX_RX_ENABLED)); TRY_CHECK_RC(OM::write(elif, *itf_span)); HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); @@ -1193,11 +1212,11 @@ BOOST_AUTO_TEST_CASE(test_interface_span) { delete itf_span; STRICT_ORDER_OFF(); - ADD_EXPECT(interface_span::unconfig_cmd(hw_is_uncfg, hw_ifh.data(), hw_ifh2.data())); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down2, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_span_cmds::unconfig_cmd(hw_is_uncfg, hw_ifh.data(), hw_ifh2.data())); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down2, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name)); TRY_CHECK(OM::remove(elif)); } @@ -1219,8 +1238,8 @@ BOOST_AUTO_TEST_CASE(test_routing) { HW::item<route::table_id_t> hw_rd4_unbind(route::DEFAULT_TABLE, rc_t::OK); HW::item<route::table_id_t> hw_rd6_bind(1, rc_t::OK); HW::item<route::table_id_t> hw_rd7_unbind(route::DEFAULT_TABLE, rc_t::OK); - ADD_EXPECT(route_domain::create_cmd(hw_rd4_create, l3_proto_t::IPV4, 1)); - ADD_EXPECT(route_domain::create_cmd(hw_rd6_create, l3_proto_t::IPV6, 1)); + ADD_EXPECT(route_domain_cmds::create_cmd(hw_rd4_create, l3_proto_t::IPV4, 1)); + ADD_EXPECT(route_domain_cmds::create_cmd(hw_rd6_create, l3_proto_t::IPV6, 1)); TRY_CHECK_RC(OM::write(ian, rd4)); /* @@ -1233,8 +1252,8 @@ BOOST_AUTO_TEST_CASE(test_routing) { HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(ian, itf1)); std::string itf2_name = "af2"; @@ -1246,10 +1265,10 @@ BOOST_AUTO_TEST_CASE(test_routing) { HW::item<handle_t> hw_ifh2(4, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up2(interface::admin_state_t::UP, rc_t::OK); HW::item<interface::admin_state_t> hw_as_down2(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up2, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd4_bind, l3_proto_t::IPV4, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd6_bind, l3_proto_t::IPV6, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up2, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd4_bind, l3_proto_t::IPV4, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd6_bind, l3_proto_t::IPV6, hw_ifh2)); TRY_CHECK_RC(OM::write(ian, *itf2)); /* @@ -1259,13 +1278,13 @@ BOOST_AUTO_TEST_CASE(test_routing) { l3_binding *l3_10 = new l3_binding(itf1, pfx_10); HW::item<bool> hw_l3_10_bind(true, rc_t::OK); HW::item<bool> hw_l3_10_unbind(false, rc_t::OK); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_10_bind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_10_bind, hw_ifh.data(), pfx_10)); TRY_CHECK_RC(OM::write(ian, *l3_10)); route::prefix_t pfx_11("11.11.11.11", 24); l3_binding *l3_11 = new l3_binding(*itf2, pfx_11); HW::item<bool> hw_l3_11_bind(true, rc_t::OK); HW::item<bool> hw_l3_11_unbind(false, rc_t::OK); - ADD_EXPECT(l3_binding::bind_cmd(hw_l3_11_bind, hw_ifh2.data(), pfx_11)); + ADD_EXPECT(l3_binding_cmds::bind_cmd(hw_l3_11_bind, hw_ifh2.data(), pfx_11)); TRY_CHECK_RC(OM::write(ian, *l3_11)); /* @@ -1277,7 +1296,7 @@ BOOST_AUTO_TEST_CASE(test_routing) { route::ip_route *route_5 = new route::ip_route(pfx_5); route_5->add(*path_10); HW::item<bool> hw_route_5(true, rc_t::OK); - ADD_EXPECT(route::ip_route::update_cmd(hw_route_5, 0, pfx_5, {*path_10})); + ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5, 0, pfx_5, {*path_10})); TRY_CHECK_RC(OM::write(ian, *route_5)); /* @@ -1288,7 +1307,7 @@ BOOST_AUTO_TEST_CASE(test_routing) { route::ip_route *route_5_2 = new route::ip_route(rd4, pfx_5); route_5_2->add(*path_11); HW::item<bool> hw_route_5_2(true, rc_t::OK); - ADD_EXPECT(route::ip_route::update_cmd(hw_route_5_2, 1, pfx_5, {*path_11})); + ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5_2, 1, pfx_5, {*path_11})); TRY_CHECK_RC(OM::write(ian, *route_5_2)); /* @@ -1297,7 +1316,7 @@ BOOST_AUTO_TEST_CASE(test_routing) { HW::item<bool> hw_neighbour(true, rc_t::OK); mac_address_t mac_n({0,1,2,4,5,6}); neighbour *ne = new neighbour(itf1, mac_n, nh_10); - ADD_EXPECT(neighbour::create_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10)); + ADD_EXPECT(neighbour_cmds::create_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10)); TRY_CHECK_RC(OM::write(ian, *ne)); /* @@ -1308,7 +1327,7 @@ BOOST_AUTO_TEST_CASE(test_routing) { route::ip_route *route_dvr = new route::ip_route(pfx_6); route_dvr->add(*path_l2); HW::item<bool> hw_route_dvr(true, rc_t::OK); - ADD_EXPECT(route::ip_route::update_cmd(hw_route_dvr, 0, pfx_6, {*path_l2})); + ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_dvr, 0, pfx_6, {*path_l2})); TRY_CHECK_RC(OM::write(ian, *route_dvr)); STRICT_ORDER_OFF(); @@ -1324,20 +1343,20 @@ BOOST_AUTO_TEST_CASE(test_routing) { delete route_dvr; delete path_l2; delete ne; - ADD_EXPECT(neighbour::delete_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10)); - ADD_EXPECT(route::ip_route::delete_cmd(hw_route_dvr, 0, pfx_6)); - ADD_EXPECT(route::ip_route::delete_cmd(hw_route_5_2, 1, pfx_5)); - ADD_EXPECT(route::ip_route::delete_cmd(hw_route_5, 0, pfx_5)); - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_10_unbind, hw_ifh.data(), pfx_10)); - ADD_EXPECT(l3_binding::unbind_cmd(hw_l3_11_unbind, hw_ifh2.data(), pfx_11)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf1_name)); - ADD_EXPECT(interface::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV4, hw_ifh2)); - ADD_EXPECT(interface::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV6, hw_ifh2)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down2, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf2_name)); - ADD_EXPECT(route_domain::delete_cmd(hw_rd4_delete, l3_proto_t::IPV4, 1)); - ADD_EXPECT(route_domain::delete_cmd(hw_rd6_delete, l3_proto_t::IPV6, 1)); + ADD_EXPECT(neighbour_cmds::delete_cmd(hw_neighbour, hw_ifh.data(), mac_n, nh_10)); + ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_dvr, 0, pfx_6)); + ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5)); + ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5)); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_10_unbind, hw_ifh.data(), pfx_10)); + ADD_EXPECT(l3_binding_cmds::unbind_cmd(hw_l3_11_unbind, hw_ifh2.data(), pfx_11)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf1_name)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV4, hw_ifh2)); + ADD_EXPECT(interface_cmds::set_table_cmd(hw_rd4_unbind, l3_proto_t::IPV6, hw_ifh2)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down2, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf2_name)); + ADD_EXPECT(route_domain_cmds::delete_cmd(hw_rd4_delete, l3_proto_t::IPV4, 1)); + ADD_EXPECT(route_domain_cmds::delete_cmd(hw_rd6_delete, l3_proto_t::IPV6, 1)); TRY_CHECK(OM::remove(ian)); } @@ -1357,8 +1376,8 @@ BOOST_AUTO_TEST_CASE(test_nat) { HW::item<handle_t> hw_ifh(2, rc_t::OK); HW::item<interface::admin_state_t> hw_as_up(interface::admin_state_t::UP, rc_t::OK); HW::item<interface::admin_state_t> hw_as_down(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh, itf_in_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh, itf_in_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up, hw_ifh)); TRY_CHECK_RC(OM::write(gs, itf_in)); /* @@ -1373,8 +1392,8 @@ BOOST_AUTO_TEST_CASE(test_nat) { HW::item<interface::admin_state_t> hw_as_up2(interface::admin_state_t::UP, rc_t::OK); HW::item<interface::admin_state_t> hw_as_down2(interface::admin_state_t::DOWN, rc_t::OK); - ADD_EXPECT(interface::af_packet_create_cmd(hw_ifh2, itf_out_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_up2, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_create_cmd(hw_ifh2, itf_out_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_up2, hw_ifh2)); TRY_CHECK_RC(OM::write(gs, itf_out)); /* @@ -1386,7 +1405,7 @@ BOOST_AUTO_TEST_CASE(test_nat) { nat_static ns(in_addr, out_addr); HW::item<bool> hw_ns(true, rc_t::OK); - ADD_EXPECT(nat_static::create_44_cmd(hw_ns, 0, in_addr.to_v4(), out_addr)); + ADD_EXPECT(nat_static_cmds::create_44_cmd(hw_ns, 0, in_addr.to_v4(), out_addr)); TRY_CHECK_RC(OM::write(gs, ns)); /* @@ -1398,8 +1417,9 @@ BOOST_AUTO_TEST_CASE(test_nat) { nat_binding::zone_t::INSIDE); HW::item<bool> hw_nb_in(true, rc_t::OK); - ADD_EXPECT(nat_binding::bind_44_input_cmd(hw_nb_in, hw_ifh.data().value(), - nat_binding::zone_t::INSIDE)); + ADD_EXPECT(nat_binding_cmds::bind_44_input_cmd(hw_nb_in, + hw_ifh.data().value(), + nat_binding::zone_t::INSIDE)); TRY_CHECK_RC(OM::write(gs, *nb_in)); nat_binding *nb_out = new nat_binding(itf_out, @@ -1408,23 +1428,26 @@ BOOST_AUTO_TEST_CASE(test_nat) { nat_binding::zone_t::OUTSIDE); HW::item<bool> hw_nb_out(true, rc_t::OK); - ADD_EXPECT(nat_binding::bind_44_input_cmd(hw_nb_out, hw_ifh2.data().value(), - nat_binding::zone_t::OUTSIDE)); + ADD_EXPECT(nat_binding_cmds::bind_44_input_cmd(hw_nb_out, + hw_ifh2.data().value(), + nat_binding::zone_t::OUTSIDE)); TRY_CHECK_RC(OM::write(gs, *nb_out)); STRICT_ORDER_OFF(); delete nb_in; delete nb_out; - ADD_EXPECT(nat_binding::unbind_44_input_cmd(hw_nb_in, hw_ifh.data().value(), - nat_binding::zone_t::INSIDE)); - ADD_EXPECT(nat_binding::unbind_44_input_cmd(hw_nb_out, hw_ifh2.data().value(), - nat_binding::zone_t::OUTSIDE)); - ADD_EXPECT(nat_static::delete_44_cmd(hw_ns, 0, in_addr.to_v4(), out_addr)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down, hw_ifh)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh, itf_in_name)); - ADD_EXPECT(interface::state_change_cmd(hw_as_down2, hw_ifh2)); - ADD_EXPECT(interface::af_packet_delete_cmd(hw_ifh2, itf_out_name)); + ADD_EXPECT(nat_binding_cmds::unbind_44_input_cmd(hw_nb_in, + hw_ifh.data().value(), + nat_binding::zone_t::INSIDE)); + ADD_EXPECT(nat_binding_cmds::unbind_44_input_cmd(hw_nb_out, + hw_ifh2.data().value(), + nat_binding::zone_t::OUTSIDE)); + ADD_EXPECT(nat_static_cmds::delete_44_cmd(hw_ns, 0, in_addr.to_v4(), out_addr)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down, hw_ifh)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh, itf_in_name)); + ADD_EXPECT(interface_cmds::state_change_cmd(hw_as_down2, hw_ifh2)); + ADD_EXPECT(interface_cmds::af_packet_delete_cmd(hw_ifh2, itf_out_name)); TRY_CHECK(OM::remove(gs)); } @@ -1435,8 +1458,8 @@ BOOST_AUTO_TEST_CASE(test_interface_events) { HW::item<bool> hw_want(true, rc_t::OK); - ADD_EXPECT(interface::events_cmd(ml)); - cmd* itf = new interface::events_cmd(ml); + ADD_EXPECT(interface_cmds::events_cmd(ml)); + cmd* itf = new interface_cmds::events_cmd(ml); HW::enqueue(itf); HW::write(); |