]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" This manpage is Copyright (C) 1996 Austin Donnelly <and1000@cam.ac.uk>, | |
4 | .\" with additional material (c) 1995 Martin Schulze <joey@infodrom.north.de> | |
5 | .\" | |
6 | .\" Permission is granted to make and distribute verbatim copies of this | |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
c13182ef | 14 | .\" |
fea681da MK |
15 | .\" Since the Linux kernel and libraries are constantly changing, this |
16 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
17 | .\" responsibility for errors or omissions, or for damages resulting from | |
18 | .\" the use of the information contained herein. The author(s) may not | |
19 | .\" have taken the same level of care in the production of this manual, | |
20 | .\" which is licensed free of charge, as they might when working | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
fea681da MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
25 | .\" | |
26 | .\" This manpage was made by merging two independently written manpages, | |
27 | .\" one written by Martin Schulze (18 Oct 95), the other written by | |
28 | .\" Austin Donnelly, (9 Jan 96). | |
29 | .\" | |
30 | .\" Thu Jan 11 12:14:41 1996 Austin Donnelly <and1000@cam.ac.uk> | |
31 | .\" * Merged two services(5) manpages | |
32 | .\" | |
33 | .TH SERVICES 5 1996-01-11 "Linux" "Linux Programmer's Manual" | |
34 | .SH NAME | |
35 | services \- Internet network services list | |
36 | .SH DESCRIPTION | |
37 | .B services | |
38 | is a plain ASCII file providing a mapping between friendly textual | |
39 | names for internet services, and their underlying assigned port | |
c13182ef MK |
40 | numbers and protocol types. |
41 | Every networking program should look into | |
fea681da MK |
42 | this file to get the port number (and protocol) for its service. |
43 | The C library routines | |
44 | .BR getservent (3), | |
45 | .BR getservbyname (3), | |
46 | .BR getservbyport (3), | |
47 | .BR setservent (3), | |
c13182ef | 48 | and |
fea681da MK |
49 | .BR endservent (3) |
50 | support querying this file from programs. | |
51 | ||
52 | Port numbers are assigned by the IANA (Internet Assigned Numbers | |
53 | Authority), and their current policy is to assign both TCP and UDP | |
c13182ef MK |
54 | protocols when assigning a port number. |
55 | Therefore, most entries will | |
fea681da MK |
56 | have two entries, even for TCP only services. |
57 | ||
58 | Port numbers below 1024 (so-called 'low numbered' ports) can only be | |
59 | bound to by root (see | |
60 | .BR bind (2), | |
61 | .BR tcp (7), | |
c13182ef | 62 | and |
fea681da MK |
63 | .BR udp (7)). |
64 | This is so clients connecting to low numbered ports can trust | |
65 | that the service running on the port is the standard implementation, | |
c13182ef MK |
66 | and not a rogue service run by a user of the machine. |
67 | Well-known port numbers specified by the IANA are normally | |
68 | located in this root-only space. | |
fea681da | 69 | |
c13182ef | 70 | The presence of an entry for a service in the |
fea681da MK |
71 | .B services |
72 | file does not necessarily mean that the service is currently running | |
c13182ef MK |
73 | on the machine. |
74 | See | |
fea681da | 75 | .BR inetd.conf (5) |
c13182ef MK |
76 | for the configuration of Internet services offered. |
77 | Note that not all | |
fea681da MK |
78 | networking services are started by |
79 | .BR inetd (8), | |
80 | and so won't appear in | |
81 | .BR inetd.conf (5). | |
82 | In particular, news (NNTP) and mail (SMTP) servers are often | |
83 | initialized from the system boot scripts. | |
84 | ||
85 | The location of the | |
86 | .B services | |
87 | file is defined by | |
88 | .B _PATH_SERVICES | |
89 | in | |
90 | .IR /usr/include/netdb.h "." | |
91 | This is usually set to | |
92 | .IR /etc/services "." | |
93 | ||
94 | Each line describes one service, and is of the form: | |
95 | .IP | |
96 | \f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1] | |
97 | .TP | |
98 | where: | |
99 | .TP 10 | |
100 | .I service-name | |
c13182ef MK |
101 | is the friendly name the service is known by and looked up under. |
102 | It is case sensitive. | |
103 | Often, the client program is named after the | |
fea681da MK |
104 | .IR service-name "." |
105 | .TP | |
106 | .I port | |
107 | is the port number (in decimal) to use for this service. | |
108 | .TP | |
109 | .I protocol | |
c13182ef MK |
110 | is the type of protocol to be used. |
111 | This field should match an entry | |
fea681da MK |
112 | in the |
113 | .BR protocols (5) | |
c13182ef MK |
114 | file. |
115 | Typical values include | |
fea681da MK |
116 | .B tcp |
117 | and | |
118 | .BR udp . | |
119 | .TP | |
120 | .I aliases | |
121 | is an optional space or tab separated list of other names for this | |
c13182ef MK |
122 | service (but see the BUGS section below). |
123 | Again, the names are case | |
fea681da MK |
124 | sensitive. |
125 | .PP | |
fea681da MK |
126 | Either spaces or tabs may be used to separate the fields. |
127 | ||
128 | Comments are started by the hash sign (#) and continue until the end | |
c13182ef MK |
129 | of the line. |
130 | Blank lines are skipped. | |
fea681da MK |
131 | |
132 | The | |
133 | .I service-name | |
134 | should begin in the first column of the file, since leading spaces are | |
135 | not stripped. | |
136 | .I service-names | |
c13182ef MK |
137 | can be any printable characters excluding space and tab. |
138 | However, a conservative choice of characters should be used to minimize | |
139 | inter-operability problems. | |
140 | E.g., a\-z, 0\-9, and hyphen (\-) would seem a | |
fea681da MK |
141 | sensible choice. |
142 | ||
143 | Lines not matching this format should not be present in the | |
c13182ef MK |
144 | file. |
145 | (Currently, they are silently skipped by | |
fea681da MK |
146 | .BR getservent (3), |
147 | .BR getservbyname (3), | |
148 | and | |
149 | .BR getservbyport (3). | |
150 | However, this behaviour should not be relied on.) | |
151 | ||
152 | As a backwards compatibility feature, the slash (/) between the | |
153 | .I port | |
154 | number and | |
155 | .I protocol | |
c13182ef MK |
156 | name can in fact be either a slash or a comma (,). |
157 | Use of the comma in | |
fea681da MK |
158 | modern installations is depreciated. |
159 | ||
160 | This file might be distributed over a network using a network-wide | |
161 | naming service like Yellow Pages/NIS or BIND/Hesiod. | |
162 | ||
163 | A sample | |
164 | .B services | |
165 | file might look like this: | |
166 | .RS | |
167 | .nf | |
168 | .sp | |
169 | .ta 3i | |
170 | netstat 15/tcp | |
171 | qotd 17/tcp quote | |
172 | msp 18/tcp # message send protocol | |
173 | msp 18/udp # message send protocol | |
174 | chargen 19/tcp ttytst source | |
175 | chargen 19/udp ttytst source | |
176 | ftp 21/tcp | |
2bc2f479 | 177 | # 22 \- unassigned |
fea681da | 178 | telnet 23/tcp |
fea681da MK |
179 | .fi |
180 | .RE | |
181 | .SH BUGS | |
182 | There is a maximum of 35 aliases, due to the way the | |
183 | .BR getservent (3) | |
184 | code is written. | |
185 | ||
186 | Lines longer than | |
187 | .B BUFSIZ | |
188 | (currently 1024) characters will be ignored by | |
189 | .BR getservent (3), | |
190 | .BR getservbyname (3), | |
191 | and | |
192 | .BR getservbyport (3). | |
193 | However, this will also cause the next line to be mis-parsed. | |
194 | .SH FILES | |
195 | .TP | |
196 | .I /etc/services | |
197 | The Internet network services list | |
198 | .TP | |
199 | .I /usr/include/netdb.h | |
200 | Definition of | |
201 | .B _PATH_SERVICES | |
202 | .SH "SEE ALSO" | |
203 | .BR listen (2), | |
204 | .BR endservent (3), | |
205 | .BR getservbyname (3), | |
206 | .BR getservbyport (3), | |
207 | .BR getservent (3), | |
208 | .BR setservent (3), | |
209 | .BR inetd.conf (5), | |
210 | .BR protocols (5), | |
211 | .BR inetd (8) | |
212 | ||
331da7c3 | 213 | Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002) |
fea681da MK |
214 | |
215 | Guide to Yellow Pages Service | |
216 | ||
217 | Guide to BIND/Hesiod Service |