2014-08-04 11:11:40 -07:00
|
|
|
# This is a "sed" script that transforms <linux/openvswitch.h> into a
|
|
|
|
# form that is suitable for inclusion within the Open vSwitch tree on
|
|
|
|
# both Linux and non-Linux systems.
|
|
|
|
|
|
|
|
# Add a header warning that this is a generated file. It might save somebody
|
|
|
|
# some frustration (maybe even me!).
|
|
|
|
1i\
|
|
|
|
/* -*- mode: c; buffer-read-only: t -*- */\
|
|
|
|
/* Generated automatically from <linux/openvswitch.h> -- do not modify! */\
|
|
|
|
\
|
|
|
|
\
|
|
|
|
|
|
|
|
|
|
|
|
# Avoid using reserved names in header guards.
|
|
|
|
s/_LINUX_OPENVSWITCH_H/ODP_NETLINK_H/
|
|
|
|
|
2014-08-19 13:51:51 -07:00
|
|
|
# Include platform extensions header file on Win32.
|
|
|
|
$i\
|
|
|
|
#ifdef _WIN32\
|
|
|
|
#include "OvsDpInterfaceExt.h"\
|
2016-07-01 13:49:25 -07:00
|
|
|
#include "OvsDpInterfaceCtExt.h"\
|
2014-08-19 13:51:51 -07:00
|
|
|
#endif\
|
2017-04-28 15:49:16 -07:00
|
|
|
\
|
|
|
|
/* IPCT_* enums may not be defined in all platforms, so do not use them. */\
|
|
|
|
#define OVS_CT_EVENT_NEW (1 << 0) /* 1 << IPCT_NEW */\
|
|
|
|
#define OVS_CT_EVENT_RELATED (1 << 1) /* 1 << IPCT_RELATED */\
|
|
|
|
#define OVS_CT_EVENT_DESTROY (1 << 2) /* 1 << IPCT_DESTROY */\
|
|
|
|
#define OVS_CT_EVENT_REPLY (1 << 3) /* 1 << IPCT_REPLY */\
|
|
|
|
#define OVS_CT_EVENT_ASSURED (1 << 4) /* 1 << IPCT_ASSURED */\
|
|
|
|
#define OVS_CT_EVENT_PROTOINFO (1 << 5) /* 1 << IPCT_PROTOINFO */\
|
|
|
|
#define OVS_CT_EVENT_HELPER (1 << 6) /* 1 << IPCT_HELPER */\
|
|
|
|
#define OVS_CT_EVENT_MARK (1 << 7) /* 1 << IPCT_MARK */\
|
|
|
|
#define OVS_CT_EVENT_SEQADJ (1 << 8) /* 1 << IPCT_SEQADJ */\
|
|
|
|
#define OVS_CT_EVENT_SECMARK (1 << 9) /* 1 << IPCT_SECMARK */\
|
|
|
|
#define OVS_CT_EVENT_LABEL (1 << 10) /* 1 << IPCT_LABEL */\
|
|
|
|
\
|
|
|
|
#define OVS_CT_EVENTMASK_DEFAULT \\\
|
|
|
|
(OVS_CT_EVENT_NEW | OVS_CT_EVENT_RELATED | OVS_CT_EVENT_DESTROY |\\\
|
|
|
|
OVS_CT_EVENT_MARK | OVS_CT_EVENT_LABEL)\
|
2014-08-19 13:51:51 -07:00
|
|
|
|
2015-08-28 14:55:11 -07:00
|
|
|
# Use OVS's own struct eth_addr instead of a 6-byte char array.
|
2017-01-04 16:10:56 -08:00
|
|
|
s,<linux/types\.h>,"openvswitch/types.h"\
|
|
|
|
#include <netinet/in.h>,
|
2015-08-28 14:55:11 -07:00
|
|
|
s,#.*<linux/if_ether\.h>,,
|
2015-10-14 04:30:51 +00:00
|
|
|
s/__u8[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\[[[:space:]]*ETH_ALEN[[:space:]]*\]/struct eth_addr \1/
|
2014-08-19 13:51:51 -07:00
|
|
|
|
2017-01-04 16:10:56 -08:00
|
|
|
# Transform IPv6 addresses from an array to struct in6_addr
|
|
|
|
s/__be32[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\[[[:space:]]*4[[:space:]]*\]/struct in6_addr \1/
|
|
|
|
|
2014-06-13 15:28:29 -07:00
|
|
|
# Transform most Linux-specific __u<N> types into C99 uint<N>_t types,
|
|
|
|
# and most Linux-specific __be<N> into Open vSwitch ovs_be<N>,
|
2014-08-04 11:11:40 -07:00
|
|
|
# and use the appropriate userspace header.
|
|
|
|
s/__u32/uint32_t/g
|
|
|
|
s/__u16/uint16_t/g
|
|
|
|
s/__u8/uint8_t/g
|
|
|
|
s/__be32/ovs_be32/g
|
|
|
|
s/__be16/ovs_be16/g
|
|
|
|
|
2014-06-13 15:28:29 -07:00
|
|
|
# Transform 64-bit Linux-specific types into Open vSwitch specialized
|
|
|
|
# types for 64-bit numbers that might only be aligned on a 32-bit
|
|
|
|
# boundary.
|
|
|
|
s/__u64/ovs_32aligned_u64/g
|
|
|
|
s/__be64/ovs_32aligned_be64/g
|