3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
|
SockAddr addr;
const char *err;
char *loghost;
int addressfamily, sshprot;
loghost = conf_get_str(ssh->conf, CONF_loghost);
if (*loghost) {
char *colon;
ssh->savedhost = dupstr(loghost);
ssh->savedport = 22; /* default ssh port */
/*
* A colon suffix on savedhost also lets us affect
* savedport.
*
* (FIXME: do something about IPv6 address literals here.)
*/
colon = strrchr(ssh->savedhost, ':');
if (colon) {
*colon++ = '\0';
if (*colon)
ssh->savedport = atoi(colon);
}
} else {
ssh->savedhost = dupstr(host);
if (port < 0)
port = 22; /* default ssh port */
ssh->savedport = port;
}
ssh->fn = &fn_table; /* make 'ssh' usable as a Plug */
|
>
|
|
|
<
<
|
>
>
>
|
|
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
|
SockAddr addr;
const char *err;
char *loghost;
int addressfamily, sshprot;
loghost = conf_get_str(ssh->conf, CONF_loghost);
if (*loghost) {
char *tmphost;
char *colon;
tmphost = dupstr(loghost);
ssh->savedport = 22; /* default ssh port */
/*
* A colon suffix on the hostname string also lets us affect
* savedport.
*/
colon = host_strrchr(tmphost, ':');
if (colon) {
*colon++ = '\0';
if (*colon)
ssh->savedport = atoi(colon);
}
ssh->savedhost = host_strduptrim(tmphost);
sfree(tmphost);
} else {
ssh->savedhost = host_strduptrim(host);
if (port < 0)
port = 22; /* default ssh port */
ssh->savedport = port;
}
ssh->fn = &fn_table; /* make 'ssh' usable as a Plug */
|
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
|
address_family = 'A';
type = 'L';
if (*kp == 'A' || *kp == '4' || *kp == '6')
address_family = *kp++;
if (*kp == 'L' || *kp == 'R')
type = *kp++;
if ((kp2 = strchr(kp, ':')) != NULL) {
/*
* There's a colon in the middle of the source port
* string, which means that the part before it is
* actually a source address.
*/
saddr = dupprintf("%.*s", (int)(kp2 - kp), kp);
sports = kp2+1;
} else {
saddr = NULL;
sports = kp;
}
sport = atoi(sports);
sserv = 0;
|
|
|
>
>
|
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
|
address_family = 'A';
type = 'L';
if (*kp == 'A' || *kp == '4' || *kp == '6')
address_family = *kp++;
if (*kp == 'L' || *kp == 'R')
type = *kp++;
if ((kp2 = host_strchr(kp, ':')) != NULL) {
/*
* There's a colon in the middle of the source port
* string, which means that the part before it is
* actually a source address.
*/
char *saddr_tmp = dupprintf("%.*s", (int)(kp2 - kp), kp);
saddr = host_strduptrim(saddr_tmp);
sfree(saddr_tmp);
sports = kp2+1;
} else {
saddr = NULL;
sports = kp;
}
sport = atoi(sports);
sserv = 0;
|
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
|
dports = NULL;
dport = -1;
dserv = 0;
type = 'D';
} else {
/* ordinary forwarding */
vp = val;
vp2 = vp + strcspn(vp, ":");
host = dupprintf("%.*s", (int)(vp2 - vp), vp);
if (vp2)
vp2++;
dports = vp2;
dport = atoi(dports);
dserv = 0;
if (dport == 0) {
|
|
|
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
|
dports = NULL;
dport = -1;
dserv = 0;
type = 'D';
} else {
/* ordinary forwarding */
vp = val;
vp2 = vp + host_strcspn(vp, ":");
host = dupprintf("%.*s", (int)(vp2 - vp), vp);
if (vp2)
vp2++;
dports = vp2;
dport = atoi(dports);
dserv = 0;
if (dport == 0) {
|
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
|
PKT_INT, c->localid,
PKT_STR, hostname,
PKT_INT, port,
/* PKT_STR, <org:orgport>, */
PKT_END);
} else {
pktout = ssh2_chanopen_init(c, "direct-tcpip");
ssh2_pkt_addstring(pktout, hostname);
ssh2_pkt_adduint32(pktout, port);
/*
* We make up values for the originator data; partly it's
* too much hassle to keep track, and partly I'm not
* convinced the server should be told details like that
* about my local network configuration.
* The "originator IP address" is syntactically a numeric
|
>
>
|
>
>
|
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
|
PKT_INT, c->localid,
PKT_STR, hostname,
PKT_INT, port,
/* PKT_STR, <org:orgport>, */
PKT_END);
} else {
pktout = ssh2_chanopen_init(c, "direct-tcpip");
{
char *trimmed_host = host_strduptrim(hostname);
ssh2_pkt_addstring(pktout, trimmed_host);
sfree(trimmed_host);
}
ssh2_pkt_adduint32(pktout, port);
/*
* We make up values for the originator data; partly it's
* too much hassle to keep track, and partly I'm not
* convinced the server should be told details like that
* about my local network configuration.
* The "originator IP address" is syntactically a numeric
|