version 1.17, 1999/11/10 22:24:01 |
version 1.18, 1999/11/10 23:36:44 |
|
|
#define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ |
#define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ |
|
|
|
|
/* Includes that need definitions above. */ |
/*------------ Definitions for logging. -----------------------*/ |
|
|
#include "readconf.h" |
/* 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); |
|
|
|
|
/*------------ definitions for login.c -------------*/ |
/*------------ definitions for login.c -------------*/ |
|
|
/* Returns the time when the user last logged in. Returns 0 if the |
/* Returns the time when the user last logged in. Returns 0 if the |
|
|
If login fails, this function prints an error and never returns. |
If login fails, this function prints an error and never returns. |
This initializes the random state, and leaves it initialized (it will also |
This initializes the random state, and leaves it initialized (it will also |
have references from the packet module). */ |
have references from the packet module). */ |
|
|
|
/* for Options */ |
|
#include "readconf.h" |
|
|
void ssh_login(int host_key_valid, RSA *host_key, const char *host, |
void ssh_login(int host_key_valid, RSA *host_key, const char *host, |
struct sockaddr_in *hostaddr, Options *options, |
struct sockaddr_in *hostaddr, Options *options, |
uid_t original_real_uid); |
uid_t original_real_uid); |
|
|
with xfree. */ |
with xfree. */ |
int load_private_key(const char *filename, const char *passphrase, |
int load_private_key(const char *filename, const char *passphrase, |
RSA *private_key, char **comment_return); |
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 ------------------*/ |
/*---------------- definitions for channels ------------------*/ |
|
|