Lines Matching defs:fwd

79 /* Context for stdio fwd open confirmation callback */
516 format_forward(u_int ftype, struct Forward *fwd)
523 (fwd->listen_path != NULL) ? fwd->listen_path :
524 (fwd->listen_host == NULL) ?
526 fwd->listen_host, fwd->listen_port,
527 (fwd->connect_path != NULL) ? fwd->connect_path :
528 fwd->connect_host, fwd->connect_port);
532 (fwd->listen_host == NULL) ?
534 fwd->listen_host, fwd->listen_port);
538 (fwd->listen_path != NULL) ? fwd->listen_path :
539 (fwd->listen_host == NULL) ?
540 "LOCALHOST" : fwd->listen_host,
541 fwd->listen_port,
542 (fwd->connect_path != NULL) ? fwd->connect_path :
543 fwd->connect_host, fwd->connect_port);
672 struct Forward fwd;
679 memset(&fwd, 0, sizeof(fwd));
702 memset(&fwd, 0, sizeof(fwd));
703 fwd.listen_port = lport;
704 if (fwd.listen_port == PORT_STREAMLOCAL)
705 fwd.listen_path = listen_addr;
707 fwd.listen_host = listen_addr;
708 fwd.connect_port = cport;
709 if (fwd.connect_port == PORT_STREAMLOCAL)
710 fwd.connect_path = connect_addr;
712 fwd.connect_host = connect_addr;
715 (fwd_desc = format_forward(ftype, &fwd)));
727 if (ftype == MUX_FWD_DYNAMIC && fwd.listen_path) {
732 if (fwd.listen_port != PORT_STREAMLOCAL && fwd.listen_port >= 65536) {
733 logit_f("invalid listen port %u", fwd.listen_port);
736 if ((fwd.connect_port != PORT_STREAMLOCAL &&
737 fwd.connect_port >= 65536) ||
739 fwd.connect_port == 0)) {
741 fwd.connect_port);
744 if (ftype != MUX_FWD_DYNAMIC && fwd.connect_host == NULL &&
745 fwd.connect_path == NULL) {
755 if (compare_forward(&fwd,
766 if (!compare_forward(&fwd, options.remote_forwards + i))
768 if (fwd.listen_port != 0)
793 if (!channel_setup_local_fwd_listener(ssh, &fwd,
801 add_local_forward(&options, &fwd);
806 fwd.handle = channel_request_remote_forwarding(ssh, &fwd);
807 if (fwd.handle < 0)
809 add_remote_forward(&options, &fwd);
825 free(fwd.listen_host);
826 free(fwd.listen_path);
827 free(fwd.connect_host);
828 free(fwd.connect_path);
837 struct Forward fwd, *found_fwd;
845 memset(&fwd, 0, sizeof(fwd));
868 memset(&fwd, 0, sizeof(fwd));
869 fwd.listen_port = lport;
870 if (fwd.listen_port == PORT_STREAMLOCAL)
871 fwd.listen_path = listen_addr;
873 fwd.listen_host = listen_addr;
874 fwd.connect_port = cport;
875 if (fwd.connect_port == PORT_STREAMLOCAL)
876 fwd.connect_path = connect_addr;
878 fwd.connect_host = connect_addr;
881 (fwd_desc = format_forward(ftype, &fwd)));
889 if (compare_forward(&fwd,
898 if (compare_forward(&fwd,
920 if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port,
972 debug2_f("channel %d: stdio fwd to %s:%d", c->self, chost, cport);
1012 debug2_f("stdio fwd refused by user");
1041 /* Callback on open confirmation in mux master for a mux stdio fwd session. */
1743 mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd)
1751 fwd_desc = format_forward(ftype, fwd);
1757 if (fwd->listen_path != NULL)
1758 lhost = fwd->listen_path;
1759 else if (fwd->listen_host == NULL)
1761 else if (*fwd->listen_host == '\0')
1764 lhost = fwd->listen_host;
1766 if (fwd->connect_path != NULL)
1767 chost = fwd->connect_path;
1768 else if (fwd->connect_host == NULL)
1771 chost = fwd->connect_host;
1779 (r = sshbuf_put_u32(m, fwd->listen_port)) != 0 ||
1781 (r = sshbuf_put_u32(m, fwd->connect_port)) != 0)
1808 if ((r = sshbuf_get_u32(m, &fwd->allocated_port)) != 0)
1811 fwd->allocated_port,
1812 fwd->connect_host ? fwd->connect_host : "",
1813 fwd->connect_port);
1815 fprintf(stdout, "%i\n", fwd->allocated_port);