From 56c091ec8cb20fb00f8af0e9a3f8b381ecaae03d Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 2 May 2014 17:41:33 +0900 Subject: [PATCH] ofproto-dpif: Add table_is_internal() helper This will be used by a subsequent patch to add support for recirculation for MPLS. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 7 +++++++ ofproto/ofproto-dpif.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 7d082bcc7..e50b4fe85 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4514,6 +4514,13 @@ ofproto_dpif_unixctl_init(void) ofproto_unixctl_dpif_dump_flows, NULL); } +/* 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; +} /* Linux VLAN device support (e.g. "eth0.10" for VLAN 10.) * diff --git a/ofproto/ofproto-dpif.h b/ofproto/ofproto-dpif.h index b2b18c7c7..d4ad624b1 100644 --- a/ofproto/ofproto-dpif.h +++ b/ofproto/ofproto-dpif.h @@ -111,6 +111,8 @@ static inline 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); + const struct rule_actions *rule_dpif_get_actions(const struct rule_dpif *); ovs_be64 rule_dpif_get_flow_cookie(const struct rule_dpif *rule); -- 2.43.0