dpif: Use explicit packet metadata.
[sliver-openvswitch.git] / lib / dpif.h
index d447a86..7f986f9 100644 (file)
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
+#include "netdev.h"
 #include "ofpbuf.h"
 #include "openflow/openflow.h"
-#include "netdev.h"
+#include "packets.h"
 #include "util.h"
 
 #ifdef  __cplusplus
@@ -413,9 +414,9 @@ struct dpif_dp_stats {
     uint64_t n_missed;          /* Number of flow table misses. */
     uint64_t n_lost;            /* Number of misses not sent to userspace. */
     uint64_t n_flows;           /* Number of flows present. */
-    uint64_t n_masks;           /* Number of mega flow masks. */
     uint64_t n_mask_hit;        /* Number of mega flow masks visited for
                                    flow table matches. */
+    uint32_t n_masks;           /* Number of mega flow masks. */
 };
 int dpif_get_dp_stats(const struct dpif *, struct dpif_dp_stats *);
 
@@ -516,13 +517,6 @@ bool dpif_flow_dump_next(struct dpif_flow_dump *,
                          const struct dpif_flow_stats **);
 int dpif_flow_dump_done(struct dpif_flow_dump *);
 \f
-/* Packet operations. */
-
-int dpif_execute(struct dpif *,
-                 const struct nlattr *key, size_t key_len,
-                 const struct nlattr *actions, size_t actions_len,
-                 struct ofpbuf *, bool needs_help);
-\f
 /* Operation batching interface.
  *
  * Some datapaths are faster at performing N operations together than the same
@@ -560,11 +554,10 @@ struct dpif_flow_del {
 
 struct dpif_execute {
     /* Raw support for execute passed along to the provider. */
-    const struct nlattr *key;       /* Partial flow key (only for metadata). */
-    size_t key_len;                 /* Length of 'key' in bytes. */
     const struct nlattr *actions;   /* Actions to execute on packet. */
     size_t actions_len;             /* Length of 'actions' in bytes. */
     struct ofpbuf *packet;          /* Packet to execute. */
+    struct pkt_metadata md;         /* Packet metadata. */
 
     /* Some dpif providers do not implement every action.  The Linux kernel
      * datapath, in particular, does not implement ARP field modification.
@@ -576,6 +569,8 @@ struct dpif_execute {
     bool needs_help;
 };
 
+int dpif_execute(struct dpif *, struct dpif_execute *);
+
 struct dpif_op {
     enum dpif_op_type type;
     int error;