X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fmeta-flow.h;h=d02d320373495c5d30fa454cc0f22d92db56f48c;hb=d4e781981a769acd59108c5db062980b71a1cc50;hp=2c5616f0c07022888b0bff07b8bc94c502d89e59;hpb=fabbb9797fa5705ba3aadb15891edbad33fb884e;p=sliver-openvswitch.git diff --git a/lib/meta-flow.h b/lib/meta-flow.h index 2c5616f0c..d02d32037 100644 --- a/lib/meta-flow.h +++ b/lib/meta-flow.h @@ -33,6 +33,8 @@ struct match; * to represent its value. */ enum OVS_PACKED_ENUM mf_field_id { /* Metadata. */ + MFF_DP_HASH, /* be32 */ + MFF_RECIRC_ID, /* be32 */ MFF_TUN_ID, /* be64 */ MFF_TUN_SRC, /* be32 */ MFF_TUN_DST, /* be32 */ @@ -87,6 +89,8 @@ enum OVS_PACKED_ENUM mf_field_id { MFF_MPLS_BOS, /* u8 */ /* L3. */ + /* Update mf_is_l3_or_higher() if MFF_IPV4_SRC is + * no longer the first element for a field of layer 3 or higher */ MFF_IPV4_SRC, /* be32 */ MFF_IPV4_DST, /* be32 */ @@ -297,6 +301,9 @@ struct mf_field { enum ofputil_protocol usable_protocols; /* If fully/cidr masked. */ /* If partially/non-cidr masked. */ enum ofputil_protocol usable_protocols_bitwise; + + int flow_be32ofs; /* Field's be32 offset in "struct flow", if prefix tree + * lookup is supported for the field, or -1. */ }; /* The representation of a field's value. */ @@ -356,6 +363,12 @@ void mf_get_mask(const struct mf_field *, const struct flow_wildcards *, bool mf_are_prereqs_ok(const struct mf_field *, const struct flow *); void mf_mask_field_and_prereqs(const struct mf_field *, struct flow *mask); +static inline bool +mf_is_l3_or_higher(const struct mf_field *mf) +{ + return mf->id >= MFF_IPV4_SRC; +} + /* Field values. */ bool mf_is_value_valid(const struct mf_field *, const union mf_value *value);