blob: 61eaf659333325f98ae22f965ec0cac7d82cbbf1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<html>
<body>
<pre>
NAME
getprotobyname, getprotobynumber - get protocol entry
SYNOPSIS
#include <network.h>
struct protoent *getprotobyname(const char *name);
struct protoent *getprotobynumber(int proto);
DESCRIPTION
The getprotobyname() function returns a protoent structure
for the line from /etc/protocols that matches the protocol
name name.
The getprotobynumber() function returns a protoent struc
ture for the line that matches the protocol number number.
The protoent structure is defined in <netdb.h> as follows:
struct protoent {
char *p_name; /* official protocol name */
char **p_aliases; /* alias list */
int p_proto; /* protocol number */
}
The members of the protoent structure are:
p_name The official name of the protocol.
p_aliases
A zero terminated list of alternative names for the
protocol.
p_proto
The protocol number.
RETURN VALUE
The getprotobyname() and getprotobynumber()
functions return the protoent structure, or a NULL pointer
if an error occurs.
</pre>
</body>
</html>
|