12 lines
No EOL
231 B
Text
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 |