2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00
Files
openvswitch/build-aux/extract-odp-netlink-h
Nithin Raju 107331906b Add extentions to the standard datapath interface
The datapath interface defined in odp-netlink.h needs some extensions
that are platform dependent. Some examples are the name of the communication
device on Windows and a set of commands that are specific to Windows.

In this change we define a datapath-windows/include/OvsDpInterfaceExt.h
to include any platform specific interface extensions.

OvsDpInterfaceExt.h is in turn included in odp-netlink.h ONLY for _WIN32.
This approach was chosen to avoid including OvsDpInterfaceExt.h directly
although the latter approach is as good as the former.

Also, we define three ioctls in OvsDpInterfaceExt.h:
read:     provides an output buffer (mimics a recv)
write:    provides an input buffer (mimics a send)
transact: provides an input and optionally an output buffer.
          (mimics a send followed by recv)

Signed-off-by: Nithin Raju <nithin@vmware.com>
Co-Authored-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Saurabh Shah <ssaurabh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-08-19 14:21:21 -07:00

43 lines
1.2 KiB
Plaintext
Executable File

# 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/
# Include platform extensions header file on Win32.
$i\
#ifdef _WIN32\
#include "OvsDpInterfaceExt.h"\
#endif\
# 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>,
# 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
# 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
# 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/