X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fclassifier.h;h=48eb59629a8bab669ffc2bd4ef4464bace015f72;hb=b5a36e3878937a489458f7a0ff42769e826ae88b;hp=d55475d8ff3b15dc764878979b0e7f7c8661a810;hpb=17f5d263877b25b42cda73b2fc96a8825ec81b78;p=openvswitch diff --git a/lib/classifier.h b/lib/classifier.h index d55475d8..48eb5962 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ struct cls_table { struct hmap rules; /* Contains "struct cls_rule"s. */ struct flow_wildcards wc; /* Wildcards for fields. */ int n_table_rules; /* Number of rules, including duplicates. */ + bool is_catchall; /* True if this table wildcards every field. */ }; /* Returns true if 'table' is a "catch-all" table that will match every @@ -55,11 +56,7 @@ struct cls_table { 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)); + return table->is_catchall; } /* A flow classification rule. @@ -110,7 +107,11 @@ void cls_rule_set_dl_vlan(struct cls_rule *, ovs_be16); void cls_rule_set_any_pcp(struct cls_rule *); void cls_rule_set_dl_vlan_pcp(struct cls_rule *, uint8_t); void cls_rule_set_tp_src(struct cls_rule *, ovs_be16); +void cls_rule_set_tp_src_masked(struct cls_rule *, + ovs_be16 port, ovs_be16 mask); void cls_rule_set_tp_dst(struct cls_rule *, ovs_be16); +void cls_rule_set_tp_dst_masked(struct cls_rule *, + ovs_be16 port, ovs_be16 mask); void cls_rule_set_nw_proto(struct cls_rule *, uint8_t); void cls_rule_set_nw_src(struct cls_rule *, ovs_be32); void cls_rule_set_nw_src_masked(struct cls_rule *, ovs_be32 ip, ovs_be32 mask); @@ -134,6 +135,8 @@ void cls_rule_set_ipv6_dst_masked(struct cls_rule *, const struct in6_addr *, const struct in6_addr *); void cls_rule_set_ipv6_label(struct cls_rule *, ovs_be32); void cls_rule_set_nd_target(struct cls_rule *, const struct in6_addr *); +void cls_rule_set_nd_target_masked(struct cls_rule *, const struct in6_addr *, + 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);