summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2008-06-10 23:01:51 +1000
committerDarren Tucker <dtucker@zip.com.au>2008-06-10 23:01:51 +1000
commite7140f20cb2da1456e6080059eef54cf0f3533f2 (patch)
tree7c4809d2dbb4b9e93599a2fb29c51a4621f88346 /log.c
parentb06cc4abf8e2eb4d1e14f19911a7e0afde50ee95 (diff)
- dtucker@cvs.openbsd.org 2008/06/10 04:50:25
[sshd.c channels.h channels.c log.c servconf.c log.h servconf.h sshd.8] 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 'log.c')
-rw-r--r--log.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/log.c b/log.c
index fae5b043f..4a8239b93 100644
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.c,v 1.40 2007/05/17 07:50:31 djm Exp $ */ 1/* $OpenBSD: log.c,v 1.41 2008/06/10 04:50:25 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -114,6 +114,17 @@ log_facility_number(char *name)
114 return SYSLOG_FACILITY_NOT_SET; 114 return SYSLOG_FACILITY_NOT_SET;
115} 115}
116 116
117const char *
118log_facility_name(SyslogFacility facility)
119{
120 u_int i;
121
122 for (i = 0; log_facilities[i].name; i++)
123 if (log_facilities[i].val == facility)
124 return log_facilities[i].name;
125 return NULL;
126}
127
117LogLevel 128LogLevel
118log_level_number(char *name) 129log_level_number(char *name)
119{ 130{
@@ -126,6 +137,17 @@ log_level_number(char *name)
126 return SYSLOG_LEVEL_NOT_SET; 137 return SYSLOG_LEVEL_NOT_SET;
127} 138}
128 139
140const char *
141log_level_name(LogLevel level)
142{
143 u_int i;
144
145 for (i = 0; log_levels[i].name != NULL; i++)
146 if (log_levels[i].val == level)
147 return log_levels[i].name;
148 return NULL;
149}
150
129/* Error messages that should be logged. */ 151/* Error messages that should be logged. */
130 152
131void 153void