X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-provider.h;h=8f4f41e60e6d85a61d5905e17d4e48116197f838;hb=HEAD;hp=9431be875d13e6642d9a97aacae8c6afd6495dc2;hpb=dc723c447a797e555d400594133a35b9841eb1de;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 9431be875..8f4f41e60 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -406,24 +406,8 @@ struct rule { void ofproto_rule_ref(struct rule *); void ofproto_rule_unref(struct rule *); -static inline const struct rule_actions * -rule_get_actions(const struct rule *rule) -{ - return ovsrcu_get(const struct rule_actions *, &rule->actions); -} - -/* Returns true if 'rule' is an OpenFlow 1.3 "table-miss" rule, false - * otherwise. - * - * ("Table-miss" rules are special because a packet_in generated through one - * uses OFPR_NO_MATCH as its reason, whereas packet_ins generated by any other - * rule use OFPR_ACTION.) */ -static inline bool -rule_is_table_miss(const struct rule *rule) -{ - return rule->cr.priority == 0 && cls_rule_is_catchall(&rule->cr); -} -bool rule_is_internal(const struct rule *); +static inline const struct rule_actions * rule_get_actions(const struct rule *); +static inline bool rule_is_table_miss(const struct rule *); /* A set of actions within a "struct rule". * @@ -476,11 +460,7 @@ extern unsigned ofproto_max_idle; * ofproto-dpif implementation. */ extern size_t n_handlers, n_revalidators; -static inline struct rule * -rule_from_cls_rule(const struct cls_rule *cls_rule) -{ - return cls_rule ? CONTAINER_OF(cls_rule, struct rule, cr) : NULL; -} +static inline struct rule *rule_from_cls_rule(const struct cls_rule *); void ofproto_rule_expire(struct rule *rule, uint8_t reason) OVS_REQUIRES(ofproto_mutex); @@ -1746,4 +1726,29 @@ bool ofproto_delete_flow(struct ofproto *, OVS_EXCLUDED(ofproto_mutex); void ofproto_flush_flows(struct ofproto *); + +static inline const struct rule_actions * +rule_get_actions(const struct rule *rule) +{ + return ovsrcu_get(const struct rule_actions *, &rule->actions); +} + +/* Returns true if 'rule' is an OpenFlow 1.3 "table-miss" rule, false + * otherwise. + * + * ("Table-miss" rules are special because a packet_in generated through one + * uses OFPR_NO_MATCH as its reason, whereas packet_ins generated by any other + * rule use OFPR_ACTION.) */ +static inline bool +rule_is_table_miss(const struct rule *rule) +{ + return rule->cr.priority == 0 && cls_rule_is_catchall(&rule->cr); +} + +static inline struct rule * +rule_from_cls_rule(const struct cls_rule *cls_rule) +{ + return cls_rule ? CONTAINER_OF(cls_rule, struct rule, cr) : NULL; +} + #endif /* ofproto/ofproto-provider.h */