6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
|
*/
static const struct telnet_special *ssh_get_specials(void *handle)
{
static const struct telnet_special ignore_special[] = {
{"IGNORE message", TS_NOP},
};
static const struct telnet_special ssh2_session_specials[] = {
{"", 0},
{"Break", TS_BRK}
/* XXX we should also support signals */
};
static const struct telnet_special specials_end[] = {
{NULL, 0}
};
static struct telnet_special ssh_specials[lenof(ignore_special) +
lenof(ssh2_session_specials) +
lenof(specials_end)];
Ssh ssh = (Ssh) handle;
int i = 0;
#define ADD_SPECIALS(name) \
|
|
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
|
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
|
*/
static const struct telnet_special *ssh_get_specials(void *handle)
{
static const struct telnet_special ignore_special[] = {
{"IGNORE message", TS_NOP},
};
static const struct telnet_special ssh2_session_specials[] = {
{NULL, TS_SEP},
{"Break", TS_BRK},
/* These are the signal names defined by draft-ietf-secsh-connect-19.
* They include all the ISO C signals, but are a subset of the POSIX
* required signals. */
{"SIGINT (Interrupt)", TS_SIGINT},
{"SIGTERM (Terminate)", TS_SIGTERM},
{"SIGKILL (Kill)", TS_SIGKILL},
{"SIGQUIT (Quit)", TS_SIGQUIT},
{"SIGHUP (Hangup)", TS_SIGHUP},
{"More signals", TS_SUBMENU},
{"SIGABRT", TS_SIGABRT}, {"SIGALRM", TS_SIGALRM},
{"SIGFPE", TS_SIGFPE}, {"SIGILL", TS_SIGILL},
{"SIGPIPE", TS_SIGPIPE}, {"SIGSEGV", TS_SIGSEGV},
{"SIGUSR1", TS_SIGUSR1}, {"SIGUSR2", TS_SIGUSR2},
{NULL, TS_EXITMENU}
};
static const struct telnet_special specials_end[] = {
{NULL, TS_EXITMENU}
};
static struct telnet_special ssh_specials[lenof(ignore_special) +
lenof(ssh2_session_specials) +
lenof(specials_end)];
Ssh ssh = (Ssh) handle;
int i = 0;
#define ADD_SPECIALS(name) \
|
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
|
ssh2_pkt_adduint32(ssh, ssh->mainchan->remoteid);
ssh2_pkt_addstring(ssh, "break");
ssh2_pkt_addbool(ssh, 0);
ssh2_pkt_adduint32(ssh, 0); /* default break length */
ssh2_pkt_send(ssh);
}
} else {
/* do nothing */
}
}
void *new_sock_channel(void *handle, Socket s)
{
Ssh ssh = (Ssh) handle;
struct ssh_channel *c;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
|
ssh2_pkt_adduint32(ssh, ssh->mainchan->remoteid);
ssh2_pkt_addstring(ssh, "break");
ssh2_pkt_addbool(ssh, 0);
ssh2_pkt_adduint32(ssh, 0); /* default break length */
ssh2_pkt_send(ssh);
}
} else {
/* Is is a POSIX signal? */
char *signame = NULL;
if (code == TS_SIGABRT) signame = "ABRT";
if (code == TS_SIGALRM) signame = "ALRM";
if (code == TS_SIGFPE) signame = "FPE";
if (code == TS_SIGHUP) signame = "HUP";
if (code == TS_SIGILL) signame = "ILL";
if (code == TS_SIGINT) signame = "INT";
if (code == TS_SIGKILL) signame = "KILL";
if (code == TS_SIGPIPE) signame = "PIPE";
if (code == TS_SIGQUIT) signame = "QUIT";
if (code == TS_SIGSEGV) signame = "SEGV";
if (code == TS_SIGTERM) signame = "TERM";
if (code == TS_SIGUSR1) signame = "USR1";
if (code == TS_SIGUSR2) signame = "USR2";
/* The SSH-2 protocol does in principle support arbitrary named
* signals, including signame@domain, but we don't support those. */
if (signame) {
/* It's a signal. */
if (ssh->version == 2 && ssh->mainchan) {
ssh2_pkt_init(ssh, SSH2_MSG_CHANNEL_REQUEST);
ssh2_pkt_adduint32(ssh, ssh->mainchan->remoteid);
ssh2_pkt_addstring(ssh, "signal");
ssh2_pkt_addbool(ssh, 0);
ssh2_pkt_addstring(ssh, signame);
ssh2_pkt_send(ssh);
logeventf(ssh, "Sent signal SIG%s", signame);
}
} else {
/* Never heard of it. Do nothing */
}
}
}
void *new_sock_channel(void *handle, Socket s)
{
Ssh ssh = (Ssh) handle;
struct ssh_channel *c;
|