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;
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, ":")) {
}
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);
static void
dump_stats_transaction(const char *vconn_name, struct ofpbuf *request)
{
- uint32_t send_xid = ((struct ofp_header *) request->data)->xid;
+ ovs_be32 send_xid = ((struct ofp_header *) request->data)->xid;
struct vconn *vconn;
bool done = false;
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);
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);
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);
- } 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);
- } 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);
- } 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 {
ofp_print(stdout, reply, reply->size, 2);
}
printf("%zu bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
- reply->size - sizeof *rpy_hdr, argv[1], rpy_hdr->xid,
+ reply->size - sizeof *rpy_hdr, argv[1], ntohl(rpy_hdr->xid),
(1000*(double)(end.tv_sec - start.tv_sec))
+ (.001*(end.tv_usec - start.tv_usec)));
ofpbuf_delete(request);