Lines Matching refs:sock
48 get_remote_hostname(int sock, int use_dns)
59 if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) {
65 check_ip_options(sock, ntop);
158 check_ip_options(int sock, char *ipaddr)
173 if (getsockopt(sock, ipproto, IP_OPTIONS, options,
247 get_socket_address(int sock, int remote, int flags)
259 if (getpeername(sock, (struct sockaddr *)&addr, &addrlen)
263 if (getsockname(sock, (struct sockaddr *)&addr, &addrlen)
285 get_peer_ipaddr(int sock)
289 if ((p = get_socket_address(sock, 1, NI_NUMERICHOST)) != NULL)
295 get_local_ipaddr(int sock)
299 if ((p = get_socket_address(sock, 0, NI_NUMERICHOST)) != NULL)
370 get_sock_port(int sock, int local)
381 if (getsockname(sock, (struct sockaddr *)&from, &fromlen) < 0) {
386 if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) {
421 get_peer_port(int sock)
423 return get_sock_port(sock, 0);