diff --git a/netpfga/minip4/simple_sume_switch/bitfiles/program_switch.sh b/netpfga/minip4/simple_sume_switch/bitfiles/program_switch.sh old mode 100644 new mode 100755 diff --git a/p4src/minip4_solution.p4 b/p4src/minip4_solution.p4 index bed75ed..787874d 100644 --- a/p4src/minip4_solution.p4 +++ b/p4src/minip4_solution.p4 @@ -9,7 +9,10 @@ // bit<16> etherType; // } -typedef struct headers Parsed_packet; +//typedef struct headers Parsed_packet; + +#define Parsed_packet headers +#define user_metadata_t metadata //struct Parsed_packet { // Ethernet_h ethernet; @@ -17,9 +20,9 @@ typedef struct headers Parsed_packet; // user defined metadata: can be used to share information between // TopParser, TopPipe, and TopDeparser -struct user_metadata_t { - bit<8> unused; -} +//struct user_metadata_t { +// bit<8> unused; +//} // digest_data, MUST be 256 bits -- what is this used for? struct digest_data_t { @@ -38,7 +41,7 @@ parser RealParser( state start { packet.extract(hdr.ethernet); - meta.unused = 0; +// meta.unused = 0; digest_data.unused = 0; transition accept; } @@ -73,9 +76,9 @@ control RealMain( #include "actions_nat64_generic.p4" action swap_eth_addresses() { - EthAddr_t temp = hdr.ethernet.dstAddr; - hdr.ethernet.dstAddr = hdr.ethernet.srcAddr; - hdr.ethernet.srcAddr = temp; + mac_addr_t temp = hdr.ethernet.dst_addr; + hdr.ethernet.dst_addr = hdr.ethernet.src_addr; + hdr.ethernet.src_addr = temp; /* set egress port */ sume_metadata.dst_port = sume_metadata.src_port; @@ -98,12 +101,12 @@ control RealMain( } action do_nothing() { - EthAddr_t temp = hdr.ethernet.dstAddr; + mac_addr_t temp = hdr.ethernet.dst_addr; } table lookup_table { key = { - hdr.ethernet.dstAddr: exact; + hdr.ethernet.dst_addr: exact; } actions = {