projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement stress option framework.
[openvswitch]
/
utilities
/
ovs-ofctl.c
diff --git
a/utilities/ovs-ofctl.c
b/utilities/ovs-ofctl.c
index be68bdcb1692eff78b58c56738e8663cbfcbfa67..82e135abd1d6d629bf535addd191fed67a8a867e 100644
(file)
--- a/
utilities/ovs-ofctl.c
+++ b/
utilities/ovs-ofctl.c
@@
-51,12
+51,6
@@
VLOG_DEFINE_THIS_MODULE(ofctl);
VLOG_DEFINE_THIS_MODULE(ofctl);
-
-#define MOD_PORT_CMD_UP "up"
-#define MOD_PORT_CMD_DOWN "down"
-#define MOD_PORT_CMD_FLOOD "flood"
-#define MOD_PORT_CMD_NOFLOOD "noflood"
-
/* Use strict matching for flow mod commands? */
static bool strict;
/* Use strict matching for flow mod commands? */
static bool strict;
@@
-217,7
+211,7
@@
open_vconn__(const char *name, const char *default_suffix,
struct stat s;
char *bridge_path, *datapath_name, *datapath_type;
struct stat s;
char *bridge_path, *datapath_name, *datapath_type;
- bridge_path = xasprintf("%s/%s.%s", ovs_rundir, name, default_suffix);
+ bridge_path = xasprintf("%s/%s.%s", ovs_rundir
()
, name, default_suffix);
dp_parse_name(name, &datapath_name, &datapath_type);
if (strstr(name, ":")) {
dp_parse_name(name, &datapath_name, &datapath_type);
if (strstr(name, ":")) {
@@
-239,7
+233,7
@@
open_vconn__(const char *name, const char *default_suffix,
}
socket_name = xasprintf("%s/%s.%s",
}
socket_name = xasprintf("%s/%s.%s",
- ovs_rundir, dpif_name, default_suffix);
+ ovs_rundir
()
, dpif_name, default_suffix);
if (stat(socket_name, &s)) {
ovs_fatal(errno, "cannot connect to %s: stat failed on %s",
name, socket_name);
if (stat(socket_name, &s)) {
ovs_fatal(errno, "cannot connect to %s: stat failed on %s",
name, socket_name);
@@
-443,8
+437,7
@@
do_dump_flows(int argc, char *argv[])
req = alloc_stats_request(sizeof *req, OFPST_FLOW, &request);
parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
req = alloc_stats_request(sizeof *req, OFPST_FLOW, &request);
parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
- flow_to_match(&pf.rule.flow, pf.rule.wc.wildcards, NXFF_OPENFLOW10,
- &req->match);
+ ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match);
memset(&req->pad, 0, sizeof req->pad);
req->out_port = htons(pf.out_port);
memset(&req->pad, 0, sizeof req->pad);
req->out_port = htons(pf.out_port);
@@
-460,8
+453,7
@@
do_dump_aggregate(int argc, char *argv[])
req = alloc_stats_request(sizeof *req, OFPST_AGGREGATE, &request);
parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
req = alloc_stats_request(sizeof *req, OFPST_AGGREGATE, &request);
parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
- flow_to_match(&pf.rule.flow, pf.rule.wc.wildcards, NXFF_OPENFLOW10,
- &req->match);
+ ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match);
memset(&req->pad, 0, sizeof req->pad);
req->out_port = htons(pf.out_port);
memset(&req->pad, 0, sizeof req->pad);
req->out_port = htons(pf.out_port);
@@
-692,19
+684,14
@@
do_mod_port(int argc OVS_UNUSED, char *argv[])
opm->mask = htonl(0);
opm->advertise = htonl(0);
opm->mask = htonl(0);
opm->advertise = htonl(0);
- printf("modifying port: %s\n", osf->ports[port_idx].name);
-
- if (!strncasecmp(argv[3], MOD_PORT_CMD_UP, sizeof MOD_PORT_CMD_UP)) {
+ if (!strcasecmp(argv[3], "up")) {
opm->mask |= htonl(OFPPC_PORT_DOWN);
opm->mask |= htonl(OFPPC_PORT_DOWN);
- } else if (!strncasecmp(argv[3], MOD_PORT_CMD_DOWN,
- sizeof MOD_PORT_CMD_DOWN)) {
+ } else if (!strcasecmp(argv[3], "down")) {
opm->mask |= htonl(OFPPC_PORT_DOWN);
opm->config |= htonl(OFPPC_PORT_DOWN);
opm->mask |= htonl(OFPPC_PORT_DOWN);
opm->config |= htonl(OFPPC_PORT_DOWN);
- } else if (!strncasecmp(argv[3], MOD_PORT_CMD_FLOOD,
- sizeof MOD_PORT_CMD_FLOOD)) {
+ } else if (!strcasecmp(argv[3], "flood")) {
opm->mask |= htonl(OFPPC_NO_FLOOD);
opm->mask |= htonl(OFPPC_NO_FLOOD);
- } else if (!strncasecmp(argv[3], MOD_PORT_CMD_NOFLOOD,
- sizeof MOD_PORT_CMD_NOFLOOD)) {
+ } else if (!strcasecmp(argv[3], "noflood")) {
opm->mask |= htonl(OFPPC_NO_FLOOD);
opm->config |= htonl(OFPPC_NO_FLOOD);
} else {
opm->mask |= htonl(OFPPC_NO_FLOOD);
opm->config |= htonl(OFPPC_NO_FLOOD);
} else {