Global replace of Nicira Networks.
[sliver-openvswitch.git] / include / sparse / netinet / ip6.h
1 /*
2  * Copyright (c) 2011 Nicira, Inc.
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
17 #ifndef __CHECKER__
18 #error "Use this header only with sparse.  It is not a correct implementation."
19 #endif
20
21 #ifndef __NETINET_IP6_SPARSE
22 #define __NETINET_IP6_SPARSE 1
23
24 #include <netinet/in.h>
25
26 struct ip6_hdr {
27     union {
28         struct ip6_hdrctl {
29             ovs_be32 ip6_un1_flow;
30             ovs_be16 ip6_un1_plen;
31             uint8_t ip6_un1_nxt;
32             uint8_t ip6_un1_hlim;
33         } ip6_un1;
34         uint8_t ip6_un2_vfc;
35     } ip6_ctlun;
36     struct in6_addr ip6_src;
37     struct in6_addr ip6_dst;
38 };
39
40 #define ip6_vfc   ip6_ctlun.ip6_un2_vfc
41 #define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow
42 #define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen
43 #define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt
44 #define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim
45 #define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim
46
47 struct ip6_ext {
48     uint8_t ip6e_nxt;
49     uint8_t ip6e_len;
50 };
51
52 struct ip6_frag {
53     uint8_t ip6f_nxt;
54     uint8_t ip6f_reserved;
55     ovs_be16 ip6f_offlg;
56     ovs_be32 ip6f_ident;
57 };
58
59 #define IP6F_OFF_MASK ((OVS_FORCE ovs_be16) 0xfff8)
60
61 #endif /* netinet/ip6.h sparse */