+enum { LRU_MAX_PORTS = 1024 };
+enum { LRU_MASK = LRU_MAX_PORTS - 1};
+BUILD_ASSERT_DECL(IS_POW2(LRU_MAX_PORTS));
+
+struct dpif_linux_dp {
+ /* Generic Netlink header. */
+ uint8_t cmd;
+
+ /* struct odp_header. */
+ int dp_ifindex;
+
+ /* Attributes. */
+ const char *name; /* ODP_DP_ATTR_NAME. */
+ struct odp_stats stats; /* ODP_DP_ATTR_STATS. */
+ enum odp_frag_handling ipv4_frags; /* ODP_DP_ATTR_IPV4_FRAGS. */
+ const uint32_t *sampling; /* ODP_DP_ATTR_SAMPLING. */
+ uint32_t mcgroups[DPIF_N_UC_TYPES]; /* ODP_DP_ATTR_MCGROUPS. */
+};
+
+static void dpif_linux_dp_init(struct dpif_linux_dp *);
+static int dpif_linux_dp_from_ofpbuf(struct dpif_linux_dp *,
+ const struct ofpbuf *);
+static void dpif_linux_dp_dump_start(struct nl_dump *);
+static int dpif_linux_dp_transact(const struct dpif_linux_dp *request,
+ struct dpif_linux_dp *reply,
+ struct ofpbuf **bufp);
+static int dpif_linux_dp_get(const struct dpif *, struct dpif_linux_dp *reply,
+ struct ofpbuf **bufp);
+
+struct dpif_linux_flow {
+ /* Generic Netlink header. */
+ uint8_t cmd;
+
+ /* struct odp_header. */
+ unsigned int nlmsg_flags;
+ int dp_ifindex;
+
+ /* Attributes.
+ *
+ * The 'stats' and 'used' members point to 64-bit data that might only be
+ * aligned on 32-bit boundaries, so get_unaligned_u64() should be used to
+ * access their values.
+ *
+ * If 'actions' is nonnull then ODP_FLOW_ATTR_ACTIONS will be included in
+ * the Netlink version of the command, even if actions_len is zero. */
+ const struct nlattr *key; /* ODP_FLOW_ATTR_KEY. */
+ size_t key_len;
+ const struct nlattr *actions; /* ODP_FLOW_ATTR_ACTIONS. */
+ size_t actions_len;
+ const struct odp_flow_stats *stats; /* ODP_FLOW_ATTR_STATS. */
+ const uint8_t *tcp_flags; /* ODP_FLOW_ATTR_TCP_FLAGS. */
+ const uint64_t *used; /* ODP_FLOW_ATTR_USED. */
+ bool clear; /* ODP_FLOW_ATTR_CLEAR. */
+};
+
+static void dpif_linux_flow_init(struct dpif_linux_flow *);
+static int dpif_linux_flow_from_ofpbuf(struct dpif_linux_flow *,
+ const struct ofpbuf *);
+static void dpif_linux_flow_to_ofpbuf(const struct dpif_linux_flow *,
+ struct ofpbuf *);
+static int dpif_linux_flow_transact(const struct dpif_linux_flow *request,
+ struct dpif_linux_flow *reply,
+ struct ofpbuf **bufp);
+static void dpif_linux_flow_get_stats(const struct dpif_linux_flow *,
+ struct dpif_flow_stats *);
+