2 * Copyright (c) 2011 Nicira, Inc.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #define LINUX_TYPES_H 1
20 /* On Linux, this header file just includes <linux/types.h>.
22 * On other platforms, this header file implements just enough of
23 * <linux/types.h> to allow <linux/openvswitch.h> to work, that is, it defines
24 * the __u<N> and __be<N> types. */
27 #include_next <linux/types.h>
28 #elif defined(HAVE_LINUX_TYPES_H)
29 /* With some combinations of kernel and userspace headers, including both
30 * <sys/types.h> and <linux/types.h> only works if you do so in that order, so
34 #define __CHECK_ENDIAN__
37 #include <sys/types.h>
38 #include_next <linux/types.h>
39 #else /* no <linux/types.h> */
43 #define __bitwise__ __attribute__((bitwise))
49 typedef uint16_t __u16;
50 typedef uint32_t __u32;
51 typedef uint64_t __u64;
53 typedef uint16_t __bitwise__ __be16;
54 typedef uint32_t __bitwise__ __be32;
55 typedef uint64_t __bitwise__ __be64;
56 #endif /* no <linux/types.h> */
58 #endif /* <linux/types.h> */