Begin to implement egress handling, make controller usable, update notes

This commit is contained in:
Nico Schottelius 2019-02-23 14:22:46 +01:00
commit bec7dc548e
5 changed files with 81 additions and 7 deletions

View file

@ -8,5 +8,6 @@
#define THE_ANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING 42
#define ROUTING_TABLE_SIZE = 64 /* maximum routes per protocol */
#endif

View file

@ -13,11 +13,41 @@
*************************************************************************/
control MyIngress(inout headers hdr,
inout metadata meta,
inout standard_metadata_t standard_metadata) {
inout metadata meta,
inout standard_metadata_t standard_metadata) {
/********************** ROUTING (egress definiton) TABLES ***********************************/
action set_egress_port (port_t out_port) {
standard_metadata.egress_spec = out_port;
}
table v6_routing {
key = {
hdr.ipv6.dst_addr: lpm;
}
actions = {
set_egress_port;
NoAction;
}
size = ROUTING_TABLE_SIZE;
default_action = NoAction;
}
table v4_routing {
key = {
hdr.ipv4.dst_addr: lpm;
}
actions = {
set_egress_port;
NoAction;
}
size = ROUTING_TABLE_SIZE;
default_action = NoAction;
}
apply {
v6_routing.apply()
v4_routing.apply()
}
}