getaddrinfo

Autres langues

Langue: ja

Version: 2000-12-18 (openSuse - 09/10/07)

Section: 3 (Bibliothèques de fonctions)

̾Á°

getaddrinfo, freeaddrinfo, gai_strerror - ¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥¢¥É¥ì¥¹¤È¥µ¡¼¥Ó¥¹¤òÊÑ´¹¤¹¤ë

½ñ¼°


#include <sys/types.h>

#include <sys/socket.h>

#include <netdb.h>



int getaddrinfo(const char *node, const char *service,

                const struct addrinfo *hints,

                struct addrinfo **res);



void freeaddrinfo(struct addrinfo *res);



const char *gai_strerror(int errcode);

ÀâÌÀ

getaddrinfo(3) ´Ø¿ô¤Ï¡¢4 ¤Ä¤Î´Ø¿ô getipnodebyname(3), getipnodebyaddr(3), getservbyname(3), getservbyport(3) ¤Îµ¡Ç½¤ò¤Þ¤È¤á¤Æ°ì¤Ä¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£ getaddrinfo(3) ´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¡¢ ¤Ò¤È¤Ä°Ê¾å¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤòÀ¸À®¤¹¤ë¡£ ¤³¤Î¹½Â¤ÂÎ¤Ï bind(2) ¤ä connect(2) ¤Ê¤É¤Î´Ø¿ô¥³¡¼¥ë¤Ç¥¯¥é¥¤¥¢¥ó¥ÈÍÑ¡¦¥µ¡¼¥Ð¡¼ÍѤΥ½¥±¥Ã¥È¤òÀ¸À®¤¹¤ëºÝ¤Ë ÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£

getaddrinfo(3) ´Ø¿ô¤¬ºî¤ë¤³¤È¤Î¤Ç¤­¤ë¤Î¤Ï IPv4 ¥¢¥É¥ì¥¹¹½Â¤ÂΤÀ¤±¤Ç¤Ï¤Ê¤¤¡£ IPv6 ¤Î¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Ê¤é IPv6 ¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤâÀ¸À®¤Ç¤­¤ë¡£ ¤³¤ì¤é¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¹½Â¤ÂΤϡ¢ ¥¯¥é¥¤¥¢¥ó¥È¤ä¥µ¡¼¥Ð¡¼¤Ç¥½¥±¥Ã¥È¤ò½àÈ÷¤¹¤ëºÝ¤Ë¡¢ bind(2) ¤ä connect(2) ¤«¤éľÀÜÍøÍѤǤ­¤ë¡£

¤³¤Î´Ø¿ô¤¬ÍѤ¤¤ë addrinfo ¹½Â¤ÂΤˤϰʲ¼¤Î¥á¥ó¥Ð¡¼¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£


struct addrinfo {

    int     ai_flags;

    int     ai_family;

    int     ai_socktype;

    int     ai_protocol;

    size_t  ai_addrlen;

    struct sockaddr *ai_addr;

    char   *ai_canonname;

    struct addrinfo *ai_next;

};

getaddrinfo(3) ¤Ï¡¢ ¥á¥â¥ê¤òưŪ¤Ë³ä¤êÅö¤Æ¤Æ addrinfo ¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤òºîÀ®¤·¡¢ ¤½¤Î¥ê¥ó¥¯¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò res ¤ËÀßÄꤹ¤ë¡£ ³Æ¹½Â¤ÂÎ¤Ï ai_next ¥á¥ó¥Ð¡¼¤Ç¥ê¥ó¥¯¤µ¤ì¤ë¡£ ¥ê¥ó¥¯¥ê¥¹¥È¤Î addrinfo ¹½Â¤ÂΤÏÊ£¿ô¸Ä¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ê¡¢¤½¤ÎÍýͳ¤Ï¤¤¤¯¤Ä¤«¤¢¤ë¡£ ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤¬¥Þ¥ë¥Á¥Û¡¼¥à¤Î¾ì¹ç¡¢ Ê£¿ô¤Î¥½¥±¥Ã¥È¥×¥í¥È¥³¥ë¤ÇƱ¤¸¥µ¡¼¥Ó¥¹¤¬»È¤¨¤ë (¤Ò¤È¤Ä¤¬ SOCK_STREM ¥¢¥É¥ì¥¹¤Ç¡¢¤â¤¦¤Ò¤È¤Ä¤¬ SOCK_DGRAM ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¤Ê¤É) ¾ì¹ç¡¢¤¬¤¢¤ë¡£

