- port = str_to_port_no(vconn_name, port_name);
-
- protocol = open_vconn(vconn_name, &vconn);
- version = ofputil_protocol_to_ofp_version(protocol);
- request = ofputil_encode_queue_get_config_request(version, port);
- dump_transaction(vconn, request);
+ struct vconn *vconn;
+ enum ofputil_protocol protocol = open_vconn(vconn_name, &vconn);
+ enum ofp_version version = ofputil_protocol_to_ofp_version(protocol);
+ if (port == OFPP_ANY && version == OFP10_VERSION) {
+ /* The user requested all queues on all ports. OpenFlow 1.0 only
+ * supports getting queues for an individual port, so to implement the
+ * user's request we have to get a list of all the ports.
+ *
+ * We use a second vconn to avoid having to accumulate a list of all of
+ * the ports. */
+ struct vconn *vconn2;
+ enum ofputil_protocol protocol2 = open_vconn(vconn_name, &vconn2);
+ enum ofp_version version2 = ofputil_protocol_to_ofp_version(protocol2);
+
+ struct port_iterator pi;
+ struct ofputil_phy_port pp;
+ for (port_iterator_init(&pi, vconn); port_iterator_next(&pi, &pp); ) {
+ if (ofp_to_u16(pp.port_no) < ofp_to_u16(OFPP_MAX)) {
+ dump_transaction(vconn2,
+ ofputil_encode_queue_get_config_request(
+ version2, pp.port_no));
+ }
+ }
+ port_iterator_destroy(&pi);
+ vconn_close(vconn2);
+ } else {
+ dump_transaction(vconn, ofputil_encode_queue_get_config_request(
+ version, port));
+ }