Lines Matching refs:ip
109 static int init_client_ip(int *sock, unsigned char ip[4], int port, int type);
111 static int init_server_long(int *sock, int port, char *ip, int type);
113 static int host_ip(char *str, unsigned char ip[4]);
236 unsigned char ip[4];
238 memset(ip, '\0', sizeof ip);
239 if (!host_ip(host, &(ip[0])))
241 return init_client_ip(sock, ip, port, type);
244 static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
257 ((unsigned long)ip[0] << 24L) |
258 ((unsigned long)ip[1] << 16L) |
259 ((unsigned long)ip[2] << 8L) | ((unsigned long)ip[3]);
331 static int init_server_long(int *sock, int port, char *ip, int type)
343 if (ip == NULL)
348 memcpy(&server.sin_addr.s_addr, ip, 4);
350 memcpy(&server.sin_addr, ip, 4);
480 int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
493 if ((ip != NULL) && !host_ip(str, ip))
505 static int host_ip(char *str, unsigned char ip[4])
517 ip[0] = in[0];
518 ip[1] = in[1];
519 ip[2] = in[2];
520 ip[3] = in[3];
537 ip[0] = he->h_addr_list[0][0];
538 ip[1] = he->h_addr_list[0][1];
539 ip[2] = he->h_addr_list[0][2];
540 ip[3] = he->h_addr_list[0][3];