From 267e5f40aac6fc7524203c7f8a05b1f86d1d961a Mon Sep 17 00:00:00 2001 From: Annika Hammervoll Date: Mon, 15 Oct 2018 14:35:04 +0200 Subject: [PATCH] Updating goldenfiles (Super_stack -> Interfaces) --- goldenfiles/assignments.cpp | 11 ++-- goldenfiles/cidr.cpp | 5 +- goldenfiles/config_options.cpp | 13 +++-- goldenfiles/conntrack.cpp | 7 ++- goldenfiles/conntrack_with_timeout.cpp | 5 +- .../conntrack_with_timeout_assignments.cpp | 5 +- goldenfiles/functions.cpp | 5 +- goldenfiles/gateway_with_forward_chain.cpp | 7 ++- .../gateway_with_send_time_exceeded.cpp | 7 ++- goldenfiles/iface.cpp | 19 ++++--- goldenfiles/iface_with_limits.cpp | 15 +++--- .../iface_without_network_configuration.cpp | 13 +++-- goldenfiles/lb.cpp | 7 ++- goldenfiles/lb_assignment_functionality.cpp | 7 ++- goldenfiles/lb_assignment_functionality_2.cpp | 7 ++- goldenfiles/lb_with_uplink.cpp | 9 ++-- goldenfiles/log.cpp | 5 +- goldenfiles/nacl.cpp | 17 +++--- goldenfiles/nacl_one_liner.cpp | 17 +++--- goldenfiles/nat_and_gateway.cpp | 7 ++- goldenfiles/syslog.cpp | 7 ++- goldenfiles/timers.cpp | 5 +- goldenfiles/vlan.cpp | 53 +++++++++---------- goldenfiles/vlan_routing.cpp | 15 +++--- goldenfiles/vlan_with_mac.cpp | 15 +++--- 25 files changed, 129 insertions(+), 154 deletions(-) diff --git a/goldenfiles/assignments.cpp b/goldenfiles/assignments.cpp index 82ed391..4b528e3 100644 --- a/goldenfiles/assignments.cpp +++ b/goldenfiles/assignments.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -67,9 +66,9 @@ return {nullptr, Filter_verdict_type::DROP}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.negotiate_dhcp(10.0, [ð1] (bool timedout) { if (timedout) { INFO("NaCl plugin interface eth1", "DHCP request timed out. Nothing to do."); @@ -78,8 +77,8 @@ void register_plugin_nacl() { INFO("NaCl plugin interface eth1", "IP address updated: %s", eth1.ip_addr().str().c_str()); }); // vlan vlan1 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 13), 0, 13); - auto& vlan1 = Super_stack::get(0, 13); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 13), 0, 13); + auto& vlan1 = Interfaces::get(0, 13); vlan1.network_config(IP4::addr{20,20,20,10}, IP4::addr{255,255,255,0}, 0); custom_made_classes_from_nacl::Another_Filter another_filter; diff --git a/goldenfiles/cidr.cpp b/goldenfiles/cidr.cpp index ecb6450..3cd0c52 100644 --- a/goldenfiles/cidr.cpp +++ b/goldenfiles/cidr.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -57,7 +56,7 @@ return {nullptr, Filter_verdict_type::DROP}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,50}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/config_options.cpp b/goldenfiles/config_options.cpp index 7812328..f635e98 100644 --- a/goldenfiles/config_options.cpp +++ b/goldenfiles/config_options.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -80,14 +79,14 @@ return {nullptr, Filter_verdict_type::DROP}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& s = Super_stack::get(3); + auto& s = Interfaces::get(3); s.negotiate_dhcp(10.0, [&s] (bool timedout) { if (timedout) { INFO("NaCl plugin interface s", "DHCP timeout (%s) - falling back to static configuration", s.ifname().c_str()); s.network_config(IP4::addr{10,0,0,60}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); } }); - auto& something_else = Super_stack::get(2); + auto& something_else = Interfaces::get(2); something_else.negotiate_dhcp(10.0, [&something_else] (bool timedout) { if (timedout) { INFO("NaCl plugin interface something_else", "DHCP request timed out. Nothing to do."); @@ -95,7 +94,7 @@ void register_plugin_nacl() { } INFO("NaCl plugin interface something_else", "IP address updated: %s", something_else.ip_addr().str().c_str()); }); - auto& something = Super_stack::get(1); + auto& something = Interfaces::get(1); something.negotiate_dhcp(10.0, [&something] (bool timedout) { if (timedout) { INFO("NaCl plugin interface something", "DHCP request timed out. Nothing to do."); @@ -103,14 +102,14 @@ void register_plugin_nacl() { } INFO("NaCl plugin interface something", "IP address updated: %s", something.ip_addr().str().c_str()); }); - auto& some_other = Super_stack::get(0); + auto& some_other = Interfaces::get(0); some_other.negotiate_dhcp(10.0, [&some_other] (bool timedout) { if (timedout) { INFO("NaCl plugin interface some_other", "DHCP timeout (%s) - falling back to static configuration", some_other.ifname().c_str()); some_other.network_config(IP4::addr{10,0,0,50}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); } }); - auto& eth0 = Super_stack::get(4); + auto& eth0 = Interfaces::get(4); eth0.network_config(IP4::addr{10,0,0,42}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/conntrack.cpp b/goldenfiles/conntrack.cpp index 86c91cb..ed68913 100644 --- a/goldenfiles/conntrack.cpp +++ b/goldenfiles/conntrack.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -59,9 +58,9 @@ return {nullptr, Filter_verdict_type::DROP}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,0,0,50}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/conntrack_with_timeout.cpp b/goldenfiles/conntrack_with_timeout.cpp index d5d773f..9c9a85b 100644 --- a/goldenfiles/conntrack_with_timeout.cpp +++ b/goldenfiles/conntrack_with_timeout.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -52,7 +51,7 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/conntrack_with_timeout_assignments.cpp b/goldenfiles/conntrack_with_timeout_assignments.cpp index 1a918db..0abc7ce 100644 --- a/goldenfiles/conntrack_with_timeout_assignments.cpp +++ b/goldenfiles/conntrack_with_timeout_assignments.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -52,7 +51,7 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/functions.cpp b/goldenfiles/functions.cpp index 8cb97e3..6288fb3 100644 --- a/goldenfiles/functions.cpp +++ b/goldenfiles/functions.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -148,7 +147,7 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,50}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::My_Ip_Filter my_ip_filter; diff --git a/goldenfiles/gateway_with_forward_chain.cpp b/goldenfiles/gateway_with_forward_chain.cpp index ed2a58e..ae53126 100644 --- a/goldenfiles/gateway_with_forward_chain.cpp +++ b/goldenfiles/gateway_with_forward_chain.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -90,9 +89,9 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,10,10,50}, IP4::addr{255,255,255,0}, 0); custom_made_classes_from_nacl::Gw_Second_Forwarding_Filter gw_second_forwarding_filter; diff --git a/goldenfiles/gateway_with_send_time_exceeded.cpp b/goldenfiles/gateway_with_send_time_exceeded.cpp index a1be4b6..a2f6487 100644 --- a/goldenfiles/gateway_with_send_time_exceeded.cpp +++ b/goldenfiles/gateway_with_send_time_exceeded.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -65,9 +64,9 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,10,10,50}, IP4::addr{255,255,255,0}, 0); diff --git a/goldenfiles/iface.cpp b/goldenfiles/iface.cpp index 1b841b8..7774faa 100644 --- a/goldenfiles/iface.cpp +++ b/goldenfiles/iface.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -57,25 +56,25 @@ void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); // vlan my_other_vlan - Super_stack::inet().create(VLAN_manager::get(1).add(hw::Devices::nic(1), 20), 1, 20); - auto& my_other_vlan = Super_stack::get(1, 20); + Interfaces::create(VLAN_manager::get(1).add(hw::Devices::nic(1), 20), 1, 20); + auto& my_other_vlan = Interfaces::get(1, 20); my_other_vlan.network_config(IP4::addr{10,20,10,10}, IP4::addr{255,255,255,0}, 0); // vlan my_vlan0 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 10), 0, 10); - auto& my_vlan0 = Super_stack::get(0, 10); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 10), 0, 10); + auto& my_vlan0 = Interfaces::get(0, 10); my_vlan0.network_config(IP4::addr{10,10,10,10}, IP4::addr{255,255,255,0}, 0); // vlan my_vlan1 - Super_stack::inet().create(VLAN_manager::get(1).add(hw::Devices::nic(1), 10), 1, 10); - auto& my_vlan1 = Super_stack::get(1, 10); + Interfaces::create(VLAN_manager::get(1).add(hw::Devices::nic(1), 10), 1, 10); + auto& my_vlan1 = Interfaces::get(1, 10); my_vlan1.network_config(IP4::addr{10,10,10,10}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.negotiate_dhcp(10.0, [ð1] (bool timedout) { if (timedout) { INFO("NaCl plugin interface eth1", "DHCP timeout (%s) - falling back to static configuration", eth1.ifname().c_str()); eth1.network_config(IP4::addr{10,0,0,50}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); } }); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); custom_made_classes_from_nacl::My_Filter my_filter; diff --git a/goldenfiles/iface_with_limits.cpp b/goldenfiles/iface_with_limits.cpp index 6fcfc31..4c73b6d 100644 --- a/goldenfiles/iface_with_limits.cpp +++ b/goldenfiles/iface_with_limits.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,15 +37,15 @@ void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); // vlan vlan1 - Super_stack::inet().create(VLAN_manager::get(4).add(hw::Devices::nic(4), 1), 4, 1); - auto& vlan1 = Super_stack::get(4, 1); + Interfaces::create(VLAN_manager::get(4).add(hw::Devices::nic(4), 1), 4, 1); + auto& vlan1 = Interfaces::get(4, 1); vlan1.network_config(IP4::addr{10,0,10,10}, IP4::addr{255,255,255,0}, 0); - auto& eth3 = Super_stack::get(3); + auto& eth3 = Interfaces::get(3); eth3.network_config(IP4::addr{10,0,0,75}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth2 = Super_stack::get(2); + auto& eth2 = Interfaces::get(2); eth2.network_config(IP4::addr{10,0,0,65}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); eth2.nic().set_buffer_limit(1000); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.negotiate_dhcp(10.0, [ð1] (bool timedout) { if (timedout) { INFO("NaCl plugin interface eth1", "DHCP timeout (%s) - falling back to static configuration", eth1.ifname().c_str()); @@ -54,7 +53,7 @@ void register_plugin_nacl() { } }); eth1.nic().set_sendq_limit(1000); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); eth0.nic().set_sendq_limit(1000); eth0.nic().set_buffer_limit(1000); diff --git a/goldenfiles/iface_without_network_configuration.cpp b/goldenfiles/iface_without_network_configuration.cpp index c519c98..b15aff9 100644 --- a/goldenfiles/iface_without_network_configuration.cpp +++ b/goldenfiles/iface_without_network_configuration.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,14 +37,14 @@ void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); // vlan vlan1 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 10), 0, 10); - auto& vlan1 = Super_stack::get(0, 10); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 10), 0, 10); + auto& vlan1 = Interfaces::get(0, 10); vlan1.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, 0); // vlan vlan2 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 11), 0, 11); - auto& vlan2 = Super_stack::get(0, 11); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 11), 0, 11); + auto& vlan2 = Interfaces::get(0, 11); vlan2.network_config(IP4::addr{10,0,0,46}, IP4::addr{255,255,255,0}, 0); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.nic().set_sendq_limit(100); eth0.nic().set_buffer_limit(100); diff --git a/goldenfiles/lb.cpp b/goldenfiles/lb.cpp index 15cd928..4185a01 100644 --- a/goldenfiles/lb.cpp +++ b/goldenfiles/lb.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,9 +37,9 @@ static microLB::Balancer* nacl_lb_obj = nullptr; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& outside = Super_stack::get(0); + auto& outside = Interfaces::get(0); outside.network_config(IP4::addr{10,20,17,71}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); - auto& inside = Super_stack::get(1); + auto& inside = Interfaces::get(1); inside.network_config(IP4::addr{10,20,17,72}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); diff --git a/goldenfiles/lb_assignment_functionality.cpp b/goldenfiles/lb_assignment_functionality.cpp index deda67a..6749d05 100644 --- a/goldenfiles/lb_assignment_functionality.cpp +++ b/goldenfiles/lb_assignment_functionality.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,9 +37,9 @@ static microLB::Balancer* nacl_lb_obj = nullptr; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& inside = Super_stack::get(1); + auto& inside = Interfaces::get(1); inside.network_config(IP4::addr{10,20,17,72}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); - auto& outside = Super_stack::get(0); + auto& outside = Interfaces::get(0); outside.network_config(IP4::addr{10,20,17,71}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); diff --git a/goldenfiles/lb_assignment_functionality_2.cpp b/goldenfiles/lb_assignment_functionality_2.cpp index deda67a..6749d05 100644 --- a/goldenfiles/lb_assignment_functionality_2.cpp +++ b/goldenfiles/lb_assignment_functionality_2.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,9 +37,9 @@ static microLB::Balancer* nacl_lb_obj = nullptr; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& inside = Super_stack::get(1); + auto& inside = Interfaces::get(1); inside.network_config(IP4::addr{10,20,17,72}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); - auto& outside = Super_stack::get(0); + auto& outside = Interfaces::get(0); outside.network_config(IP4::addr{10,20,17,71}, IP4::addr{255,255,255,0}, IP4::addr{10,20,17,1}); diff --git a/goldenfiles/lb_with_uplink.cpp b/goldenfiles/lb_with_uplink.cpp index f61458e..6505219 100644 --- a/goldenfiles/lb_with_uplink.cpp +++ b/goldenfiles/lb_with_uplink.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,11 +37,11 @@ static microLB::Balancer* nacl_lb_obj = nullptr; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& outside = Super_stack::get(1); + auto& outside = Interfaces::get(1); outside.network_config(IP4::addr{10,0,0,43}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& inside = Super_stack::get(2); + auto& inside = Interfaces::get(2); inside.network_config(IP4::addr{10,0,0,44}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& uplink = Super_stack::get(0); + auto& uplink = Interfaces::get(0); uplink.network_config(IP4::addr{10,0,0,42}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); diff --git a/goldenfiles/log.cpp b/goldenfiles/log.cpp index 2c39ca8..c90669f 100644 --- a/goldenfiles/log.cpp +++ b/goldenfiles/log.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -93,7 +92,7 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); custom_made_classes_from_nacl::Ip_Filter ip_filter; diff --git a/goldenfiles/nacl.cpp b/goldenfiles/nacl.cpp index 6c54b27..677a4be 100644 --- a/goldenfiles/nacl.cpp +++ b/goldenfiles/nacl.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -562,15 +561,15 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth4 = Super_stack::get(3); + auto& eth4 = Interfaces::get(3); eth4.network_config(IP4::addr{10,0,0,203}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth3 = Super_stack::get(2); + auto& eth3 = Interfaces::get(2); eth3.network_config(IP4::addr{10,0,0,102}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth1 = Super_stack::get(5); + auto& eth1 = Interfaces::get(5); eth1.network_config(IP4::addr{10,0,0,80}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth0 = Super_stack::get(4); + auto& eth0 = Interfaces::get(4); eth0.network_config(IP4::addr{10,0,0,40}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); - auto& eth2 = Super_stack::get(6); + auto& eth2 = Interfaces::get(6); eth2.negotiate_dhcp(10.0, [ð2] (bool timedout) { if (timedout) { INFO("NaCl plugin interface eth2", "DHCP request timed out. Nothing to do."); @@ -578,9 +577,9 @@ void register_plugin_nacl() { } INFO("NaCl plugin interface eth2", "IP address updated: %s", eth2.ip_addr().str().c_str()); }); - auto& eth_test_2 = Super_stack::get(1); + auto& eth_test_2 = Interfaces::get(1); eth_test_2.network_config(IP4::addr{10,0,0,99}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{10,10,10,10}); - auto& eth_test_1 = Super_stack::get(0); + auto& eth_test_1 = Interfaces::get(0); eth_test_1.network_config(IP4::addr{10,0,0,130}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{9,9,9,9}); custom_made_classes_from_nacl::Encapsulating_Ip_Filter encapsulating_ip_filter; diff --git a/goldenfiles/nacl_one_liner.cpp b/goldenfiles/nacl_one_liner.cpp index 6c54b27..677a4be 100644 --- a/goldenfiles/nacl_one_liner.cpp +++ b/goldenfiles/nacl_one_liner.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -562,15 +561,15 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth4 = Super_stack::get(3); + auto& eth4 = Interfaces::get(3); eth4.network_config(IP4::addr{10,0,0,203}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth3 = Super_stack::get(2); + auto& eth3 = Interfaces::get(2); eth3.network_config(IP4::addr{10,0,0,102}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth1 = Super_stack::get(5); + auto& eth1 = Interfaces::get(5); eth1.network_config(IP4::addr{10,0,0,80}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth0 = Super_stack::get(4); + auto& eth0 = Interfaces::get(4); eth0.network_config(IP4::addr{10,0,0,40}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{8,8,8,8}); - auto& eth2 = Super_stack::get(6); + auto& eth2 = Interfaces::get(6); eth2.negotiate_dhcp(10.0, [ð2] (bool timedout) { if (timedout) { INFO("NaCl plugin interface eth2", "DHCP request timed out. Nothing to do."); @@ -578,9 +577,9 @@ void register_plugin_nacl() { } INFO("NaCl plugin interface eth2", "IP address updated: %s", eth2.ip_addr().str().c_str()); }); - auto& eth_test_2 = Super_stack::get(1); + auto& eth_test_2 = Interfaces::get(1); eth_test_2.network_config(IP4::addr{10,0,0,99}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{10,10,10,10}); - auto& eth_test_1 = Super_stack::get(0); + auto& eth_test_1 = Interfaces::get(0); eth_test_1.network_config(IP4::addr{10,0,0,130}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}, IP4::addr{9,9,9,9}); custom_made_classes_from_nacl::Encapsulating_Ip_Filter encapsulating_ip_filter; diff --git a/goldenfiles/nat_and_gateway.cpp b/goldenfiles/nat_and_gateway.cpp index bfac385..cfb5b64 100644 --- a/goldenfiles/nat_and_gateway.cpp +++ b/goldenfiles/nat_and_gateway.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -65,9 +64,9 @@ return {std::move(pckt), Filter_verdict_type::ACCEPT}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,10,10,50}, IP4::addr{255,255,255,0}, 0); diff --git a/goldenfiles/syslog.cpp b/goldenfiles/syslog.cpp index e6991f9..78d39e4 100644 --- a/goldenfiles/syslog.cpp +++ b/goldenfiles/syslog.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include @@ -67,9 +66,9 @@ return {nullptr, Filter_verdict_type::DROP}; void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& uplink = Super_stack::get(0); + auto& uplink = Interfaces::get(0); uplink.network_config(IP4::addr{10,0,0,40}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); - auto& eth0 = Super_stack::get(1); + auto& eth0 = Interfaces::get(1); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); // Init syslog over UDP diff --git a/goldenfiles/timers.cpp b/goldenfiles/timers.cpp index 4350ce1..1c82a03 100644 --- a/goldenfiles/timers.cpp +++ b/goldenfiles/timers.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -123,7 +122,7 @@ namespace nacl { void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); diff --git a/goldenfiles/vlan.cpp b/goldenfiles/vlan.cpp index ce6a7d0..e2dda02 100644 --- a/goldenfiles/vlan.cpp +++ b/goldenfiles/vlan.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -38,54 +37,54 @@ void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); // vlan vlan2_eth4 - Super_stack::inet().create(VLAN_manager::get(4).add(hw::Devices::nic(4), 63), 4, 63); - auto& vlan2_eth4 = Super_stack::get(4, 63); + Interfaces::create(VLAN_manager::get(4).add(hw::Devices::nic(4), 63), 4, 63); + auto& vlan2_eth4 = Interfaces::get(4, 63); vlan2_eth4.network_config(IP4::addr{10,200,100,3}, IP4::addr{255,255,255,0}, 0); // vlan vlan2_eth3 - Super_stack::inet().create(VLAN_manager::get(3).add(hw::Devices::nic(3), 23), 3, 23); - auto& vlan2_eth3 = Super_stack::get(3, 23); + Interfaces::create(VLAN_manager::get(3).add(hw::Devices::nic(3), 23), 3, 23); + auto& vlan2_eth3 = Interfaces::get(3, 23); vlan2_eth3.network_config(IP4::addr{10,100,0,20}, IP4::addr{255,255,255,0}, 0); // vlan vlan2_eth2 - Super_stack::inet().create(VLAN_manager::get(2).add(hw::Devices::nic(2), 23), 2, 23); - auto& vlan2_eth2 = Super_stack::get(2, 23); + Interfaces::create(VLAN_manager::get(2).add(hw::Devices::nic(2), 23), 2, 23); + auto& vlan2_eth2 = Interfaces::get(2, 23); vlan2_eth2.network_config(IP4::addr{10,100,0,20}, IP4::addr{255,255,255,0}, 0); // vlan vlan1_eth4 - Super_stack::inet().create(VLAN_manager::get(4).add(hw::Devices::nic(4), 62), 4, 62); - auto& vlan1_eth4 = Super_stack::get(4, 62); + Interfaces::create(VLAN_manager::get(4).add(hw::Devices::nic(4), 62), 4, 62); + auto& vlan1_eth4 = Interfaces::get(4, 62); vlan1_eth4.network_config(IP4::addr{10,200,100,2}, IP4::addr{255,255,255,0}, 0); - auto& eth3 = Super_stack::get(3); + auto& eth3 = Interfaces::get(3); eth3.network_config(IP4::addr{10,100,100,100}, IP4::addr{255,255,255,0}, IP4::addr{100,100,100,1}); // vlan no1 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 2), 0, 2); - auto& no1 = Super_stack::get(0, 2); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 2), 0, 2); + auto& no1 = Interfaces::get(0, 2); no1.network_config(IP4::addr{10,60,0,10}, IP4::addr{255,255,255,0}, 0); // vlan vlan1_eth2 - Super_stack::inet().create(VLAN_manager::get(2).add(hw::Devices::nic(2), 22), 2, 22); - auto& vlan1_eth2 = Super_stack::get(2, 22); + Interfaces::create(VLAN_manager::get(2).add(hw::Devices::nic(2), 22), 2, 22); + auto& vlan1_eth2 = Interfaces::get(2, 22); vlan1_eth2.network_config(IP4::addr{10,100,0,10}, IP4::addr{255,255,255,0}, 0); // vlan no2 - Super_stack::inet().create(VLAN_manager::get(1).add(hw::Devices::nic(1), 13), 1, 13); - auto& no2 = Super_stack::get(1, 13); + Interfaces::create(VLAN_manager::get(1).add(hw::Devices::nic(1), 13), 1, 13); + auto& no2 = Interfaces::get(1, 13); no2.network_config(IP4::addr{10,50,0,20}, IP4::addr{255,255,255,0}, 0); // vlan no3 - Super_stack::inet().create(VLAN_manager::get(1).add(hw::Devices::nic(1), 24), 1, 24); - auto& no3 = Super_stack::get(1, 24); + Interfaces::create(VLAN_manager::get(1).add(hw::Devices::nic(1), 24), 1, 24); + auto& no3 = Interfaces::get(1, 24); no3.network_config(IP4::addr{10,60,0,20}, IP4::addr{255,255,255,0}, 0); // vlan vlan1_eth3 - Super_stack::inet().create(VLAN_manager::get(3).add(hw::Devices::nic(3), 24), 3, 24); - auto& vlan1_eth3 = Super_stack::get(3, 24); + Interfaces::create(VLAN_manager::get(3).add(hw::Devices::nic(3), 24), 3, 24); + auto& vlan1_eth3 = Interfaces::get(3, 24); vlan1_eth3.network_config(IP4::addr{10,100,0,10}, IP4::addr{255,255,255,0}, 0); - auto& eth4 = Super_stack::get(4); + auto& eth4 = Interfaces::get(4); eth4.network_config(IP4::addr{10,200,100,100}, IP4::addr{255,255,255,0}, IP4::addr{100,200,100,1}); // vlan no0 - Super_stack::inet().create(VLAN_manager::get(0).add(hw::Devices::nic(0), 5), 0, 5); - auto& no0 = Super_stack::get(0, 5); + Interfaces::create(VLAN_manager::get(0).add(hw::Devices::nic(0), 5), 0, 5); + auto& no0 = Interfaces::get(0, 5); no0.network_config(IP4::addr{10,50,0,10}, IP4::addr{255,255,255,0}, 0); - auto& eth2 = Super_stack::get(2); + auto& eth2 = Interfaces::get(2); eth2.network_config(IP4::addr{10,10,10,50}, IP4::addr{255,255,255,0}, IP4::addr{10,10,10,1}); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,0,10,45}, IP4::addr{255,255,255,0}, IP4::addr{10,0,10,1}); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,30}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1}); } diff --git a/goldenfiles/vlan_routing.cpp b/goldenfiles/vlan_routing.cpp index 9dccce8..9d6fd38 100644 --- a/goldenfiles/vlan_routing.cpp +++ b/goldenfiles/vlan_routing.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -41,16 +40,16 @@ void register_plugin_nacl() { INFO("NaCl", "Registering NaCl plugin"); // vlan vlan1 - Super_stack::inet().create(VLAN_manager::get(1).add(hw::Devices::nic(1), 2), 1, 2); - auto& vlan1 = Super_stack::get(1, 2); + Interfaces::create(VLAN_manager::get(1).add(hw::Devices::nic(1), 2), 1, 2); + auto& vlan1 = Interfaces::get(1, 2); vlan1.network_config(IP4::addr{10,100,0,50}, IP4::addr{255,255,255,0}, 0); // vlan vlan2 - Super_stack::inet().create(VLAN_manager::get(2).add(hw::Devices::nic(2), 2), 2, 2); - auto& vlan2 = Super_stack::get(2, 2); + Interfaces::create(VLAN_manager::get(2).add(hw::Devices::nic(2), 2), 2, 2); + auto& vlan2 = Interfaces::get(2, 2); vlan2.network_config(IP4::addr{10,100,1,50}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get(1); + auto& eth1 = Interfaces::get(1); eth1.network_config(IP4::addr{10,0,0,41}, IP4::addr{255,255,255,0}, 0); - auto& eth0 = Super_stack::get(0); + auto& eth0 = Interfaces::get(0); eth0.network_config(IP4::addr{10,0,0,40}, IP4::addr{255,255,255,0}, 0); diff --git a/goldenfiles/vlan_with_mac.cpp b/goldenfiles/vlan_with_mac.cpp index 671b97e..6346e8a 100644 --- a/goldenfiles/vlan_with_mac.cpp +++ b/goldenfiles/vlan_with_mac.cpp @@ -17,8 +17,7 @@ // Autogenerated by NaCl #include -#include -#include +#include #include #include #include @@ -42,17 +41,17 @@ void register_plugin_nacl() { // vlan vlan1 int index_vlan1 = hw::Devices::nic_index(MAC::Addr("c0:01:0a:00:00:2d")); - Super_stack::inet().create(VLAN_manager::get(index_vlan1).add(hw::Devices::nic(index_vlan1), 2), index_vlan1, 2); - auto& vlan1 = Super_stack::get(index_vlan1, 2); + Interfaces::create(VLAN_manager::get(index_vlan1).add(hw::Devices::nic(index_vlan1), 2), index_vlan1, 2); + auto& vlan1 = Interfaces::get(index_vlan1, 2); vlan1.network_config(IP4::addr{10,100,0,50}, IP4::addr{255,255,255,0}, 0); // vlan vlan2 int index_vlan2 = hw::Devices::nic_index(MAC::Addr("c0:01:0a:00:00:3e")); - Super_stack::inet().create(VLAN_manager::get(index_vlan2).add(hw::Devices::nic(index_vlan2), 2), index_vlan2, 2); - auto& vlan2 = Super_stack::get(index_vlan2, 2); + Interfaces::create(VLAN_manager::get(index_vlan2).add(hw::Devices::nic(index_vlan2), 2), index_vlan2, 2); + auto& vlan2 = Interfaces::get(index_vlan2, 2); vlan2.network_config(IP4::addr{10,100,1,50}, IP4::addr{255,255,255,0}, 0); - auto& eth1 = Super_stack::get("c0:01:0a:00:00:2d"); + auto& eth1 = Interfaces::get("c0:01:0a:00:00:2d"); eth1.network_config(IP4::addr{10,0,0,41}, IP4::addr{255,255,255,0}, 0); - auto& eth0 = Super_stack::get("c0:01:0a:00:00:1c"); + auto& eth0 = Interfaces::get("c0:01:0a:00:00:1c"); eth0.network_config(IP4::addr{10,0,0,40}, IP4::addr{255,255,255,0}, 0);