projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unaligned: Add unaligned accessors for ovs_be<N> data.
[openvswitch]
/
utilities
/
ovs-ofctl.c
diff --git
a/utilities/ovs-ofctl.c
b/utilities/ovs-ofctl.c
index b11defaf38987e6ce09877acdb188e502bd63379..65e2a9fc64da972c558deb94a406c4f0dd5e9761 100644
(file)
--- a/
utilities/ovs-ofctl.c
+++ b/
utilities/ovs-ofctl.c
@@
-217,7
+217,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
+239,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);
@@
-307,7
+307,7
@@
dump_trivial_transaction(const char *vconn_name, uint8_t request_type)
static void
dump_stats_transaction(const char *vconn_name, struct ofpbuf *request)
{
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;
struct vconn *vconn;
bool done = false;
@@
-431,21
+431,21
@@
str_to_port_no(const char *vconn_name, const char *str)
ofpbuf_delete(reply);
vconn_close(vconn);
ofpbuf_delete(reply);
vconn_close(vconn);
- return
port_idx
;
+ return
ntohs(osf->ports[port_idx].port_no)
;
}
static void
do_dump_flows(int argc, char *argv[])
{
struct ofp_flow_stats_request *req;
}
static void
do_dump_flows(int argc, char *argv[])
{
struct ofp_flow_stats_request *req;
-
uint16_t out_port
;
+
struct parsed_flow pf
;
struct ofpbuf *request;
req = alloc_stats_request(sizeof *req, OFPST_FLOW, &request);
struct ofpbuf *request;
req = alloc_stats_request(sizeof *req, OFPST_FLOW, &request);
- parse_ofp_str(
argc > 2 ? argv[2] : "", &req->match, NULL,
-
&req->table_id, &out_port, NULL, NULL, NULL, NULL
);
+ parse_ofp_str(
&pf, NULL, argc > 2 ? argv[2] : "");
+
ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match
);
memset(&req->pad, 0, sizeof req->pad);
memset(&req->pad, 0, sizeof req->pad);
- req->out_port = htons(out_port);
+ req->out_port = htons(
pf.
out_port);
dump_stats_transaction(argv[1], request);
}
dump_stats_transaction(argv[1], request);
}
@@
-455,13
+455,13
@@
do_dump_aggregate(int argc, char *argv[])
{
struct ofp_aggregate_stats_request *req;
struct ofpbuf *request;
{
struct ofp_aggregate_stats_request *req;
struct ofpbuf *request;
-
uint16_t out_port
;
+
struct parsed_flow pf
;
req = alloc_stats_request(sizeof *req, OFPST_AGGREGATE, &request);
req = alloc_stats_request(sizeof *req, OFPST_AGGREGATE, &request);
- parse_ofp_str(
argc > 2 ? argv[2] : "", &req->match, NULL,
-
&req->table_id, &out_port, NULL, NULL, NULL, NULL
);
+ parse_ofp_str(
&pf, NULL, argc > 2 ? argv[2] : "");
+
ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match
);
memset(&req->pad, 0, sizeof req->pad);
memset(&req->pad, 0, sizeof req->pad);
- req->out_port = htons(out_port);
+ req->out_port = htons(
pf.
out_port);
dump_stats_transaction(argv[1], request);
}
dump_stats_transaction(argv[1], request);
}
@@
-753,7
+753,7
@@
do_ping(int argc, char *argv[])
ofp_print(stdout, reply, reply->size, 2);
}
printf("%zu bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
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);
(1000*(double)(end.tv_sec - start.tv_sec))
+ (.001*(end.tv_usec - start.tv_usec)));
ofpbuf_delete(request);