]> git.proxmox.com Git - mirror_ovs.git/blame - build-aux/extract-odp-netlink-h
dist-docs: New utility to generate a documentation bundle for the website.
[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"\
21#endif\
22
23
6a54dedc
BP
24# Transform most Linux-specific __u<N> types into C99 uint<N>_t types,
25# and most Linux-specific __be<N> into Open vSwitch ovs_be<N>,
837eefc7
BP
26# and use the appropriate userspace header.
27s,<linux/types\.h>,"openvswitch/types.h",
837eefc7
BP
28s/__u32/uint32_t/g
29s/__u16/uint16_t/g
30s/__u8/uint8_t/g
837eefc7
BP
31s/__be32/ovs_be32/g
32s/__be16/ovs_be16/g
33
6a54dedc
BP
34# Transform 64-bit Linux-specific types into Open vSwitch specialized
35# types for 64-bit numbers that might only be aligned on a 32-bit
36# boundary.
37s/__u64/ovs_32aligned_u64/g
38s/__be64/ovs_32aligned_be64/g
39
837eefc7
BP
40# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN.
41s,<linux/if_ether\.h>,"packets.h",
42s/ETH_ALEN/ETH_ADDR_LEN/