ai_family, ai_socktype, ai_protocol ¥á¥ó¥Ð¡¼¤Ï¡¢¤½¤ì¤¾¤ì socket(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÂбþ¤¹¤ë°ú¤­¿ô¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Ä¡£ getaddrinfo(3) ´Ø¿ô¤Ï IPv4 ¤È IPv6 ¤Î¤É¤Á¤é¤«¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤òÊÖ¤¹ (ai_family ¤¬ AF_INET ¤Þ¤¿¤Ï AF_INET6 ¤Î¤É¤Á¤é¤«¤Ë¥»¥Ã¥È¤µ¤ì¤ë)¡£

hints ¥Ñ¥é¥á¡¼¥¿¤Ë¤Ï¡¢´õ˾¤Î¥½¥±¥Ã¥È¤Î¥¿¥¤¥×¤ä¥×¥í¥È¥³¥ë ¤ò»ØÄꤹ¤ë¡£ hints ¤ò NULL ¤Ë¤¹¤ë¤³¤È¤Ï¡¢¤É¤ó¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ä¥×¥í¥È¥³¥ë¤Ç¤â¤è¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤¬ NULL ¤Ç¤Ê¤¤¤È¤­¤Ï¡¢ addrinfo ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤È¤Ê¤ë¡£ ¤³¤Î¹½Â¤ÂΤΠai_familiy, ai_socktype, ai_protocol ¥á¥ó¥Ð¡¼¤Ç¡¢´õ˾¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤Ê¤É¤ò»ØÄꤹ¤ë¡£ ai_family ¤Ë AF_UNSPEC ¤ò»ØÄꤹ¤ë¤È¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¥Õ¥¡¥ß¥ê¡¼¤ò°ÕÌ£¤¹¤ë (Î㤨¤Ð IPv4 ¤ä IPv6)¡£ ai_socktype ¤ä ai_protocol ¤Ë 0 ¤ò»ØÄꤹ¤ë¤È¡¢ ƱÍͤËǤ°Õ¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤ä¥×¥í¥È¥³¥ë¤ò¼õÉÕ¤±¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£ ai_flags ¥á¥ó¥Ð¡¼¤Ë¤ÏÄɲ媥ץ·¥ç¥ó¤ò»ØÄꤹ¤ë (ÄêµÁ¤Ï²¼¤Î¤È¤ª¤ê)¡£ Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ì¤é¤ÎÏÀÍý OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ì¤Ð¤è¤¤¡£ hints ¥Ñ¥é¥á¡¼¥¿¤Î¤½¤Î¾¤Î¥á¥ó¥Ð¡¼¤Ë¤Ï¡¢ 0 (¤Þ¤¿¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿) ¤òÆþ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£

node ¥Ñ¥é¥á¡¼¥¿¤È service ¥Ñ¥é¥á¡¼¥¿¤Î¤É¤Á¤é¤«¤Ï NULL ¤Ë¤·¤Æ¤è¤¤ (ξÊýƱ»þ NULL ¤ÏÉÔ²Ä)¡£ node ¤Ë¤Ï¿ôÃÍ·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹ (IPv4 ¤Ê¤é¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê·Á¼°¡¢ IPv6 ¤Ê¤é 16 ¿Ê·Á¼°) ¤«¡¢¤¢¤ë¤¤¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¡£ ¸å¼Ô¤Î¾ì¹ç¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸¡º÷¤µ¤ì¡¢Ì¾Á°²ò·è¤¬¹Ô¤Ê¤ï¤ì¤ë¡£ hints.ai_flags ¤Ë AI_NUMERICHOST ¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢ node ¥Ñ¥é¥á¡¼¥¿¤Ï¿ôÃÍŪ¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ AI_NUMERICHOST ¥Õ¥é¥°¤ò»È¤¦¤È¡¢ »þ´Ö¤Î³Ý¤«¤ë²ÄǽÀ­¤Î¤¢¤ë¤¹¤Ù¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¥¢¥É¥ì¥¹¤Î¸¡º÷¤¬ÍÞÀ©¤µ¤ì¤ë¡£

getaddrinfo(3) ´Ø¿ô¤Ï addrinfo ¹½Â¤ÂΤΥê¥ó¥¯¥ê¥¹¥È¤òÀ¸À®¤¹¤ë¤¬¡¢ ¤½¤ì¤¾¤ì¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï hints ¥Ñ¥é¥á¡¼¥¿¤Ç²Ý¤µ¤ì¤¿¤¹¤Ù¤Æ¤ÎÀ©¸Â¤Ë½¾¤Ã¤Æ¤¤¤ë¡£ hints.ai_flags ¤Ë AI_CANONNAME ¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤é¤Î addrinfo ¹½Â¤ÂΤκǽé¤Î ai_canonname ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥Û¥¹¥È¤Î¸ø¼°¤Ê̾Á°¤ò»Ø¤¹¤è¤¦¤ËÀßÄꤵ¤ì¤ë¡£ ai_family, ai_socktype, ai_protocol ³Æ¥á¥ó¥Ð¡¼¤Ë¤Ï¥½¥±¥Ã¥ÈÀ¸À®»þ¤Î¥Ñ¥é¥á¡¼¥¿¤¬ÀßÄꤵ¤ì¤ë¡£ ai_addr ¥á¥ó¥Ð¡¼¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬½ñ¤­¹þ¤Þ¤ì¡¢ ai_addrlen ¥á¥ó¥Ð¡¼¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤ÎŤµ (¥Ð¥¤¥Èñ°Ì) ¤¬½ñ¤­¹þ¤Þ¤ì¤ë¡£

node ¤¬ NULL ¤Î¾ì¹ç¡¢³Æ¥½¥±¥Ã¥È¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤Ï AI_PASSIVE ¥Õ¥é¥°¤Ë´ð¤Å¤¤¤Æ½é´ü²½¤µ¤ì¤ë (¤³¤Î¥Õ¥é¥°¤Ï hints.ai_flags ¤ËÀßÄꤵ¤ì¤ë)¡£ AI_PASSIVE ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ ³Æ¥½¥±¥Ã¥È¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤ÏÀßÄꤵ¤ì¤Ê¤¤¤Þ¤Þ¤È¤Ê¤ë (ÌõÃí: IPv4 ¤Î¾ì¹ç INADDR_ANY ¤Ë¡¢IPv6 ¤Î¾ì¹ç IN6ADDR_ANY_INIT ¤ËÅù¤·¤¤)¡£ ¤³¤ì¤Ï¤¹¤Ù¤Æ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ç¥¯¥é¥¤¥¢¥ó¥ÈÀܳ¤òÂÔ¤Á¼õ¤±¤ë¤è¤¦¤Ê ¥µ¡¼¥Ð¡¼¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍѤ¤¤é¤ì¤ë¡£ AI_PASSIVE ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Ï loopback ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤ËÀßÄꤵ¤ì¤ë¡£ ¤³¤ì¤ÏƱ¤¸¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤è¤¦¤Ê ¥¯¥é¥¤¥¢¥ó¥È¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÇÍѤ¤¤é¤ì¤ë¡£

hints.ai_flags ¤¬ AI_ADDRCONFIG ¤ò´Þ¤à¾ì¹ç¡¢ result ¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï¡¢ ¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv4 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï IPv4 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¡¢ ¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤ËºÇÄã°ì¤Ä¤Î IPv6 ¥¢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£

hint.ai_flags ¤Ë AI_V4MAPPED ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ hints.ai_family ¤Ë AF_INET6 ¤¬»ØÄꤵ¤ì¡¢ ¥Þ¥Ã¥Á¤¹¤ë IPv6 ¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ result ¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤ë¡£ hints.ai_family ¤Ë AI_V4MAPPED ¤È AI_ALL ¤ÎξÊý¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ result ¤¬»Ø¤¹¥ê¥¹¥È¤Ë¤Ï IPV6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤Î ξÊý¤¬ÊÖ¤µ¤ì¤ë¡£ AI_V4MAPPED ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ AI_ALL ¤Ï̵»ë¤µ¤ì¤ë¡£

service ¤Ï¡¢³Æ¥½¥±¥Ã¥È¹½Â¤ÂΤΥͥåȥ¥¯¥¢¥É¥ì¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ¤òÀßÄꤹ¤ë¡£ service ¤¬ NULL ¤Î¾ì¹ç¡¢¥Ý¡¼¥ÈÈÖ¹æ¤Ï½é´ü²½¤µ¤ì¤Ê¤¤¡£ hints.ai_flags ¤Ë AI_NUMERICSERV ¤¬»ØÄꤵ¤ì¡¢ service ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ service ¤Ï¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤ò´Þ¤àʸ»úÎó¤ò»Ø¤·¼¨¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ ¤³¤Î¥Õ¥é¥°¤Ï¡¢Ì¾Á°²ò·è¥µ¡¼¥Ó¥¹¤¬ÉÔÍפǤ¢¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ ¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤òÍÞÀ©¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£

freeaddrinfo(3) ´Ø¿ô¤Ï¡¢ ¥ê¥ó¥¯¥ê¥¹¥È res ¤ËÂФ·¤ÆưŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£

¹ñºÝ²½¥É¥á¥¤¥ó̾¤Î¤¿¤á¤Î getaddrinfo() ¤Î³ÈÄ¥

glibc 2.3.4 ¤«¤é¡¢ getaddrinfo() ¤ÏÆþ½ÐÎϤ¹¤ë¥Û¥¹¥È̾¤òÆ©²áŪ¤Ë¹ñºÝ²½¥É¥á¥¤¥ó̾ (IDN) ·Á¼° (RFC 3490 ¤Î Internationalizing Domain Names in Applications (IDNA) ¤ò»²¾È¤Î¤³¤È) ¤ÈÊÑ´¹¤¹¤ë¤³¤È¤òÁªÂòŪ¤Ëǧ¤á¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤Æ¤¤¤ë¡£ 4 ¤Ä¤Î¿·¤·¤¤¥Õ¥é¥°¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë:

AI_IDN
¤³¤Î¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤ë¤È¡¢ node ¤ÇÍ¿¤¨¤é¤ì¤¿¥Î¡¼¥É̾¤ÏɬÍפ¬¤¢¤ì¤Ð IDN ·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£ ¥½¡¼¥¹Éä¹æ²½·Á¼°¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î¤â¤Î¤Ç¤¢¤ë¡£

ÆþÎÏ̾¤ËÈó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ IDN Éä¹æ²½·Á¼°¤¬»È¤ï¤ì¤ë¡£ Èó ASCII ʸ»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë(¥Ô¥ê¥ª¥É¤Ç¶èÀÚ¤é¤ì¤ë)Éôʬ¥Î¡¼¥É̾¤Ï¡¢ ̾Á°²ò·èµ¡Ç½¤ËÅϤµ¤ì¤ëÁ°¤Ë ASCII ¸ß´¹Éä¹æ²½·Á¼° (ACE) ¤ò»È¤Ã¤Æ Éä¹æ²½¤µ¤ì¤ë¡£

AI_CANONIDN
AI_CANONNAME ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ getaddrinfo() ¤Ï̾Á°¤Î¸¡º÷¤ËÀ®¸ù¤·¤¿¸å¡¢ ÊÖ¤µ¤ì¤¿ addrinfo ¹½Â¤ÂΤËÂбþ¤¹¤ë¥Î¡¼¥É¤ÎÀµµ¬Ì¾¤òÊÖ¤¹¡£ ÊÖ¤êÃͤÏ̾Á°²ò·èµ¡Ç½¤«¤éÊÖ¤µ¤ì¤¿ÃͤÎÀµ³Î¤Ê¥³¥Ô¡¼¤Ç¤¢¤ë¡£

AI_CANONIDN ̾Á°¤¬ ACE ¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î̾Á°¤Î¹½À®Í×ÁǤÎÀèƬ¤Ë xn-- ¤ò´Þ¤ó¤Ç¤¤¤ë¡£ ¤³¤ì¤é¤Î¹½À®Í×ÁǤòÆɤ߹þ¤ß²Äǽ¤Ê·Á¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¡¢ AI_CANONNAME ¤È¶¦¤Ë AI_CANONIDN ¥Õ¥é¥°¤òÅϤ¹¤³¤È¤â½ÐÍè¤ë¡£ ÊÖ¤µ¤ì¤ëʸ»úÎó¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤ÎÉä¹æ²½·Á¼°¤ÇÉä¹æ²½¤µ¤ì¤Æ¤¤¤ë¡£

AI_IDN_ALLOW_UNASSIGNED, AI_IDN_USE_STD3_ASCII_RULES
¤³¤ì¤é¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¤È¡¢ IDNA ¥Ï¥ó¥É¥ê¥ó¥°¤ò»È¤¦¤È¤­¤Ë¤½¤ì¤¾¤ì IDNA_ALLOW_UNASSIGNED (Èó³ä¤êÅö¤Æ Unicode ¥³¡¼¥É¥Ý¥¤¥ó¥È¤òµö²Ä¤¹¤ë) ¤È IDNA_USE_STD3_ASCII_RULES (½ÐÎϤ¬ STD3 ½àµò¥Û¥¹¥È̾¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë) ¥Õ¥é¥°¤¬Í­¸ú¤Ë¤Ê¤ë¡£

ÊÖ¤êÃÍ

getaddrinfo(3) ¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤¹¤ë¤È°Ê²¼¤ÎÈó 0 ¤Î¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤òÊÖ¤¹¡£
EAI_ADDRFAMILY
»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ë¤Ï¡¢ Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ê¤¤¡£
EAI_AGAIN
¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure) ¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¸å¤Ç¤â¤¦°ìÅٻ¤Æ¤ß¤è¡£
EAI_BADFLAGS
ai_flags ¤Î¥Õ¥é¥°¤ËÉÔÀµ¤Ê¥Õ¥é¥°¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
EAI_FAIL
¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure) ¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£
EAI_FAMILY
Í׵ᤵ¤ì¤¿¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
EAI_MEMORY
¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¡£
EAI_NODATA
»ØÄꤵ¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Ï¸ºß¤¹¤ë¤¬¡¢ ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¤Ò¤È¤Ä¤âÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
EAI_NONAME
node ¤È service ¤Î¤É¤Á¤é¤«¤¬ÉÔÌÀ¡¢¤Þ¤¿¤Ï node ¤È service ¤ÎξÊý¤¬ NULL ¤À¤Ã¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï AI_NUMERICSERV ¤¬ hints.ai_flags ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Æ¡¢ hints.ai_flags ¤È service ¤¬¿ôÃͤΥݡ¼¥ÈÈÖ¹æ¤Îʸ»úÎó¤Ç¤Ê¤¤¡£
EAI_SERVICE
Í׵ᤵ¤ì¤¿¥µ¡¼¥Ó¥¹¤Ï¡¢Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤ÏÍøÍѤǤ­¤Ê¤¤¡£ ¾¤Î¥½¥±¥Ã¥È¥¿¥¤¥×¤Ç¤Ê¤éÍøÍѲÄǽ¤«¤â¤·¤ì¤Ê¤¤¡£
EAI_SOCKTYPE
Í׵ᤵ¤ì¤¿¥½¥±¥Ã¥È¥¿¥¤¥×¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
EAI_SYSTEM
¤½¤Î¾¤Î¥·¥¹¥Æ¥à¥¨¥é¡¼¡£¾Ü¤·¤¯¤Ï errno ¤òÄ´¤Ù¤ë¤³¤È¡£

gai_strerror(3) ´Ø¿ô¤òÍѤ¤¤ë¤È¡¢¤³¤ì¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤ò¿Í´Ö¤Ë²ÄÆɤÊʸ»úÎó¤ËÊÑ´¹¤Ç¤­¤ë¤Î¤Ç¡¢ ¥¨¥é¡¼Êó¹ð¤ËŬ¤¹¤ë¤À¤í¤¦¡£

½àµò

POSIX.1-2001. getaddrinfo() ´Ø¿ô¤Ï RFC 2553 ¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¡£

Ãí°Õ

AI_ADDRCONFIG, AI_ALL, AI_V4MAPPED ¤Ï glibc 2.3.3 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£ AI_NUMERICSERV ¤Ï glibc 2.3.4 °Ê¹ß¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£

´ØÏ¢¹àÌÜ

getipnodebyaddr(3), getipnodebyname(3)