ovs-brcompatd: Delete ports when netdevs on fake bridges disappear.
[openvswitch] / lib / classifier.h
index 2e6d8b9b95bbe9cf7175be9779ebc4736d3ed500..db090225b42cf31127acc76a9374049e6e5ed959 100644 (file)
@@ -44,12 +44,24 @@ struct classifier {
 
 /* A set of rules that all have the same fields wildcarded. */
 struct cls_table {
-    struct hmap_node hmap_node; /* Within struct classifier 'wctables'. */
+    struct hmap_node hmap_node; /* Within struct classifier 'tables' hmap. */
     struct hmap rules;          /* Contains "struct cls_rule"s. */
     struct flow_wildcards wc;   /* Wildcards for fields. */
     int n_table_rules;          /* Number of rules, including duplicates. */
 };
 
+/* Returns true if 'table' is a "catch-all" table that will match every
+ * packet (if there is no higher-priority match). */
+static inline bool
+cls_table_is_catchall(const struct cls_table *table)
+{
+    /* A catch-all table can only have one rule, so use hmap_count() as a cheap
+     * check to rule out other kinds of match before doing the full check with
+     * flow_wildcards_is_catchall(). */
+    return (hmap_count(&table->rules) == 1
+            && flow_wildcards_is_catchall(&table->wc));
+}
+
 /* A flow classification rule.
  *
  * Use one of the cls_rule_*() functions to initialize a cls_rule.
@@ -115,7 +127,7 @@ bool cls_rule_set_ipv6_src_masked(struct cls_rule *, const struct in6_addr *,
 void cls_rule_set_ipv6_dst(struct cls_rule *, const struct in6_addr *);
 bool cls_rule_set_ipv6_dst_masked(struct cls_rule *, const struct in6_addr *,
                                   const struct in6_addr *);
-void cls_rule_set_nd_target(struct cls_rule *, const struct in6_addr);
+void cls_rule_set_nd_target(struct cls_rule *, const struct in6_addr *);
 
 bool cls_rule_equal(const struct cls_rule *, const struct cls_rule *);
 uint32_t cls_rule_hash(const struct cls_rule *, uint32_t basis);