+struct ofport_dpif *ofp_port_to_ofport(const struct ofproto_dpif *,
+ ofp_port_t);
+
+bool ofproto_dpif_backer_enabled(struct dpif_backer* backer);
+
+int ofproto_dpif_add_internal_flow(struct ofproto_dpif *,
+ const struct match *, int priority,
+ uint16_t idle_timeout,
+ const struct ofpbuf *ofpacts,
+ struct rule **rulep);
+int ofproto_dpif_delete_internal_flow(struct ofproto_dpif *, struct match *,
+ int priority);
+\f
+/* struct rule_dpif has struct rule as it's first member. */
+#define RULE_CAST(RULE) ((struct rule *)RULE)
+#define GROUP_CAST(GROUP) ((struct ofgroup *)GROUP)
+
+static inline struct group_dpif* group_dpif_ref(struct group_dpif *group)
+{
+ if (group) {
+ ofproto_group_ref(GROUP_CAST(group));
+ }
+ return group;
+}
+
+static inline void group_dpif_unref(struct group_dpif *group)
+{
+ if (group) {
+ ofproto_group_unref(GROUP_CAST(group));
+ }
+}
+
+static inline void rule_dpif_ref(struct rule_dpif *rule)
+{
+ if (rule) {
+ ofproto_rule_ref(RULE_CAST(rule));
+ }
+}
+
+static inline void rule_dpif_unref(struct rule_dpif *rule)
+{
+ if (rule) {
+ ofproto_rule_unref(RULE_CAST(rule));
+ }
+}
+
+static inline bool rule_dpif_is_fail_open(const struct rule_dpif *rule)
+{
+ return is_fail_open_rule(RULE_CAST(rule));
+}
+
+static inline bool rule_dpif_is_table_miss(const struct rule_dpif *rule)
+{
+ return rule_is_table_miss(RULE_CAST(rule));
+}
+
+/* Returns true if 'rule' is an internal rule, false otherwise. */
+static inline bool rule_dpif_is_internal(const struct rule_dpif *rule)
+{
+ return RULE_CAST(rule)->table_id == TBL_INTERNAL;
+}
+
+#undef RULE_CAST