[ovs-dev] [PATCH v2 03/11] ofproto-dpif: Add table_is_internal() helper

Simon Horman horms at verge.net.au
Wed Apr 16 06:30:01 UTC 2014


This will be used by a subsequent patch to add support for
recirculation for MPLS.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 ofproto/ofproto-dpif.c | 10 +++++++++-
 ofproto/ofproto-dpif.h |  2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 82027c2..d6f73c2 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4485,11 +4485,19 @@ ofproto_dpif_unixctl_init(void)
 }
 
 
+/* Returns true if 'table' is the table used for internal rules,
+ * false otherwise. */
+bool
+table_is_internal(uint8_t table_id)
+{
+    return table_id == TBL_INTERNAL;
+}
+
 /* Returns true if 'rule' is an internal rule, false otherwise. */
 bool
 rule_is_internal(const struct rule *rule)
 {
-    return rule->table_id == TBL_INTERNAL;
+    return table_is_internal(rule->table_id);
 }
 
 /* Linux VLAN device support (e.g. "eth0.10" for VLAN 10.)
diff --git a/ofproto/ofproto-dpif.h b/ofproto/ofproto-dpif.h
index 9e56558..da9cb9c 100644
--- a/ofproto/ofproto-dpif.h
+++ b/ofproto/ofproto-dpif.h
@@ -110,6 +110,8 @@ bool rule_dpif_is_table_miss(const struct rule_dpif *);
 bool rule_dpif_is_internal(const struct rule_dpif *);
 uint8_t rule_dpif_get_table(const struct rule_dpif *);
 
+bool table_is_internal(uint8_t table_id);
+
 struct rule_actions *rule_dpif_get_actions(const struct rule_dpif *);
 
 ovs_be64 rule_dpif_get_flow_cookie(const struct rule_dpif *rule);
-- 
1.8.5.2




More information about the dev mailing list