s/p/hdr/, add settings.h

This commit is contained in:
Nico Schottelius 2019-06-24 13:11:12 +02:00
parent 4798778265
commit 4803b56e65

View file

@ -1,6 +1,7 @@
#include <core.p4>
#include <sume_switch.p4>
#include "headers.p4"
#include "settings.p4"
/********************************************************************************
* Possible bugs / things to fix:
@ -53,7 +54,7 @@ parser TopParser(packet_in b,
/********************************************************************************
* Main
*/
control TopPipe(inout Parsed_packet p,
control TopPipe(inout Parsed_packet hdr,
inout metadata meta,
inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) {
@ -568,9 +569,9 @@ control TopPipe(inout Parsed_packet p,
action swap_eth_addresses() {
EthAddr_t temp = p.ethernet.dstAddr;
p.ethernet.dstAddr = p.ethernet.srcAddr;
p.ethernet.srcAddr = temp;
EthAddr_t temp = hdr.ethernet.dstAddr;
hdr.ethernet.dstAddr = hdr.ethernet.srcAddr;
hdr.ethernet.srcAddr = temp;
/* set egress port */
sume_metadata.dst_port = sume_metadata.src_port;
@ -594,7 +595,7 @@ control TopPipe(inout Parsed_packet p,
// }
action do_nothing() {
EthAddr_t temp = p.ethernet.dstAddr;
EthAddr_t temp = hdr.ethernet.dstAddr;
}
table lookup_table {
@ -625,12 +626,12 @@ control TopPipe(inout Parsed_packet p,
@Xilinx_MaxPacketRegion(1024)
control TopDeparser(packet_out b,
in Parsed_packet p,
in Parsed_packet hdr,
in metadata meta,
inout digest_data_t digest_data,
inout sume_metadata_t sume_metadata) {
apply {
b.emit(p.ethernet);
b.emit(hdr.ethernet);
}
}