48 lines
No EOL
1.2 KiB
Text
48 lines
No EOL
1.2 KiB
Text
#ifndef NICO_EGRESS
|
|
#define NICO_EGRESS
|
|
|
|
|
|
/********************** ROUTING (egress definiton) TABLES ***********************************/
|
|
|
|
action set_egress_port (port_t out_port) {
|
|
standard_metadata.egress_spec = out_port;
|
|
}
|
|
|
|
action set_egress_port_and_mac (port_t out_port, mac_addr_t mac_addr) {
|
|
hdr.ethernet.dst_addr = mac_addr;
|
|
standard_metadata.egress_spec = out_port;
|
|
}
|
|
|
|
table v6_networks {
|
|
key = {
|
|
hdr.ipv6.dst_addr: lpm;
|
|
}
|
|
actions = {
|
|
set_egress_port;
|
|
set_egress_port_and_mac;
|
|
controller_debug;
|
|
controller_reply;
|
|
controller_debug_table_id;
|
|
NoAction;
|
|
}
|
|
size = ROUTING_TABLE_SIZE;
|
|
|
|
default_action = controller_debug_table_id(TABLE_V6_NETWORKS);
|
|
}
|
|
|
|
table v4_networks {
|
|
key = {
|
|
hdr.ipv4.dst_addr: lpm;
|
|
}
|
|
actions = {
|
|
set_egress_port;
|
|
set_egress_port_and_mac;
|
|
controller_debug;
|
|
controller_debug_table_id;
|
|
NoAction;
|
|
}
|
|
size = ROUTING_TABLE_SIZE;
|
|
default_action = controller_debug_table_id(TABLE_V4_NETWORKS);
|
|
}
|
|
|
|
#endif |