ovs_u128 ct_label; /* Connection label. */
uint32_t conj_id; /* Conjunction ID. */
ofp_port_t actset_output; /* Output port in action set. */
- uint8_t pad2[2]; /* Pad to 64 bits. */
/* L2, Order the same as in the Ethernet header! (64-bit aligned) */
struct eth_addr dl_dst; /* Ethernet destination address. */
/*
- * Copyright (c) 2010, 2011, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2013, 2014, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
ovs_be32 hi, lo;
} ovs_32aligned_be64;
-/* ofp_port_t represents the port number of a OpenFlow switch.
- * odp_port_t represents the port number on the datapath.
- * ofp11_port_t represents the OpenFlow-1.1 port number. */
-typedef uint16_t OVS_BITWISE ofp_port_t;
+/* Port numbers
+ * ------------
+ *
+ * None of these types are directly interchangeable, hence the OVS_BITWISE
+ * annotation.
+ *
+ * ofp_port_t is an OpenFlow 1.0 port number. It uses a 16-bit range, even
+ * though it is a 32-bit type. This allows it to be overlaid on an odp_port_t
+ * for a few situations where this is useful, e.g. in union flow_in_port.
+ *
+ * ofp11_port_t is an OpenFlow-1.1 port number.
+ *
+ * odp_port_t is a port number within a datapath (e.g. see lib/dpif.h).
+ */
+typedef uint32_t OVS_BITWISE ofp_port_t;
typedef uint32_t OVS_BITWISE odp_port_t;
typedef uint32_t OVS_BITWISE ofp11_port_t;
}
for (i = 0; i < bundle->n_slaves; i++) {
- uint16_t ofp_port = ntohs(((ovs_be16 *)(nab + 1))[i]);
+ ofp_port_t ofp_port = u16_to_ofp(ntohs(((ovs_be16 *)(nab + 1))[i]));
ofpbuf_put(ofpacts, &ofp_port, sizeof ofp_port);
bundle = ofpacts->header;
}
ovs_error(error, "%s: read failed", filename);
}
- pkt_metadata_init(&packet->md, ODPP_NONE);
+ pkt_metadata_init(&packet->md, u32_to_odp(ofp_to_u16(OFPP_ANY)));
flow_extract(packet, &flow);
flow_print(stdout, &flow);
putchar('\n');