00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #ifndef SERVER_H
00029 #define SERVER_H
00030
00031 #include "libssh/libssh.h"
00032 #define SERVERBANNER CLIENTBANNER
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00038 typedef struct ssh_bind_struct SSH_BIND;
00039
00045 SSH_BIND *ssh_bind_new(void);
00046
00054 void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options);
00055
00063 int ssh_bind_listen(SSH_BIND *ssh_bind);
00064
00072 void ssh_bind_set_blocking(SSH_BIND *ssh_bind, int blocking);
00073
00081 socket_t ssh_bind_get_fd(SSH_BIND *ssh_bind);
00082
00090 void ssh_bind_set_fd(SSH_BIND *ssh_bind, socket_t fd);
00091
00097 void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind);
00098
00106 SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
00107
00113 void ssh_bind_free(SSH_BIND *ssh_bind);
00114
00122 int ssh_accept(SSH_SESSION *session);
00123
00124
00125
00126 #define SSH_AUTH_REQUEST 1
00127 #define SSH_CHANNEL_REQUEST_OPEN 2
00128 #define SSH_CHANNEL_REQUEST 3
00129
00130 #define SSH_AUTH_NONE (1<<0)
00131 #define SSH_AUTH_PASSWORD (1<<1)
00132 #define SSH_AUTH_HOSTBASED (1<<2)
00133 #define SSH_AUTH_PUBLICKEY (1<<3)
00134 #define SSH_AUTH_KEYBINT (1<<4)
00135 #define SSH_AUTH_UNKNOWN 0
00136
00137 #define SSH_CHANNEL_SESSION 1
00138 #define SSH_CHANNEL_TCPIP 2
00139 #define SSH_CHANNEL_X11 3
00140 #define SSH_CHANNEL_UNKNOWN 4
00141
00142 #define SSH_CHANNEL_REQUEST_PTY 1
00143 #define SSH_CHANNEL_REQUEST_EXEC 2
00144 #define SSH_CHANNEL_REQUEST_SHELL 3
00145 #define SSH_CHANNEL_REQUEST_ENV 4
00146 #define SSH_CHANNEL_REQUEST_SUBSYSTEM 5
00147 #define SSH_CHANNEL_REQUEST_WINDOW_CHANGE 6
00148 #define SSH_CHANNEL_REQUEST_UNKNOWN 7
00149
00150 typedef struct ssh_message SSH_MESSAGE;
00151
00152 SSH_MESSAGE *ssh_message_get(SSH_SESSION *session);
00153 int ssh_message_type(SSH_MESSAGE *msg);
00154 int ssh_message_subtype(SSH_MESSAGE *msg);
00155 int ssh_message_reply_default(SSH_MESSAGE *msg);
00156 void ssh_message_free(SSH_MESSAGE *msg);
00157
00158 char *ssh_message_auth_user(SSH_MESSAGE *msg);
00159 char *ssh_message_auth_password(SSH_MESSAGE *msg);
00160 int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial);
00161 int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
00162
00163 CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
00164
00165 CHANNEL *ssh_message_channel_request_channel(SSH_MESSAGE *msg);
00166
00167 char *ssh_message_channel_request_pty_term(SSH_MESSAGE *msg);
00168 char *ssh_message_channel_request_subsystem(SSH_MESSAGE *msg);
00169 int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg);
00170
00171 #ifdef __cplusplus
00172 }
00173 #endif
00174
00175 #endif
00176
00180