mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
flow: Introduce parse_dl_type().
The function simply returns the ethernet type of the packet (after eventually discarding the VLAN tag). It will be used by a following commit. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Flavio Leitner <fbl@sysclose.org>
This commit is contained in:
14
lib/flow.c
14
lib/flow.c
@@ -328,7 +328,7 @@ parse_mpls(const void **datap, size_t *sizep)
|
|||||||
return MIN(count, FLOW_MAX_MPLS_LABELS);
|
return MIN(count, FLOW_MAX_MPLS_LABELS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ovs_be16
|
static inline ALWAYS_INLINE ovs_be16
|
||||||
parse_vlan(const void **datap, size_t *sizep)
|
parse_vlan(const void **datap, size_t *sizep)
|
||||||
{
|
{
|
||||||
const struct eth_header *eth = *datap;
|
const struct eth_header *eth = *datap;
|
||||||
@@ -350,7 +350,7 @@ parse_vlan(const void **datap, size_t *sizep)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ovs_be16
|
static inline ALWAYS_INLINE ovs_be16
|
||||||
parse_ethertype(const void **datap, size_t *sizep)
|
parse_ethertype(const void **datap, size_t *sizep)
|
||||||
{
|
{
|
||||||
const struct llc_snap_header *llc;
|
const struct llc_snap_header *llc;
|
||||||
@@ -827,6 +827,16 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
|
|||||||
dst->map = mf.map;
|
dst->map = mf.map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ovs_be16
|
||||||
|
parse_dl_type(const struct eth_header *data_, size_t size)
|
||||||
|
{
|
||||||
|
const void *data = data_;
|
||||||
|
|
||||||
|
parse_vlan(&data, &size);
|
||||||
|
|
||||||
|
return parse_ethertype(&data, &size);
|
||||||
|
}
|
||||||
|
|
||||||
/* For every bit of a field that is wildcarded in 'wildcards', sets the
|
/* For every bit of a field that is wildcarded in 'wildcards', sets the
|
||||||
* corresponding bit in 'flow' to zero. */
|
* corresponding bit in 'flow' to zero. */
|
||||||
void
|
void
|
||||||
|
@@ -108,6 +108,7 @@ void flow_compose(struct dp_packet *, const struct flow *);
|
|||||||
|
|
||||||
bool parse_ipv6_ext_hdrs(const void **datap, size_t *sizep, uint8_t *nw_proto,
|
bool parse_ipv6_ext_hdrs(const void **datap, size_t *sizep, uint8_t *nw_proto,
|
||||||
uint8_t *nw_frag);
|
uint8_t *nw_frag);
|
||||||
|
ovs_be16 parse_dl_type(const struct eth_header *data_, size_t size);
|
||||||
|
|
||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
flow_get_xreg(const struct flow *flow, int idx)
|
flow_get_xreg(const struct flow *flow, int idx)
|
||||||
|
Reference in New Issue
Block a user