Connection *conn_open_tcp_with_port(Octstr *host, int port, int our_port, Octstr *our_host) { int sockfd; sockfd = tcpip_connect_to_server_with_port(octstr_get_cstr(host), port, our_port, our_host == NULL ? NULL : octstr_get_cstr(our_host)); if (sockfd < 0) return NULL; return conn_wrap_fd(sockfd, 0); }
int tcpip_connect_to_server(char *hostname, int port, const char *interface_name) { return tcpip_connect_to_server_with_port(hostname, port, 0, interface_name); }
int tcpip_connect_to_server(char *hostname, int port, const char *source_addr) { return tcpip_connect_to_server_with_port(hostname, port, 0, source_addr); }