Lines Matching refs:fwd
541 format_forward(u_int ftype, struct Forward *fwd) in format_forward() argument
548 (fwd->listen_path != NULL) ? fwd->listen_path : in format_forward()
549 (fwd->listen_host == NULL) ? in format_forward()
551 fwd->listen_host, fwd->listen_port, in format_forward()
552 (fwd->connect_path != NULL) ? fwd->connect_path : in format_forward()
553 fwd->connect_host, fwd->connect_port); in format_forward()
557 (fwd->listen_host == NULL) ? in format_forward()
559 fwd->listen_host, fwd->listen_port); in format_forward()
563 (fwd->listen_path != NULL) ? fwd->listen_path : in format_forward()
564 (fwd->listen_host == NULL) ? in format_forward()
565 "LOCALHOST" : fwd->listen_host, in format_forward()
566 fwd->listen_port, in format_forward()
567 (fwd->connect_path != NULL) ? fwd->connect_path : in format_forward()
568 fwd->connect_host, fwd->connect_port); in format_forward()
698 struct Forward fwd; in mux_master_process_open_fwd() local
705 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_open_fwd()
728 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_open_fwd()
729 fwd.listen_port = lport; in mux_master_process_open_fwd()
730 if (fwd.listen_port == PORT_STREAMLOCAL) in mux_master_process_open_fwd()
731 fwd.listen_path = listen_addr; in mux_master_process_open_fwd()
733 fwd.listen_host = listen_addr; in mux_master_process_open_fwd()
734 fwd.connect_port = cport; in mux_master_process_open_fwd()
735 if (fwd.connect_port == PORT_STREAMLOCAL) in mux_master_process_open_fwd()
736 fwd.connect_path = connect_addr; in mux_master_process_open_fwd()
738 fwd.connect_host = connect_addr; in mux_master_process_open_fwd()
741 (fwd_desc = format_forward(ftype, &fwd))); in mux_master_process_open_fwd()
753 if (ftype == MUX_FWD_DYNAMIC && fwd.listen_path) { in mux_master_process_open_fwd()
758 if (fwd.listen_port != PORT_STREAMLOCAL && fwd.listen_port >= 65536) { in mux_master_process_open_fwd()
760 fwd.listen_port); in mux_master_process_open_fwd()
763 if ((fwd.connect_port != PORT_STREAMLOCAL && in mux_master_process_open_fwd()
764 fwd.connect_port >= 65536) || in mux_master_process_open_fwd()
766 fwd.connect_port == 0)) { in mux_master_process_open_fwd()
768 fwd.connect_port); in mux_master_process_open_fwd()
771 if (ftype != MUX_FWD_DYNAMIC && fwd.connect_host == NULL && in mux_master_process_open_fwd()
772 fwd.connect_path == NULL) { in mux_master_process_open_fwd()
782 if (compare_forward(&fwd, in mux_master_process_open_fwd()
794 if (!compare_forward(&fwd, options.remote_forwards + i)) in mux_master_process_open_fwd()
796 if (fwd.listen_port != 0) in mux_master_process_open_fwd()
821 if (!channel_setup_local_fwd_listener(ssh, &fwd, in mux_master_process_open_fwd()
829 add_local_forward(&options, &fwd); in mux_master_process_open_fwd()
834 fwd.handle = channel_request_remote_forwarding(ssh, &fwd); in mux_master_process_open_fwd()
835 if (fwd.handle < 0) in mux_master_process_open_fwd()
837 add_remote_forward(&options, &fwd); in mux_master_process_open_fwd()
853 free(fwd.listen_host); in mux_master_process_open_fwd()
854 free(fwd.listen_path); in mux_master_process_open_fwd()
855 free(fwd.connect_host); in mux_master_process_open_fwd()
856 free(fwd.connect_path); in mux_master_process_open_fwd()
865 struct Forward fwd, *found_fwd; in mux_master_process_close_fwd() local
873 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_close_fwd()
896 memset(&fwd, 0, sizeof(fwd)); in mux_master_process_close_fwd()
897 fwd.listen_port = lport; in mux_master_process_close_fwd()
898 if (fwd.listen_port == PORT_STREAMLOCAL) in mux_master_process_close_fwd()
899 fwd.listen_path = listen_addr; in mux_master_process_close_fwd()
901 fwd.listen_host = listen_addr; in mux_master_process_close_fwd()
902 fwd.connect_port = cport; in mux_master_process_close_fwd()
903 if (fwd.connect_port == PORT_STREAMLOCAL) in mux_master_process_close_fwd()
904 fwd.connect_path = connect_addr; in mux_master_process_close_fwd()
906 fwd.connect_host = connect_addr; in mux_master_process_close_fwd()
909 (fwd_desc = format_forward(ftype, &fwd))); in mux_master_process_close_fwd()
917 if (compare_forward(&fwd, in mux_master_process_close_fwd()
926 if (compare_forward(&fwd, in mux_master_process_close_fwd()
948 if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port, in mux_master_process_close_fwd()
1776 mux_client_forward(int fd, int cancel_flag, u_int ftype, struct Forward *fwd) in mux_client_forward() argument
1784 fwd_desc = format_forward(ftype, fwd); in mux_client_forward()
1790 if (fwd->listen_path != NULL) in mux_client_forward()
1791 lhost = fwd->listen_path; in mux_client_forward()
1792 else if (fwd->listen_host == NULL) in mux_client_forward()
1794 else if (*fwd->listen_host == '\0') in mux_client_forward()
1797 lhost = fwd->listen_host; in mux_client_forward()
1799 if (fwd->connect_path != NULL) in mux_client_forward()
1800 chost = fwd->connect_path; in mux_client_forward()
1801 else if (fwd->connect_host == NULL) in mux_client_forward()
1804 chost = fwd->connect_host; in mux_client_forward()
1812 (r = sshbuf_put_u32(m, fwd->listen_port)) != 0 || in mux_client_forward()
1814 (r = sshbuf_put_u32(m, fwd->connect_port)) != 0) in mux_client_forward()
1841 if ((r = sshbuf_get_u32(m, &fwd->allocated_port)) != 0) in mux_client_forward()
1844 fwd->allocated_port, in mux_client_forward()
1845 fwd->connect_host ? fwd->connect_host : "", in mux_client_forward()
1846 fwd->connect_port); in mux_client_forward()
1848 fprintf(stdout, "%i\n", fwd->allocated_port); in mux_client_forward()