2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

classifier: New function cls_rule_equal().

This commit is contained in:
Ben Pfaff
2010-11-08 16:35:34 -08:00
parent 955f579d42
commit 193eb87453
3 changed files with 15 additions and 10 deletions

View File

@@ -307,6 +307,16 @@ cls_rule_set_icmp_code(struct cls_rule *rule, uint8_t icmp_code)
rule->flow.icmp_code = htons(icmp_code);
}
/* Returns true if 'a' and 'b' have the same priority, wildcard the same
* fields, and have the same values for fixed fields, otherwise false. */
bool
cls_rule_equal(const struct cls_rule *a, const struct cls_rule *b)
{
return (a->priority == b->priority
&& flow_wildcards_equal(&a->wc, &b->wc)
&& flow_equal(&a->flow, &b->flow));
}
/* Converts 'rule' to a string and returns the string. The caller must free
* the string (with free()). */
char *