master-thesis/p4src/actions_set_port_by_ip_ending.p4

12 lines
231 B
Text
Raw Normal View History

2019-07-29 14:29:12 +00:00
#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