Lines Matching defs:fwd
516 format_forward(u_int ftype, Forward *fwd)
523 (fwd->listen_host == NULL) ?
525 fwd->listen_host, fwd->listen_port,
526 fwd->connect_host, fwd->connect_port);
530 (fwd->listen_host == NULL) ?
532 fwd->listen_host, fwd->listen_port);
536 (fwd->listen_host == NULL) ?
537 "LOCALHOST" : fwd->listen_host,
538 fwd->listen_port,
539 fwd->connect_host, fwd->connect_port);
630 Forward fwd;
635 fwd.listen_host = fwd.connect_host = NULL;
637 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
638 buffer_get_int_ret(&fwd.listen_port, m) != 0 ||
639 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL ||
640 buffer_get_int_ret(&fwd.connect_port, m) != 0) {
646 if (*fwd.listen_host == '\0') {
647 xfree(fwd.listen_host);
648 fwd.listen_host = NULL;
650 if (*fwd.connect_host == '\0') {
651 xfree(fwd.connect_host);
652 fwd.connect_host = NULL;
656 (fwd_desc = format_forward(ftype, &fwd)));
662 if (fwd.listen_host)
663 xfree(fwd.listen_host);
664 if (fwd.connect_host)
665 xfree(fwd.connect_host);
671 if (fwd.listen_port >= 65536) {
673 fwd.listen_port);
676 if (fwd.connect_port >= 65536 || (ftype != MUX_FWD_DYNAMIC &&
677 ftype != MUX_FWD_REMOTE && fwd.connect_port == 0)) {
679 fwd.connect_port);
682 if (ftype != MUX_FWD_DYNAMIC && fwd.connect_host == NULL) {
692 if (compare_forward(&fwd,
705 if (compare_forward(&fwd,
707 if (fwd.listen_port != 0)
733 if (channel_setup_local_fwd_listener(fwd.listen_host,
734 fwd.listen_port, fwd.connect_host, fwd.connect_port,
743 add_local_forward(&options, &fwd);
748 if (channel_request_remote_forwarding(fwd.listen_host,
749 fwd.listen_port, fwd.connect_host, fwd.connect_port) < 0)
751 add_remote_forward(&options, &fwd);
769 if (fwd.listen_host != NULL)
770 xfree(fwd.listen_host);
771 if (fwd.connect_host != NULL)
772 xfree(fwd.connect_host);
780 Forward fwd;
785 fwd.listen_host = fwd.connect_host = NULL;
787 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
788 buffer_get_int_ret(&fwd.listen_port, m) != 0 ||
789 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL ||
790 buffer_get_int_ret(&fwd.connect_port, m) != 0) {
796 if (*fwd.listen_host == '\0') {
797 xfree(fwd.listen_host);
798 fwd.listen_host = NULL;
800 if (*fwd.connect_host == '\0') {
801 xfree(fwd.connect_host);
802 fwd.connect_host = NULL;
806 (fwd_desc = format_forward(ftype, &fwd)));
816 if (fwd.listen_host != NULL)
817 xfree(fwd.listen_host);
818 if (fwd.connect_host != NULL)
819 xfree(fwd.connect_host);
845 debug2("%s: channel %d: request stdio fwd to %s:%u",
887 debug2("%s: stdio fwd refused by user", __func__);
1540 mux_client_request_forward(int fd, u_int ftype, Forward *fwd)
1546 fwd_desc = format_forward(ftype, fwd);
1555 fwd->listen_host == NULL ? "" : fwd->listen_host);
1556 buffer_put_int(&m, fwd->listen_port);
1558 fwd->connect_host == NULL ? "" : fwd->connect_host);
1559 buffer_put_int(&m, fwd->connect_port);
1580 fwd->allocated_port = buffer_get_int(&m);
1582 fwd->allocated_port,
1583 fwd->connect_host ? fwd->connect_host : "",
1584 fwd->connect_port);
1586 fprintf(stdout, "%u\n", fwd->allocated_port);