Lines Matching refs:fwd
3886 struct Forward *fwd, int *allocated_listen_port,
3898 if (is_client && fwd->connect_path != NULL) {
3899 host = fwd->connect_path;
3902 fwd->listen_host : fwd->connect_host;
3914 addr = channel_fwd_bind_addr(ssh, fwd->listen_host, &wildcard,
3927 snprintf(strport, sizeof strport, "%d", fwd->listen_port);
3959 fwd->listen_port == 0 && allocated_listen_port != NULL &&
4003 * fwd->listen_port == 0 requests a dynamically allocated port -
4007 fwd->listen_port == 0 &&
4026 c->host_port = fwd->connect_port;
4028 if (fwd
4032 c->listening_port = fwd->listen_port;
4036 error_f("cannot listen to port: %d", fwd->listen_port);
4043 struct Forward *fwd, struct ForwardOptions *fwd_opts)
4053 if (fwd->connect_path != NULL) {
4054 if (strlen(fwd->connect_path) > sizeof(sunaddr.sun_path)) {
4056 fwd->connect_path);
4059 path = fwd->connect_path;
4062 if (fwd->connect_host == NULL) {
4066 if (strlen(fwd->connect_host) >= NI_MAXHOST) {
4070 path = fwd->connect_host;
4071 port = fwd->connect_port;
4075 path = fwd->listen_path;
4083 if (fwd->listen_path == NULL) {
4087 if (strlen(fwd->listen_path) > sizeof(sunaddr.sun_path)) {
4088 error("Local listening path too long: %s", fwd->listen_path);
4092 debug3_f("type %d path %s", type, fwd->listen_path);
4096 sock = unix_listener(fwd->listen_path, SSH_LISTEN_BACKLOG,
4102 debug("Local forwarding listening on path %s.", fwd->listen_path);
4111 c->listening_addr = xstrdup(fwd->listen_path);
4159 channel_cancel_rport_listener(struct ssh *ssh, struct Forward *fwd)
4161 if (fwd->listen_path != NULL) {
4163 fwd->listen_path);
4166 fwd->listen_host, fwd->listen_port);
4235 struct Forward *fwd, int cport, struct ForwardOptions *fwd_opts)
4237 if (fwd->listen_path != NULL) {
4239 fwd->listen_path);
4242 fwd->listen_host, fwd->listen_port, cport, fwd_opts);
4246 /* protocol local port fwd, used by ssh */
4249 struct Forward *fwd, struct ForwardOptions *fwd_opts)
4251 if (fwd->listen_path != NULL) {
4253 SSH_CHANNEL_UNIX_LISTENER, fwd, fwd_opts);
4256 SSH_CHANNEL_PORT_LISTENER, fwd, NULL, fwd_opts);
4262 remote_open_match(struct permission *allowed_open, struct Forward *fwd)
4268 if (fwd->listen_path != NULL)
4271 if (fwd->listen_host == NULL || allowed_open->listen_host == NULL)
4275 allowed_open->listen_port != fwd->listen_port)
4279 lhost = xstrdup(fwd->listen_host);
4289 check_rfwd_permission(struct ssh *ssh, struct Forward *fwd)
4302 if (remote_open_match(perm, fwd)) {
4313 if (remote_open_match(perm, fwd)) {
4323 /* protocol v2 remote port fwd, used by sshd */
4325 channel_setup_remote_fwd_listener(struct ssh *ssh, struct Forward *fwd,
4328 if (!check_rfwd_permission(ssh, fwd)) {
4330 if (fwd->listen_path != NULL)
4336 fwd->listen_path);
4337 else if(fwd->listen_host != NULL)
4342 fwd->listen_host, fwd->listen_port );
4349 if (fwd->listen_path != NULL) {
4351 SSH_CHANNEL_RUNIX_LISTENER, fwd, fwd_opts);
4354 SSH_CHANNEL_RPORT_LISTENER, fwd, allocated_listen_port,
4381 channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd)
4388 if (fwd->listen_path != NULL) {
4393 (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 ||
4402 channel_rfwd_bind_host(fwd->listen_host))) != 0 ||
4403 (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 ||
4414 if (fwd->connect_path != NULL) {
4415 host_to_connect = fwd->connect_path;
4418 host_to_connect = fwd->connect_host;
4419 port_to_connect = fwd->connect_port;
4421 if (fwd->listen_path != NULL) {
4422 listen_path = fwd->listen_path;
4425 listen_host = fwd->listen_host;
4426 listen_port = fwd->listen_port;
4569 channel_request_rforward_cancel(struct ssh *ssh, struct Forward *fwd)
4571 if (fwd->listen_path != NULL) {
4573 fwd->listen_path);
4576 fwd->listen_host,
4577 fwd->listen_port ? fwd->listen_port : fwd->allocated_port);