diff options
author | 2009-11-02 20:23:29 +0000 | |
---|---|---|
committer | 2009-11-02 20:23:29 +0000 | |
commit | c331907069073ad55c6b7ec9c91d7e1959a3bdf0 (patch) | |
tree | 854c941fe083675143827a05b9756c61482b0109 /usr.sbin/ospf6ctl/ospf6ctl.c | |
parent | Implement IMSG_CTL_LOG_VERBOSE to enable or disable debug logging on runtime. (diff) | |
download | wireguard-openbsd-c331907069073ad55c6b7ec9c91d7e1959a3bdf0.tar.xz wireguard-openbsd-c331907069073ad55c6b7ec9c91d7e1959a3bdf0.zip |
Implement "log verbose" and "log brief" to enable or disable verbose debug
logging. henning, sthen, michele like the idea
Diffstat (limited to 'usr.sbin/ospf6ctl/ospf6ctl.c')
-rw-r--r-- | usr.sbin/ospf6ctl/ospf6ctl.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/ospf6ctl/ospf6ctl.c b/usr.sbin/ospf6ctl/ospf6ctl.c index 952bf332290..ade7787c32f 100644 --- a/usr.sbin/ospf6ctl/ospf6ctl.c +++ b/usr.sbin/ospf6ctl/ospf6ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6ctl.c,v 1.29 2009/09/14 11:49:25 claudio Exp $ */ +/* $OpenBSD: ospf6ctl.c,v 1.30 2009/11/02 20:25:27 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -87,7 +87,7 @@ main(int argc, char *argv[]) struct imsg imsg; unsigned int ifidx = 0; int ctl_sock; - int done = 0; + int done = 0, verbose = 0; int n; /* parse options */ @@ -199,6 +199,15 @@ main(int argc, char *argv[]) printf("decouple request sent.\n"); done = 1; break; + case LOG_VERBOSE: + verbose = 1; + /* FALLTHROUGH */ + case LOG_BRIEF: + imsg_compose(ibuf, IMSG_CTL_LOG_VERBOSE, 0, 0, -1, + &verbose, sizeof(verbose)); + printf("logging request sent.\n"); + done = 1; + break; case RELOAD: imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1, NULL, 0); printf("reload request sent.\n"); @@ -265,6 +274,8 @@ main(int argc, char *argv[]) case FIB: case FIB_COUPLE: case FIB_DECOUPLE: + case LOG_VERBOSE: + case LOG_BRIEF: case RELOAD: break; } |