## page was renamed from DNS/実装/djbdns/dnscache/sockaddr_in ## page was renamed from DNS/dnscache/sockaddr_in #format plain DNS/dnscache/sockaddr_inについて、ここに記述してください。 /usr/include/netinet/in.h /* Socket address, internet style. */ struct sockaddr_in { uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; ---- #include #include #include #include #include "byte.h" #include "socket.h" int socket_recv4(int s,char *buf,int len,char ip[4],uint16 *port) { struct sockaddr_in sa; int dummy = sizeof sa; int r; r = recvfrom(s,buf,len,0,(struct sockaddr *) &sa,&dummy); if (r == -1) return -1; byte_copy(ip,4,(char *) &sa.sin_addr); uint16_unpack_big((char *) &sa.sin_port,port); return r; }