Lines Matching refs:fwd
75 /* Context for stdio fwd open confirmation callback */
566 format_forward(u_int ftype, struct Forward *fwd)
573 (fwd->listen_path != NULL) ? fwd->listen_path :
574 (fwd->listen_host == NULL) ?
576 fwd->listen_host, fwd->listen_port,
577 (fwd->connect_path != NULL) ? fwd->connect_path :
578 fwd->connect_host, fwd->connect_port);
582 (fwd->listen_host == NULL) ?
584 fwd->listen_host, fwd->listen_port);
588 (fwd->listen_path != NULL) ? fwd->listen_path :
589 (fwd->listen_host == NULL) ?
590 "LOCALHOST" : fwd->listen_host,
591 fwd->listen_port,
592 (fwd->connect_path != NULL) ? fwd->connect_path :
593 fwd->connect_host, fwd->connect_port);
723 struct Forward fwd;
730 memset(&fwd, 0, sizeof(fwd));
753 memset(&fwd, 0, sizeof(fwd));
754 fwd.listen_port = lport;
755 if (fwd.listen_port == PORT_STREAMLOCAL)
756 fwd.listen_path = listen_addr;
758 fwd.listen_host = listen_addr;
759 fwd.connect_port = cport;
760 if (fwd.connect_port == PORT_STREAMLOCAL)
761 fwd.connect_path = connect_addr;
763 fwd.connect_host = connect_addr;
766 (fwd_desc = format_forward(ftype, &fwd)));
778 if (ftype == MUX_FWD_DYNAMIC && fwd.listen_path) {
783 if (fwd.listen_port != PORT_STREAMLOCAL && fwd.listen_port >= 65536) {
784 logit_f("invalid listen port %u", fwd.listen_port);
787 if ((fwd.connect_port != PORT_STREAMLOCAL &&
788 fwd.connect_port >= 65536) ||
790 fwd.connect_port == 0)) {
792 fwd.connect_port);
795 if (ftype != MUX_FWD_DYNAMIC && fwd.connect_host == NULL &&
796 fwd.connect_path == NULL) {
806 if (compare_forward(&fwd,
817 if (!compare_forward(&fwd, options.remote_forwards + i))
819 if (fwd.listen_port != 0)
844 if (!channel_setup_local_fwd_listener(ssh, &fwd,
852 add_local_forward(&options, &fwd);
857 fwd.handle = channel_request_remote_forwarding(ssh, &fwd);
858 if (fwd.handle < 0)
860 add_remote_forward(&options, &fwd);
876 free(fwd.listen_host);
877 free(fwd.listen_path);
878 free(fwd.connect_host);
879 free(fwd.connect_path);
888 struct Forward fwd, *found_fwd;
896 memset(&fwd, 0, sizeof(fwd));
919 memset(&fwd, 0, sizeof(fwd));
920 fwd.listen_port = lport;
921 if (fwd.listen_port == PORT_STREAMLOCAL)
922 fwd.listen_path = listen_addr;
924 fwd.listen_host = listen_addr;
925 fwd.connect_port = cport;
926 if (fwd.connect_port == PORT_STREAMLOCAL)
927 fwd.connect_path = connect_addr;
929 fwd.connect_host = connect_addr;
932 (fwd_desc = format_forward(ftype, &fwd)));
940 if (compare_forward(&fwd,
949 if (compare_forward(&fwd,
971 if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port,
1023 debug2_f("channel %d: stdio fwd to %s:%d", c->self, chost, cport);
1063 debug2_f("stdio fwd refused by user");
1092 /* Callback on open confirmation in mux master for a mux stdio fwd session. */
1860 mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd)
1868 fwd_desc = format_forward(ftype, fwd);
1874 if (fwd->listen_path != NULL)
1875 lhost = fwd->listen_path;
1876 else if (fwd->listen_host == NULL)
1878 else if (*fwd->listen_host == '\0')
1881 lhost = fwd->listen_host;
1883 if (fwd->connect_path != NULL)
1884 chost = fwd->connect_path;
1885 else if (fwd->connect_host == NULL)
1888 chost = fwd->connect_host;
1896 (r = sshbuf_put_u32(m, fwd->listen_port)) != 0 ||
1898 (r = sshbuf_put_u32(m, fwd->connect_port)) != 0)
1925 if ((r = sshbuf_get_u32(m, &fwd->allocated_port)) != 0)
1928 fwd->allocated_port,
1929 fwd->connect_host ? fwd->connect_host : "",
1930 fwd->connect_port);
1932 fprintf(stdout, "%i\n", fwd->allocated_port);