Lines Matching defs:fwd
366 struct Forward *fwd;
377 fwd = &options->local_forwards[options->num_local_forwards++];
379 fwd->listen_host = newfwd->listen_host;
380 fwd->listen_port = newfwd->listen_port;
381 fwd->listen_path = newfwd->listen_path;
382 fwd->connect_host = newfwd->connect_host;
383 fwd->connect_port = newfwd->connect_port;
384 fwd->connect_path = newfwd->connect_path;
395 struct Forward *fwd;
406 fwd = &options->remote_forwards[options->num_remote_forwards++];
408 fwd->listen_host = newfwd->listen_host;
409 fwd->listen_port = newfwd->listen_port;
410 fwd->listen_path = newfwd->listen_path;
411 fwd->connect_host = newfwd->connect_host;
412 fwd->connect_port = newfwd->connect_port;
413 fwd->connect_path = newfwd->connect_path;
414 fwd->handle = newfwd->handle;
415 fwd->allocated_port = 0;
1082 struct Forward fwd;
1690 if (parse_forward(&fwd, fwdarg, dynamicfwd, remotefwd) == 0) {
1698 add_remote_forward(options, &fwd);
1700 add_local_forward(options, &fwd);
3084 * sets fwd to the parsed field and advances p past the colon
3089 parse_fwd_field(char **p, struct fwdarg *fwd)
3116 fwd->arg = cp + 1;
3117 fwd->ispath = ispath;
3138 fwd->arg = *p;
3139 fwd->ispath = ispath;
3155 parse_forward(struct Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd)
3161 memset(fwd, 0, sizeof(*fwd));
3190 fwd->listen_path = xstrdup(fwdargs[0].arg);
3191 fwd->listen_port = PORT_STREAMLOCAL;
3193 fwd->listen_host = NULL;
3194 fwd->listen_port = a2port(fwdargs[0].arg);
3196 fwd->connect_host = xstrdup("socks");
3201 fwd->listen_path = xstrdup(fwdargs[0].arg);
3202 fwd->listen_port = PORT_STREAMLOCAL;
3203 fwd->connect_path = xstrdup(fwdargs[1].arg);
3204 fwd->connect_port = PORT_STREAMLOCAL;
3206 fwd->listen_host = NULL;
3207 fwd->listen_port = a2port(fwdargs[0].arg);
3208 fwd->connect_path = xstrdup(fwdargs[1].arg);
3209 fwd->connect_port = PORT_STREAMLOCAL;
3211 fwd->listen_host = xstrdup(fwdargs[0].arg);
3212 fwd->listen_port = a2port(fwdargs[1].arg);
3213 fwd->connect_host = xstrdup("socks");
3219 fwd->listen_path = xstrdup(fwdargs[0].arg);
3220 fwd->listen_port = PORT_STREAMLOCAL;
3221 fwd->connect_host = xstrdup(fwdargs[1].arg);
3222 fwd->connect_port = a2port(fwdargs[2].arg);
3224 fwd->listen_host = xstrdup(fwdargs[0].arg);
3225 fwd->listen_port = a2port(fwdargs[1].arg);
3226 fwd->connect_path = xstrdup(fwdargs[2].arg);
3227 fwd->connect_port = PORT_STREAMLOCAL;
3229 fwd->listen_host = NULL;
3230 fwd->listen_port = a2port(fwdargs[0].arg);
3231 fwd->connect_host = xstrdup(fwdargs[1].arg);
3232 fwd->connect_port = a2port(fwdargs[2].arg);
3237 fwd->listen_host = xstrdup(fwdargs[0].arg);
3238 fwd->listen_port = a2port(fwdargs[1].arg);
3239 fwd->connect_host = xstrdup(fwdargs[2].arg);
3240 fwd->connect_port = a2port(fwdargs[3].arg);
3253 if (fwd->connect_path == NULL &&
3254 fwd->listen_path == NULL)
3257 if (fwd->connect_port <= 0 && fwd->connect_path == NULL)
3261 if ((fwd->listen_port < 0 && fwd->listen_path == NULL) ||
3262 (!remotefwd && fwd->listen_port == 0))
3264 if (fwd->connect_host != NULL &&
3265 strlen(fwd->connect_host) >= NI_MAXHOST)
3271 if (fwd->connect_path != NULL &&
3272 strlen(fwd->connect_path) >= PATH_MAX_SUN)
3274 if (fwd->listen_host != NULL &&
3275 strlen(fwd->listen_host) >= NI_MAXHOST)
3277 if (fwd->listen_path != NULL &&
3278 strlen(fwd->listen_path) >= PATH_MAX_SUN)
3284 free(fwd->connect_host);
3285 fwd->connect_host = NULL;
3286 free(fwd->connect_path);
3287 fwd->connect_path = NULL;
3288 free(fwd->listen_host);
3289 fwd->listen_host = NULL;
3290 free(fwd->listen_path);
3291 fwd->listen_path = NULL;
3509 const struct Forward *fwd;
3514 fwd = &fwds[i];
3515 if (code == oDynamicForward && fwd->connect_host != NULL &&
3516 strcmp(fwd->connect_host, "socks") != 0)
3518 if (code == oLocalForward && fwd->connect_host != NULL &&
3519 strcmp(fwd->connect_host, "socks") == 0)
3522 if (fwd->listen_port == PORT_STREAMLOCAL)
3523 printf(" %s", fwd->listen_path);
3524 else if (fwd->listen_host == NULL)
3525 printf(" %d", fwd->listen_port);
3528 fwd->listen_host, fwd->listen_port);
3531 if (fwd->connect_port == PORT_STREAMLOCAL)
3532 printf(" %s", fwd->connect_path);
3533 else if (fwd->connect_host == NULL)
3534 printf(" %d", fwd->connect_port);
3537 fwd->connect_host, fwd->connect_port);