#include "vom/bond_group_binding_cmds.hpp"
#include "vom/l2_binding.hpp"
#include "vom/l2_binding_cmds.hpp"
+#include "vom/l2_vtr_cmds.hpp"
#include "vom/l2_xconnect.hpp"
#include "vom/l2_xconnect_cmds.hpp"
#include "vom/l3_binding.hpp"
#include "vom/sub_interface_cmds.hpp"
#include "vom/acl_ethertype.hpp"
#include "vom/acl_ethertype_cmds.hpp"
-#include "vom/acl_list.hpp"
+#include "vom/acl_l2_list.hpp"
+#include "vom/acl_l3_list.hpp"
#include "vom/acl_binding.hpp"
#include "vom/acl_list_cmds.hpp"
#include "vom/acl_binding_cmds.hpp"
{
rc = handle_derived<l2_binding_cmds::unbind_cmd>(f_exp, f_act);
}
- else if (typeid(*f_exp) == typeid(l2_binding_cmds::set_vtr_op_cmd))
+ else if (typeid(*f_exp) == typeid(l2_vtr_cmds::set_cmd))
{
- rc = handle_derived<l2_binding_cmds::set_vtr_op_cmd>(f_exp, f_act);
+ rc = handle_derived<l2_vtr_cmds::set_cmd>(f_exp, f_act);
}
else if (typeid(*f_exp) == typeid(l2_xconnect_cmds::bind_cmd))
{
TRY_CHECK_RC(OM::write(dante, bd1));
l2_binding *l2itf2 = new l2_binding(itf2, bd1);
- 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);
+ HW::item<l2_vtr::option_t> hw_set_vtr(l2_vtr::option_t::POP_1, rc_t::OK);
+ l2itf2->set(l2_vtr::option_t::POP_1, 68);
ADD_EXPECT(l2_binding_cmds::bind_cmd(hw_l2_bind,
hw_ifh2.data(),
hw_bd.data(),
l2_binding::l2_port_type_t::L2_PORT_TYPE_NORMAL));
- ADD_EXPECT(l2_binding_cmds::set_vtr_op_cmd(hw_set_vtr, hw_ifh2.data(), 68));
+ ADD_EXPECT(l2_vtr_cmds::set_cmd(hw_set_vtr, hw_ifh2.data(), 68));
TRY_CHECK_RC(OM::write(dante, *l2itf2));
// Add some static entries to the bridge-domain
* A route via interface 1 in the default table
*/
route::prefix_t pfx_5("5.5.5.5", 32);
+ boost::asio::ip::address nh_9 = boost::asio::ip::address::from_string("10.10.10.9");
+ route::path *path_9 = new route::path(nh_9, itf1);
boost::asio::ip::address nh_10 = boost::asio::ip::address::from_string("10.10.10.11");
route::path *path_10 = new route::path(nh_10, itf1);
route::ip_route *route_5 = new route::ip_route(pfx_5);
route_5->add(*path_10);
+ route_5->add(*path_9);
HW::item<bool> hw_route_5(true, rc_t::OK);
- ADD_EXPECT(route::ip_route_cmds::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_9));
+ ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5, 0, pfx_5, *path_10));
TRY_CHECK_RC(OM::write(ian, *route_5));
+ route_5->remove(*path_9);
+ ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5, *path_9));
+ TRY_CHECK_RC(OM::write(ian, *route_5));
+
+ delete path_9;
+
/*
* A route via interface 2 in the non-default table
*/
boost::asio::ip::address nh_11 = boost::asio::ip::address::from_string("11.11.11.10");
route::path *path_11 = new route::path(nh_11, *itf2);
+ boost::asio::ip::address nh_12 = boost::asio::ip::address::from_string("11.11.11.12");
+ route::path *path_12 = new route::path(nh_12, *itf2);
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_cmds::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));
+
+ route_5_2->add(*path_12);
+ ADD_EXPECT(route::ip_route_cmds::update_cmd(hw_route_5_2, 1, pfx_5, *path_12));
TRY_CHECK_RC(OM::write(ian, *route_5_2));
/*
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, nh_10, mac_n);
- ADD_EXPECT(neighbour_cmds::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,
+ neighbour::flags_t::STATIC));
TRY_CHECK_RC(OM::write(ian, *ne));
/*
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_cmds::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));
/*
delete l3_10;
delete itf2;
delete route_5;
- delete path_10;
delete route_5_2;
- delete path_11;
delete route_dvr;
- delete path_l2;
delete ne;
delete mroute_4;
delete mp1;
delete mp2;
- 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(neighbour_cmds::delete_cmd(hw_neighbour, hw_ifh.data(),
+ mac_n, nh_10,
+ neighbour::flags_t::STATIC));
+ ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_dvr, 0, pfx_6, *path_l2));
+ ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5, *path_11));
+ ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5_2, 1, pfx_5, *path_12));
+ ADD_EXPECT(route::ip_route_cmds::delete_cmd(hw_route_5, 0, pfx_5, *path_10));
+
+ delete path_10;
+ delete path_11;
+ delete path_12;
+ delete path_l2;
+
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));