summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/log.c
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-10-05 08:18:38 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-10-05 08:18:38 +0000
commite295e5839812a0c428df0c35c0e63ce2cdf753c2 (patch)
treebd94b254d2a30d3d6b8e98dbf96b80230adb2287 /sbin/isakmpd/log.c
parenta15db65009f5aaad718205fb07878e79e6534bd9 (diff)
Extend the FIFO ui with the 'D A <level>' (to set all debug levels) and
'D T' (to toggle all logging on and off) commands. niklas@ ok.
Diffstat (limited to 'sbin/isakmpd/log.c')
-rw-r--r--sbin/isakmpd/log.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index badacb1b7e8..9c6ada9dc3b 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.23 2001/10/02 18:04:35 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.24 2001/10/05 08:18:37 ho Exp $ */
/* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */
/*
@@ -291,6 +291,25 @@ log_debug_cmd (int cls, int level)
log_level[cls] = level;
}
}
+
+void
+log_debug_toggle (void)
+{
+ static int log_level_copy[LOG_ENDCLASS], toggle = 0;
+
+ if (!toggle)
+ {
+ LOG_DBG ((LOG_MISC, 50, "log_debug_toggle: debug levels cleared"));
+ memcpy (&log_level_copy, &log_level, sizeof log_level);
+ memset (&log_level, 0, sizeof log_level);
+ }
+ else
+ {
+ memcpy (&log_level, &log_level_copy, sizeof log_level);
+ LOG_DBG ((LOG_MISC, 50, "log_debug_toggle: debug levels restored"));
+ }
+ toggle = !toggle;
+}
#endif /* USE_DEBUG */
void