2019-07-10 22:47:52 +02:00
|
|
|
#ifndef DUMMY_NETPFGA
|
|
|
|
#define DUMMY_NETPFGA
|
|
|
|
|
2019-07-17 17:41:54 +02:00
|
|
|
action send_to_port1() {
|
2019-07-29 16:35:05 +02:00
|
|
|
sume_metadata.dst_port = 1;
|
|
|
|
// sume_metadata.dst_port = 16;
|
2019-07-17 17:41:54 +02:00
|
|
|
}
|
|
|
|
|
2019-07-29 09:37:01 +02:00
|
|
|
action select_port_by_type() {
|
|
|
|
/*
|
|
|
|
>>> 0x86dd >> 11 v6
|
|
|
|
16
|
|
|
|
>>> 0x0800 >> 11 v4
|
|
|
|
1
|
|
|
|
>>> 0x0806 >> 11 ARP
|
|
|
|
1
|
|
|
|
*/
|
|
|
|
|
2019-07-29 09:40:20 +02:00
|
|
|
sume_metadata.dst_port = (bit<8>) (hdr.ethernet.ethertype >> 11);
|
2019-07-29 09:37:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-07-10 22:47:52 +02:00
|
|
|
table dummy_table_for_netpfga {
|
|
|
|
key = {
|
2019-07-29 16:35:05 +02:00
|
|
|
hdr.ethernet.ethertype: exact;
|
2019-07-10 22:47:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
send_to_port1;
|
2019-07-29 09:37:01 +02:00
|
|
|
select_port_by_type;
|
2019-07-29 16:35:05 +02:00
|
|
|
set_egress_port;
|
2019-07-10 22:47:52 +02:00
|
|
|
}
|
2019-07-28 20:08:28 +02:00
|
|
|
size = 64;
|
2019-07-29 09:37:01 +02:00
|
|
|
default_action = select_port_by_type; //send_to_port1;
|
2019-07-10 22:47:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|