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"\
|
|
|
|
#endif\
|
|
|
|
|
|
|
|
|
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,<linux/types\.h>,"openvswitch/types.h",
|
|
|
|
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
|
|
|
|
|
2014-08-04 11:11:40 -07:00
|
|
|
# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN.
|
|
|
|
s,<linux/if_ether\.h>,"packets.h",
|
|
|
|
s/ETH_ALEN/ETH_ADDR_LEN/
|