Skip to content

Commit

Permalink
Merge pull request #67 from AnnikaH/master
Browse files Browse the repository at this point in the history
Updating goldenfiles (Super_stack -> Interfaces)
  • Loading branch information
AnnikaH authored Oct 15, 2018
2 parents e3500ac + 267e5f4 commit 0af7dac
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 154 deletions.
11 changes: 5 additions & 6 deletions goldenfiles/assignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/router.hpp>
#include <net/vlan_manager.hpp>
Expand Down Expand Up @@ -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, [&eth1] (bool timedout) {
if (timedout) {
INFO("NaCl plugin interface eth1", "DHCP request timed out. Nothing to do.");
Expand All @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions goldenfiles/cidr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -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;
Expand Down
13 changes: 6 additions & 7 deletions goldenfiles/config_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -80,37 +79,37 @@ 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.");
return;
}
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.");
return;
}
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;
Expand Down
7 changes: 3 additions & 4 deletions goldenfiles/conntrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions goldenfiles/conntrack_with_timeout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions goldenfiles/conntrack_with_timeout_assignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions goldenfiles/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <syslogd>

Expand Down Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions goldenfiles/gateway_with_forward_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/nat/napt.hpp>
#include <net/router.hpp>
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions goldenfiles/gateway_with_send_time_exceeded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/nat/napt.hpp>
#include <net/router.hpp>
Expand Down Expand Up @@ -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);


Expand Down
19 changes: 9 additions & 10 deletions goldenfiles/iface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/nat/napt.hpp>
#include <net/vlan_manager.hpp>
Expand Down Expand Up @@ -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, [&eth1] (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;
Expand Down
15 changes: 7 additions & 8 deletions goldenfiles/iface_with_limits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/vlan_manager.hpp>
#include <hw/devices.hpp>
Expand All @@ -38,23 +37,23 @@ 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, [&eth1] (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,55}, IP4::addr{255,255,255,0}, IP4::addr{10,0,0,1});
}
});
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);
Expand Down
13 changes: 6 additions & 7 deletions goldenfiles/iface_without_network_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <net/vlan_manager.hpp>
#include <hw/devices.hpp>
Expand All @@ -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);

Expand Down
7 changes: 3 additions & 4 deletions goldenfiles/lb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <microLB>
#include <syslogd>
Expand All @@ -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});


Expand Down
7 changes: 3 additions & 4 deletions goldenfiles/lb_assignment_functionality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// Autogenerated by NaCl

#include <iostream>
#include <net/inet>
#include <net/super_stack.hpp>
#include <net/interfaces>
#include <net/ip4/cidr.hpp>
#include <microLB>
#include <syslogd>
Expand All @@ -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});


Expand Down
Loading

0 comments on commit 0af7dac

Please sign in to comment.