datapath-windows: Allow NdisSwitchPortTypeSynthetic to be updated
[cascardo/ovs.git] / lib / flow.h
index 17b9b86..dcb5bb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ struct dpif_flow_stats;
 struct ds;
 struct flow_wildcards;
 struct minimask;
-struct ofpbuf;
+struct dp_packet;
 struct pkt_metadata;
 
 /* This sequence number should be incremented whenever anything involving flows
  * or the wildcarding of flows changes.  This will cause build assertion
  * failures in places which likely need to be updated. */
-#define FLOW_WC_SEQ 29
+#define FLOW_WC_SEQ 31
 
 /* Number of Open vSwitch extension 32-bit registers. */
 #define FLOW_N_REGS 8
@@ -105,8 +105,9 @@ struct flow {
                                  * computation is opaque to the user space. */
     union flow_in_port in_port; /* Input port.*/
     uint32_t recirc_id;         /* Must be exact match. */
+    uint32_t conj_id;           /* Conjunction ID. */
     ofp_port_t actset_output;   /* Output port in action set. */
-    ovs_be16 pad1;              /* Pad to 64 bits. */
+    uint8_t pad1[6];            /* Pad to 64 bits. */
 
     /* L2, Order the same as in the Ethernet header! (64-bit aligned) */
     uint8_t dl_dst[ETH_ADDR_LEN]; /* Ethernet destination address. */
@@ -154,8 +155,8 @@ BUILD_ASSERT_DECL(sizeof(struct flow) % sizeof(uint64_t) == 0);
 
 /* Remember to update FLOW_WC_SEQ when changing 'struct flow'. */
 BUILD_ASSERT_DECL(offsetof(struct flow, igmp_group_ip4) + sizeof(uint32_t)
-                  == sizeof(struct flow_tnl) + 184
-                  && FLOW_WC_SEQ == 29);
+                  == sizeof(struct flow_tnl) + 192
+                  && FLOW_WC_SEQ == 31);
 
 /* Incremental points at which flow classification may be performed in
  * segments.
@@ -185,14 +186,15 @@ struct flow_metadata {
     ovs_be64 tun_id;                 /* Encapsulating tunnel ID. */
     ovs_be32 tun_src;                /* Tunnel outer IPv4 src addr */
     ovs_be32 tun_dst;                /* Tunnel outer IPv4 dst addr */
+    ovs_be16 gbp_id;                 /* Group policy ID */
+    uint8_t  gbp_flags;              /* Group policy flags */
     ovs_be64 metadata;               /* OpenFlow 1.1+ metadata field. */
     uint32_t regs[FLOW_N_REGS];      /* Registers. */
     uint32_t pkt_mark;               /* Packet mark. */
     ofp_port_t in_port;              /* OpenFlow port or zero. */
 };
 
-void flow_extract(struct ofpbuf *, const struct pkt_metadata *md,
-                  struct flow *);
+void flow_extract(struct dp_packet *, struct flow *);
 
 void flow_zero_wildcards(struct flow *, const struct flow_wildcards *);
 void flow_unwildcard_tp_ports(const struct flow *, struct flow_wildcards *);
@@ -229,7 +231,7 @@ void flow_set_mpls_tc(struct flow *, int idx, uint8_t tc);
 void flow_set_mpls_bos(struct flow *, int idx, uint8_t stack);
 void flow_set_mpls_lse(struct flow *, int idx, ovs_be32 lse);
 
-void flow_compose(struct ofpbuf *, const struct flow *);
+void flow_compose(struct dp_packet *, const struct flow *);
 
 static inline uint64_t
 flow_get_xreg(const struct flow *flow, int idx)
@@ -448,8 +450,7 @@ struct pkt_metadata;
 /* The 'dst->values' must be initialized with a buffer with space for
  * FLOW_U64S.  'dst->map' is ignored on input and set on output to
  * indicate which fields were extracted. */
-void miniflow_extract(struct ofpbuf *packet, const struct pkt_metadata *,
-                      struct miniflow *dst);
+void miniflow_extract(struct dp_packet *packet, struct miniflow *dst);
 void miniflow_init(struct miniflow *, const struct flow *);
 void miniflow_init_with_minimask(struct miniflow *, const struct flow *,
                                  const struct minimask *);
@@ -743,19 +744,15 @@ flow_union_with_miniflow(struct flow *dst, const struct miniflow *src)
     }
 }
 
-static inline struct pkt_metadata
-pkt_metadata_from_flow(const struct flow *flow)
-{
-    struct pkt_metadata md;
-
-    md.recirc_id = flow->recirc_id;
-    md.dp_hash = flow->dp_hash;
-    md.tunnel = flow->tunnel;
-    md.skb_priority = flow->skb_priority;
-    md.pkt_mark = flow->pkt_mark;
-    md.in_port = flow->in_port;
-
-    return md;
+static inline void
+pkt_metadata_from_flow(struct pkt_metadata *md, const struct flow *flow)
+{
+    md->recirc_id = flow->recirc_id;
+    md->dp_hash = flow->dp_hash;
+    md->tunnel = flow->tunnel;
+    md->skb_priority = flow->skb_priority;
+    md->pkt_mark = flow->pkt_mark;
+    md->in_port = flow->in_port;
 }
 
 static inline bool is_ip_any(const struct flow *flow)