From: Paul Blakey <pa...@mellanox.com> Add help function match_set_nw_ttl_masked() Will be used later to set ttl value.
Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> --- include/openvswitch/match.h | 3 ++- lib/match.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h index 1b43de0..030a137 100644 --- a/include/openvswitch/match.h +++ b/include/openvswitch/match.h @@ -168,7 +168,8 @@ void match_set_nw_dst(struct match *, ovs_be32); void match_set_nw_dst_masked(struct match *, ovs_be32 ip, ovs_be32 mask); void match_set_nw_dscp(struct match *, uint8_t); void match_set_nw_ecn(struct match *, uint8_t); -void match_set_nw_ttl(struct match *, uint8_t); +void match_set_nw_ttl(struct match *, uint8_t nw_ttl); +void match_set_nw_ttl_masked(struct match *, uint8_t nw_ttl, uint8_t mask); void match_set_nw_frag(struct match *, uint8_t nw_frag); void match_set_nw_frag_masked(struct match *, uint8_t nw_frag, uint8_t mask); void match_set_icmp_type(struct match *, uint8_t); diff --git a/lib/match.c b/lib/match.c index f5288e3..3cfa6b3 100644 --- a/lib/match.c +++ b/lib/match.c @@ -889,6 +889,13 @@ match_set_nw_ttl(struct match *match, uint8_t nw_ttl) } void +match_set_nw_ttl_masked(struct match *match, uint8_t nw_ttl, uint8_t mask) +{ + match->flow.nw_ttl = nw_ttl & mask; + match->wc.masks.nw_ttl = mask; +} + +void match_set_nw_frag(struct match *match, uint8_t nw_frag) { match->wc.masks.nw_frag |= FLOW_NW_FRAG_MASK; -- 2.8.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev