+
+static void rule_send_removed(struct ofproto *, struct rule *, uint8_t reason);
+
+/* An exact-match instantiation of an OpenFlow flow. */
+struct facet {
+ long long int used; /* Time last used; time created if not used. */
+
+ /* These statistics:
+ *
+ * - Do include packets and bytes sent "by hand", e.g. with
+ * dpif_execute().
+ *
+ * - Do include packets and bytes that were obtained from the datapath
+ * when a flow was deleted (e.g. dpif_flow_del()) or when its
+ * statistics were reset (e.g. dpif_flow_put() with ODPPF_ZERO_STATS).
+ *
+ * - Do not include any packets or bytes that can currently be obtained
+ * from the datapath by, e.g., dpif_flow_get().
+ */
+ uint64_t packet_count; /* Number of packets received. */
+ uint64_t byte_count; /* Number of bytes received. */
+
+ /* Number of bytes passed to account_cb. This may include bytes that can
+ * currently obtained from the datapath (thus, it can be greater than
+ * byte_count). */
+ uint64_t accounted_bytes;
+
+ struct hmap_node hmap_node; /* In owning ofproto's 'facets' hmap. */
+ struct list list_node; /* In owning rule's 'facets' list. */
+ struct rule *rule; /* Owning rule. */
+ struct flow flow; /* Exact-match flow. */
+ bool installed; /* Installed in datapath? */
+ bool may_install; /* True ordinarily; false if actions must
+ * be reassessed for every packet. */
+ int n_actions; /* Number of elements in actions[]. */
+ union odp_action *actions; /* Datapath actions. */
+ tag_type tags; /* Tags (set only by hooks). */
+ struct netflow_flow nf_flow; /* Per-flow NetFlow tracking data. */
+};
+
+static struct facet *facet_create(struct ofproto *, struct rule *,
+ const struct flow *,
+ const struct ofpbuf *packet);
+static void facet_remove(struct ofproto *, struct facet *);
+static void facet_free(struct facet *);
+
+static struct facet *facet_lookup_valid(struct ofproto *, const struct flow *);
+static bool facet_revalidate(struct ofproto *, struct facet *);
+
+static void facet_install(struct ofproto *, struct facet *, bool zero_stats);
+static void facet_uninstall(struct ofproto *, struct facet *);
+static void facet_post_uninstall(struct ofproto *, struct facet *);
+
+static bool facet_make_actions(struct ofproto *, struct facet *,