I'd like to use this from connmgr.
Signed-off-by: Ben Pfaff <[email protected]>
---
ofproto/ofproto-provider.h | 12 ++++++++++++
ofproto/ofproto.c | 20 ++++----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index c8cd69d..97e5cdd 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -405,6 +405,7 @@ void ofproto_rule_unref(struct rule *);
static inline const struct rule_actions * rule_get_actions(const struct rule
*);
static inline bool rule_is_table_miss(const struct rule *);
+static inline bool rule_is_hidden(const struct rule *);
/* A set of actions within a "struct rule".
*
@@ -1743,6 +1744,17 @@ rule_is_table_miss(const struct rule *rule)
return rule->cr.priority == 0 && cls_rule_is_catchall(&rule->cr);
}
+/* Returns true if 'rule' should be hidden from the controller.
+ *
+ * Rules with priority higher than UINT16_MAX are set up by ofproto itself
+ * (e.g. by in-band control) and are intentionally hidden from the
+ * controller. */
+static inline bool
+rule_is_hidden(const struct rule *rule)
+{
+ return rule->cr.priority > UINT16_MAX;
+}
+
static inline struct rule *
rule_from_cls_rule(const struct cls_rule *cls_rule)
{
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 27f5a46..2c6c3ce 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2751,17 +2751,6 @@ destroy_rule_executes(struct ofproto *ofproto)
}
}
-/* Returns true if 'rule' should be hidden from the controller.
- *
- * Rules with priority higher than UINT16_MAX are set up by ofproto itself
- * (e.g. by in-band control) and are intentionally hidden from the
- * controller. */
-static bool
-ofproto_rule_is_hidden(const struct rule *rule)
-{
- return (rule->cr.priority > UINT16_MAX);
-}
-
static bool
oftable_is_modifiable(const struct oftable *table,
enum ofputil_flow_mod_flags flags)
@@ -3415,7 +3404,7 @@ collect_rule(struct rule *rule, const struct
rule_criteria *c,
* rules to be selected. (This doesn't allow OpenFlow clients to meddle
* with hidden flows because OpenFlow uses only a 16-bit field to specify
* priority.) */
- if (ofproto_rule_is_hidden(rule) && c->cr.priority <= UINT16_MAX) {
+ if (rule_is_hidden(rule) && c->cr.priority <= UINT16_MAX) {
return 0;
} else if (rule->pending) {
return OFPROTO_POSTPONE;
@@ -4388,8 +4377,7 @@ ofproto_rule_send_removed(struct rule *rule, uint8_t
reason)
struct ofputil_flow_removed fr;
long long int used;
- if (ofproto_rule_is_hidden(rule) ||
- !(rule->flags & OFPUTIL_FF_SEND_FLOW_REM)) {
+ if (rule_is_hidden(rule) || !(rule->flags & OFPUTIL_FF_SEND_FLOW_REM)) {
return;
}
@@ -4815,7 +4803,7 @@ ofproto_collect_ofmonitor_refresh_rule(const struct
ofmonitor *m,
{
enum nx_flow_monitor_flags update;
- if (ofproto_rule_is_hidden(rule)) {
+ if (rule_is_hidden(rule)) {
return;
}
@@ -6251,7 +6239,7 @@ ofopgroup_complete(struct ofopgroup *group)
- The operation's only effect was to update rule->modified. */
if (!(op->error
- || ofproto_rule_is_hidden(rule)
+ || rule_is_hidden(rule)
|| (op->type == OFOPERATION_MODIFY
&& !op->actions
&& rule->flow_cookie == op->flow_cookie))) {
--
1.9.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev