summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2015-12-01 17:37:33 +0300
committerHans Rosenfeld <hans.rosenfeld@nexenta.com>2015-12-05 00:12:46 +0100
commit62ef8476c4f1cb016de161827d921418dee4b031 (patch)
treea7c97261e224775bb15f92ac668d1c83f1101de6 /usr/src/cmd
parente8ea23086f5fd6f2b2f60c03b98d019041a374a2 (diff)
downloadillumos-joyent-62ef8476c4f1cb016de161827d921418dee4b031.tar.gz
4008 libdladm should not have a curses UI inside
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/dladm/dladm.c24
-rw-r--r--usr/src/cmd/flowstat/flowstat.c25
2 files changed, 7 insertions, 42 deletions
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c
index 904eca536d..8277d60ac2 100644
--- a/usr/src/cmd/dladm/dladm.c
+++ b/usr/src/cmd/dladm/dladm.c
@@ -3389,7 +3389,6 @@ do_show_link(int argc, char *argv[], const char *use)
{
int option;
boolean_t s_arg = B_FALSE;
- boolean_t S_arg = B_FALSE;
boolean_t i_arg = B_FALSE;
uint32_t flags = DLADM_OPT_ACTIVE;
boolean_t p_arg = B_FALSE;
@@ -3411,7 +3410,7 @@ do_show_link(int argc, char *argv[], const char *use)
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":pPsSi:o:",
+ while ((option = getopt_long(argc, argv, ":pPsi:o:",
show_lopts, NULL)) != -1) {
switch (option) {
case 'p':
@@ -3432,12 +3431,6 @@ do_show_link(int argc, char *argv[], const char *use)
flags = DLADM_OPT_PERSIST;
break;
- case 'S':
- if (S_arg)
- die_optdup(option);
-
- S_arg = B_TRUE;
- break;
case 'o':
o_arg = B_TRUE;
fields_str = optarg;
@@ -3456,18 +3449,12 @@ do_show_link(int argc, char *argv[], const char *use)
}
}
- if (i_arg && !(s_arg || S_arg))
- die("the option -i can be used only with -s or -S");
-
- if (s_arg && S_arg)
- die("the -s option cannot be used with -S");
+ if (i_arg && !s_arg)
+ die("the option -i can be used only with -s");
if (s_arg && flags != DLADM_OPT_ACTIVE)
die("the option -P cannot be used with -s");
- if (S_arg && (p_arg || flags != DLADM_OPT_ACTIVE))
- die("the option -%c cannot be used with -S", p_arg ? 'p' : 'P');
-
/* get link name (optional last argument) */
if (optind == (argc-1)) {
uint32_t f;
@@ -3492,11 +3479,6 @@ do_show_link(int argc, char *argv[], const char *use)
if (p_arg && !o_arg)
die("-p requires -o");
- if (S_arg) {
- dladm_continuous(handle, linkid, NULL, interval, LINK_REPORT);
- return;
- }
-
if (p_arg && strcasecmp(fields_str, "all") == 0)
die("\"-o all\" is invalid with -p");
diff --git a/usr/src/cmd/flowstat/flowstat.c b/usr/src/cmd/flowstat/flowstat.c
index 3ddff9e34f..1f8c65c957 100644
--- a/usr/src/cmd/flowstat/flowstat.c
+++ b/usr/src/cmd/flowstat/flowstat.c
@@ -191,7 +191,7 @@ static dladm_handle_t handle = NULL;
const char *usage_ermsg = "flowstat [-r | -t] [-i interval] "
"[-l link] [flow]\n"
- " flowstat [-S] [-A] [-i interval] [-p] [ -o field[,...]]\n"
+ " flowstat [-A] [-i interval] [-p] [ -o field[,...]]\n"
" [-u R|K|M|G|T|P] [-l link] [flow]\n"
" flowstat -h [-a] [-d] [-F format]"
" [-s <DD/MM/YYYY,HH:MM:SS>]\n"
@@ -546,7 +546,6 @@ main(int argc, char *argv[])
boolean_t o_arg = B_FALSE;
boolean_t u_arg = B_FALSE;
boolean_t A_arg = B_FALSE;
- boolean_t S_arg = B_FALSE;
boolean_t flow_arg = B_FALSE;
datalink_id_t linkid = DATALINK_ALL_LINKID;
char linkname[MAXLINKNAMELEN];
@@ -585,7 +584,7 @@ main(int argc, char *argv[])
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":rtApSi:o:u:l:h",
+ while ((option = getopt_long(argc, argv, ":rtApi:o:u:l:h",
NULL, NULL)) != -1) {
switch (option) {
case 'r':
@@ -612,11 +611,6 @@ main(int argc, char *argv[])
p_arg = B_TRUE;
break;
- case 'S':
- if (S_arg)
- die_optdup(option);
- S_arg = B_TRUE;
- break;
case 'i':
if (i_arg)
die_optdup(option);
@@ -648,9 +642,9 @@ main(int argc, char *argv[])
break;
case 'h':
if (r_arg || t_arg || p_arg || o_arg || u_arg ||
- i_arg || S_arg || A_arg) {
+ i_arg || A_arg) {
die("the option -h is not compatible with "
- "-r, -t, -p, -o, -u, -i, -S, -A");
+ "-r, -t, -p, -o, -u, -i, -A");
}
do_show_history(argc, argv);
return (0);
@@ -673,11 +667,6 @@ main(int argc, char *argv[])
if (p_arg && strcasecmp(o_fields_str, "all") == 0)
die("\"-o all\" is invalid with -p");
- if (S_arg &&
- (r_arg || t_arg || p_arg || o_arg || u_arg))
- die("the option -S is not compatible with "
- "-r, -t, -p, -o, -u");
-
if (A_arg &&
(r_arg || t_arg || p_arg || o_arg || u_arg || i_arg))
die("the option -A is not compatible with "
@@ -693,12 +682,6 @@ main(int argc, char *argv[])
usage();
}
- if (S_arg) {
- dladm_continuous(handle, linkid, (flow_arg ? flowname : NULL),
- interval, FLOW_REPORT);
- return (0);
- }
-
if (flow_arg &&
dladm_flow_info(handle, flowname, &attr) != DLADM_STATUS_OK)
die("invalid flow %s", flowname);