netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / build-aux / extract-odp-netlink-h
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!).
7 1i\
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.
15 s/_LINUX_OPENVSWITCH_H/ODP_NETLINK_H/
16
17 # Include platform extensions header file on Win32.
18 $i\
19 #ifdef _WIN32\
20 #include "OvsDpInterfaceExt.h"\
21 #endif\
22
23 # Use OVS's own struct eth_addr instead of a 6-byte char array.
24 s,<linux/types\.h>,"openvswitch/types.h",
25 s,#.*<linux/if_ether\.h>,,
26 s/__u8[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\[[[:space:]]*ETH_ALEN[[:space:]]*\]/struct eth_addr \1/
27
28 # Transform most Linux-specific __u<N> types into C99 uint<N>_t types,
29 # and most Linux-specific __be<N> into Open vSwitch ovs_be<N>,
30 # and use the appropriate userspace header.
31 s/__u32/uint32_t/g
32 s/__u16/uint16_t/g
33 s/__u8/uint8_t/g
34 s/__be32/ovs_be32/g
35 s/__be16/ovs_be16/g
36
37 # Transform 64-bit Linux-specific types into Open vSwitch specialized
38 # types for 64-bit numbers that might only be aligned on a 32-bit
39 # boundary.
40 s/__u64/ovs_32aligned_u64/g
41 s/__be64/ovs_32aligned_be64/g