[netfpga] import generic parser
This commit is contained in:
parent
6e162ca63b
commit
cae8e6c7c0
1 changed files with 24 additions and 12 deletions
|
@ -33,21 +33,33 @@ struct digest_data_t {
|
|||
* Parser
|
||||
*/
|
||||
|
||||
@Xilinx_MaxPacketRegion(1024)
|
||||
parser TopParser(packet_in b,
|
||||
out Parsed_packet p,
|
||||
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;
|
||||
// @Xilinx_MaxPacketRegion(1024)
|
||||
// parser TopParser(packet_in b,
|
||||
// out Parsed_packet p,
|
||||
// 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;
|
||||
}
|
||||
// transition accept;
|
||||
// }
|
||||
// }
|
||||
|
||||
@Xilinx_MaxPacketRegion(1024)
|
||||
parser TopParser(packet_in packet,
|
||||
out headers hdr,
|
||||
out metadata meta,
|
||||
out digest_data_t digest_data,
|
||||
inout sume_metadata_t standard_metadata) {
|
||||
|
||||
#include "parsers.p4"
|
||||
digest_data.unused = 0; /* avoid compiler warning */
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
* Main
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue