Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

protocols(4) [opensolaris man page]

protocols(4)							   File Formats 						      protocols(4)

NAME
protocols - protocol name database SYNOPSIS
/etc/inet/protocols /etc/protocols DESCRIPTION
The protocols file is a local source of information regarding the known protocols used in the DARPA Internet. The protocols file can be used in conjunction with or instead of other protocols sources, including the NIS maps ``protcols.byname'' and "protocols.bynumber" and the NIS+ table ``protocols''. Programs use the getprotobyname(3SOCKET) routine to access this information. The protocols file has one line for each protocol. The line has the following format: official-protocol-name protocol-number aliases Items are separated by any number of blanks and/or TAB characters. A `#' indicates the beginning of a comment; characters up to the end of the line are not interpreted by routines which search the file. Protocol names may contain any printable character other than a field delimiter, NEWLINE, or comment character. EXAMPLES
Example 1 A Sample Database The following is a sample database: # # Internet (IP) protocols # ip 0 IP # internet protocol, pseudo protocol number icmp 1 ICMP # internet control message protocol ggp 3 GGP # gateway-gateway protocol tcp 6 TCP # transmission control protocol egp 8 EGP # exterior gateway protocol pup 12 PUP # PARC universal packet protocol udp 17 UDP # user datagram protocol # # Internet (IPv6) extension headers # hopopt 0 HOPOPT # Hop-by-hop options for IPv6 ipv6 41 IPv6 # IPv6 in IP encapsulation ipv6-route 43 IPv6-Route # Routing header for IPv6 ipv6-frag 44 IPv6-Frag # Fragment header for IPv6 esp 50 ESP # Encap Security Payload for IPv6 ah 51 AH # Authentication Header for IPv6 ipv6-icmp 58 IPv6-ICMP # IPv6 internet control message protocol ipv6-nonxt 59 IPv6-NoNxt # No next header extension header for IPv6 ipv6-opts 60 IPv6-Opts # Destination Options for IPv6 FILES
/etc/nsswitch.conf configuration file for name-service switch SEE ALSO
getprotobyname(3SOCKET), nsswitch.conf(4) NOTES
/etc/inet/protocols is the official SVR4 name of the protocols file. The symbolic link /etc/protocols exists for BSD compatibility. SunOS 5.11 13 Jun 2002 protocols(4)

Check Out this Related Man Page

GETPROTOENT(3)						     Linux Programmer's Manual						    GETPROTOENT(3)

NAME
getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent - get protocol entry SYNOPSIS
#include <netdb.h> struct protoent *getprotoent(void); struct protoent *getprotobyname(const char *name); struct protoent *getprotobynumber(int proto); void setprotoent(int stayopen); void endprotoent(void); DESCRIPTION
The getprotoent() function reads the next line from the file /etc/protocols and returns a structure protoent containing the broken out fields from the line. The /etc/protocols file is opened if necessary. 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 structure for the line that matches the protocol number number. The setprotoent() function opens and rewinds the /etc/protocols file. If stayopen is true (1), then the file will not be closed between calls to getprotobyname() or getprotobynumber(). The endprotoent() function closes /etc/protocols. 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 getprotoent(), getprotobyname() and getprotobynumber() functions return the protoent structure, or a NULL pointer if an error occurs or the end of the file is reached. FILES
/etc/protocols protocol database file CONFORMING TO
BSD 4.3 SEE ALSO
getservent(3), getnetent(3), protocols(5) BSD
1993-04-24 GETPROTOENT(3)
Man Page