getnetent

Autres langues

Langue: ja

Version: 1993-05-15 (openSuse - 09/10/07)

Section: 3 (Bibliothèques de fonctions)

̾Á°

getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent - ¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë

½ñ¼°


#include <netdb.h>



struct netent *getnetent(void);



struct netent *getnetbyname(const char *name);



struct netent *getnetbyaddr(long net, int type);



void setnetent(int stayopen);



void endnetent(void);

ÀâÌÀ

getnetent() ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë /etc/networks ¤«¤é¿·¤·¤¤¹Ô¤òÆɤ߹þ¤ß¡¢¹Ô¤ò¥Õ¥£¡¼ ¥ë¥É¤Ëʬ³ä¤·¤¿ÆâÍƤò¼ý¤á¤¿¹½Â¤ÂÎ netent ¤òÊÖ¤¹¡£ /etc/networks ¤ÏɬÍפʤé¤Ð¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£

getnetbyname() ´Ø¿ô¤Ï ¥Í¥Ã¥È¥ï¡¼¥¯Ì¾ name ¤Ë¥Þ¥Ã¥Á¤¹¤ë¹Ô¤ò /etc/networks ¤«¤éõ¤·¡¢¤½¤ÎÆâÍƤò¼ý¤á¤¿ netent ¹½Â¤ÂΤòÊÖ¤¹¡£

getnetbyaddr() ´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ net (type ·¿) ¤Ë¥Þ¥Ã¥Á¤¹¤ë¹Ô¤ËÂÐ ±þ¤¹¤ë netent ¹½Â¤ÂΤòÊÖ¤¹¡£

setnetent() ´Ø¿ô¤Ï /etc/networks ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Æ¡¢¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ò ÀèƬ¤ËÌ᤹¡£ stayopen ¤¬¿¿ (1) ¤Ê¤é¤Ð¡¢ getnetbyname() ¤ä getnetbyaddr() ¤Ê¤É¤Î¸Æ¤Ó½Ð¤·¤Î´Ö¤Ë¥Õ¥¡¥¤¥ë¤Ï¥¯¥í¡¼¥º¤µ¤ì¤Ê¤¤¡£

endnetent() ´Ø¿ô¤Ï /etc/networks ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£

netent ¹½Â¤ÂÎ¤Ï <netdb.h> ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£


struct netent {

    char          *n_name;     /* official network name */

    char         **n_aliases;  /* alias list */

    int            n_addrtype; /* net address type */

    unsigned long  n_net;      /* network number */

}

netent ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ

n_name
¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÀµ¼°Ì¾ (official name)¡£
n_aliases
¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊÌ̾¤«¤é¤Ê¤ëÇÛÎó¡£ 0 ¤Ç½ªÃ¼¤¹¤ë¡£
n_addrtype
¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ¤Î·Á¼°¡£¸½ºß¤Ï AF_INET ¤Î¤ß¡£
n_net
¥Û¥¹¥È¤Î¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Çɽ¤·¤¿¥Í¥Ã¥È¥ï¡¼¥¯Èֹ档

ÊÖ¤êÃÍ

getnetent(), getnetbyname(), getnetbyaddr() ´Ø¿ô¤Ï netent ¹½Â¤ÂΤòÊÖ¤¹¡£¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ëã ¤·¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£

¥Õ¥¡¥¤¥ë

/etc/networks
¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë

½àµò

4.3BSD, POSIX.1-2001.

´ØÏ¢¹àÌÜ

getprotoent(3), getservent(3), networks(5)
RFC 1101