1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
30 .\" Translated Fri Mar 15 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
33 .TH GETPROTOENT 3 2008-08-19 "GNU" "Linux Programmer's Manual"
35 .\"O getprotoent, getprotobyname, getprotobynumber, setprotoent,
36 .\"O endprotoent \- get protocol entry
38 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
39 ¥×¥í¥È¥³¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
45 .B struct protoent *getprotoent(void);
47 .BI "struct protoent *getprotobyname(const char *" name );
49 .BI "struct protoent *getprotobynumber(int " proto );
51 .BI "void setprotoent(int " stayopen );
53 .B void endprotoent(void);
58 .\"O .BR getprotoent ()
59 .\"O function reads the next entry from the protocols database (see
60 .\"O .BR protocols (5))
61 .\"O and returns a \fIprotoent\fP structure
62 .\"O containing the broken-out fields from the entry.
63 .\"O A connection is opened to the database if necessary.
65 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹
67 »²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢
68 ¤½¤Î¥¨¥ó¥È¥ê¤ò \fIprotoent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢
70 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
73 .\"O .BR getprotobyname ()
74 .\"O function returns a \fIprotoent\fP structure
75 .\"O for the entry from the database
76 .\"O that matches the protocol name \fIname\fP.
77 .\"O A connection is opened to the database if necessary.
79 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë̾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
80 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
81 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
84 .\"O .BR getprotobynumber ()
85 .\"O function returns a \fIprotoent\fP structure
86 .\"O for the entry from the database
87 .\"O that matches the protocol number \fInumber\fP.
88 .\"O A connection is opened to the database if necessary.
89 .BR getprotobynumber ()
90 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ëÈÖ¹æ \fInumber\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
91 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
92 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
95 .\"O .BR setprotoent ()
96 .\"O function opens a connection to the database,
97 .\"O and sets the next entry to the first entry.
98 .\"O If \fIstayopen\fP is nonzero,
99 .\"O then the connection to the database
100 .\"O will not be closed between calls to one of the
101 .\"O .BR getproto* ()
104 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢
105 ¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£
106 \fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢
109 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£
112 .\"O .BR endprotoent ()
113 .\"O function closes the connection to the database.
115 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
117 .\"O The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
118 \fIprotoent\fP ¹½Â¤ÂÎ¤Ï \fI<netdb.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
123 char *p_name; /* official protocol name */
124 char **p_aliases; /* alias list */
125 int p_proto; /* protocol number */
130 .\"O The members of the \fIprotoent\fP structure are:
131 \fIprotoent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ
135 .\"O The official name of the protocol.
136 ¥×¥í¥È¥³¥ë¤ÎÀµ¼°Ì¾ (official name)¡£
139 .\"O A NULL-terminated list of alternative names for the protocol.
140 ¥×¥í¥È¥³¥ë¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£
141 ¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
144 .\"O The protocol number.
147 .\"O .SH "RETURN VALUE"
150 .\"O .BR getprotoent (),
151 .\"O .BR getprotobyname ()
153 .\"O .BR getprotobynumber ()
154 .\"O functions return a pointer to a
155 .\"O statically allocated \fIprotoent\fP structure, or a NULL pointer if an
156 .\"O error occurs or the end of the file is reached.
158 .BR getprotobyname (),
159 .BR getprotobynumber ()
160 ´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIprotoent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
161 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
167 .\"O protocol database file
168 ¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
170 .\"O .SH "CONFORMING TO"
172 4.3BSD, POSIX.1-2001.
176 .BR getprotoent_r (3),