2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

Implement OpenFlow 1.5 port desc stats request.

OpenFlow 1.4 and earlier always send the description of every port in
response to an OFPMP_PORT_DESC request.  OpenFlow 1.5 proposes allowing
the controller to request a description of a single port.  This commit
implements a prototype.

EXT-69.
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2014-05-07 23:18:46 -07:00
parent 19187a715f
commit 70ae4f930c
9 changed files with 193 additions and 41 deletions

View File

@@ -1899,6 +1899,23 @@ ofp_print_ofpst_queue_reply(struct ds *string, const struct ofp_header *oh,
}
}
static void
ofp_print_ofpst_port_desc_request(struct ds *string,
const struct ofp_header *oh)
{
enum ofperr error;
ofp_port_t port;
error = ofputil_decode_port_desc_stats_request(oh, &port);
if (error) {
ofp_print_error(string, error);
return;
}
ds_put_cstr(string, " port=");
ofputil_format_port(port, string);
}
static void
ofp_print_ofpst_port_desc_reply(struct ds *string,
const struct ofp_header *oh)
@@ -2917,7 +2934,6 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
break;
case OFPTYPE_DESC_STATS_REQUEST:
case OFPTYPE_PORT_DESC_STATS_REQUEST:
case OFPTYPE_METER_FEATURES_STATS_REQUEST:
ofp_print_stats_request(string, oh);
break;
@@ -2972,6 +2988,11 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
ofp_print_aggregate_stats_reply(string, oh);
break;
case OFPTYPE_PORT_DESC_STATS_REQUEST:
ofp_print_stats_request(string, oh);
ofp_print_ofpst_port_desc_request(string, oh);
break;
case OFPTYPE_PORT_DESC_STATS_REPLY:
ofp_print_stats_reply(string, oh);
ofp_print_ofpst_port_desc_reply(string, oh);