+/* A set of actions within a "struct rule".
+ *
+ *
+ * Thread-safety
+ * =============
+ *
+ * A struct rule_actions may be accessed without a risk of being freed by
+ * code that holds 'rule->mutex' (where 'rule' is the rule for which
+ * 'rule->actions == actions') or during the RCU active period.
+ *
+ * All members are immutable: they do not change during the struct's
+ * lifetime. */
+struct rule_actions {
+ /* Flags.
+ *
+ * 'has_meter' is true if 'ofpacts' contains an OFPACT_METER action.
+ *
+ * 'has_learn_with_delete' is true if 'ofpacts' contains an OFPACT_LEARN
+ * action whose flags include NX_LEARN_F_DELETE_LEARNED. */
+ bool has_meter;
+ bool has_learn_with_delete;
+
+ /* Actions. */
+ uint32_t ofpacts_len; /* Size of 'ofpacts', in bytes. */
+ struct ofpact ofpacts[]; /* Sequence of "struct ofpacts". */
+};
+BUILD_ASSERT_DECL(offsetof(struct rule_actions, ofpacts) % OFPACT_ALIGNTO == 0);
+
+const struct rule_actions *rule_actions_create(const struct ofpact *, size_t);
+void rule_actions_destroy(const struct rule_actions *);
+bool ofproto_rule_has_out_port(const struct rule *, ofp_port_t port)
+ OVS_REQUIRES(ofproto_mutex);
+
+/* A set of rules to which an OpenFlow operation applies. */
+struct rule_collection {
+ struct rule **rules; /* The rules. */
+ size_t n; /* Number of rules collected. */
+
+ size_t capacity; /* Number of rules that will fit in 'rules'. */
+ struct rule *stub[64]; /* Preallocated rules to avoid malloc(). */
+};
+
+void rule_collection_init(struct rule_collection *);
+void rule_collection_add(struct rule_collection *, struct rule *);
+void rule_collection_ref(struct rule_collection *) OVS_REQUIRES(ofproto_mutex);
+void rule_collection_unref(struct rule_collection *);
+void rule_collection_destroy(struct rule_collection *);
+
+/* Limits the number of flows allowed in the datapath. Only affects the
+ * ofproto-dpif implementation. */
+extern unsigned ofproto_flow_limit;
+
+/* Maximum idle time (in ms) for flows to be cached in the datapath.
+ * Revalidators may expire flows more quickly than the configured value based
+ * on system load and other factors. This variable is subject to change. */
+extern unsigned ofproto_max_idle;
+
+/* Number of upcall handler and revalidator threads. Only affects the
+ * ofproto-dpif implementation. */
+extern size_t n_handlers, n_revalidators;
+
+/* Number of rx queues to be created for each dpdk interface. */
+extern size_t n_dpdk_rxqs;
+
+/* Cpu mask for pmd threads. */
+extern char *pmd_cpu_mask;
+
+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);
+void ofproto_rule_delete(struct ofproto *, struct rule *)
+ OVS_EXCLUDED(ofproto_mutex);
+void ofproto_rule_reduce_timeouts(struct rule *rule, uint16_t idle_timeout,
+ uint16_t hard_timeout)
+ OVS_EXCLUDED(ofproto_mutex);
+
+/* A group within a "struct ofproto".
+ *
+ * With few exceptions, ofproto implementations may look at these fields but
+ * should not modify them. */
+struct ofgroup {
+ struct hmap_node hmap_node OVS_GUARDED; /* In ofproto's "groups" hmap. */