Lines Matching refs:fwd
3792 struct Forward *fwd, int *allocated_listen_port, in channel_setup_fwd_listener_tcpip() argument
3804 if (is_client && fwd->connect_path != NULL) { in channel_setup_fwd_listener_tcpip()
3805 host = fwd->connect_path; in channel_setup_fwd_listener_tcpip()
3808 fwd->listen_host : fwd->connect_host; in channel_setup_fwd_listener_tcpip()
3820 addr = channel_fwd_bind_addr(ssh, fwd->listen_host, &wildcard, in channel_setup_fwd_listener_tcpip()
3833 snprintf(strport, sizeof strport, "%d", fwd->listen_port); in channel_setup_fwd_listener_tcpip()
3865 fwd->listen_port == 0 && allocated_listen_port != NULL && in channel_setup_fwd_listener_tcpip()
3920 fwd->listen_port == 0 && in channel_setup_fwd_listener_tcpip()
3933 c->host_port = fwd->connect_port; in channel_setup_fwd_listener_tcpip()
3935 if (fwd->listen_port == 0 && allocated_listen_port != NULL && in channel_setup_fwd_listener_tcpip()
3939 c->listening_port = fwd->listen_port; in channel_setup_fwd_listener_tcpip()
3943 error_f("cannot listen to port: %d", fwd->listen_port); in channel_setup_fwd_listener_tcpip()
3950 struct Forward *fwd, struct ForwardOptions *fwd_opts) in channel_setup_fwd_listener_streamlocal() argument
3960 if (fwd->connect_path != NULL) { in channel_setup_fwd_listener_streamlocal()
3961 if (strlen(fwd->connect_path) > sizeof(sunaddr.sun_path)) { in channel_setup_fwd_listener_streamlocal()
3963 fwd->connect_path); in channel_setup_fwd_listener_streamlocal()
3966 path = fwd->connect_path; in channel_setup_fwd_listener_streamlocal()
3969 if (fwd->connect_host == NULL) { in channel_setup_fwd_listener_streamlocal()
3973 if (strlen(fwd->connect_host) >= NI_MAXHOST) { in channel_setup_fwd_listener_streamlocal()
3977 path = fwd->connect_host; in channel_setup_fwd_listener_streamlocal()
3978 port = fwd->connect_port; in channel_setup_fwd_listener_streamlocal()
3982 path = fwd->listen_path; in channel_setup_fwd_listener_streamlocal()
3990 if (fwd->listen_path == NULL) { in channel_setup_fwd_listener_streamlocal()
3994 if (strlen(fwd->listen_path) > sizeof(sunaddr.sun_path)) { in channel_setup_fwd_listener_streamlocal()
3995 error("Local listening path too long: %s", fwd->listen_path); in channel_setup_fwd_listener_streamlocal()
3999 debug3_f("type %d path %s", type, fwd->listen_path); in channel_setup_fwd_listener_streamlocal()
4003 sock = unix_listener(fwd->listen_path, SSH_LISTEN_BACKLOG, in channel_setup_fwd_listener_streamlocal()
4009 debug("Local forwarding listening on path %s.", fwd->listen_path); in channel_setup_fwd_listener_streamlocal()
4018 c->listening_addr = xstrdup(fwd->listen_path); in channel_setup_fwd_listener_streamlocal()
4066 channel_cancel_rport_listener(struct ssh *ssh, struct Forward *fwd) in channel_cancel_rport_listener() argument
4068 if (fwd->listen_path != NULL) { in channel_cancel_rport_listener()
4070 fwd->listen_path); in channel_cancel_rport_listener()
4073 fwd->listen_host, fwd->listen_port); in channel_cancel_rport_listener()
4142 struct Forward *fwd, int cport, struct ForwardOptions *fwd_opts) in channel_cancel_lport_listener() argument
4144 if (fwd->listen_path != NULL) { in channel_cancel_lport_listener()
4146 fwd->listen_path); in channel_cancel_lport_listener()
4149 fwd->listen_host, fwd->listen_port, cport, fwd_opts); in channel_cancel_lport_listener()
4156 struct Forward *fwd, struct ForwardOptions *fwd_opts) in channel_setup_local_fwd_listener() argument
4158 if (fwd->listen_path != NULL) { in channel_setup_local_fwd_listener()
4160 SSH_CHANNEL_UNIX_LISTENER, fwd, fwd_opts); in channel_setup_local_fwd_listener()
4163 SSH_CHANNEL_PORT_LISTENER, fwd, NULL, fwd_opts); in channel_setup_local_fwd_listener()
4169 remote_open_match(struct permission *allowed_open, struct Forward *fwd) in remote_open_match() argument
4175 if (fwd->listen_path != NULL) in remote_open_match()
4178 if (fwd->listen_host == NULL || allowed_open->listen_host == NULL) in remote_open_match()
4182 allowed_open->listen_port != fwd->listen_port) in remote_open_match()
4186 lhost = xstrdup(fwd->listen_host); in remote_open_match()
4196 check_rfwd_permission(struct ssh *ssh, struct Forward *fwd) in check_rfwd_permission() argument
4209 if (remote_open_match(perm, fwd)) { in check_rfwd_permission()
4220 if (remote_open_match(perm, fwd)) { in check_rfwd_permission()
4232 channel_setup_remote_fwd_listener(struct ssh *ssh, struct Forward *fwd, in channel_setup_remote_fwd_listener() argument
4235 if (!check_rfwd_permission(ssh, fwd)) { in channel_setup_remote_fwd_listener()
4237 if (fwd->listen_path != NULL) in channel_setup_remote_fwd_listener()
4243 fwd->listen_path); in channel_setup_remote_fwd_listener()
4244 else if(fwd->listen_host != NULL) in channel_setup_remote_fwd_listener()
4249 fwd->listen_host, fwd->listen_port ); in channel_setup_remote_fwd_listener()
4256 if (fwd->listen_path != NULL) { in channel_setup_remote_fwd_listener()
4258 SSH_CHANNEL_RUNIX_LISTENER, fwd, fwd_opts); in channel_setup_remote_fwd_listener()
4261 SSH_CHANNEL_RPORT_LISTENER, fwd, allocated_listen_port, in channel_setup_remote_fwd_listener()
4288 channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) in channel_request_remote_forwarding() argument
4295 if (fwd->listen_path != NULL) { in channel_request_remote_forwarding()
4300 (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 || in channel_request_remote_forwarding()
4309 channel_rfwd_bind_host(fwd->listen_host))) != 0 || in channel_request_remote_forwarding()
4310 (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 || in channel_request_remote_forwarding()
4321 if (fwd->connect_path != NULL) { in channel_request_remote_forwarding()
4322 host_to_connect = fwd->connect_path; in channel_request_remote_forwarding()
4325 host_to_connect = fwd->connect_host; in channel_request_remote_forwarding()
4326 port_to_connect = fwd->connect_port; in channel_request_remote_forwarding()
4328 if (fwd->listen_path != NULL) { in channel_request_remote_forwarding()
4329 listen_path = fwd->listen_path; in channel_request_remote_forwarding()
4332 listen_host = fwd->listen_host; in channel_request_remote_forwarding()
4333 listen_port = fwd->listen_port; in channel_request_remote_forwarding()
4476 channel_request_rforward_cancel(struct ssh *ssh, struct Forward *fwd) in channel_request_rforward_cancel() argument
4478 if (fwd->listen_path != NULL) { in channel_request_rforward_cancel()
4480 fwd->listen_path); in channel_request_rforward_cancel()
4483 fwd->listen_host, in channel_request_rforward_cancel()
4484 fwd->listen_port ? fwd->listen_port : fwd->allocated_port); in channel_request_rforward_cancel()