2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

ofp-parse: New function parse_ofp_exact_flow().

This function parses a flow rather than a cls_rule.  It will be useful
for "ofproto/trace", which currently requires an odp_flow and thus can't
accept values for registers and other concepts that don't exist in the
kernel.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2012-05-04 09:52:37 -07:00
parent 33cadc5034
commit ccbe50f8f6
4 changed files with 94 additions and 0 deletions

View File

@@ -1457,6 +1457,19 @@ mf_set_flow_value(const struct mf_field *mf,
}
}
/* Returns true if 'mf' has a zero value in 'flow', false if it is nonzero.
*
* The caller is responsible for ensuring that 'flow' meets 'mf''s
* prerequisites. */
bool
mf_is_zero(const struct mf_field *mf, const struct flow *flow)
{
union mf_value value;
mf_get_value(mf, flow, &value);
return is_all_zeros((const uint8_t *) &value, mf->n_bytes);
}
/* Makes 'rule' wildcard field 'mf'.
*
* The caller is responsible for ensuring that 'rule' meets 'mf''s