[ovs-dev] [RFC PATCH] userspace: Define and use struct eth_addr.

Takashi Yamamoto yamamoto at midokura.com
Thu Oct 15 04:39:18 UTC 2015


hi,

On Thu, Sep 17, 2015 at 12:44 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Sep 16, 2015 at 10:55:10AM +0900, Takashi Yamamoto wrote:
>> hi,
>>
>> > --- a/build-aux/extract-odp-netlink-h
>> > +++ b/build-aux/extract-odp-netlink-h
>> > @@ -20,11 +20,14 @@ $i\
>> >  #include "OvsDpInterfaceExt.h"\
>> >  #endif\
>> >
>> > +# Use OVS's own struct eth_addr instead of a 6-byte char array.
>> > +s,<linux/types\.h>,"openvswitch/types.h",
>> > +s,#.*<linux/if_ether\.h>,,
>> > +s/__u8[ \t]*\([a-zA-Z0-9_]*\)[ \t]*\[[ \t]*ETH_ALEN[ \t]*\]/struct eth_addr \1/
>> >
>> >  # 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
>> > @@ -36,7 +39,3 @@ s/__be16/ovs_be16/g
>> >  # 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/
>>
>> isn't this still necessary for ovs_key_ethernet etc?
>
> It gets transformed into struct eth_addr, see the output:
>
> struct ovs_key_ethernet {
>         struct eth_addr eth_src;
>         struct eth_addr eth_dst;
> };

thank you.
it turned out to be a portability problem in the script.
i'll send out a patch later.



More information about the dev mailing list