Lines Matching refs:fwd
3380 struct Forward *fwd, int *allocated_listen_port, argument
3392 if (is_client && fwd->connect_path != NULL) {
3393 host = fwd->connect_path;
3396 fwd->listen_host : fwd->connect_host;
3408 addr = channel_fwd_bind_addr(ssh, fwd->listen_host, &wildcard,
3421 snprintf(strport, sizeof strport, "%d", fwd->listen_port);
3453 fwd->listen_port == 0 && allocated_listen_port != NULL &&
3509 fwd->listen_port == 0 &&
3522 c->host_port = fwd->connect_port;
3524 if (fwd->listen_port == 0 && allocated_listen_port != NULL &&
3528 c->listening_port = fwd->listen_port;
3533 fwd->listen_port);
3540 struct Forward *fwd, struct ForwardOptions *fwd_opts) argument
3550 if (fwd->connect_path != NULL) {
3551 if (strlen(fwd->connect_path) > sizeof(sunaddr.sun_path)) {
3553 fwd->connect_path);
3556 path = fwd->connect_path;
3559 if (fwd->connect_host == NULL) {
3563 if (strlen(fwd->connect_host) >= NI_MAXHOST) {
3567 path = fwd->connect_host;
3568 port = fwd->connect_port;
3572 path = fwd->listen_path;
3580 if (fwd->listen_path == NULL) {
3584 if (strlen(fwd->listen_path) > sizeof(sunaddr.sun_path)) {
3585 error("Local listening path too long: %s", fwd->listen_path);
3589 debug3("%s: type %d path %s", __func__, type, fwd->listen_path);
3593 sock = unix_listener(fwd->listen_path, SSH_LISTEN_BACKLOG,
3599 debug("Local forwarding listening on path %s.", fwd->listen_path);
3608 c->listening_addr = xstrdup(fwd->listen_path);
3656 channel_cancel_rport_listener(struct ssh *ssh, struct Forward *fwd) argument
3658 if (fwd->listen_path != NULL) {
3660 fwd->listen_path);
3663 fwd->listen_host, fwd->listen_port);
3732 struct Forward *fwd, int cport, struct ForwardOptions *fwd_opts) argument
3734 if (fwd->listen_path != NULL) {
3736 fwd->listen_path);
3739 fwd->listen_host, fwd->listen_port, cport, fwd_opts);
3746 struct Forward *fwd, struct ForwardOptions *fwd_opts) argument
3748 if (fwd->listen_path != NULL) {
3750 SSH_CHANNEL_UNIX_LISTENER, fwd, fwd_opts);
3753 SSH_CHANNEL_PORT_LISTENER, fwd, NULL, fwd_opts);
3759 remote_open_match(struct permission *allowed_open, struct Forward *fwd) argument
3765 if (fwd->listen_path != NULL)
3768 if (fwd->listen_host == NULL || allowed_open->listen_host == NULL)
3772 allowed_open->listen_port != fwd->listen_port)
3776 lhost = xstrdup(fwd->listen_host);
3786 check_rfwd_permission(struct ssh *ssh, struct Forward *fwd) argument
3799 if (remote_open_match(perm, fwd)) {
3810 if (remote_open_match(perm, fwd)) {
3822 channel_setup_remote_fwd_listener(struct ssh *ssh, struct Forward *fwd, argument
3825 if (!check_rfwd_permission(ssh, fwd)) {
3827 if (fwd->listen_path != NULL)
3833 fwd->listen_path);
3834 else if(fwd->listen_host != NULL)
3839 fwd->listen_host, fwd->listen_port );
3846 if (fwd->listen_path != NULL) {
3848 SSH_CHANNEL_RUNIX_LISTENER, fwd, fwd_opts);
3851 SSH_CHANNEL_RPORT_LISTENER, fwd, allocated_listen_port,
3878 channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) argument
3885 if (fwd->listen_path != NULL) {
3890 (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 ||
3900 channel_rfwd_bind_host(fwd->listen_host))) != 0 ||
3901 (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 ||
3913 if (fwd->connect_path != NULL) {
3914 host_to_connect = xstrdup(fwd->connect_path);
3917 host_to_connect = xstrdup(fwd->connect_host);
3918 port_to_connect = fwd->connect_port;
3920 if (fwd->listen_path != NULL) {
3921 listen_path = xstrdup(fwd->listen_path);
3924 if (fwd->listen_host != NULL)
3925 listen_host = xstrdup(fwd->listen_host);
3926 listen_port = fwd->listen_port;
4069 channel_request_rforward_cancel(struct ssh *ssh, struct Forward *fwd) argument
4071 if (fwd->listen_path != NULL) {
4073 fwd->listen_path);
4076 fwd->listen_host,
4077 fwd->listen_port ? fwd->listen_port : fwd->allocated_port);