Connection *conn_open_tcp_nb_with_port(Octstr *host, int port, int our_port, Octstr *our_host) { int sockfd; int done = -1; Connection *c; sockfd = tcpip_connect_nb_to_server_with_port(octstr_get_cstr(host), port, our_port, our_host == NULL ? NULL : octstr_get_cstr(our_host), &done); if (sockfd < 0) return NULL; c = conn_wrap_fd(sockfd, 0); if (done != 0) { c->connected = no; } return c; }
int tcpip_connect_nb_to_server(char *hostname, int port, const char *interface_name, int *done) { return tcpip_connect_nb_to_server_with_port(hostname, port, 0, interface_name, done); }
int tcpip_connect_nb_to_server(char *hostname, int port, const char *source_addr, int *done) { return tcpip_connect_nb_to_server_with_port(hostname, port, 0, source_addr, done); }