master-thesis/p4src/actions_set_port_by_ip_ending.p4
2019-07-29 16:29:12 +02:00

12 lines
No EOL
231 B
Text

#ifndef PORT_BY_IP_ENDING
#define PORT_BY_IP_ENDING
if(hdr.ipv6.isValid()) {
set_egress_port((bit<8>) (hdr.ipv6.dst_addr & 0xff));
}
if(hdr.ipv4.isValid()) {
set_egress_port((bit<8>) (hdr.ipv4.dst_addr & 0xff));
}
#endif