<html>
|
<html>
|
<body>
|
<body>
|
<pre>
|
<pre>
|
NAME
|
NAME
|
getprotobyname, getprotobynumber - get protocol entry
|
getprotobyname, getprotobynumber - get protocol entry
|
|
|
SYNOPSIS
|
SYNOPSIS
|
#include <network.h>
|
#include <network.h>
|
|
|
struct protoent *getprotobyname(const char *name);
|
struct protoent *getprotobyname(const char *name);
|
|
|
struct protoent *getprotobynumber(int proto);
|
struct protoent *getprotobynumber(int proto);
|
|
|
DESCRIPTION
|
DESCRIPTION
|
The getprotobyname() function returns a protoent structure
|
The getprotobyname() function returns a protoent structure
|
for the line from /etc/protocols that matches the protocol
|
for the line from /etc/protocols that matches the protocol
|
name name.
|
name name.
|
|
|
The getprotobynumber() function returns a protoent struc
|
The getprotobynumber() function returns a protoent struc
|
ture for the line that matches the protocol number number.
|
ture for the line that matches the protocol number number.
|
|
|
The protoent structure is defined in <netdb.h> as follows:
|
The protoent structure is defined in <netdb.h> as follows:
|
|
|
struct protoent {
|
struct protoent {
|
char *p_name; /* official protocol name */
|
char *p_name; /* official protocol name */
|
char **p_aliases; /* alias list */
|
char **p_aliases; /* alias list */
|
int p_proto; /* protocol number */
|
int p_proto; /* protocol number */
|
}
|
}
|
|
|
The members of the protoent structure are:
|
The members of the protoent structure are:
|
|
|
p_name The official name of the protocol.
|
p_name The official name of the protocol.
|
|
|
p_aliases
|
p_aliases
|
A zero terminated list of alternative names for the
|
A zero terminated list of alternative names for the
|
protocol.
|
protocol.
|
p_proto
|
p_proto
|
The protocol number.
|
The protocol number.
|
|
|
RETURN VALUE
|
RETURN VALUE
|
The getprotobyname() and getprotobynumber()
|
The getprotobyname() and getprotobynumber()
|
functions return the protoent structure, or a NULL pointer
|
functions return the protoent structure, or a NULL pointer
|
if an error occurs.
|
if an error occurs.
|
|
|
|
|
</pre>
|
</pre>
|
</body>
|
</body>
|
</html>
|
</html>
|
|
|