C 言語関数:gethostbyaddr サンプルコード

サンプルコードを検索した結果です。


TITLE : gethostbyname(), gethostbyaddr()
gethostbyname(), gethostbyaddr().......
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html


TITLE : gethostbyname(), gethostbyaddr()
struct hostent *gethostbyaddr(const char *addr, int len, int type);.......
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html
TITLE : gethostbyname(), gethostbyaddr()
Conversely, if you have a struct in_addr or a struct in6_addr, you can use gethostbyaddr() to get the hostname back. gethostbyaddr() is IPv6 compatible, but you should use the newer shinier getnameinfo() instead........
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html
TITLE : gethostbyname(), gethostbyaddr()
gethostbyaddr() takes a struct in_addr or struct in6_addr and brings you up a corresponding host name (if there is one), so it's sort of the reverse of gethostbyname(). As for parameters, even though addr is a char*, you actually want to pass in a pointer to a struct in_addr. len should be sizeof(struct in_addr), and type should be AF_INET........
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html
TITLE : gethostbyname(), gethostbyaddr()
he = gethostbyaddr(&ipv4addr, sizeof ipv4addr, AF_INET);.......
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html
TITLE : gethostbyname(), gethostbyaddr()
he = gethostbyaddr(&ipv6addr, sizeof ipv6addr, AF_INET6);.......
http://beej.us/guide/bgnet/output/html/multipage/gethostbynameman.html
Googleで検索

https://www.google.co.jp/#q=gethostbyaddr