fbd2997b32b0c1afc9f262cd841caf985eb38e4f
[sliver-openvswitch.git] / include / openvswitch / types.h
1 /*
2  * Copyright (c) 2010 Nicira Networks.
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 OPENVSWITCH_TYPES_H
18 #define OPENVSWITCH_TYPES_H 1
19
20 #include <stdint.h>
21
22 #ifdef __CHECKER__
23 #define OVS_BITWISE __attribute__((bitwise))
24 #define OVS_FORCE __attribute__((force))
25 #else
26 #define OVS_BITWISE
27 #define OVS_FORCE
28 #endif
29
30 /* The ovs_be<N> types indicate that an object is in big-endian, not
31  * native-endian, byte order.  They are otherwise equivalent to uint<N>_t.
32  *
33  * The OVS_BITWISE annotation allows the sparse checker to issue warnings
34  * for incorrect use of values in network byte order. */
35 typedef uint16_t OVS_BITWISE ovs_be16;
36 typedef uint32_t OVS_BITWISE ovs_be32;
37 typedef uint64_t OVS_BITWISE ovs_be64;
38
39 #endif /* openvswitch/types.h */