summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/log.c
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2008-06-10 04:50:25 +0000
committerdtucker <dtucker@openbsd.org>2008-06-10 04:50:25 +0000
commitbba0fca2fbd91e6d3c2e710bf1c51ac2f2d9fb9b (patch)
treed58d53f4167aee9c3f2a538e27fc7c1e299a686b /usr.bin/ssh/log.c
parentadd the -O option to run an external script when the "other (diff)
downloadwireguard-openbsd-bba0fca2fbd91e6d3c2e710bf1c51ac2f2d9fb9b.tar.xz
wireguard-openbsd-bba0fca2fbd91e6d3c2e710bf1c51ac2f2d9fb9b.zip
Add extended test mode (-T) and connection parameters for test mode (-C).
-T causes sshd to write its effective configuration to stdout and exit. -C causes any relevant Match rules to be applied before output. The combination allows tesing of the parser and config files. ok deraadt djm
Diffstat (limited to 'usr.bin/ssh/log.c')
-rw-r--r--usr.bin/ssh/log.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.bin/ssh/log.c b/usr.bin/ssh/log.c
index 6874ef697fe..e421be6beb1 100644
--- a/usr.bin/ssh/log.c
+++ b/usr.bin/ssh/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.40 2007/05/17 07:50:31 djm Exp $ */
+/* $OpenBSD: log.c,v 1.41 2008/06/10 04:50:25 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -104,6 +104,17 @@ log_facility_number(char *name)
return SYSLOG_FACILITY_NOT_SET;
}
+const char *
+log_facility_name(SyslogFacility facility)
+{
+ u_int i;
+
+ for (i = 0; log_facilities[i].name; i++)
+ if (log_facilities[i].val == facility)
+ return log_facilities[i].name;
+ return NULL;
+}
+
LogLevel
log_level_number(char *name)
{
@@ -116,6 +127,17 @@ log_level_number(char *name)
return SYSLOG_LEVEL_NOT_SET;
}
+const char *
+log_level_name(LogLevel level)
+{
+ u_int i;
+
+ for (i = 0; log_levels[i].name != NULL; i++)
+ if (log_levels[i].val == level)
+ return log_levels[i].name;
+ return NULL;
+}
+
/* Error messages that should be logged. */
void