[netpfga] re-introduce old parser, rename variables

This commit is contained in:
Nico Schottelius 2019-07-23 16:06:18 +02:00
parent 1be73a0e50
commit e6951c6210

View file

@ -45,23 +45,24 @@ struct digest_data_t {
// out user_metadata_t user_metadata,
// out digest_data_t digest_data,
// inout sume_metadata_t sume_metadata) {
// state start {
// b.extract(p.ethernet);
// user_metadata.unused = 0;
// digest_data.unused = 0;
// transition accept;
// }
// }
@Xilinx_MaxPacketRegion(1024)
parser TopParser(packet_in packet,
out headers hdr,
out metadata meta,
// out metadata meta,
out user_metadata_t user_metadata,
out digest_data_t digest_data,
inout sume_metadata_t standard_metadata) {
state start {
packet.extract(hdr.ethernet);
user_metadata.unused = 0;
digest_data.unused = 0;
#include "parsers.p4"
transition accept;
}
// #include "parsers.p4"
}
@ -87,6 +88,8 @@ control TopPipe(inout headers hdr,
// #include "actions_arp.p4" // includes v4_arp, v4_egress
// #include "actions_delta_checksum.p4" // non payload based checksumming
// apply {
// if(hdr.ipv6.isValid()) {
// if(nat64.apply().hit) { /* generic / static nat64 done */
@ -181,6 +184,13 @@ control TopPipe(inout headers hdr,
sume_metadata.dst_port = 1;
}
// action send_testdata_to_port1() {
// // python: MAC2 = "08:22:22:22:22:08"
// if(hdr.ethernet.dst_addr == 0x082222222208) {
// sume_metadata.dst_port = 1;
// }
// }
action send_to_all_ports() {
/* Taken from commands.txt of the "int" project:
table_cam_add_entry forward set_output_port 0xffffffffffff => 0b01010101
@ -245,11 +255,11 @@ control TopDeparser(packet_out packet,
// inout sume_metadata_t sume_metadata) {
// apply {
// packet.emit(hdr.ethernet);
// }
apply {
packet.emit(hdr.ethernet);
}
#include "deparser.p4"
// #include "deparser.p4"
}