diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-12-03 14:35:06 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-12-03 14:35:06 +0000 |
commit | b8b45d78aa4c6595db8bd5c4c093389c2f948a78 (patch) | |
tree | a8ce6efa5cb010885325aae5e122412dbdea2430 /usr.sbin | |
parent | 8ae76ad0eb3fe8e092e09edfdb9d69ebb184cbf6 (diff) |
No more status subcommands; ok florian@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/unwindctl/parser.c | 16 | ||||
-rw-r--r-- | usr.sbin/unwindctl/parser.h | 10 | ||||
-rw-r--r-- | usr.sbin/unwindctl/unwindctl.8 | 15 | ||||
-rw-r--r-- | usr.sbin/unwindctl/unwindctl.c | 59 |
4 files changed, 16 insertions, 84 deletions
diff --git a/usr.sbin/unwindctl/parser.c b/usr.sbin/unwindctl/parser.c index 572b49ac885..95734a957e8 100644 --- a/usr.sbin/unwindctl/parser.c +++ b/usr.sbin/unwindctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.8 2019/12/02 06:26:52 otto Exp $ */ +/* $OpenBSD: parser.c,v 1.9 2019/12/03 14:35:05 otto Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -50,11 +50,10 @@ struct token { static const struct token t_main[]; static const struct token t_log[]; -static const struct token t_status[]; static const struct token t_main[] = { {KEYWORD, "reload", RELOAD, NULL}, - {KEYWORD, "status", STATUS, t_status}, + {KEYWORD, "status", STATUS, NULL}, {KEYWORD, "log", NONE, t_log}, {ENDTOKEN, "", NONE, NULL} }; @@ -66,17 +65,6 @@ static const struct token t_log[] = { {ENDTOKEN, "", NONE, NULL} }; -static const struct token t_status[] = { - {NOTOKEN, "", NONE, NULL}, - {KEYWORD, "recursor", STATUS_RECURSOR, NULL}, - {KEYWORD, "dhcp", STATUS_DHCP, NULL}, - {KEYWORD, "forwarder", STATUS_STATIC, NULL}, - {KEYWORD, "DoT", STATUS_DOT, NULL}, - {KEYWORD, "stub", STATUS_STUB, NULL}, - {KEYWORD, "all", STATUS_ALL, NULL}, - {ENDTOKEN, "", STATUS, NULL} -}; - static const struct token *match_token(const char *, const struct token *, struct parse_result *); static void show_valid_args(const struct token *); diff --git a/usr.sbin/unwindctl/parser.h b/usr.sbin/unwindctl/parser.h index 56190fcb8b8..3f96b6fe22f 100644 --- a/usr.sbin/unwindctl/parser.h +++ b/usr.sbin/unwindctl/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.6 2019/12/02 06:26:52 otto Exp $ */ +/* $OpenBSD: parser.h,v 1.7 2019/12/03 14:35:05 otto Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -24,13 +24,7 @@ enum actions { LOG_BRIEF, RELOAD, PORTAL, - STATUS, - STATUS_RECURSOR, - STATUS_DHCP, - STATUS_STATIC, - STATUS_DOT, - STATUS_STUB, - STATUS_ALL + STATUS }; struct parse_result { diff --git a/usr.sbin/unwindctl/unwindctl.8 b/usr.sbin/unwindctl/unwindctl.8 index 70ce14779f8..0d2c844bef1 100644 --- a/usr.sbin/unwindctl/unwindctl.8 +++ b/usr.sbin/unwindctl/unwindctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: unwindctl.8,v 1.7 2019/11/27 17:09:12 florian Exp $ +.\" $OpenBSD: unwindctl.8,v 1.8 2019/12/03 14:35:05 otto Exp $ .\" .\" Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 27 2019 $ +.Dd $Mdocdate: December 3 2019 $ .Dt UNWINDCTL 8 .Os .Sh NAME @@ -53,17 +53,8 @@ Enable verbose logging. Enable very noisy debug logging. .It Cm reload Reload the configuration file. -.It Cm status Op Cm recursor | dhcp | DoT | forwarder +.It Cm status Show a status summary. -If one of -.Cm recursor , -.Cm dhcp , -.Cm DoT , -or -.Cm forwarder -is specified, more detailed information about that type of resolver is given -including reasons why DNSSEC validation might be failing and a query time -histogram. .El .Sh FILES .Bl -tag -width "/dev/unwind.sockXX" -compact diff --git a/usr.sbin/unwindctl/unwindctl.c b/usr.sbin/unwindctl/unwindctl.c index c9c4172e193..3831f1360b4 100644 --- a/usr.sbin/unwindctl/unwindctl.c +++ b/usr.sbin/unwindctl/unwindctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unwindctl.c,v 1.20 2019/12/02 06:26:52 otto Exp $ */ +/* $OpenBSD: unwindctl.c,v 1.21 2019/12/03 14:35:05 otto Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -72,7 +72,6 @@ main(int argc, char *argv[]) int done = 0; int i, n, verbose = 0; int ch; - int type; char *sockname; sockname = UNWIND_SOCKET; @@ -143,40 +142,8 @@ main(int argc, char *argv[]) printf("reload request sent.\n"); done = 1; break; - case STATUS_RECURSOR: - type = UW_RES_RECURSOR; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; - case STATUS_DHCP: - type = UW_RES_DHCP; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; - case STATUS_STATIC: - type = UW_RES_FORWARDER; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; - case STATUS_DOT: - type = UW_RES_DOT; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; - case STATUS_STUB: - type = UW_RES_ASR; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; case STATUS: - type = UW_RES_NONE; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); - break; - case STATUS_ALL: - type = UW_RES_NONE; - imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, &type, - sizeof(type)); + imsg_compose(ibuf, IMSG_CTL_STATUS, 0, 0, -1, NULL, 0); break; default: usage(); @@ -200,12 +167,6 @@ main(int argc, char *argv[]) switch (res->action) { case STATUS: - case STATUS_RECURSOR: - case STATUS_DHCP: - case STATUS_STATIC: - case STATUS_DOT: - case STATUS_STUB: - case STATUS_ALL: done = show_status_msg(&imsg); break; default: @@ -217,15 +178,13 @@ main(int argc, char *argv[]) close(ctl_sock); free(ibuf); - if (res->action != STATUS) { - if (histogram_cnt) - histogram_header(); - for (i = 0; i < histogram_cnt; i++) { - print_histogram(uw_resolver_type_short[info[i].type], - info[i].histogram, nitems(info[i].histogram)); - print_histogram("", info[i].latest_histogram, - nitems(info[i].latest_histogram)); - } + if (histogram_cnt) + histogram_header(); + for (i = 0; i < histogram_cnt; i++) { + print_histogram(uw_resolver_type_short[info[i].type], + info[i].histogram, nitems(info[i].histogram)); + print_histogram("", info[i].latest_histogram, + nitems(info[i].latest_histogram)); } return (0); } |