blob: c8fb31f9c24e6b637b33d102fec46e4359efbc1f [file] [log] [blame]
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001#ifndef __HEADERS_P4__
2#define __HEADERS_P4__
3
4#ifdef __TOFINO_BUILD__
5#include <tofino/intrinsic_metadata.p4>
6#endif
7
8header_type packet_in_t {
Carmelo Cascone4f011022017-06-05 01:41:02 -04009 fields {
Carmelo Cascone16de6db2017-08-22 00:27:57 +020010 ingress_port: 9;
11 }
12}
13
14header_type packet_out_t {
15 fields {
16 egress_port: 9;
Carmelo Cascone4f011022017-06-05 01:41:02 -040017 }
18}
19
20header_type ethernet_t {
21 fields {
22 dstAddr : 48;
23 srcAddr : 48;
24 etherType : 16;
25 }
26}
27
28header_type ipv4_t {
29 fields {
30 version : 4;
31 ihl : 4;
32 diffserv : 8;
33 totalLen : 16;
34 identification : 16;
35 flags : 3;
36 fragOffset : 13;
37 ttl : 8;
38 protocol : 8;
39 hdrChecksum : 16;
40 srcAddr : 32;
41 dstAddr: 32;
42 }
43}
44
45header_type tcp_t {
46 fields {
47 srcPort : 16;
48 dstPort : 16;
49 seqNo : 32;
50 ackNo : 32;
51 dataOffset : 4;
52 res : 3;
53 ecn : 3;
54 ctrl : 6;
55 window : 16;
56 checksum : 16;
57 urgentPtr : 16;
58 }
59}
60
61header_type udp_t {
62 fields {
63 srcPort : 16;
64 dstPort : 16;
65 length_ : 16;
66 checksum : 16;
67 }
Carmelo Cascone16de6db2017-08-22 00:27:57 +020068}
69
70#endif