]> git.proxmox.com Git - mirror_ovs.git/blame - build-aux/extract-odp-netlink-h
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / build-aux / extract-odp-netlink-h
CommitLineData
837eefc7
BP
1# This is a "sed" script that transforms <linux/openvswitch.h> into a
2# form that is suitable for inclusion within the Open vSwitch tree on
3# both Linux and non-Linux systems.
4
5# Add a header warning that this is a generated file. It might save somebody
6# some frustration (maybe even me!).
71i\
8/* -*- mode: c; buffer-read-only: t -*- */\
9/* Generated automatically from <linux/openvswitch.h> -- do not modify! */\
10\
11\
12
13
14# Avoid using reserved names in header guards.
15s/_LINUX_OPENVSWITCH_H/ODP_NETLINK_H/
16
10733190
NR
17# Include platform extensions header file on Win32.
18$i\
19#ifdef _WIN32\
20#include "OvsDpInterfaceExt.h"\
3c1c2119 21#include "OvsDpInterfaceCtExt.h"\
10733190 22#endif\
975954af
JR
23\
24/* IPCT_* enums may not be defined in all platforms, so do not use them. */\
25#define OVS_CT_EVENT_NEW (1 << 0) /* 1 << IPCT_NEW */\
26#define OVS_CT_EVENT_RELATED (1 << 1) /* 1 << IPCT_RELATED */\
27#define OVS_CT_EVENT_DESTROY (1 << 2) /* 1 << IPCT_DESTROY */\
28#define OVS_CT_EVENT_REPLY (1 << 3) /* 1 << IPCT_REPLY */\
29#define OVS_CT_EVENT_ASSURED (1 << 4) /* 1 << IPCT_ASSURED */\
30#define OVS_CT_EVENT_PROTOINFO (1 << 5) /* 1 << IPCT_PROTOINFO */\
31#define OVS_CT_EVENT_HELPER (1 << 6) /* 1 << IPCT_HELPER */\
32#define OVS_CT_EVENT_MARK (1 << 7) /* 1 << IPCT_MARK */\
33#define OVS_CT_EVENT_SEQADJ (1 << 8) /* 1 << IPCT_SEQADJ */\
34#define OVS_CT_EVENT_SECMARK (1 << 9) /* 1 << IPCT_SECMARK */\
35#define OVS_CT_EVENT_LABEL (1 << 10) /* 1 << IPCT_LABEL */\
36\
37#define OVS_CT_EVENTMASK_DEFAULT \\\
38 (OVS_CT_EVENT_NEW | OVS_CT_EVENT_RELATED | OVS_CT_EVENT_DESTROY |\\\
39 OVS_CT_EVENT_MARK | OVS_CT_EVENT_LABEL)\
10733190 40
74ff3298 41# Use OVS's own struct eth_addr instead of a 6-byte char array.
932c96b7
JR
42s,<linux/types\.h>,"openvswitch/types.h"\
43#include <netinet/in.h>,
74ff3298 44s,#.*<linux/if_ether\.h>,,
132911b3 45s/__u8[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\[[[:space:]]*ETH_ALEN[[:space:]]*\]/struct eth_addr \1/
10733190 46
932c96b7 47# Transform IPv6 addresses from an array to struct in6_addr
3d2fbd70
JS
48#
49# As a very special case, only transform member names with more than
50# one character because struct ovs_key_nsh has a member "__be32 c[4];"
51# that is not an IPv6 address.
52s/__be32[[:space:]]*\([a-zA-Z0-9_]\{2,\}\)[[:space:]]*\[[[:space:]]*4[[:space:]]*\]/struct in6_addr \1/
932c96b7 53
6a54dedc
BP
54# Transform most Linux-specific __u<N> types into C99 uint<N>_t types,
55# and most Linux-specific __be<N> into Open vSwitch ovs_be<N>,
837eefc7 56# and use the appropriate userspace header.
837eefc7
BP
57s/__u32/uint32_t/g
58s/__u16/uint16_t/g
59s/__u8/uint8_t/g
837eefc7
BP
60s/__be32/ovs_be32/g
61s/__be16/ovs_be16/g
62
6a54dedc
BP
63# Transform 64-bit Linux-specific types into Open vSwitch specialized
64# types for 64-bit numbers that might only be aligned on a 32-bit
65# boundary.
66s/__u64/ovs_32aligned_u64/g
67s/__be64/ovs_32aligned_be64/g