s/p/hdr/, add settings.h
This commit is contained in:
parent
4798778265
commit
4803b56e65
1 changed files with 8 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <core.p4>
|
#include <core.p4>
|
||||||
#include <sume_switch.p4>
|
#include <sume_switch.p4>
|
||||||
#include "headers.p4"
|
#include "headers.p4"
|
||||||
|
#include "settings.p4"
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Possible bugs / things to fix:
|
* Possible bugs / things to fix:
|
||||||
|
@ -53,7 +54,7 @@ parser TopParser(packet_in b,
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Main
|
* Main
|
||||||
*/
|
*/
|
||||||
control TopPipe(inout Parsed_packet p,
|
control TopPipe(inout Parsed_packet hdr,
|
||||||
inout metadata meta,
|
inout metadata meta,
|
||||||
inout digest_data_t digest_data,
|
inout digest_data_t digest_data,
|
||||||
inout sume_metadata_t sume_metadata) {
|
inout sume_metadata_t sume_metadata) {
|
||||||
|
@ -568,9 +569,9 @@ control TopPipe(inout Parsed_packet p,
|
||||||
|
|
||||||
|
|
||||||
action swap_eth_addresses() {
|
action swap_eth_addresses() {
|
||||||
EthAddr_t temp = p.ethernet.dstAddr;
|
EthAddr_t temp = hdr.ethernet.dstAddr;
|
||||||
p.ethernet.dstAddr = p.ethernet.srcAddr;
|
hdr.ethernet.dstAddr = hdr.ethernet.srcAddr;
|
||||||
p.ethernet.srcAddr = temp;
|
hdr.ethernet.srcAddr = temp;
|
||||||
|
|
||||||
/* set egress port */
|
/* set egress port */
|
||||||
sume_metadata.dst_port = sume_metadata.src_port;
|
sume_metadata.dst_port = sume_metadata.src_port;
|
||||||
|
@ -594,7 +595,7 @@ control TopPipe(inout Parsed_packet p,
|
||||||
// }
|
// }
|
||||||
|
|
||||||
action do_nothing() {
|
action do_nothing() {
|
||||||
EthAddr_t temp = p.ethernet.dstAddr;
|
EthAddr_t temp = hdr.ethernet.dstAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
table lookup_table {
|
table lookup_table {
|
||||||
|
@ -625,12 +626,12 @@ control TopPipe(inout Parsed_packet p,
|
||||||
|
|
||||||
@Xilinx_MaxPacketRegion(1024)
|
@Xilinx_MaxPacketRegion(1024)
|
||||||
control TopDeparser(packet_out b,
|
control TopDeparser(packet_out b,
|
||||||
in Parsed_packet p,
|
in Parsed_packet hdr,
|
||||||
in metadata meta,
|
in metadata meta,
|
||||||
inout digest_data_t digest_data,
|
inout digest_data_t digest_data,
|
||||||
inout sume_metadata_t sume_metadata) {
|
inout sume_metadata_t sume_metadata) {
|
||||||
apply {
|
apply {
|
||||||
b.emit(p.ethernet);
|
b.emit(hdr.ethernet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue