00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SESSION_H_
00023 #define SESSION_H_
00024 #include "libssh/priv.h"
00025 #include "libssh/packet.h"
00026 #include "libssh/pcap.h"
00027
00028 typedef struct ssh_kbdint_struct* ssh_kbdint;
00029
00030 struct ssh_session_struct {
00031 struct error_struct error;
00032 struct socket *socket;
00033 char *serverbanner;
00034 char *clientbanner;
00035 int protoversion;
00036 int server;
00037 int client;
00038 int openssh;
00039 uint32_t send_seq;
00040 uint32_t recv_seq;
00041
00042 int closed;
00043 int closed_by_except;
00044
00045 int connected;
00046
00047 int alive;
00048
00049 int auth_service_asked;
00050
00051
00052 int blocking;
00053
00054 ssh_string banner;
00055
00056 char *remotebanner;
00057
00058 char *discon_msg;
00059
00060 ssh_buffer in_buffer;
00061 PACKET in_packet;
00062 ssh_buffer out_buffer;
00063
00064
00065
00066 int packet_state;
00067 int dh_handshake_state;
00068 ssh_string dh_server_signature;
00069
00070 KEX server_kex;
00071 KEX client_kex;
00072 ssh_buffer in_hashbuf;
00073 ssh_buffer out_hashbuf;
00074 struct ssh_crypto_struct *current_crypto;
00075 struct ssh_crypto_struct *next_crypto;
00076
00077 ssh_channel channels;
00078 int maxchannel;
00079 int exec_channel_opened;
00080
00081 ssh_agent agent;
00082
00083
00084 struct ssh_kbdint_struct *kbdint;
00085 int version;
00086
00087 ssh_private_key rsa_key;
00088 ssh_private_key dsa_key;
00089
00090 int auth_methods;
00091 int hostkeys;
00092 struct ssh_list *ssh_message_list;
00093 int (*ssh_message_callback)( struct ssh_session_struct *session, ssh_message msg);
00094 int log_verbosity;
00095 int log_indent;
00096
00097 ssh_callbacks callbacks;
00098
00099
00100 #ifdef WITH_PCAP
00101 ssh_pcap_context pcap_ctx;
00102 #endif
00103 char *username;
00104 char *host;
00105 char *bindaddr;
00106 char *xbanner;
00107 struct ssh_list *identity;
00108 char *sshdir;
00109 char *knownhosts;
00110 char *wanted_methods[10];
00111 unsigned long timeout;
00112 unsigned long timeout_usec;
00113 unsigned int port;
00114 socket_t fd;
00115 int ssh2;
00116 int ssh1;
00117 };
00118
00119 int ssh_handle_packets(ssh_session session);
00120
00121 #endif