00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00029 #ifndef SERVER_H
00030 #define SERVER_H
00031
00032 #include "libssh/libssh.h"
00033 #define SERVERBANNER CLIENTBANNER
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 enum ssh_bind_options_e {
00040 SSH_BIND_OPTIONS_BINDADDR,
00041 SSH_BIND_OPTIONS_BINDPORT,
00042 SSH_BIND_OPTIONS_BINDPORT_STR,
00043 SSH_BIND_OPTIONS_HOSTKEY,
00044 SSH_BIND_OPTIONS_DSAKEY,
00045 SSH_BIND_OPTIONS_RSAKEY,
00046 SSH_BIND_OPTIONS_BANNER,
00047 SSH_BIND_OPTIONS_LOG_VERBOSITY,
00048 SSH_BIND_OPTIONS_LOG_VERBOSITY_STR
00049 };
00050
00051
00052 typedef struct ssh_bind_struct* ssh_bind;
00053
00059 LIBSSH_API ssh_bind ssh_bind_new(void);
00060
00068 LIBSSH_API int ssh_bind_options_set(ssh_bind sshbind,
00069 enum ssh_bind_options_e type, const void *value);
00070
00078 LIBSSH_API int ssh_bind_listen(ssh_bind ssh_bind_o);
00079
00087 LIBSSH_API void ssh_bind_set_blocking(ssh_bind ssh_bind_o, int blocking);
00088
00096 LIBSSH_API socket_t ssh_bind_get_fd(ssh_bind ssh_bind_o);
00097
00105 LIBSSH_API void ssh_bind_set_fd(ssh_bind ssh_bind_o, socket_t fd);
00106
00112 LIBSSH_API void ssh_bind_fd_toaccept(ssh_bind ssh_bind_o);
00113
00122 LIBSSH_API int ssh_bind_accept(ssh_bind ssh_bind_o, ssh_session session);
00123
00129 LIBSSH_API void ssh_bind_free(ssh_bind ssh_bind_o);
00130
00138 LIBSSH_API int ssh_accept(ssh_session session);
00139
00140 LIBSSH_API int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len);
00141
00142
00143 LIBSSH_API int ssh_message_reply_default(ssh_message msg);
00144
00145 LIBSSH_API char *ssh_message_auth_user(ssh_message msg);
00146 LIBSSH_API char *ssh_message_auth_password(ssh_message msg);
00147 LIBSSH_API ssh_public_key ssh_message_auth_publickey(ssh_message msg);
00148 LIBSSH_API int ssh_message_auth_reply_success(ssh_message msg,int partial);
00149 LIBSSH_API int ssh_message_auth_reply_pk_ok(ssh_message msg, ssh_string algo, ssh_string pubkey);
00150 LIBSSH_API int ssh_message_auth_set_methods(ssh_message msg, int methods);
00151
00152 LIBSSH_API int ssh_message_service_reply_success(ssh_message msg);
00153 LIBSSH_API char *ssh_message_service_service(ssh_message msg);
00154
00155 LIBSSH_API void ssh_set_message_callback(ssh_session session,
00156 int(*ssh_message_callback)(ssh_session session, ssh_message msg));
00157
00158 LIBSSH_API char *ssh_message_channel_request_open_originator(ssh_message msg);
00159 LIBSSH_API int ssh_message_channel_request_open_originator_port(ssh_message msg);
00160 LIBSSH_API char *ssh_message_channel_request_open_destination(ssh_message msg);
00161 LIBSSH_API int ssh_message_channel_request_open_destination_port(ssh_message msg);
00162
00163 LIBSSH_API ssh_channel ssh_message_channel_request_channel(ssh_message msg);
00164
00165 LIBSSH_API char *ssh_message_channel_request_pty_term(ssh_message msg);
00166 LIBSSH_API int ssh_message_channel_request_pty_width(ssh_message msg);
00167 LIBSSH_API int ssh_message_channel_request_pty_height(ssh_message msg);
00168 LIBSSH_API int ssh_message_channel_request_pty_pxwidth(ssh_message msg);
00169 LIBSSH_API int ssh_message_channel_request_pty_pxheight(ssh_message msg);
00170
00171 LIBSSH_API char *ssh_message_channel_request_env_name(ssh_message msg);
00172 LIBSSH_API char *ssh_message_channel_request_env_value(ssh_message msg);
00173
00174 LIBSSH_API char *ssh_message_channel_request_command(ssh_message msg);
00175
00176 LIBSSH_API char *ssh_message_channel_request_subsystem(ssh_message msg);
00177
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181
00182 #endif
00183
00187