[ovs-dev] [of1.1 rollup 15/20] openflow: Rename OpenFlow 1.0 statistics messages with "10" infix.
Ben Pfaff
blp at nicira.com
Tue Jun 12 07:32:19 UTC 2012
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
include/openflow/nicira-ext.h | 10 ++--
include/openflow/openflow-1.0.h | 61 +++++++---------------
include/openflow/openflow-common.h | 49 +++++++++++++-----
lib/ofp-print.c | 10 ++--
lib/ofp-util.c | 100 ++++++++++++++++++------------------
ofproto/ofproto-dpif.c | 2 +-
ofproto/ofproto-provider.h | 4 +-
ofproto/ofproto.c | 10 ++--
utilities/ovs-ofctl.c | 6 +-
9 files changed, 126 insertions(+), 126 deletions(-)
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
index 3ac893f..5ad5723 100644
--- a/include/openflow/nicira-ext.h
+++ b/include/openflow/nicira-ext.h
@@ -120,14 +120,14 @@ enum nicira_type {
};
/* Header for Nicira vendor stats request and reply messages. */
-struct nicira_stats_msg {
- struct ofp_vendor_stats_msg vsm; /* Vendor NX_VENDOR_ID. */
+struct nicira10_stats_msg {
+ struct ofp10_vendor_stats_msg vsm; /* Vendor NX_VENDOR_ID. */
ovs_be32 subtype; /* One of NXST_* below. */
uint8_t pad[4]; /* Align to 64-bits. */
};
-OFP_ASSERT(sizeof(struct nicira_stats_msg) == 24);
+OFP_ASSERT(sizeof(struct nicira10_stats_msg) == 24);
-/* Values for the 'subtype' member of struct nicira_stats_msg. */
+/* Values for the 'subtype' member of struct nicira10_stats_msg. */
enum nicira_stats_type {
/* Flexible flow specification (aka NXM = Nicira Extended Match). */
NXST_FLOW, /* Analogous to OFPST_FLOW. */
@@ -1922,7 +1922,7 @@ struct nx_aggregate_stats_request {
};
OFP_ASSERT(sizeof(struct nx_aggregate_stats_request) == 8);
-/* Body for nicira_stats_msg reply of type NXST_AGGREGATE (analogous to
+/* Body for nicira10_stats_msg reply of type NXST_AGGREGATE (analogous to
* OFPST_AGGREGATE reply). */
struct nx_aggregate_stats_reply {
ovs_be64 packet_count; /* Number of packets, UINT64_MAX if unknown. */
diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h
index 8cafd0b..d01a0f9 100644
--- a/include/openflow/openflow-1.0.h
+++ b/include/openflow/openflow-1.0.h
@@ -517,34 +517,20 @@ struct ofp_error_msg {
OFP_ASSERT(sizeof(struct ofp_error_msg) == 12);
/* Statistics request or reply message. */
-struct ofp_stats_msg {
+struct ofp10_stats_msg {
struct ofp_header header;
ovs_be16 type; /* One of the OFPST_* constants. */
ovs_be16 flags; /* Requests: always 0.
* Replies: 0 or OFPSF_REPLY_MORE. */
};
-OFP_ASSERT(sizeof(struct ofp_stats_msg) == 12);
+OFP_ASSERT(sizeof(struct ofp10_stats_msg) == 12);
enum ofp_stats_reply_flags {
OFPSF_REPLY_MORE = 1 << 0 /* More replies to follow. */
};
-#define DESC_STR_LEN 256
-#define SERIAL_NUM_LEN 32
-/* Body of reply to OFPST_DESC request. Each entry is a NULL-terminated ASCII
- * string. */
-struct ofp_desc_stats {
- char mfr_desc[DESC_STR_LEN]; /* Manufacturer description. */
- char hw_desc[DESC_STR_LEN]; /* Hardware description. */
- char sw_desc[DESC_STR_LEN]; /* Software description. */
- char serial_num[SERIAL_NUM_LEN]; /* Serial number. */
- char dp_desc[DESC_STR_LEN]; /* Human readable description of
- the datapath. */
-};
-OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056);
-
/* Stats request of type OFPST_AGGREGATE or OFPST_FLOW. */
-struct ofp_flow_stats_request {
+struct ofp10_flow_stats_request {
struct ofp10_match match; /* Fields to match. */
uint8_t table_id; /* ID of table to read (from ofp_table_stats)
or 0xff for all tables. */
@@ -553,10 +539,10 @@ struct ofp_flow_stats_request {
as an output port. A value of OFPP_NONE
indicates no restriction. */
};
-OFP_ASSERT(sizeof(struct ofp_flow_stats_request) == 44);
+OFP_ASSERT(sizeof(struct ofp10_flow_stats_request) == 44);
/* Body of reply to OFPST_FLOW request. */
-struct ofp_flow_stats {
+struct ofp10_flow_stats {
ovs_be16 length; /* Length of this entry. */
uint8_t table_id; /* ID of table flow came from. */
uint8_t pad;
@@ -574,19 +560,10 @@ struct ofp_flow_stats {
ovs_32aligned_be64 byte_count; /* Number of bytes in flow. */
struct ofp_action_header actions[0]; /* Actions. */
};
-OFP_ASSERT(sizeof(struct ofp_flow_stats) == 88);
-
-/* Reply to OFPST_AGGREGATE request. */
-struct ofp_aggregate_stats_reply {
- ovs_32aligned_be64 packet_count; /* Number of packets in flows. */
- ovs_32aligned_be64 byte_count; /* Number of bytes in flows. */
- ovs_be32 flow_count; /* Number of flows. */
- uint8_t pad[4]; /* Align to 64 bits. */
-};
-OFP_ASSERT(sizeof(struct ofp_aggregate_stats_reply) == 24);
+OFP_ASSERT(sizeof(struct ofp10_flow_stats) == 88);
/* Body of reply to OFPST_TABLE request. */
-struct ofp_table_stats {
+struct ofp10_table_stats {
uint8_t table_id; /* Identifier of table. Lower numbered tables
are consulted first. */
uint8_t pad[3]; /* Align to 32-bits. */
@@ -598,20 +575,20 @@ struct ofp_table_stats {
ovs_32aligned_be64 lookup_count; /* # of packets looked up in table. */
ovs_32aligned_be64 matched_count; /* Number of packets that hit table. */
};
-OFP_ASSERT(sizeof(struct ofp_table_stats) == 64);
+OFP_ASSERT(sizeof(struct ofp10_table_stats) == 64);
/* Stats request of type OFPST_PORT. */
-struct ofp_port_stats_request {
+struct ofp10_port_stats_request {
ovs_be16 port_no; /* OFPST_PORT message may request statistics
for a single port (specified with port_no)
or for all ports (port_no == OFPP_NONE). */
uint8_t pad[6];
};
-OFP_ASSERT(sizeof(struct ofp_port_stats_request) == 8);
+OFP_ASSERT(sizeof(struct ofp10_port_stats_request) == 8);
/* Body of reply to OFPST_PORT request. If a counter is unsupported, set
* the field to all ones. */
-struct ofp_port_stats {
+struct ofp10_port_stats {
ovs_be16 port_no;
uint8_t pad[6]; /* Align to 64-bits. */
ovs_32aligned_be64 rx_packets; /* Number of received packets. */
@@ -631,22 +608,22 @@ struct ofp_port_stats {
ovs_32aligned_be64 rx_crc_err; /* Number of CRC errors. */
ovs_32aligned_be64 collisions; /* Number of collisions. */
};
-OFP_ASSERT(sizeof(struct ofp_port_stats) == 104);
+OFP_ASSERT(sizeof(struct ofp10_port_stats) == 104);
/* All ones is used to indicate all queues in a port (for stats retrieval). */
#define OFPQ_ALL 0xffffffff
/* Body for stats request of type OFPST_QUEUE. */
-struct ofp_queue_stats_request {
+struct ofp10_queue_stats_request {
ovs_be16 port_no; /* All ports if OFPP_ALL. */
uint8_t pad[2]; /* Align to 32-bits. */
ovs_be32 queue_id; /* All queues if OFPQ_ALL. */
};
-OFP_ASSERT(sizeof(struct ofp_queue_stats_request) == 8);
+OFP_ASSERT(sizeof(struct ofp10_queue_stats_request) == 8);
/* Body for stats reply of type OFPST_QUEUE consists of an array of this
* structure type. */
-struct ofp_queue_stats {
+struct ofp10_queue_stats {
ovs_be16 port_no;
uint8_t pad[2]; /* Align to 32-bits. */
ovs_be32 queue_id; /* Queue id. */
@@ -654,18 +631,18 @@ struct ofp_queue_stats {
ovs_32aligned_be64 tx_packets; /* Number of transmitted packets. */
ovs_32aligned_be64 tx_errors; /* # of packets dropped due to overrun. */
};
-OFP_ASSERT(sizeof(struct ofp_queue_stats) == 32);
+OFP_ASSERT(sizeof(struct ofp10_queue_stats) == 32);
/* Vendor extension stats message. */
-struct ofp_vendor_stats_msg {
- struct ofp_stats_msg osm; /* Type OFPST_VENDOR. */
+struct ofp10_vendor_stats_msg {
+ struct ofp10_stats_msg osm; /* Type OFPST_VENDOR. */
ovs_be32 vendor; /* Vendor ID:
* - MSB 0: low-order bytes are IEEE OUI.
* - MSB != 0: defined by OpenFlow
* consortium. */
/* Followed by vendor-defined arbitrary additional data. */
};
-OFP_ASSERT(sizeof(struct ofp_vendor_stats_msg) == 16);
+OFP_ASSERT(sizeof(struct ofp10_vendor_stats_msg) == 16);
/* Vendor extension. */
struct ofp_vendor_header {
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index 833737f..69e7341 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -244,39 +244,39 @@ OFP_ASSERT(sizeof(struct ofp_port_status) == 16);
enum ofp_stats_types {
/* Description of this OpenFlow switch. (OFPMP_DESC)
- * The OF1.0 request body is empty.
- * The OF1.0 reply body is struct ofp_desc_stats. */
+ * The request body is empty.
+ * The reply body is struct ofp_desc_stats. */
OFPST_DESC = 0,
/* Individual flow statistics. (OFPMP_FLOW)
- * The OF1.0 request body is struct ofp_flow_stats_request.
- * The OF1.0 reply body is an array of struct ofp_flow_stats. */
+ * The OF1.0 request body is struct ofp10_flow_stats_request.
+ * The OF1.0 reply body is an array of struct ofp10_flow_stats. */
OFPST_FLOW = 1,
/* Aggregate flow statistics. (OFPMP_AGGREGATE)
- * The OF1.0 request body is struct ofp_flow_stats_request.
- * The OF1.0 reply body is struct ofp_aggregate_stats_reply. */
+ * The OF1.0 request body is struct ofp10_flow_stats_request.
+ * The reply body is struct ofp_aggregate_stats_reply. */
OFPST_AGGREGATE = 2,
/* Flow table statistics. (OFPMP_TABLE)
- * The OF1.0 request body is struct ofp_stats_msg.
- * The OF1.0 reply body is an array of struct ofp_table_stats. */
+ * The OF1.0 request body is struct ofp10_stats_msg.
+ * The OF1.0 reply body is an array of struct ofp10_table_stats. */
OFPST_TABLE = 3,
/* Physical port statistics. (OFPMP_PORT_STATS)
- * The OF1.0 request body is struct ofp_port_stats_request.
- * The OF1.0 reply body is an array of struct ofp_port_stats. */
+ * The OF1.0 request body is struct ofp10_port_stats_request.
+ * The OF1.0 reply body is an array of struct ofp10_port_stats. */
OFPST_PORT = 4,
/* Queue statistics for a port. (OFPMP_QUEUE)
- * The OF1.0 request body is empty.
- * The OF1.0 reply body is an array of struct ofp_queue_stats. */
+ * The OF1.0 request body is struct ofp10_queue_stats_request.
+ * The OF1.0 reply body is an array of struct ofp10_queue_stats. */
OFPST_QUEUE = 5,
/* Port description. (OFPMP_PORT_DESC)
* This was introduced as part of OF1.3, but is useful for bridges
* with many ports, so we support it with OF1.0, too.
- * The OF1.0 request body is empty.
+ * The request body is empty.
* The OF1.0 reply body is an array of struct ofp10_phy_port. */
OFPST_PORT_DESC = 13,
@@ -285,6 +285,29 @@ enum ofp_stats_types {
OFPST_VENDOR = 0xffff
};
+#define DESC_STR_LEN 256
+#define SERIAL_NUM_LEN 32
+/* Body of reply to OFPST_DESC request. Each entry is a NULL-terminated ASCII
+ * string. */
+struct ofp_desc_stats {
+ char mfr_desc[DESC_STR_LEN]; /* Manufacturer description. */
+ char hw_desc[DESC_STR_LEN]; /* Hardware description. */
+ char sw_desc[DESC_STR_LEN]; /* Software description. */
+ char serial_num[SERIAL_NUM_LEN]; /* Serial number. */
+ char dp_desc[DESC_STR_LEN]; /* Human readable description of
+ the datapath. */
+};
+OFP_ASSERT(sizeof(struct ofp_desc_stats) == 1056);
+
+/* Reply to OFPST_AGGREGATE request. */
+struct ofp_aggregate_stats_reply {
+ ovs_32aligned_be64 packet_count; /* Number of packets in flows. */
+ ovs_32aligned_be64 byte_count; /* Number of bytes in flows. */
+ ovs_be32 flow_count; /* Number of flows. */
+ uint8_t pad[4]; /* Align to 64 bits. */
+};
+OFP_ASSERT(sizeof(struct ofp_aggregate_stats_reply) == 24);
+
/* The match type indicates the match structure (set of fields that compose the
* match) in use. The match type is placed in the type field at the beginning
* of all match structures. The "OpenFlow Extensible Match" type corresponds
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 52fe39e..469aa1d 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1059,7 +1059,7 @@ static void print_port_stat(struct ds *string, const char *leader,
static void
ofp_print_ofpst_port_request(struct ds *string, const struct ofp_header *oh)
{
- const struct ofp_port_stats_request *psr = ofputil_stats_msg_body(oh);
+ const struct ofp10_port_stats_request *psr = ofputil_stats_msg_body(oh);
ds_put_format(string, " port_no=%"PRIu16, ntohs(psr->port_no));
}
@@ -1067,7 +1067,7 @@ static void
ofp_print_ofpst_port_reply(struct ds *string, const struct ofp_header *oh,
int verbosity)
{
- struct ofp_port_stats *ps;
+ struct ofp10_port_stats *ps;
struct ofpbuf b;
size_t n;
@@ -1110,7 +1110,7 @@ static void
ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh,
int verbosity)
{
- struct ofp_table_stats *ts;
+ struct ofp10_table_stats *ts;
struct ofpbuf b;
size_t n;
@@ -1158,7 +1158,7 @@ ofp_print_queue_name(struct ds *string, uint32_t queue_id)
static void
ofp_print_ofpst_queue_request(struct ds *string, const struct ofp_header *oh)
{
- const struct ofp_queue_stats_request *qsr = ofputil_stats_msg_body(oh);
+ const struct ofp10_queue_stats_request *qsr = ofputil_stats_msg_body(oh);
ds_put_cstr(string, "port=");
ofputil_format_port(ntohs(qsr->port_no), string);
@@ -1171,7 +1171,7 @@ static void
ofp_print_ofpst_queue_reply(struct ds *string, const struct ofp_header *oh,
int verbosity)
{
- struct ofp_queue_stats *qs;
+ struct ofp10_queue_stats *qs;
struct ofpbuf b;
size_t n;
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 02be8f9..56c07a2 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -721,10 +721,10 @@ ofputil_decode_vendor(const struct ofp_header *oh, size_t length,
static enum ofperr
check_nxstats_msg(const struct ofp_header *oh, size_t length)
{
- const struct ofp_stats_msg *osm = (const struct ofp_stats_msg *) oh;
+ const struct ofp10_stats_msg *osm = (const struct ofp10_stats_msg *) oh;
ovs_be32 vendor;
- if (length < sizeof(struct ofp_vendor_stats_msg)) {
+ if (length < sizeof(struct ofp10_vendor_stats_msg)) {
if (length == ntohs(oh->length)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "truncated vendor stats message");
}
@@ -738,7 +738,7 @@ check_nxstats_msg(const struct ofp_header *oh, size_t length)
return OFPERR_OFPBRC_BAD_VENDOR;
}
- if (length < sizeof(struct nicira_stats_msg)) {
+ if (length < sizeof(struct nicira10_stats_msg)) {
if (length == ntohs(osm->header.length)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "truncated Nicira stats message");
}
@@ -755,12 +755,12 @@ ofputil_decode_nxst_request(const struct ofp_header *oh, size_t length,
static const struct ofputil_msg_type nxst_requests[] = {
{ OFPUTIL_NXST_FLOW_REQUEST, OFP10_VERSION,
NXST_FLOW, "NXST_FLOW request",
- sizeof(struct nicira_stats_msg) + sizeof(struct nx_flow_stats_request),
+ sizeof(struct nicira10_stats_msg) + sizeof(struct nx_flow_stats_request),
8 },
{ OFPUTIL_NXST_AGGREGATE_REQUEST, OFP10_VERSION,
NXST_AGGREGATE, "NXST_AGGREGATE request",
- sizeof(struct nicira_stats_msg) + sizeof(struct nx_aggregate_stats_request),
+ sizeof(struct nicira10_stats_msg) + sizeof(struct nx_aggregate_stats_request),
8 },
};
@@ -770,7 +770,7 @@ ofputil_decode_nxst_request(const struct ofp_header *oh, size_t length,
OFPERR_OFPBRC_BAD_SUBTYPE
};
- const struct nicira_stats_msg *nsm;
+ const struct nicira10_stats_msg *nsm;
enum ofperr error;
error = check_nxstats_msg(oh, length);
@@ -778,7 +778,7 @@ ofputil_decode_nxst_request(const struct ofp_header *oh, size_t length,
return error;
}
- nsm = (struct nicira_stats_msg *) oh;
+ nsm = (struct nicira10_stats_msg *) oh;
return ofputil_lookup_openflow_message(&nxst_request_category, oh->version,
ntohl(nsm->subtype), typep);
}
@@ -790,11 +790,11 @@ ofputil_decode_nxst_reply(const struct ofp_header *oh, size_t length,
static const struct ofputil_msg_type nxst_replies[] = {
{ OFPUTIL_NXST_FLOW_REPLY, OFP10_VERSION,
NXST_FLOW, "NXST_FLOW reply",
- sizeof(struct nicira_stats_msg), 8 },
+ sizeof(struct nicira10_stats_msg), 8 },
{ OFPUTIL_NXST_AGGREGATE_REPLY, OFP10_VERSION,
NXST_AGGREGATE, "NXST_AGGREGATE reply",
- sizeof(struct nicira_stats_msg) + sizeof(struct nx_aggregate_stats_reply),
+ sizeof(struct nicira10_stats_msg) + sizeof(struct nx_aggregate_stats_reply),
0 },
};
@@ -804,7 +804,7 @@ ofputil_decode_nxst_reply(const struct ofp_header *oh, size_t length,
OFPERR_OFPBRC_BAD_SUBTYPE
};
- const struct nicira_stats_msg *nsm;
+ const struct nicira10_stats_msg *nsm;
enum ofperr error;
error = check_nxstats_msg(oh, length);
@@ -812,7 +812,7 @@ ofputil_decode_nxst_reply(const struct ofp_header *oh, size_t length,
return error;
}
- nsm = (struct nicira_stats_msg *) oh;
+ nsm = (struct nicira10_stats_msg *) oh;
return ofputil_lookup_openflow_message(&nxst_reply_category, oh->version,
ntohl(nsm->subtype), typep);
}
@@ -820,7 +820,7 @@ ofputil_decode_nxst_reply(const struct ofp_header *oh, size_t length,
static enum ofperr
check_stats_msg(const struct ofp_header *oh, size_t length)
{
- if (length < sizeof(struct ofp_stats_msg)) {
+ if (length < sizeof(struct ofp10_stats_msg)) {
if (length == ntohs(oh->length)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "truncated stats message");
}
@@ -837,39 +837,39 @@ ofputil_decode_ofpst_request(const struct ofp_header *oh, size_t length,
static const struct ofputil_msg_type ofpst_requests[] = {
{ OFPUTIL_OFPST_DESC_REQUEST, OFP10_VERSION,
OFPST_DESC, "OFPST_DESC request",
- sizeof(struct ofp_stats_msg), 0 },
+ sizeof(struct ofp10_stats_msg), 0 },
{ OFPUTIL_OFPST_FLOW_REQUEST, OFP10_VERSION,
OFPST_FLOW, "OFPST_FLOW request",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_flow_stats_request),
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp10_flow_stats_request),
0 },
{ OFPUTIL_OFPST_AGGREGATE_REQUEST, OFP10_VERSION,
OFPST_AGGREGATE, "OFPST_AGGREGATE request",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_flow_stats_request),
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp10_flow_stats_request),
0 },
{ OFPUTIL_OFPST_TABLE_REQUEST, OFP10_VERSION,
OFPST_TABLE, "OFPST_TABLE request",
- sizeof(struct ofp_stats_msg), 0 },
+ sizeof(struct ofp10_stats_msg), 0 },
{ OFPUTIL_OFPST_PORT_REQUEST, OFP10_VERSION,
OFPST_PORT, "OFPST_PORT request",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_port_stats_request),
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp10_port_stats_request),
0 },
{ OFPUTIL_OFPST_QUEUE_REQUEST, OFP10_VERSION,
OFPST_QUEUE, "OFPST_QUEUE request",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_queue_stats_request),
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp10_queue_stats_request),
0 },
{ OFPUTIL_OFPST_PORT_DESC_REQUEST, OFP10_VERSION,
OFPST_PORT_DESC, "OFPST_PORT_DESC request",
- sizeof(struct ofp_stats_msg), 0 },
+ sizeof(struct ofp10_stats_msg), 0 },
{ 0, 0,
OFPST_VENDOR, "OFPST_VENDOR request",
- sizeof(struct ofp_vendor_stats_msg), 1 },
+ sizeof(struct ofp10_vendor_stats_msg), 1 },
};
static const struct ofputil_msg_category ofpst_request_category = {
@@ -878,7 +878,7 @@ ofputil_decode_ofpst_request(const struct ofp_header *oh, size_t length,
OFPERR_OFPBRC_BAD_STAT
};
- const struct ofp_stats_msg *request = (const struct ofp_stats_msg *) oh;
+ const struct ofp10_stats_msg *request = (const struct ofp10_stats_msg *) oh;
enum ofperr error;
error = check_stats_msg(oh, length);
@@ -902,36 +902,36 @@ ofputil_decode_ofpst_reply(const struct ofp_header *oh, size_t length,
static const struct ofputil_msg_type ofpst_replies[] = {
{ OFPUTIL_OFPST_DESC_REPLY, OFP10_VERSION,
OFPST_DESC, "OFPST_DESC reply",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_desc_stats), 0 },
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp_desc_stats), 0 },
{ OFPUTIL_OFPST_FLOW_REPLY, OFP10_VERSION,
OFPST_FLOW, "OFPST_FLOW reply",
- sizeof(struct ofp_stats_msg), 1 },
+ sizeof(struct ofp10_stats_msg), 1 },
{ OFPUTIL_OFPST_AGGREGATE_REPLY, OFP10_VERSION,
OFPST_AGGREGATE, "OFPST_AGGREGATE reply",
- sizeof(struct ofp_stats_msg) + sizeof(struct ofp_aggregate_stats_reply),
+ sizeof(struct ofp10_stats_msg) + sizeof(struct ofp_aggregate_stats_reply),
0 },
{ OFPUTIL_OFPST_TABLE_REPLY, OFP10_VERSION,
OFPST_TABLE, "OFPST_TABLE reply",
- sizeof(struct ofp_stats_msg), sizeof(struct ofp_table_stats) },
+ sizeof(struct ofp10_stats_msg), sizeof(struct ofp10_table_stats) },
{ OFPUTIL_OFPST_PORT_REPLY, OFP10_VERSION,
OFPST_PORT, "OFPST_PORT reply",
- sizeof(struct ofp_stats_msg), sizeof(struct ofp_port_stats) },
+ sizeof(struct ofp10_stats_msg), sizeof(struct ofp10_port_stats) },
{ OFPUTIL_OFPST_QUEUE_REPLY, OFP10_VERSION,
OFPST_QUEUE, "OFPST_QUEUE reply",
- sizeof(struct ofp_stats_msg), sizeof(struct ofp_queue_stats) },
+ sizeof(struct ofp10_stats_msg), sizeof(struct ofp10_queue_stats) },
{ OFPUTIL_OFPST_PORT_DESC_REPLY, OFP10_VERSION,
OFPST_PORT_DESC, "OFPST_PORT_DESC reply",
- sizeof(struct ofp_stats_msg), sizeof(struct ofp10_phy_port) },
+ sizeof(struct ofp10_stats_msg), sizeof(struct ofp10_phy_port) },
{ 0, 0,
OFPST_VENDOR, "OFPST_VENDOR reply",
- sizeof(struct ofp_vendor_stats_msg), 1 },
+ sizeof(struct ofp10_vendor_stats_msg), 1 },
};
static const struct ofputil_msg_category ofpst_reply_category = {
@@ -940,7 +940,7 @@ ofputil_decode_ofpst_reply(const struct ofp_header *oh, size_t length,
OFPERR_OFPBRC_BAD_STAT
};
- const struct ofp_stats_msg *reply = (const struct ofp_stats_msg *) oh;
+ const struct ofp10_stats_msg *reply = (const struct ofp10_stats_msg *) oh;
enum ofperr error;
error = check_stats_msg(oh, length);
@@ -1032,11 +1032,11 @@ ofputil_decode_msg_type__(const struct ofp_header *oh, size_t length,
{ 0, OFP10_VERSION,
OFPT10_STATS_REQUEST, "OFPT_STATS_REQUEST",
- sizeof(struct ofp_stats_msg), 1 },
+ sizeof(struct ofp10_stats_msg), 1 },
{ 0, OFP10_VERSION,
OFPT10_STATS_REPLY, "OFPT_STATS_REPLY",
- sizeof(struct ofp_stats_msg), 1 },
+ sizeof(struct ofp10_stats_msg), 1 },
{ OFPUTIL_OFPT_BARRIER_REQUEST, OFP10_VERSION,
OFPT10_BARRIER_REQUEST, "OFPT_BARRIER_REQUEST",
@@ -1847,7 +1847,7 @@ ofputil_flow_mod_usable_protocols(const struct ofputil_flow_mod *fms,
static enum ofperr
ofputil_decode_ofpst_flow_request(struct ofputil_flow_stats_request *fsr,
- const struct ofp_flow_stats_request *ofsr,
+ const struct ofp10_flow_stats_request *ofsr,
bool aggregate)
{
fsr->aggregate = aggregate;
@@ -1930,7 +1930,7 @@ ofputil_encode_flow_stats_request(const struct ofputil_flow_stats_request *fsr,
switch (protocol) {
case OFPUTIL_P_OF10:
case OFPUTIL_P_OF10_TID: {
- struct ofp_flow_stats_request *ofsr;
+ struct ofp10_flow_stats_request *ofsr;
int type;
type = fsr->aggregate ? OFPST_AGGREGATE : OFPST_FLOW;
@@ -2022,7 +2022,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
if (!msg->size) {
return EOF;
} else if (code == OFPUTIL_OFPST_FLOW_REPLY) {
- const struct ofp_flow_stats *ofs;
+ const struct ofp10_flow_stats *ofs;
size_t length;
ofs = ofpbuf_try_pull(msg, sizeof *ofs);
@@ -2129,11 +2129,11 @@ ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *fs,
struct list *replies)
{
struct ofpbuf *reply = ofpbuf_from_list(list_back(replies));
- const struct ofp_stats_msg *osm = reply->data;
+ const struct ofp10_stats_msg *osm = reply->data;
size_t start_ofs = reply->size;
if (osm->type == htons(OFPST_FLOW)) {
- struct ofp_flow_stats *ofs;
+ struct ofp10_flow_stats *ofs;
ofs = ofpbuf_put_uninit(reply, sizeof *ofs);
ofs->table_id = fs->table_id;
@@ -3259,14 +3259,14 @@ put_stats__(ovs_be32 xid, uint8_t ofp_type,
struct ofpbuf *msg)
{
if (ofpst_type == htons(OFPST_VENDOR)) {
- struct nicira_stats_msg *nsm;
+ struct nicira10_stats_msg *nsm;
nsm = put_openflow_xid(sizeof *nsm, ofp_type, xid, msg);
nsm->vsm.osm.type = ofpst_type;
nsm->vsm.vendor = htonl(NX_VENDOR_ID);
nsm->subtype = nxst_subtype;
} else {
- struct ofp_stats_msg *osm;
+ struct ofp10_stats_msg *osm;
osm = put_openflow_xid(sizeof *osm, ofp_type, xid, msg);
osm->type = ofpst_type;
@@ -3296,16 +3296,16 @@ ofputil_make_stats_request(size_t body_len, uint16_t ofpst_type,
static void
put_stats_reply__(const struct ofp_header *request, struct ofpbuf *msg)
{
- const struct ofp_stats_msg *osm;
+ const struct ofp10_stats_msg *osm;
assert(request->type == OFPT10_STATS_REQUEST ||
request->type == OFPT10_STATS_REPLY);
- osm = (const struct ofp_stats_msg *) request;
+ osm = (const struct ofp10_stats_msg *) request;
put_stats__(request->xid, OFPT10_STATS_REPLY, osm->type,
(osm->type != htons(OFPST_VENDOR)
? htonl(0)
- : ((const struct nicira_stats_msg *) request)->subtype),
+ : ((const struct nicira10_stats_msg *) request)->subtype),
msg);
}
@@ -3355,14 +3355,14 @@ struct ofpbuf *
ofputil_reserve_stats_reply(size_t len, struct list *replies)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
- struct ofp_stats_msg *osm = msg->data;
+ struct ofp10_stats_msg *osm = msg->data;
if (msg->size + len <= UINT16_MAX) {
ofpbuf_prealloc_tailroom(msg, len);
} else {
osm->flags |= htons(OFPSF_REPLY_MORE);
- msg = ofpbuf_new(MAX(1024, sizeof(struct nicira_stats_msg) + len));
+ msg = ofpbuf_new(MAX(1024, sizeof(struct nicira10_stats_msg) + len));
put_stats_reply__(&osm->header, msg);
list_push_back(replies, &msg->list_node);
}
@@ -3394,14 +3394,14 @@ ofputil_postappend_stats_reply(size_t start_ofs, struct list *replies)
size_t
ofputil_stats_msg_len(const struct ofp_header *oh)
{
- const struct ofp_stats_msg *osm;
+ const struct ofp10_stats_msg *osm;
assert(oh->type == OFPT10_STATS_REQUEST || oh->type == OFPT10_STATS_REPLY);
- osm = (const struct ofp_stats_msg *) oh;
+ osm = (const struct ofp10_stats_msg *) oh;
return (osm->type == htons(OFPST_VENDOR)
- ? sizeof(struct nicira_stats_msg)
- : sizeof(struct ofp_stats_msg));
+ ? sizeof(struct nicira10_stats_msg)
+ : sizeof(struct ofp10_stats_msg));
}
void
@@ -3420,14 +3420,14 @@ uint16_t
ofputil_decode_stats_msg_type(const struct ofp_header *oh)
{
assert(oh->type == OFPT10_STATS_REQUEST || oh->type == OFPT10_STATS_REPLY);
- return ntohs(((const struct ofp_stats_msg *) oh)->type);
+ return ntohs(((const struct ofp10_stats_msg *) oh)->type);
}
uint16_t
ofputil_decode_stats_msg_flags(const struct ofp_header *oh)
{
assert(oh->type == OFPT10_STATS_REQUEST || oh->type == OFPT10_STATS_REPLY);
- return ntohs(((const struct ofp_stats_msg *) oh)->flags);
+ return ntohs(((const struct ofp10_stats_msg *) oh)->flags);
}
/* Creates and returns an OFPT_ECHO_REQUEST message with an empty payload. */
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index bddb107..65355ca 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1112,7 +1112,7 @@ get_features(struct ofproto *ofproto_ OVS_UNUSED,
}
static void
-get_tables(struct ofproto *ofproto_, struct ofp_table_stats *ots)
+get_tables(struct ofproto *ofproto_, struct ofp10_table_stats *ots)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
struct dpif_dp_stats s;
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index a327c5f..d68c9d4 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -461,10 +461,10 @@ struct ofproto_class {
* - 'matched_count' to the number of packets looked up in this flow
* table so far that matched one of the flow entries.
*
- * Keep in mind that all of the members of struct ofp_table_stats are in
+ * Keep in mind that all of the members of struct ofp10_table_stats are in
* network byte order.
*/
- void (*get_tables)(struct ofproto *ofproto, struct ofp_table_stats *ots);
+ void (*get_tables)(struct ofproto *ofproto, struct ofp10_table_stats *ots);
/* ## ---------------- ## */
/* ## ofport Functions ## */
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index ad88471..3e995ac 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2123,7 +2123,7 @@ handle_table_stats_request(struct ofconn *ofconn,
const struct ofp_header *request)
{
struct ofproto *p = ofconn_get_ofproto(ofconn);
- struct ofp_table_stats *ots;
+ struct ofp10_table_stats *ots;
struct ofpbuf *msg;
size_t i;
@@ -2160,7 +2160,7 @@ static void
append_port_stat(struct ofport *port, struct list *replies)
{
struct netdev_stats stats;
- struct ofp_port_stats *ops;
+ struct ofp10_port_stats *ops;
/* Intentionally ignore return value, since errors will set
* 'stats' to all-1s, which is correct for OpenFlow, and
@@ -2189,7 +2189,7 @@ handle_port_stats_request(struct ofconn *ofconn,
const struct ofp_header *request)
{
struct ofproto *p = ofconn_get_ofproto(ofconn);
- struct ofp_port_stats_request *psr = ofputil_stats_msg_body(request);
+ struct ofp10_port_stats_request *psr = ofputil_stats_msg_body(request);
struct ofport *port;
struct list replies;
@@ -2618,7 +2618,7 @@ static void
put_queue_stats(struct queue_stats_cbdata *cbdata, uint32_t queue_id,
const struct netdev_queue_stats *stats)
{
- struct ofp_queue_stats *reply;
+ struct ofp10_queue_stats *reply;
reply = ofputil_append_stats_reply(sizeof *reply, &cbdata->replies);
reply->port_no = htons(cbdata->ofport->pp.port_no);
@@ -2661,7 +2661,7 @@ handle_queue_stats_request(struct ofconn *ofconn,
const struct ofp_header *rq)
{
struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
- const struct ofp_queue_stats_request *qsr = ofputil_stats_msg_body(rq);
+ const struct ofp10_queue_stats_request *qsr = ofputil_stats_msg_body(rq);
struct queue_stats_cbdata cbdata;
struct ofport *port;
unsigned int port_no;
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index e6d10a4..04ff354 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -381,7 +381,7 @@ dump_stats_transaction(const char *vconn_name, struct ofpbuf *request)
run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed");
recv_xid = ((struct ofp_header *) reply->data)->xid;
if (send_xid == recv_xid) {
- struct ofp_stats_msg *osm;
+ struct ofp10_stats_msg *osm;
ofp_print(stdout, reply->data, reply->size, verbosity + 1);
@@ -777,7 +777,7 @@ do_dump_aggregate(int argc, char *argv[])
static void
do_queue_stats(int argc, char *argv[])
{
- struct ofp_queue_stats_request *req;
+ struct ofp10_queue_stats_request *req;
struct ofpbuf *request;
req = ofputil_make_stats_request(sizeof *req, OFPST_QUEUE, 0, &request);
@@ -1187,7 +1187,7 @@ do_snoop(int argc OVS_UNUSED, char *argv[])
static void
do_dump_ports(int argc, char *argv[])
{
- struct ofp_port_stats_request *req;
+ struct ofp10_port_stats_request *req;
struct ofpbuf *request;
uint16_t port;
--
1.7.2.5
More information about the dev
mailing list