From 0d3a0643c436e93b2e6204a9c92c163a25d0617f Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Wed, 16 Apr 2008 15:38:25 -0700 Subject: [PATCH] Switch from "stat" to "stats" everywhere. --- configure.ac | 2 +- datapath/datapath.c | 20 +++++++------- datapath/forward.c | 26 +++++++++--------- include/openflow.h | 50 +++++++++++++++++----------------- lib/ofp-print.c | 66 ++++++++++++++++++++++----------------------- switch/datapath.c | 44 +++++++++++++++--------------- utilities/dpctl.c | 8 +++--- 7 files changed, 108 insertions(+), 108 deletions(-) diff --git a/configure.ac b/configure.ac index 581157ee..5fa1ce98 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(openflow, v0.2.1, info@openflowswitch.org) +AC_INIT(openflow, v0.2.2a2, info@openflowswitch.org) AM_INIT_AUTOMAKE AC_PROG_CC diff --git a/datapath/datapath.c b/datapath/datapath.c index 432315b1..8ab30011 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -788,17 +788,17 @@ dp_send_flow_stats(struct datapath *dp, const struct sender *sender, const struct ofp_match *match) { struct sk_buff *skb; - struct ofp_flow_stat_reply *fsr; + struct ofp_flow_stats_reply *fsr; size_t header_size, fudge, flow_size; struct sw_flow_key match_key; int table_idx, n_flows, max_flows; - header_size = offsetof(struct ofp_flow_stat_reply, flows); + header_size = offsetof(struct ofp_flow_stats_reply, flows); fudge = 128; flow_size = sizeof fsr->flows[0]; max_flows = (NLMSG_GOODSIZE - header_size - fudge) / flow_size; fsr = alloc_openflow_skb(dp, header_size + max_flows * flow_size, - OFPT_FLOW_STAT_REPLY, sender, &skb); + OFPT_FLOW_STATS_REPLY, sender, &skb); if (!fsr) return -ENOMEM; @@ -836,7 +836,7 @@ dp_send_flow_stats(struct datapath *dp, const struct sender *sender, } static int -fill_port_stat_reply(struct datapath *dp, struct ofp_port_stat_reply *psr) +fill_port_stats_reply(struct datapath *dp, struct ofp_port_stats_reply *psr) { struct net_bridge_port *p; int port_count = 0; @@ -859,19 +859,19 @@ int dp_send_port_stats(struct datapath *dp, const struct sender *sender) { struct sk_buff *skb; - struct ofp_port_stat_reply *psr; + struct ofp_port_stats_reply *psr; size_t psr_len, port_max_len; int port_count; /* Overallocate. */ port_max_len = sizeof(struct ofp_port_stats) * OFPP_MAX; psr = alloc_openflow_skb(dp, sizeof *psr + port_max_len, - OFPT_PORT_STAT_REPLY, sender, &skb); + OFPT_PORT_STATS_REPLY, sender, &skb); if (!psr) return -ENOMEM; /* Fill. */ - port_count = fill_port_stat_reply(dp, psr); + port_count = fill_port_stats_reply(dp, psr); /* Shrink to fit. */ psr_len = sizeof *psr + sizeof(struct ofp_port_stats) * port_count; @@ -883,14 +883,14 @@ int dp_send_table_stats(struct datapath *dp, const struct sender *sender) { struct sk_buff *skb; - struct ofp_table_stat_reply *tsr; + struct ofp_table_stats_reply *tsr; int i, n_tables; n_tables = dp->chain->n_tables; - tsr = alloc_openflow_skb(dp, (offsetof(struct ofp_table_stat_reply, + tsr = alloc_openflow_skb(dp, (offsetof(struct ofp_table_stats_reply, tables) + sizeof tsr->tables[0] * n_tables), - OFPT_TABLE_STAT_REPLY, sender, &skb); + OFPT_TABLE_STATS_REPLY, sender, &skb); if (!tsr) return -ENOMEM; for (i = 0; i < n_tables; i++) { diff --git a/datapath/forward.c b/datapath/forward.c index 6f8636a0..d3d27334 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -438,10 +438,10 @@ recv_flow(struct sw_chain *chain, const struct sender *sender, const void *msg) } static int -recv_flow_status_request(struct sw_chain *chain, const struct sender *sender, +recv_flow_stats_request(struct sw_chain *chain, const struct sender *sender, const void *msg) { - const struct ofp_flow_stat_request *fsr = msg; + const struct ofp_flow_stats_request *fsr = msg; if (fsr->type == OFPFS_INDIV) { return dp_send_flow_stats(chain->dp, sender, &fsr->match); } else { @@ -451,14 +451,14 @@ recv_flow_status_request(struct sw_chain *chain, const struct sender *sender, } static int -recv_port_status_request(struct sw_chain *chain, const struct sender *sender, +recv_port_stats_request(struct sw_chain *chain, const struct sender *sender, const void *msg) { return dp_send_port_stats(chain->dp, sender); } static int -recv_table_status_request(struct sw_chain *chain, const struct sender *sender, +recv_table_stats_request(struct sw_chain *chain, const struct sender *sender, const void *msg) { return dp_send_table_stats(chain->dp, sender); @@ -502,17 +502,17 @@ fwd_control_input(struct sw_chain *chain, const struct sender *sender, sizeof (struct ofp_port_mod), recv_port_mod, }, - [OFPT_FLOW_STAT_REQUEST] = { - sizeof (struct ofp_flow_stat_request), - recv_flow_status_request, + [OFPT_FLOW_STATS_REQUEST] = { + sizeof (struct ofp_flow_stats_request), + recv_flow_stats_request, }, - [OFPT_PORT_STAT_REQUEST] = { - sizeof (struct ofp_port_stat_request), - recv_port_status_request, + [OFPT_PORT_STATS_REQUEST] = { + sizeof (struct ofp_port_stats_request), + recv_port_stats_request, }, - [OFPT_TABLE_STAT_REQUEST] = { - sizeof (struct ofp_table_stat_request), - recv_table_status_request, + [OFPT_TABLE_STATS_REQUEST] = { + sizeof (struct ofp_table_stats_request), + recv_table_stats_request, }, }; diff --git a/include/openflow.h b/include/openflow.h index bc2e432c..d21f9a83 100644 --- a/include/openflow.h +++ b/include/openflow.h @@ -80,24 +80,24 @@ enum ofp_port { }; enum ofp_type { - OFPT_FEATURES_REQUEST, /* 0 Controller/switch message */ - OFPT_FEATURES_REPLY, /* 1 Controller/switch message */ - OFPT_GET_CONFIG_REQUEST, /* 2 Controller/switch message */ - OFPT_GET_CONFIG_REPLY, /* 3 Controller/switch message */ - OFPT_SET_CONFIG, /* 4 Controller/switch message */ - OFPT_PACKET_IN, /* 5 Async message */ - OFPT_PACKET_OUT, /* 6 Controller/switch message */ - OFPT_FLOW_MOD, /* 7 Controller/switch message */ - OFPT_FLOW_EXPIRED, /* 8 Async message */ - OFPT_TABLE, /* 9 Controller/switch message */ - OFPT_PORT_MOD, /* 10 Controller/switch message */ - OFPT_PORT_STATUS, /* 11 Async message */ - OFPT_FLOW_STAT_REQUEST, /* 12 Controller/switch message */ - OFPT_FLOW_STAT_REPLY, /* 13 Controller/switch message */ - OFPT_TABLE_STAT_REQUEST, /* 14 Controller/switch message */ - OFPT_TABLE_STAT_REPLY, /* 15 Controller/switch message */ - OFPT_PORT_STAT_REQUEST, /* 16 Controller/switch message */ - OFPT_PORT_STAT_REPLY /* 17 Controller/switch message */ + OFPT_FEATURES_REQUEST, /* 0 Controller/switch message */ + OFPT_FEATURES_REPLY, /* 1 Controller/switch message */ + OFPT_GET_CONFIG_REQUEST, /* 2 Controller/switch message */ + OFPT_GET_CONFIG_REPLY, /* 3 Controller/switch message */ + OFPT_SET_CONFIG, /* 4 Controller/switch message */ + OFPT_PACKET_IN, /* 5 Async message */ + OFPT_PACKET_OUT, /* 6 Controller/switch message */ + OFPT_FLOW_MOD, /* 7 Controller/switch message */ + OFPT_FLOW_EXPIRED, /* 8 Async message */ + OFPT_TABLE, /* 9 Controller/switch message */ + OFPT_PORT_MOD, /* 10 Controller/switch message */ + OFPT_PORT_STATUS, /* 11 Async message */ + OFPT_FLOW_STATS_REQUEST, /* 12 Controller/switch message */ + OFPT_FLOW_STATS_REPLY, /* 13 Controller/switch message */ + OFPT_TABLE_STATS_REQUEST, /* 14 Controller/switch message */ + OFPT_TABLE_STATS_REPLY, /* 15 Controller/switch message */ + OFPT_PORT_STATS_REQUEST, /* 16 Controller/switch message */ + OFPT_PORT_STATS_REPLY /* 17 Controller/switch message */ }; /* Header on all OpenFlow packets. */ @@ -364,13 +364,13 @@ struct ofp_flow_stats { uint8_t pad[7]; /* Align to 64-bits. */ }; -enum ofp_stat_type { +enum ofp_stats_type { OFPFS_INDIV, /* Send an entry for each matching flow */ OFPFS_AGGREGATE /* Aggregate matching flows */ }; /* Current flow statistics request */ -struct ofp_flow_stat_request { +struct ofp_flow_stats_request { struct ofp_header header; struct ofp_match match; /* Fields to match */ uint8_t table_id; /* ID of table to read (from ofp_table_stats) @@ -380,7 +380,7 @@ struct ofp_flow_stat_request { }; /* Current flow statistics reply */ -struct ofp_flow_stat_reply { +struct ofp_flow_stats_reply { struct ofp_header header; /* If request was of type OFPFS_INDIV, this will contain an array of @@ -394,7 +394,7 @@ struct ofp_flow_stat_reply { }; /* Current table statistics request */ -struct ofp_table_stat_request { +struct ofp_table_stats_request { struct ofp_header header; }; @@ -409,7 +409,7 @@ struct ofp_table_stats { }; /* Current table statistics reply */ -struct ofp_table_stat_reply { +struct ofp_table_stats_reply { struct ofp_header header; struct ofp_table_stats tables[]; /* The number of entries is inferred from the length field in the header. */ @@ -425,12 +425,12 @@ struct ofp_port_stats { }; /* Current port statistics request */ -struct ofp_port_stat_request { +struct ofp_port_stats_request { struct ofp_header header; }; /* Current port statistics reply */ -struct ofp_port_stat_reply { +struct ofp_port_stats_reply { struct ofp_header header; struct ofp_port_stats ports[]; /* The number of entries is inferred from the length field in the header. */ diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 98ee7692..6742dfc6 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -428,10 +428,10 @@ void ofp_print_port_status(struct ds *string, const void *oh, size_t len, } static void -ofp_flow_stat_request(struct ds *string, const void *oh, size_t len, +ofp_flow_stats_request(struct ds *string, const void *oh, size_t len, int verbosity) { - const struct ofp_flow_stat_request *fsr = oh; + const struct ofp_flow_stats_request *fsr = oh; if (fsr->table_id == 0xff) { ds_put_format(string, " table_id=any, "); @@ -450,14 +450,14 @@ ofp_flow_stat_request(struct ds *string, const void *oh, size_t len, } static void -ofp_flow_stat_reply(struct ds *string, const void *oh, size_t len, +ofp_flow_stats_reply(struct ds *string, const void *oh, size_t len, int verbosity) { - const struct ofp_flow_stat_reply *fsr = oh; + const struct ofp_flow_stats_reply *fsr = oh; const struct ofp_flow_stats *fs; size_t n; - n = (len - offsetof(struct ofp_flow_stat_reply, flows)) / sizeof *fs; + n = (len - offsetof(struct ofp_flow_stats_reply, flows)) / sizeof *fs; ds_put_format(string, " %zu flows\n", n); if (verbosity < 1) { return; @@ -474,14 +474,14 @@ ofp_flow_stat_reply(struct ds *string, const void *oh, size_t len, } static void -ofp_port_stat_reply(struct ds *string, const void *oh, size_t len, +ofp_port_stats_reply(struct ds *string, const void *oh, size_t len, int verbosity) { - const struct ofp_port_stat_reply *psr = oh; + const struct ofp_port_stats_reply *psr = oh; const struct ofp_port_stats *ps; size_t n; - n = (len - offsetof(struct ofp_port_stat_reply, ports)) / sizeof *ps; + n = (len - offsetof(struct ofp_port_stats_reply, ports)) / sizeof *ps; ds_put_format(string, " %zu ports\n", n); if (verbosity < 1) { return; @@ -496,14 +496,14 @@ ofp_port_stat_reply(struct ds *string, const void *oh, size_t len, } static void -ofp_table_stat_reply(struct ds *string, const void *oh, size_t len, +ofp_table_stats_reply(struct ds *string, const void *oh, size_t len, int verbosity) { - const struct ofp_table_stat_reply *tsr = oh; + const struct ofp_table_stats_reply *tsr = oh; const struct ofp_table_stats *ts; size_t n; - n = (len - offsetof(struct ofp_table_stat_reply, tables)) / sizeof *ts; + n = (len - offsetof(struct ofp_table_stats_reply, tables)) / sizeof *ts; ds_put_format(string, " %zu tables\n", n); if (verbosity < 1) { return; @@ -585,35 +585,35 @@ static const struct openflow_packet packets[] = { sizeof (struct ofp_port_status), ofp_print_port_status }, - [OFPT_FLOW_STAT_REQUEST] = { - "flow_stat_request", - sizeof (struct ofp_flow_stat_request), - ofp_flow_stat_request, + [OFPT_FLOW_STATS_REQUEST] = { + "flow_stats_request", + sizeof (struct ofp_flow_stats_request), + ofp_flow_stats_request, }, - [OFPT_FLOW_STAT_REPLY] = { - "flow_stat_reply", - sizeof (struct ofp_flow_stat_reply), - ofp_flow_stat_reply, + [OFPT_FLOW_STATS_REPLY] = { + "flow_stats_reply", + sizeof (struct ofp_flow_stats_reply), + ofp_flow_stats_reply, }, - [OFPT_PORT_STAT_REQUEST] = { - "port_stat_request", - sizeof (struct ofp_port_stat_request), + [OFPT_PORT_STATS_REQUEST] = { + "port_stats_request", + sizeof (struct ofp_port_stats_request), NULL, }, - [OFPT_PORT_STAT_REPLY] = { - "port_stat_reply", - sizeof (struct ofp_port_stat_reply), - ofp_port_stat_reply, + [OFPT_PORT_STATS_REPLY] = { + "port_stats_reply", + sizeof (struct ofp_port_stats_reply), + ofp_port_stats_reply, }, - [OFPT_TABLE_STAT_REQUEST] = { - "table_stat_request", - sizeof (struct ofp_table_stat_request), + [OFPT_TABLE_STATS_REQUEST] = { + "table_stats_request", + sizeof (struct ofp_table_stats_request), NULL, }, - [OFPT_TABLE_STAT_REPLY] = { - "table_stat_reply", - sizeof (struct ofp_table_stat_reply), - ofp_table_stat_reply, + [OFPT_TABLE_STATS_REPLY] = { + "table_stats_reply", + sizeof (struct ofp_table_stats_reply), + ofp_table_stats_reply, }, }; diff --git a/switch/datapath.c b/switch/datapath.c index 6fdd2dd7..18435676 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -654,18 +654,18 @@ dp_send_flow_stats(struct datapath *dp, const struct sender *sender, const struct ofp_match *match) { struct buffer *buffer; - struct ofp_flow_stat_reply *fsr; + struct ofp_flow_stats_reply *fsr; size_t header_size, fudge, flow_size; struct sw_flow_key match_key; int table_idx, n_flows, max_flows; time_t now; - header_size = offsetof(struct ofp_flow_stat_reply, flows); + header_size = offsetof(struct ofp_flow_stats_reply, flows); fudge = 128; flow_size = sizeof fsr->flows[0]; max_flows = (65536 - header_size - fudge) / flow_size; fsr = alloc_openflow_buffer(dp, header_size, - OFPT_FLOW_STAT_REPLY, sender, &buffer); + OFPT_FLOW_STATS_REPLY, sender, &buffer); n_flows = 0; flow_extract_match(&match_key, match); @@ -702,12 +702,12 @@ int dp_send_port_stats(struct datapath *dp, const struct sender *sender) { struct buffer *buffer; - struct ofp_port_stat_reply *psr; + struct ofp_port_stats_reply *psr; struct sw_port *p; - psr = alloc_openflow_buffer(dp, offsetof(struct ofp_port_stat_reply, + psr = alloc_openflow_buffer(dp, offsetof(struct ofp_port_stats_reply, ports), - OFPT_PORT_STAT_REPLY, sender, &buffer); + OFPT_PORT_STATS_REPLY, sender, &buffer); LIST_FOR_EACH (p, struct sw_port, node, &dp->port_list) { struct ofp_port_stats *ps = buffer_put_uninit(buffer, sizeof *ps); ps->port_no = htons(port_no(dp, p)); @@ -723,12 +723,12 @@ int dp_send_table_stats(struct datapath *dp, const struct sender *sender) { struct buffer *buffer; - struct ofp_table_stat_reply *tsr; + struct ofp_table_stats_reply *tsr; int i; - tsr = alloc_openflow_buffer(dp, offsetof(struct ofp_table_stat_reply, + tsr = alloc_openflow_buffer(dp, offsetof(struct ofp_table_stats_reply, tables), - OFPT_TABLE_STAT_REPLY, sender, &buffer); + OFPT_TABLE_STATS_REPLY, sender, &buffer); for (i = 0; i < dp->chain->n_tables; i++) { struct ofp_table_stats *ots = buffer_put_uninit(buffer, sizeof *ots); struct sw_table_stats stats; @@ -1119,10 +1119,10 @@ recv_flow(struct datapath *dp, const struct sender *sender UNUSED, } static int -recv_flow_status_request(struct datapath *dp, const struct sender *sender, +recv_flow_stats_request(struct datapath *dp, const struct sender *sender, const void *msg) { - const struct ofp_flow_stat_request *fsr = msg; + const struct ofp_flow_stats_request *fsr = msg; if (fsr->type == OFPFS_INDIV) { return dp_send_flow_stats(dp, sender, &fsr->match); } else { @@ -1132,14 +1132,14 @@ recv_flow_status_request(struct datapath *dp, const struct sender *sender, } static int -recv_port_status_request(struct datapath *dp, const struct sender *sender, +recv_port_stats_request(struct datapath *dp, const struct sender *sender, const void *msg) { return dp_send_port_stats(dp, sender); } static int -recv_table_status_request(struct datapath *dp, const struct sender *sender, +recv_table_stats_request(struct datapath *dp, const struct sender *sender, const void *msg) { return dp_send_table_stats(dp, sender); @@ -1181,17 +1181,17 @@ fwd_control_input(struct datapath *dp, const struct sender *sender, sizeof (struct ofp_port_mod), recv_port_mod, }, - [OFPT_FLOW_STAT_REQUEST] = { - sizeof (struct ofp_flow_stat_request), - recv_flow_status_request, + [OFPT_FLOW_STATS_REQUEST] = { + sizeof (struct ofp_flow_stats_request), + recv_flow_stats_request, }, - [OFPT_PORT_STAT_REQUEST] = { - sizeof (struct ofp_port_stat_request), - recv_port_status_request, + [OFPT_PORT_STATS_REQUEST] = { + sizeof (struct ofp_port_stats_request), + recv_port_stats_request, }, - [OFPT_TABLE_STAT_REQUEST] = { - sizeof (struct ofp_table_stat_request), - recv_table_status_request, + [OFPT_TABLE_STATS_REQUEST] = { + sizeof (struct ofp_table_stats_request), + recv_table_stats_request, }, }; diff --git a/utilities/dpctl.c b/utilities/dpctl.c index 80808acf..a3a2c9bd 100644 --- a/utilities/dpctl.c +++ b/utilities/dpctl.c @@ -399,7 +399,7 @@ do_show(int argc UNUSED, char *argv[]) static void do_dump_tables(int argc, char *argv[]) { - dump_transaction(argv[1], OFPT_TABLE_STAT_REQUEST); + dump_transaction(argv[1], OFPT_TABLE_STATS_REQUEST); } @@ -553,10 +553,10 @@ static void do_dump_flows(int argc, char *argv[]) { struct vconn *vconn; struct buffer *request, *reply; - struct ofp_flow_stat_request *fsr; + struct ofp_flow_stats_request *fsr; run(vconn_open_block(argv[1], &vconn), "connecting to %s", argv[1]); - fsr = alloc_openflow_buffer(sizeof *fsr, OFPT_FLOW_STAT_REQUEST, &request); + fsr = alloc_openflow_buffer(sizeof *fsr, OFPT_FLOW_STATS_REQUEST, &request); str_to_flow(argc > 2 ? argv[2] : "", &fsr->match, NULL, &fsr->table_id); fsr->type = OFPFS_INDIV; fsr->pad = 0; @@ -614,7 +614,7 @@ static void do_add_flows(int argc, char *argv[]) static void do_dump_ports(int argc, char *argv[]) { - dump_transaction(argv[1], OFPT_PORT_STAT_REQUEST); + dump_transaction(argv[1], OFPT_PORT_STATS_REQUEST); } static void do_help(int argc UNUSED, char *argv[] UNUSED) -- 2.30.2