Lines Matching defs:fwd

80 /* Context for stdio fwd open confirmation callback */
517 format_forward(u_int ftype, struct Forward *fwd)
524 (fwd->listen_path != NULL) ? fwd->listen_path :
525 (fwd->listen_host == NULL) ?
527 fwd->listen_host, fwd->listen_port,
528 (fwd->connect_path != NULL) ? fwd->connect_path :
529 fwd->connect_host, fwd->connect_port);
533 (fwd->listen_host == NULL) ?
535 fwd->listen_host, fwd->listen_port);
539 (fwd->listen_path != NULL) ? fwd->listen_path :
540 (fwd->listen_host == NULL) ?
541 "LOCALHOST" : fwd->listen_host,
542 fwd->listen_port,
543 (fwd->connect_path != NULL) ? fwd->connect_path :
544 fwd->connect_host, fwd->connect_port);
673 struct Forward fwd;
680 memset(&fwd, 0, sizeof(fwd));
703 memset(&fwd, 0, sizeof(fwd));
704 fwd.listen_port = lport;
705 if (fwd.listen_port == PORT_STREAMLOCAL)
706 fwd.listen_path = listen_addr;
708 fwd.listen_host = listen_addr;
709 fwd.connect_port = cport;
710 if (fwd.connect_port == PORT_STREAMLOCAL)
711 fwd.connect_path = connect_addr;
713 fwd.connect_host = connect_addr;
716 (fwd_desc = format_forward(ftype, &fwd)));
728 if (ftype == MUX_FWD_DYNAMIC && fwd.listen_path) {
733 if (fwd.listen_port != PORT_STREAMLOCAL && fwd.listen_port >= 65536) {
734 logit_f("invalid listen port %u", fwd.listen_port);
737 if ((fwd.connect_port != PORT_STREAMLOCAL &&
738 fwd.connect_port >= 65536) ||
740 fwd.connect_port == 0)) {
742 fwd.connect_port);
745 if (ftype != MUX_FWD_DYNAMIC && fwd.connect_host == NULL &&
746 fwd.connect_path == NULL) {
756 if (compare_forward(&fwd,
767 if (!compare_forward(&fwd, options.remote_forwards + i))
769 if (fwd.listen_port != 0)
794 if (!channel_setup_local_fwd_listener(ssh, &fwd,
802 add_local_forward(&options, &fwd);
807 fwd.handle = channel_request_remote_forwarding(ssh, &fwd);
808 if (fwd.handle < 0)
810 add_remote_forward(&options, &fwd);
826 free(fwd.listen_host);
827 free(fwd.listen_path);
828 free(fwd.connect_host);
829 free(fwd.connect_path);
838 struct Forward fwd, *found_fwd;
846 memset(&fwd, 0, sizeof(fwd));
869 memset(&fwd, 0, sizeof(fwd));
870 fwd.listen_port = lport;
871 if (fwd.listen_port == PORT_STREAMLOCAL)
872 fwd.listen_path = listen_addr;
874 fwd.listen_host = listen_addr;
875 fwd.connect_port = cport;
876 if (fwd.connect_port == PORT_STREAMLOCAL)
877 fwd.connect_path = connect_addr;
879 fwd.connect_host = connect_addr;
882 (fwd_desc = format_forward(ftype, &fwd)));
890 if (compare_forward(&fwd,
899 if (compare_forward(&fwd,
921 if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port,
973 debug2_f("channel %d: stdio fwd to %s:%d", c->self, chost, cport);
1013 debug2_f("stdio fwd refused by user");
1042 /* Callback on open confirmation in mux master for a mux stdio fwd session. */
1744 mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd)
1752 fwd_desc = format_forward(ftype, fwd);
1758 if (fwd->listen_path != NULL)
1759 lhost = fwd->listen_path;
1760 else if (fwd->listen_host == NULL)
1762 else if (*fwd->listen_host == '\0')
1765 lhost = fwd->listen_host;
1767 if (fwd->connect_path != NULL)
1768 chost = fwd->connect_path;
1769 else if (fwd->connect_host == NULL)
1772 chost = fwd->connect_host;
1780 (r = sshbuf_put_u32(m, fwd->listen_port)) != 0 ||
1782 (r = sshbuf_put_u32(m, fwd->connect_port)) != 0)
1809 if ((r = sshbuf_get_u32(m, &fwd->allocated_port)) != 0)
1812 fwd->allocated_port,
1813 fwd->connect_host ? fwd->connect_host : "",
1814 fwd->connect_port);
1816 fprintf(stdout, "%i\n", fwd->allocated_port);