| ︙ | | | ︙ | |
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
int agent_response_len;
/*
* Dispatch table for packet types that we may have to deal
* with at any time.
*/
handler_fn_t packet_dispatch[256];
};
#define logevent(s) logevent(ssh->frontend, s)
/* logevent, only printf-formatted. */
static void logeventf(Ssh ssh, const char *fmt, ...)
{
|
>
>
>
>
>
|
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
|
int agent_response_len;
/*
* Dispatch table for packet types that we may have to deal
* with at any time.
*/
handler_fn_t packet_dispatch[256];
/*
* This module deals with sending keepalives.
*/
Pinger pinger;
};
#define logevent(s) logevent(ssh->frontend, s)
/* logevent, only printf-formatted. */
static void logeventf(Ssh ssh, const char *fmt, ...)
{
|
| ︙ | | | ︙ | |
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
|
ssh->protocol = ssh1_protocol;
ssh1_protocol_setup(ssh);
ssh->version = 1;
ssh->s_rdpkt = ssh1_rdpkt;
}
update_specials_menu(ssh->frontend);
ssh->state = SSH_STATE_BEFORE_SIZE;
sfree(s->vstring);
crFinish(0);
}
static void ssh_gotdata(Ssh ssh, unsigned char *data, int datalen)
|
>
|
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
|
ssh->protocol = ssh1_protocol;
ssh1_protocol_setup(ssh);
ssh->version = 1;
ssh->s_rdpkt = ssh1_rdpkt;
}
update_specials_menu(ssh->frontend);
ssh->state = SSH_STATE_BEFORE_SIZE;
ssh->pinger = pinger_new(&ssh->cfg, &ssh_backend, ssh);
sfree(s->vstring);
crFinish(0);
}
static void ssh_gotdata(Ssh ssh, unsigned char *data, int datalen)
|
| ︙ | | | ︙ | |
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
|
int i;
struct ssh_channel *c;
ssh->state = SSH_STATE_CLOSED;
if (ssh->s) {
sk_close(ssh->s);
ssh->s = NULL;
}
/*
* Now we must shut down any port and X forwardings going
* through this connection.
*/
if (ssh->channels) {
for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) {
|
>
|
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
|
int i;
struct ssh_channel *c;
ssh->state = SSH_STATE_CLOSED;
if (ssh->s) {
sk_close(ssh->s);
ssh->s = NULL;
notify_remote_exit(ssh->frontend);
}
/*
* Now we must shut down any port and X forwardings going
* through this connection.
*/
if (ssh->channels) {
for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) {
|
| ︙ | | | ︙ | |
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
|
logeventf(ssh, "Connecting to %s port %d", addrbuf, port);
}
ssh->fn = &fn_table;
ssh->s = new_connection(addr, *realhost, port,
0, 1, nodelay, keepalive, (Plug) ssh, &ssh->cfg);
if ((err = sk_socket_error(ssh->s)) != NULL) {
ssh->s = NULL;
return err;
}
return NULL;
}
/*
|
>
|
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
|
logeventf(ssh, "Connecting to %s port %d", addrbuf, port);
}
ssh->fn = &fn_table;
ssh->s = new_connection(addr, *realhost, port,
0, 1, nodelay, keepalive, (Plug) ssh, &ssh->cfg);
if ((err = sk_socket_error(ssh->s)) != NULL) {
ssh->s = NULL;
notify_remote_exit(ssh->frontend);
return err;
}
return NULL;
}
/*
|
| ︙ | | | ︙ | |
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
|
ssh->v1_throttle_count = 0;
ssh->overall_bufsize = 0;
ssh->fallback_cmd = 0;
ssh->protocol = NULL;
ssh->protocol_initial_phase_done = FALSE;
p = connect_to_host(ssh, host, port, realhost, nodelay, keepalive);
if (p != NULL)
return p;
return NULL;
}
|
>
>
|
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
|
ssh->v1_throttle_count = 0;
ssh->overall_bufsize = 0;
ssh->fallback_cmd = 0;
ssh->protocol = NULL;
ssh->protocol_initial_phase_done = FALSE;
ssh->pinger = NULL;
p = connect_to_host(ssh, host, port, realhost, nodelay, keepalive);
if (p != NULL)
return p;
return NULL;
}
|
| ︙ | | | ︙ | |
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
|
if (ssh->crcda_ctx) {
crcda_free_context(ssh->crcda_ctx);
ssh->crcda_ctx = NULL;
}
if (ssh->s)
ssh_do_close(ssh);
sfree(ssh);
}
/*
* Reconfigure the SSH backend.
*
* Currently, this function does nothing very useful. In future,
* however, we could do some handy things with it. For example, we
* could make the port forwarding configurer active in the Change
* Settings box, and this routine could close down existing
* forwardings and open up new ones in response to changes.
*/
static void ssh_reconfig(void *handle, Config *cfg)
{
Ssh ssh = (Ssh) handle;
ssh->cfg = *cfg; /* STRUCTURE COPY */
}
/*
* Called to send data down the Telnet connection.
*/
static int ssh_send(void *handle, char *buf, int len)
|
>
>
>
|
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
|
if (ssh->crcda_ctx) {
crcda_free_context(ssh->crcda_ctx);
ssh->crcda_ctx = NULL;
}
if (ssh->s)
ssh_do_close(ssh);
sfree(ssh);
if (ssh->pinger)
pinger_free(ssh->pinger);
}
/*
* Reconfigure the SSH backend.
*
* Currently, this function does nothing very useful. In future,
* however, we could do some handy things with it. For example, we
* could make the port forwarding configurer active in the Change
* Settings box, and this routine could close down existing
* forwardings and open up new ones in response to changes.
*/
static void ssh_reconfig(void *handle, Config *cfg)
{
Ssh ssh = (Ssh) handle;
pinger_reconfig(ssh->pinger, &ssh->cfg, cfg);
ssh->cfg = *cfg; /* STRUCTURE COPY */
}
/*
* Called to send data down the Telnet connection.
*/
static int ssh_send(void *handle, char *buf, int len)
|
| ︙ | | | ︙ | |