Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
header.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
27 #ifndef HICN_HEADER_H
28 #define HICN_HEADER_H
29 
30 #include "common.h"
31 #include "protocol.h"
32 
33 typedef struct
34 {
35  _ipv6_header_t ip;
36  union
37  {
38  _tcp_header_t tcp;
39  _icmp_header_t icmp;
41  };
43 
44 typedef struct
45 {
46  _ipv6_header_t ip;
47  union
48  {
49  struct
50  {
51  _tcp_header_t tcp;
52  _ah_header_t ah;
53  };
54  struct
55  {
56  _icmp_header_t icmp;
57  _ah_header_t icmp_ah;
58  };
59  };
61 
62 typedef struct
63 {
64  _ipv4_header_t ip;
65  union
66  {
67  _tcp_header_t tcp;
68  _icmp_header_t icmp;
70  };
72 
73 typedef struct
74 {
75  _ipv4_header_t ip;
76  union
77  {
78  struct
79  {
80  _tcp_header_t tcp;
81  _ah_header_t ah;
82  };
83  struct
84  {
85  _icmp_header_t icmp;
86  _ah_header_t icmp_ah;
87  };
88  };
90 
91 typedef union
92 {
93  /* To deprecate as redundant with hicn_type_t */
94  hicn_v6_hdr_t v6;
95  hicn_v6ah_hdr_t v6ah;
96  hicn_v4_hdr_t v4;
97  hicn_v4ah_hdr_t v4ah;
98 
99  hicn_protocol_t protocol;
100 } hicn_header_t;
101 
102 
103 #define HICN_V6_TCP_HDRLEN (IPV6_HDRLEN + TCP_HDRLEN)
104 #define HICN_V6_ICMP_HDRLEN (IPV6_HDRLEN + ICMP_HDRLEN)
105 #define HICN_V6_WLDR_HDRLEN (IPV6_HDRLEN + ICMPWLDR_HDRLEN)
106 
107 #define HICN_V6_TCP_AH_HDRLEN (HICN_V6_TCP_HDRLEN + AH_HDRLEN)
108 #define HICN_V6_ICMP_AH_HDRLEN (HICN_V6_ICMP_HDRLEN + AH_HDRLEN)
109 
110 
111 #define HICN_V4_TCP_HDRLEN (IPV4_HDRLEN + TCP_HDRLEN)
112 #define HICN_V4_ICMP_HDRLEN (IPV4_HDRLEN + ICMP_HDRLEN)
113 #define HICN_V4_WLDR_HDRLEN (IPV4_HDRLEN + ICMPWLDR_HDRLEN)
114 
115 #define HICN_V4_TCP_AH_HDRLEN (HICN_V4_TCP_HDRLEN + AH_HDRLEN)
116 #define HICN_V4_ICMP_AH_HDRLEN (HICN_V4_ICMP_HDRLEN + AH_HDRLEN)
117 
118 
119 
120 
121 #endif /* HICN_HEADER_H */
122 
123 /*
124  * fd.io coding-style-patch-verification: ON
125  *
126  * Local Variables:
127  * eval: (c-set-style "gnu")
128  * End:
129  */
hicn_v4ah_hdr_t
Definition: header.h:73
hicn_header_t
Definition: header.h:91
_ah_header_t
Definition: ah.h:36
_icmp_header_t
Definition: icmp.h:30
_icmp_wldr_header_t
Definition: icmp.h:46
_tcp_header_t
Definition: tcp.h:33
hicn_protocol_t
Definition: protocol.h:31
hicn_v6_hdr_t
Definition: header.h:33
hicn_v4_hdr_t
Definition: header.h:62
hicn_v6ah_hdr_t
Definition: header.h:44
_ipv4_header_t
Definition: ipv4.h:30
protocol.h
Protocol header definitions.
_ipv6_header_t
Definition: ipv6.h:26