getprotoent

å称
     getprotoent, getprotobynumber, getprotobyname, setprotoent, endprotoent —
     ãããã³ã«ã¨ã³ããªã®åå¾

ã©ã¤ãã©ãª
     Standard C Library (libc, -lc)

æ¸å¼
     <netdb.h> struct protoent * getprotoent(void) struct protoent *
     getprotobyname(const char *name) struct protoent * getprotobynumber(int
     proto) void setprotoent(int stayopen) void endprotoent(void)

解説
     getprotoent(), getprotobyname(), ããã³ getprotobynumber()
     é¢æ°ã¯ããããã次ã«ç¤ºãæ§é ãæã¤ãªãã¸ã§ã¯ãã¸ã®ãã¤ã³ã¿ãè¿ãã¾ãã
     æ§é ä½ã«ã¯ããããã¯ã¼ã¯ãããã³ã«ãã¼ã¿ãã¼ã¹ /etc/protocols
     ã«ããè¡ã®å訳ãã£ã¼ã«ããå«ã¾ãã¾ãã


           struct  protoent {
                   char    *p_name;        /* ãããã³ã«ã®ãªãã£ã·ã£ã«å */
                   char    **p_aliases;    /* ã¨ã¤ãªã¢ã¹ãªã¹ã */
                   int     p_proto;        /* ãããã³ã«çªå· */
           };

     ãã®æ§é ä½ã®ã¡ã³ãã¯æ¬¡ã®ã¨ããã§ãã

     p_name     ãããã³ã«ã®ãªãã£ã·ã£ã«åã

     p_aliases  ãããã³ã«ã®å¥å (ã¨ã¤ãªã¢ã¹) ã® 0 ã§çµãããªã¹ãã

     p_proto    ãããã³ã«çªå·ã

     getprotoent() é¢æ°ã¯ããã¡ã¤ã«ã®æ¬¡ã®è¡ãèªã¿è¾¼ã¿ã¾ãã
     ãã®éãå¿è¦ãªãã°ãã¡ã¤ã«ããªã¼ãã³ãã¾ãã

     setprotoent() é¢æ°ã¯ããã¡ã¤ã«ããªã¼ãã³ãã¦ãªã¯ã¤ã³ããã¾ãã stayopen ãã©ã°ã 0
     ã§ãªããã°ã getprotobyname() ã¾ã㯠getprotobynumber()
     ã®ããããã®å¼ã³åºãã®å¾ã§ããããããã¼ã¿ãã¼ã¹ã¯ã¯ãã¼ãºããã¾ããã

     endprotoent() é¢æ°ã¯ãã¡ã¤ã«ãã¯ãã¼ãºãã¾ãã

     getprotobyname() ããã³ getprotobynumber() é¢æ°ã¯ãé©åãããããã³ã«åã¾ãã¯ãã‐
     ãã³ã«çªå·ãè¦ã¤ããããã¾ã㯠EOF ã«éããã¾ã§ããã¡ã¤ã«ãæåããé 次æ¤ç´¢ãã¾ãã

æ»ãå¤
     EOF ã¾ãã¯ã¨ã©ã¼ã§ Null ãã¤ã³ã¿ (0) ãè¿ãã¾ãã

é¢é£ãã¡ã¤ã«
     /etc/protocols

é¢é£é ç®
     protocols(5)

æ´å²
     getprotoent(), getprotobynumber(), getprotobyname(), setprotoent() ããã³
     endprotoent() é¢æ°ã¯ 4.2BSD ã§ç»å ´ãã¾ããã

ãã°
     ãããã®é¢æ°ã¯éçãã¼ã¿ç©ºéã使ç¨ãã¾ãã
     å¾ã§ãã®ãã¼ã¿ã使ç¨ããå¿è¦ãããã°ã以å¾ã®ãããã®é¢æ°ã®å¼ã³åºãã§
     ãã¼ã¿ãä¸æ¸ããããåã«ãã³ãã¼ãã¦ä¿åããå¿è¦ãããã¾ãã ãªãããã‐
     ãã³ã«ãã¼ã¿ã¨ãã¦åãå¥ããã®ã¯ç¾å¨ã ã¤ã³ã¿ã¼ããããããã³ã«ã ãã§ãã