-void odp_flow_key_from_flow(struct ofpbuf *, const struct flow * flow,
- const struct flow *mask, odp_port_t odp_in_port,
- bool recirc);
-void odp_flow_key_from_mask(struct ofpbuf *, const struct flow *mask,
- const struct flow *flow, uint32_t odp_in_port,
- size_t max_mpls_depth, bool recirc);
+/* Indicates support for various fields. This defines how flows will be
+ * serialised. */
+struct odp_support {
+ /* Maximum number of MPLS label stack entries to serialise in a mask. */
+ size_t max_mpls_depth;
+
+ /* If this is true, then recirculation fields will always be serialised. */
+ bool recirc;
+
+ /* If true, serialise the corresponding OVS_KEY_ATTR_CONN_* field. */
+ bool ct_state;
+ bool ct_zone;
+ bool ct_mark;
+ bool ct_label;
+
+ /* If true, it means that the datapath supports the NAT bits in
+ * 'ct_state'. The above 'ct_state' member must be true for this
+ * to make sense */
+ bool ct_state_nat;
+};
+
+struct odp_flow_key_parms {
+ /* The flow and mask to be serialized. In the case of masks, 'flow'
+ * is used as a template to determine how to interpret 'mask'. For
+ * example, the 'dl_type' of 'mask' describes the mask, but it doesn't
+ * indicate whether the other fields should be interpreted as ARP, IPv4,
+ * IPv6, etc. */
+ const struct flow *flow;
+ const struct flow *mask;
+
+ /* 'flow->in_port' is ignored (since it is likely to be an OpenFlow port
+ * number rather than a datapath port number). Instead, if 'odp_in_port'
+ * is anything other than ODPP_NONE, it is included in 'buf' as the input
+ * port. */
+ odp_port_t odp_in_port;
+
+ /* Indicates support for various fields. If the datapath supports a field,
+ * then it will always be serialised. */
+ struct odp_support support;
+
+ /* The netlink formatted version of the flow. It is used in cases where
+ * the mask cannot be constructed from the OVS internal representation
+ * and needs to see the original form. */
+ const struct ofpbuf *key_buf;
+};
+
+void odp_flow_key_from_flow(const struct odp_flow_key_parms *, struct ofpbuf *);
+void odp_flow_key_from_mask(const struct odp_flow_key_parms *, struct ofpbuf *);