Carmelo Cascone | c8d3486 | 2017-07-30 00:48:23 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Yi Tseng | 2162993 | 2017-06-06 11:17:43 -0700 | [diff] [blame] | 17 | #ifndef HEADERS |
| 18 | #define HEADERS |
Carmelo Cascone | 837e645 | 2017-07-19 20:35:22 -0400 | [diff] [blame] | 19 | |
| 20 | @controller_header("packet_in") |
| 21 | header packet_in_header_t { |
| 22 | bit<9> ingress_port; |
| 23 | } |
| 24 | |
| 25 | @controller_header("packet_out") |
| 26 | header packet_out_header_t { |
| 27 | bit<9> egress_port; |
| 28 | } |
| 29 | |
Yi Tseng | 2162993 | 2017-06-06 11:17:43 -0700 | [diff] [blame] | 30 | struct intrinsic_metadata_t { |
| 31 | bit<32> ingress_global_timestamp; |
| 32 | bit<32> lf_field_list; |
| 33 | bit<16> mcast_grp; |
| 34 | bit<16> egress_rid; |
| 35 | } |
| 36 | |
| 37 | header ethernet_t { |
| 38 | bit<48> dstAddr; |
| 39 | bit<48> srcAddr; |
| 40 | bit<16> etherType; |
| 41 | } |
| 42 | |
| 43 | header ipv4_t { |
| 44 | bit<4> version; |
| 45 | bit<4> ihl; |
| 46 | bit<8> diffserv; |
| 47 | bit<16> totalLen; |
| 48 | bit<16> identification; |
| 49 | bit<3> flags; |
| 50 | bit<13> fragOffset; |
| 51 | bit<8> ttl; |
| 52 | bit<8> protocol; |
| 53 | bit<16> hdrChecksum; |
| 54 | bit<32> srcAddr; |
| 55 | bit<32> dstAddr; |
| 56 | } |
| 57 | |
| 58 | header tcp_t { |
| 59 | bit<16> srcPort; |
| 60 | bit<16> dstPort; |
| 61 | bit<32> seqNo; |
| 62 | bit<32> ackNo; |
| 63 | bit<4> dataOffset; |
| 64 | bit<3> res; |
| 65 | bit<3> ecn; |
| 66 | bit<6> ctrl; |
| 67 | bit<16> window; |
| 68 | bit<16> checksum; |
| 69 | bit<16> urgentPtr; |
| 70 | } |
| 71 | |
| 72 | header udp_t { |
| 73 | bit<16> srcPort; |
| 74 | bit<16> dstPort; |
| 75 | bit<16> length_; |
| 76 | bit<16> checksum; |
| 77 | } |
| 78 | |
Carmelo Cascone | 837e645 | 2017-07-19 20:35:22 -0400 | [diff] [blame] | 79 | struct headers_t { |
Yi Tseng | 2162993 | 2017-06-06 11:17:43 -0700 | [diff] [blame] | 80 | ethernet_t ethernet; |
| 81 | ipv4_t ipv4; |
| 82 | tcp_t tcp; |
| 83 | udp_t udp; |
Carmelo Cascone | 837e645 | 2017-07-19 20:35:22 -0400 | [diff] [blame] | 84 | packet_out_header_t packet_out; |
| 85 | packet_in_header_t packet_in; |
Yi Tseng | 2162993 | 2017-06-06 11:17:43 -0700 | [diff] [blame] | 86 | } |
| 87 | #endif |