addrlen = sizeof(addr); if (getsockname(s->s, (struct sockaddr *)&addr, &addrlen) < 0 || addr.sin_family != AF_INET)
default:
int sk_getxdmdata(void *sock, unsigned long *ip, int *port){    Actual_Socket s = (Actual_Socket) sock;    struct sockaddr_in addr;    socklen_t addrlen;    /*     * We must check that this socket really _is_ an Actual_Socket.     */    if (s->fn != &tcp_fn_table)	return 0;		       /* failure */    /*     * If we ever implement connecting to a local X server through     * a Unix socket, we return 0xFFFFFFFF for the IP address and     * our current pid for the port. Bizarre, but such is life.     */    addrlen = sizeof(addr);    if (getsockname(s->s, (struct sockaddr *)&addr, &addrlen) < 0 ||	addr.sin_family != AF_INET)	return 0;    *ip = ntohl(addr.sin_addr.s_addr);    *port = ntohs(addr.sin_port);    return 1;}