+/* Tunnel information used in flow key and metadata. */
+struct flow_tnl {
+ ovs_be64 tun_id;
+ ovs_be32 ip_src;
+ ovs_be32 ip_dst;
+ uint16_t flags;
+ uint8_t ip_tos;
+ uint8_t ip_ttl;
+};
+
+/* Unfortunately, a "struct flow" sometimes has to handle OpenFlow port
+ * numbers and other times datapath (dpif) port numbers. This union allows
+ * access to both. */
+union flow_in_port {
+ odp_port_t odp_port;
+ ofp_port_t ofp_port;
+};
+
+/* Datapath packet metadata */
+struct pkt_metadata {
+ uint32_t recirc_id; /* Recirculation id carried with the
+ recirculating packets. 0 for packets
+ received from the wire. */
+ uint32_t dp_hash; /* hash value computed by the recirculation
+ action. */
+ struct flow_tnl tunnel; /* Encapsulating tunnel parameters. */
+ uint32_t skb_priority; /* Packet priority for QoS. */
+ uint32_t pkt_mark; /* Packet mark. */
+ union flow_in_port in_port; /* Input port. */
+};
+
+#define PKT_METADATA_INITIALIZER(PORT) \
+ (struct pkt_metadata){ 0, 0, { 0, 0, 0, 0, 0, 0}, 0, 0, {(PORT)} }
+