forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not seemingly #include Linux-specific headers on other platforms.
Until now, the OVS source tree has had a whole maze of header files that make "#include <linux/openvswitch.h>" work OK regardless of platform, but this confuses everyone new to the tree, at first glance, and is difficult to understand at second glance too. This commit renames include/linux/openvswitch.h to datapath/linux/compat/include/linux/openvswitch.h without other change, then modifies the userspace build to generate a header that makes sense in portable Open vSwitch userspace from that header. It then removes all the remaining include/linux/* files since they are now unused. Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Jesse Gross <[email protected]>
- Loading branch information
Showing
14 changed files
with
54 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 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/ | ||
|
||
# Transform Linux-specific __u<N> types into C99 uint<N>_t types, | ||
# and Linux-specific __be<N> into Open vSwitch ovs_be<N>, | ||
# and use the appropriate userspace header. | ||
s,<linux/types\.h>,"openvswitch/types.h", | ||
s/__u64/uint64_t/g | ||
s/__u32/uint32_t/g | ||
s/__u16/uint16_t/g | ||
s/__u8/uint8_t/g | ||
s/__be64/ovs_be64/g | ||
s/__be32/ovs_be32/g | ||
s/__be16/ovs_be16/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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters