2 * Copyright (c) 2008, 2009, 2010 Nicira Networks.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
29 #include "byte-order.h"
30 #include "classifier.h"
31 #include "command-line.h"
35 #include "dynamic-string.h"
39 #include "ofp-parse.h"
40 #include "ofp-print.h"
43 #include "openflow/nicira-ext.h"
44 #include "openflow/openflow.h"
46 #include "stream-ssl.h"
52 VLOG_DEFINE_THIS_MODULE(ofctl);
54 /* Use strict matching for flow mod commands? */
57 static const struct command all_commands[];
59 static void usage(void) NO_RETURN;
60 static void parse_options(int argc, char *argv[]);
63 main(int argc, char *argv[])
65 set_program_name(argv[0]);
66 parse_options(argc, argv);
67 signal(SIGPIPE, SIG_IGN);
68 run_command(argc - optind, argv + optind, all_commands);
73 parse_options(int argc, char *argv[])
76 OPT_STRICT = UCHAR_MAX + 1,
79 static struct option long_options[] = {
80 {"timeout", required_argument, 0, 't'},
81 {"strict", no_argument, 0, OPT_STRICT},
82 {"help", no_argument, 0, 'h'},
83 {"version", no_argument, 0, 'V'},
85 STREAM_SSL_LONG_OPTIONS
88 char *short_options = long_options_to_short_options(long_options);
91 unsigned long int timeout;
94 c = getopt_long(argc, argv, short_options, long_options, NULL);
101 timeout = strtoul(optarg, NULL, 10);
103 ovs_fatal(0, "value %s on -t or --timeout is not at least 1",
114 OVS_PRINT_VERSION(OFP_VERSION, OFP_VERSION);
122 STREAM_SSL_OPTION_HANDLERS
137 printf("%s: OpenFlow switch management utility\n"
138 "usage: %s [OPTIONS] COMMAND [ARG...]\n"
139 "\nFor OpenFlow switches:\n"
140 " show SWITCH show OpenFlow information\n"
141 " status SWITCH [KEY] report statistics (about KEY)\n"
142 " dump-desc SWITCH print switch description\n"
143 " dump-tables SWITCH print table stats\n"
144 " mod-port SWITCH IFACE ACT modify port behavior\n"
145 " dump-ports SWITCH [PORT] print port statistics\n"
146 " dump-flows SWITCH print all flow entries\n"
147 " dump-flows SWITCH FLOW print matching FLOWs\n"
148 " dump-aggregate SWITCH print aggregate flow statistics\n"
149 " dump-aggregate SWITCH FLOW print aggregate stats for FLOWs\n"
150 " queue-stats SWITCH [PORT [QUEUE]] dump queue stats\n"
151 " add-flow SWITCH FLOW add flow described by FLOW\n"
152 " add-flows SWITCH FILE add flows from FILE\n"
153 " mod-flows SWITCH FLOW modify actions of matching FLOWs\n"
154 " del-flows SWITCH [FLOW] delete matching FLOWs\n"
155 " monitor SWITCH [MISSLEN] print packets received from SWITCH\n"
156 "\nFor OpenFlow switches and controllers:\n"
157 " probe VCONN probe whether VCONN is up\n"
158 " ping VCONN [N] latency of N-byte echos\n"
159 " benchmark VCONN N COUNT bandwidth of COUNT N-byte echos\n"
160 "where each SWITCH is an active OpenFlow connection method.\n",
161 program_name, program_name);
162 vconn_usage(true, false, false);
164 printf("\nOther options:\n"
165 " --strict use strict match for flow commands\n"
166 " -t, --timeout=SECS give up after SECS seconds\n"
167 " -h, --help display this help message\n"
168 " -V, --version display version information\n");
172 static void run(int retval, const char *message, ...)
175 static void run(int retval, const char *message, ...)
180 fprintf(stderr, "%s: ", program_name);
181 va_start(args, message);
182 vfprintf(stderr, message, args);
185 fputs(": unexpected end of file\n", stderr);
187 fprintf(stderr, ": %s\n", strerror(retval));
194 /* Generic commands. */
197 open_vconn_socket(const char *name, struct vconn **vconnp)
199 char *vconn_name = xasprintf("unix:%s", name);
200 VLOG_INFO("connecting to %s", vconn_name);
201 run(vconn_open_block(vconn_name, OFP_VERSION, vconnp),
202 "connecting to %s", vconn_name);
207 open_vconn__(const char *name, const char *default_suffix,
208 struct vconn **vconnp)
212 char *bridge_path, *datapath_name, *datapath_type;
214 bridge_path = xasprintf("%s/%s.%s", ovs_rundir(), name, default_suffix);
215 dp_parse_name(name, &datapath_name, &datapath_type);
217 if (strstr(name, ":")) {
218 run(vconn_open_block(name, OFP_VERSION, vconnp),
219 "connecting to %s", name);
220 } else if (!stat(name, &s) && S_ISSOCK(s.st_mode)) {
221 open_vconn_socket(name, vconnp);
222 } else if (!stat(bridge_path, &s) && S_ISSOCK(s.st_mode)) {
223 open_vconn_socket(bridge_path, vconnp);
224 } else if (!dpif_open(datapath_name, datapath_type, &dpif)) {
225 char dpif_name[IF_NAMESIZE + 1];
228 run(dpif_port_get_name(dpif, ODPP_LOCAL, dpif_name, sizeof dpif_name),
229 "obtaining name of %s", dpif_name);
231 if (strcmp(dpif_name, name)) {
232 VLOG_INFO("datapath %s is named %s", name, dpif_name);
235 socket_name = xasprintf("%s/%s.%s",
236 ovs_rundir(), dpif_name, default_suffix);
237 if (stat(socket_name, &s)) {
238 ovs_fatal(errno, "cannot connect to %s: stat failed on %s",
240 } else if (!S_ISSOCK(s.st_mode)) {
241 ovs_fatal(0, "cannot connect to %s: %s is not a socket",
245 open_vconn_socket(socket_name, vconnp);
248 ovs_fatal(0, "%s is not a valid connection method", name);
257 open_vconn(const char *name, struct vconn **vconnp)
259 return open_vconn__(name, "mgmt", vconnp);
263 alloc_stats_request(size_t body_len, uint16_t type, struct ofpbuf **bufferp)
265 struct ofp_stats_request *rq;
266 rq = make_openflow((offsetof(struct ofp_stats_request, body)
267 + body_len), OFPT_STATS_REQUEST, bufferp);
268 rq->type = htons(type);
269 rq->flags = htons(0);
274 send_openflow_buffer(struct vconn *vconn, struct ofpbuf *buffer)
276 update_openflow_length(buffer);
277 run(vconn_send_block(vconn, buffer), "failed to send packet to switch");
281 dump_transaction(const char *vconn_name, struct ofpbuf *request)
284 struct ofpbuf *reply;
286 update_openflow_length(request);
287 open_vconn(vconn_name, &vconn);
288 run(vconn_transact(vconn, request, &reply), "talking to %s", vconn_name);
289 ofp_print(stdout, reply->data, reply->size, 1);
294 dump_trivial_transaction(const char *vconn_name, uint8_t request_type)
296 struct ofpbuf *request;
297 make_openflow(sizeof(struct ofp_header), request_type, &request);
298 dump_transaction(vconn_name, request);
302 dump_stats_transaction(const char *vconn_name, struct ofpbuf *request)
304 ovs_be32 send_xid = ((struct ofp_header *) request->data)->xid;
308 open_vconn(vconn_name, &vconn);
309 send_openflow_buffer(vconn, request);
312 struct ofpbuf *reply;
314 run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed");
315 recv_xid = ((struct ofp_header *) reply->data)->xid;
316 if (send_xid == recv_xid) {
317 struct ofp_stats_reply *osr;
319 ofp_print(stdout, reply->data, reply->size, 1);
321 osr = ofpbuf_at(reply, 0, sizeof *osr);
322 done = !osr || !(ntohs(osr->flags) & OFPSF_REPLY_MORE);
324 VLOG_DBG("received reply with xid %08"PRIx32" "
325 "!= expected %08"PRIx32, recv_xid, send_xid);
327 ofpbuf_delete(reply);
333 dump_trivial_stats_transaction(const char *vconn_name, uint8_t stats_type)
335 struct ofpbuf *request;
336 alloc_stats_request(0, stats_type, &request);
337 dump_stats_transaction(vconn_name, request);
341 do_show(int argc OVS_UNUSED, char *argv[])
343 dump_trivial_transaction(argv[1], OFPT_FEATURES_REQUEST);
344 dump_trivial_transaction(argv[1], OFPT_GET_CONFIG_REQUEST);
348 do_status(int argc, char *argv[])
350 struct nicira_header *request, *reply;
354 request = make_nxmsg(sizeof *request, NXT_STATUS_REQUEST, &b);
356 ofpbuf_put(b, argv[2], strlen(argv[2]));
357 update_openflow_length(b);
359 open_vconn(argv[1], &vconn);
360 run(vconn_transact(vconn, b, &b), "talking to %s", argv[1]);
363 if (b->size < sizeof *reply) {
364 ovs_fatal(0, "short reply (%zu bytes)", b->size);
367 if (reply->header.type != OFPT_VENDOR
368 || reply->vendor != ntohl(NX_VENDOR_ID)
369 || reply->subtype != ntohl(NXT_STATUS_REPLY)) {
370 ofp_print(stderr, b->data, b->size, 2);
371 ovs_fatal(0, "bad reply");
374 fwrite(reply + 1, b->size - sizeof *reply, 1, stdout);
378 do_dump_desc(int argc OVS_UNUSED, char *argv[])
380 dump_trivial_stats_transaction(argv[1], OFPST_DESC);
384 do_dump_tables(int argc OVS_UNUSED, char *argv[])
386 dump_trivial_stats_transaction(argv[1], OFPST_TABLE);
389 /* Opens a connection to 'vconn_name', fetches the ofp_phy_port structure for
390 * 'port_name' (which may be a port name or number), and copies it into
393 fetch_ofp_phy_port(const char *vconn_name, const char *port_name,
394 struct ofp_phy_port *oppp)
396 struct ofpbuf *request, *reply;
397 struct ofp_switch_features *osf;
398 unsigned int port_no;
403 /* Try to interpret the argument as a port number. */
404 if (!str_to_uint(port_name, 10, &port_no)) {
408 /* Fetch the switch's ofp_switch_features. */
409 make_openflow(sizeof(struct ofp_header), OFPT_FEATURES_REQUEST, &request);
410 open_vconn(vconn_name, &vconn);
411 run(vconn_transact(vconn, request, &reply), "talking to %s", vconn_name);
414 if (reply->size < sizeof *osf) {
415 ovs_fatal(0, "%s: received too-short features reply (only %zu bytes)",
416 vconn_name, reply->size);
418 n_ports = (reply->size - sizeof *osf) / sizeof *osf->ports;
420 for (port_idx = 0; port_idx < n_ports; port_idx++) {
421 const struct ofp_phy_port *opp = &osf->ports[port_idx];
423 if (port_no != UINT_MAX
424 ? htons(port_no) == opp->port_no
425 : !strncmp((char *) opp->name, port_name, sizeof opp->name)) {
427 ofpbuf_delete(reply);
432 ovs_fatal(0, "%s: couldn't find port `%s'", vconn_name, port_name);
435 /* Returns the port number corresponding to 'port_name' (which may be a port
436 * name or number) within the switch 'vconn_name'. */
438 str_to_port_no(const char *vconn_name, const char *port_name)
440 unsigned int port_no;
442 if (str_to_uint(port_name, 10, &port_no)) {
445 struct ofp_phy_port opp;
447 fetch_ofp_phy_port(vconn_name, port_name, &opp);
448 return ntohs(opp.port_no);
453 do_dump_flows(int argc, char *argv[])
455 struct ofp_flow_stats_request *req;
456 struct parsed_flow pf;
457 struct ofpbuf *request;
459 req = alloc_stats_request(sizeof *req, OFPST_FLOW, &request);
460 parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
461 ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match);
462 memset(&req->pad, 0, sizeof req->pad);
463 req->out_port = htons(pf.out_port);
465 dump_stats_transaction(argv[1], request);
469 do_dump_aggregate(int argc, char *argv[])
471 struct ofp_aggregate_stats_request *req;
472 struct ofpbuf *request;
473 struct parsed_flow pf;
475 req = alloc_stats_request(sizeof *req, OFPST_AGGREGATE, &request);
476 parse_ofp_str(&pf, NULL, argc > 2 ? argv[2] : "");
477 ofputil_cls_rule_to_match(&pf.rule, NXFF_OPENFLOW10, &req->match);
478 memset(&req->pad, 0, sizeof req->pad);
479 req->out_port = htons(pf.out_port);
481 dump_stats_transaction(argv[1], request);
485 do_queue_stats(int argc, char *argv[])
487 struct ofp_queue_stats_request *req;
488 struct ofpbuf *request;
490 req = alloc_stats_request(sizeof *req, OFPST_QUEUE, &request);
492 if (argc > 2 && argv[2][0] && strcasecmp(argv[2], "all")) {
493 req->port_no = htons(str_to_port_no(argv[1], argv[2]));
495 req->port_no = htons(OFPP_ALL);
497 if (argc > 3 && argv[3][0] && strcasecmp(argv[3], "all")) {
498 req->queue_id = htonl(atoi(argv[3]));
500 req->queue_id = htonl(OFPQ_ALL);
503 memset(req->pad, 0, sizeof req->pad);
505 dump_stats_transaction(argv[1], request);
509 do_add_flow(int argc OVS_UNUSED, char *argv[])
512 struct ofpbuf *buffer;
514 buffer = parse_ofp_flow_mod_str(argv[2], OFPFC_ADD);
516 open_vconn(argv[1], &vconn);
517 send_openflow_buffer(vconn, buffer);
522 do_add_flows(int argc OVS_UNUSED, char *argv[])
528 file = fopen(argv[2], "r");
530 ovs_fatal(errno, "%s: open", argv[2]);
533 open_vconn(argv[1], &vconn);
534 while ((b = parse_ofp_add_flow_file(file)) != NULL) {
535 send_openflow_buffer(vconn, b);
542 do_mod_flows(int argc OVS_UNUSED, char *argv[])
545 struct ofpbuf *buffer;
548 command = strict ? OFPFC_MODIFY_STRICT : OFPFC_MODIFY;
549 buffer = parse_ofp_flow_mod_str(argv[2], command);
550 open_vconn(argv[1], &vconn);
551 send_openflow_buffer(vconn, buffer);
555 static void do_del_flows(int argc, char *argv[])
558 struct ofpbuf *buffer;
561 command = strict ? OFPFC_DELETE_STRICT : OFPFC_DELETE;
562 buffer = parse_ofp_flow_mod_str(argc > 2 ? argv[2] : "", command);
564 open_vconn(argv[1], &vconn);
565 send_openflow_buffer(vconn, buffer);
570 do_tun_cookie(int argc OVS_UNUSED, char *argv[])
572 struct nxt_tun_id_cookie *tun_id_cookie;
573 struct ofpbuf *buffer;
576 tun_id_cookie = make_nxmsg(sizeof *tun_id_cookie, NXT_TUN_ID_FROM_COOKIE,
578 tun_id_cookie->set = !strcmp(argv[2], "true");
580 open_vconn(argv[1], &vconn);
581 send_openflow_buffer(vconn, buffer);
586 monitor_vconn(struct vconn *vconn)
590 run(vconn_recv_block(vconn, &b), "vconn_recv");
591 ofp_print(stderr, b->data, b->size, 2);
597 do_monitor(int argc, char *argv[])
601 open_vconn(argv[1], &vconn);
603 int miss_send_len = atoi(argv[2]);
604 struct ofp_switch_config *osc;
607 osc = make_openflow(sizeof *osc, OFPT_SET_CONFIG, &buf);
608 osc->miss_send_len = htons(miss_send_len);
609 send_openflow_buffer(vconn, buf);
611 monitor_vconn(vconn);
615 do_snoop(int argc OVS_UNUSED, char *argv[])
619 open_vconn__(argv[1], "snoop", &vconn);
620 monitor_vconn(vconn);
624 do_dump_ports(int argc, char *argv[])
626 struct ofp_port_stats_request *req;
627 struct ofpbuf *request;
630 req = alloc_stats_request(sizeof *req, OFPST_PORT, &request);
631 port = argc > 2 ? str_to_port_no(argv[1], argv[2]) : OFPP_NONE;
632 req->port_no = htons(port);
633 dump_stats_transaction(argv[1], request);
637 do_probe(int argc OVS_UNUSED, char *argv[])
639 struct ofpbuf *request;
641 struct ofpbuf *reply;
643 make_openflow(sizeof(struct ofp_header), OFPT_ECHO_REQUEST, &request);
644 open_vconn(argv[1], &vconn);
645 run(vconn_transact(vconn, request, &reply), "talking to %s", argv[1]);
646 if (reply->size != sizeof(struct ofp_header)) {
647 ovs_fatal(0, "reply does not match request");
649 ofpbuf_delete(reply);
654 do_mod_port(int argc OVS_UNUSED, char *argv[])
656 struct ofp_port_mod *opm;
657 struct ofp_phy_port opp;
658 struct ofpbuf *request;
661 fetch_ofp_phy_port(argv[1], argv[2], &opp);
663 opm = make_openflow(sizeof(struct ofp_port_mod), OFPT_PORT_MOD, &request);
664 opm->port_no = opp.port_no;
665 memcpy(opm->hw_addr, opp.hw_addr, sizeof opm->hw_addr);
666 opm->config = htonl(0);
667 opm->mask = htonl(0);
668 opm->advertise = htonl(0);
670 if (!strcasecmp(argv[3], "up")) {
671 opm->mask |= htonl(OFPPC_PORT_DOWN);
672 } else if (!strcasecmp(argv[3], "down")) {
673 opm->mask |= htonl(OFPPC_PORT_DOWN);
674 opm->config |= htonl(OFPPC_PORT_DOWN);
675 } else if (!strcasecmp(argv[3], "flood")) {
676 opm->mask |= htonl(OFPPC_NO_FLOOD);
677 } else if (!strcasecmp(argv[3], "noflood")) {
678 opm->mask |= htonl(OFPPC_NO_FLOOD);
679 opm->config |= htonl(OFPPC_NO_FLOOD);
681 ovs_fatal(0, "unknown mod-port command '%s'", argv[3]);
684 open_vconn(argv[1], &vconn);
685 send_openflow_buffer(vconn, request);
690 do_ping(int argc, char *argv[])
692 size_t max_payload = 65535 - sizeof(struct ofp_header);
693 unsigned int payload;
697 payload = argc > 2 ? atoi(argv[2]) : 64;
698 if (payload > max_payload) {
699 ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
702 open_vconn(argv[1], &vconn);
703 for (i = 0; i < 10; i++) {
704 struct timeval start, end;
705 struct ofpbuf *request, *reply;
706 struct ofp_header *rq_hdr, *rpy_hdr;
708 rq_hdr = make_openflow(sizeof(struct ofp_header) + payload,
709 OFPT_ECHO_REQUEST, &request);
710 random_bytes(rq_hdr + 1, payload);
712 gettimeofday(&start, NULL);
713 run(vconn_transact(vconn, ofpbuf_clone(request), &reply), "transact");
714 gettimeofday(&end, NULL);
716 rpy_hdr = reply->data;
717 if (reply->size != request->size
718 || memcmp(rpy_hdr + 1, rq_hdr + 1, payload)
719 || rpy_hdr->xid != rq_hdr->xid
720 || rpy_hdr->type != OFPT_ECHO_REPLY) {
721 printf("Reply does not match request. Request:\n");
722 ofp_print(stdout, request, request->size, 2);
724 ofp_print(stdout, reply, reply->size, 2);
726 printf("%zu bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
727 reply->size - sizeof *rpy_hdr, argv[1], ntohl(rpy_hdr->xid),
728 (1000*(double)(end.tv_sec - start.tv_sec))
729 + (.001*(end.tv_usec - start.tv_usec)));
730 ofpbuf_delete(request);
731 ofpbuf_delete(reply);
737 do_benchmark(int argc OVS_UNUSED, char *argv[])
739 size_t max_payload = 65535 - sizeof(struct ofp_header);
740 struct timeval start, end;
741 unsigned int payload_size, message_size;
747 payload_size = atoi(argv[2]);
748 if (payload_size > max_payload) {
749 ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
751 message_size = sizeof(struct ofp_header) + payload_size;
753 count = atoi(argv[3]);
755 printf("Sending %d packets * %u bytes (with header) = %u bytes total\n",
756 count, message_size, count * message_size);
758 open_vconn(argv[1], &vconn);
759 gettimeofday(&start, NULL);
760 for (i = 0; i < count; i++) {
761 struct ofpbuf *request, *reply;
762 struct ofp_header *rq_hdr;
764 rq_hdr = make_openflow(message_size, OFPT_ECHO_REQUEST, &request);
765 memset(rq_hdr + 1, 0, payload_size);
766 run(vconn_transact(vconn, request, &reply), "transact");
767 ofpbuf_delete(reply);
769 gettimeofday(&end, NULL);
772 duration = ((1000*(double)(end.tv_sec - start.tv_sec))
773 + (.001*(end.tv_usec - start.tv_usec)));
774 printf("Finished in %.1f ms (%.0f packets/s) (%.0f bytes/s)\n",
775 duration, count / (duration / 1000.0),
776 count * message_size / (duration / 1000.0));
780 do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
785 /* Undocumented commands for unit testing. */
788 do_parse_flows(int argc OVS_UNUSED, char *argv[])
793 file = fopen(argv[1], "r");
795 ovs_fatal(errno, "%s: open", argv[2]);
798 while ((b = parse_ofp_add_flow_file(file)) != NULL) {
799 ofp_print(stdout, b->data, b->size, 0);
806 do_parse_nx_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
811 while (!ds_get_line(&in, stdin)) {
812 struct ofpbuf nx_match;
813 struct cls_rule rule;
818 /* Delete comments, skip blank lines. */
824 if (strchr(s, '#')) {
825 *strchr(s, '#') = '\0';
827 if (s[strspn(s, " ")] == '\0') {
832 /* Convert string to nx_match. */
833 ofpbuf_init(&nx_match, 0);
834 match_len = nx_match_from_string(ds_cstr(&in), &nx_match);
836 /* Convert nx_match to cls_rule. */
837 error = nx_pull_match(&nx_match, match_len, 0, &rule);
841 /* Convert cls_rule back to nx_match. */
842 ofpbuf_uninit(&nx_match);
843 ofpbuf_init(&nx_match, 0);
844 match_len = nx_put_match(&nx_match, &rule);
846 /* Convert nx_match to string. */
847 out = nx_match_to_string(nx_match.data, match_len);
851 printf("nx_pull_match() returned error %x\n", error);
854 ofpbuf_uninit(&nx_match);
859 static const struct command all_commands[] = {
860 { "show", 1, 1, do_show },
861 { "status", 1, 2, do_status },
862 { "monitor", 1, 2, do_monitor },
863 { "snoop", 1, 1, do_snoop },
864 { "dump-desc", 1, 1, do_dump_desc },
865 { "dump-tables", 1, 1, do_dump_tables },
866 { "dump-flows", 1, 2, do_dump_flows },
867 { "dump-aggregate", 1, 2, do_dump_aggregate },
868 { "queue-stats", 1, 3, do_queue_stats },
869 { "add-flow", 2, 2, do_add_flow },
870 { "add-flows", 2, 2, do_add_flows },
871 { "mod-flows", 2, 2, do_mod_flows },
872 { "del-flows", 1, 2, do_del_flows },
873 { "tun-cookie", 2, 2, do_tun_cookie },
874 { "dump-ports", 1, 2, do_dump_ports },
875 { "mod-port", 3, 3, do_mod_port },
876 { "probe", 1, 1, do_probe },
877 { "ping", 1, 2, do_ping },
878 { "benchmark", 3, 3, do_benchmark },
879 { "help", 0, INT_MAX, do_help },
881 /* Undocumented commands for testing. */
882 { "parse-flows", 1, 1, do_parse_flows },
883 { "parse-nx-match", 0, 0, do_parse_nx_match },
885 { NULL, 0, 0, NULL },