diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 1999-11-10 23:36:46 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 1999-11-10 23:36:46 +0000 |
commit | 6724e1f9517ea95d84a6862483500a5d78eefe4a (patch) | |
tree | c5486ce6497c9dd849c88bd654953e48077fb635 /usr.bin/ssh/ssh.h | |
parent | 868a5e6c52f689aedf8507fad39c4897127f0505 (diff) |
add LogLevel {QUIET, FATAL, ERROR, INFO, CHAT, DEBUG} to ssh/sshd,
obsoletes QuietMode and FascistLogging in sshd.
Diffstat (limited to 'usr.bin/ssh/ssh.h')
-rw-r--r-- | usr.bin/ssh/ssh.h | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/usr.bin/ssh/ssh.h b/usr.bin/ssh/ssh.h index abf3303fad6..13fd5759f93 100644 --- a/usr.bin/ssh/ssh.h +++ b/usr.bin/ssh/ssh.h @@ -13,7 +13,7 @@ Generic header file for ssh. */ -/* RCSID("$Id: ssh.h,v 1.17 1999/11/10 22:24:01 markus Exp $"); */ +/* RCSID("$Id: ssh.h,v 1.18 1999/11/10 23:36:44 markus Exp $"); */ #ifndef SSH_H #define SSH_H @@ -205,9 +205,58 @@ only by root, whereas ssh_config should be world-readable. */ #define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ -/* Includes that need definitions above. */ +/*------------ Definitions for logging. -----------------------*/ + +/* Supported syslog facilities and levels. */ +typedef enum +{ + SYSLOG_FACILITY_DAEMON, + SYSLOG_FACILITY_USER, + SYSLOG_FACILITY_AUTH, + SYSLOG_FACILITY_LOCAL0, + SYSLOG_FACILITY_LOCAL1, + SYSLOG_FACILITY_LOCAL2, + SYSLOG_FACILITY_LOCAL3, + SYSLOG_FACILITY_LOCAL4, + SYSLOG_FACILITY_LOCAL5, + SYSLOG_FACILITY_LOCAL6, + SYSLOG_FACILITY_LOCAL7 +} SyslogFacility; + +typedef enum +{ + SYSLOG_LEVEL_QUIET, + SYSLOG_LEVEL_FATAL, + SYSLOG_LEVEL_ERROR, + SYSLOG_LEVEL_INFO, + SYSLOG_LEVEL_CHAT, + SYSLOG_LEVEL_DEBUG +} LogLevel; + +/* Initializes logging. */ +void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr); + +/* Logging implementation, depending on server or client */ +void do_log(LogLevel level, const char *fmt, va_list args); + +/* Output a message to syslog or stderr */ +void fatal(const char *fmt, ...); +void error(const char *fmt, ...); +void log(const char *fmt, ...); +void chat(const char *fmt, ...); +void debug(const char *fmt, ...); + +/* same as fatal() but w/o logging */ +void fatal_cleanup(void); + +/* Registers a cleanup function to be called by fatal()/fatal_cleanup() before exiting. + It is permissible to call fatal_remove_cleanup for the function itself + from the function. */ +void fatal_add_cleanup(void (*proc)(void *context), void *context); + +/* Removes a cleanup function to be called at fatal(). */ +void fatal_remove_cleanup(void (*proc)(void *context), void *context); -#include "readconf.h" /*------------ definitions for login.c -------------*/ @@ -247,6 +296,10 @@ int ssh_connect(const char *host, struct sockaddr_in *hostaddr, If login fails, this function prints an error and never returns. This initializes the random state, and leaves it initialized (it will also have references from the packet module). */ + +/* for Options */ +#include "readconf.h" + void ssh_login(int host_key_valid, RSA *host_key, const char *host, struct sockaddr_in *hostaddr, Options *options, uid_t original_real_uid); @@ -352,59 +405,6 @@ int load_public_key(const char *filename, RSA *pub, int load_private_key(const char *filename, const char *passphrase, RSA *private_key, char **comment_return); -/*------------ Definitions for logging. -----------------------*/ - -/* Supported syslog facilities. */ -typedef enum -{ - SYSLOG_FACILITY_DAEMON, - SYSLOG_FACILITY_USER, - SYSLOG_FACILITY_AUTH, - SYSLOG_FACILITY_LOCAL0, - SYSLOG_FACILITY_LOCAL1, - SYSLOG_FACILITY_LOCAL2, - SYSLOG_FACILITY_LOCAL3, - SYSLOG_FACILITY_LOCAL4, - SYSLOG_FACILITY_LOCAL5, - SYSLOG_FACILITY_LOCAL6, - SYSLOG_FACILITY_LOCAL7 -} SyslogFacility; - -/* Initializes logging. If debug is non-zero, debug() will output something. - If quiet is non-zero, none of these will log send anything to syslog - (but maybe to stderr). */ -void log_init(char *av0, int on_stderr, int debug, int quiet, - SyslogFacility facility); - -/* Outputs a message to syslog or stderr, depending on the implementation. - The format must guarantee that the final message does not exceed 1024 - characters. The message should not contain newline. */ -void log(const char *fmt, ...); - -/* Outputs a message to syslog or stderr, depending on the implementation. - The format must guarantee that the final message does not exceed 1024 - characters. The message should not contain newline. */ -void debug(const char *fmt, ...); - -/* Outputs a message to syslog or stderr, depending on the implementation. - The format must guarantee that the final message does not exceed 1024 - characters. The message should not contain newline. */ -void error(const char *fmt, ...); - -/* Outputs a message to syslog or stderr, depending on the implementation. - The format must guarantee that the final message does not exceed 1024 - characters. The message should not contain newline. - This call never returns. */ -void fatal(const char *fmt, ...); - -/* Registers a cleanup function to be called by fatal() before exiting. - It is permissible to call fatal_remove_cleanup for the function itself - from the function. */ -void fatal_add_cleanup(void (*proc)(void *context), void *context); - -/* Removes a cleanup function to be called at fatal(). */ -void fatal_remove_cleanup(void (*proc)(void *context), void *context); - /*---------------- definitions for channels ------------------*/ /* Sets specific protocol options. */ |