]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man5/services.5
Convert to American spelling conventions
[thirdparty/man-pages.git] / man5 / services.5
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.
14 .\"
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.
22 .\"
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
40 numbers and protocol types.
41 Every networking program should look into
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),
48 and
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
54 protocols when assigning a port number.
55 Therefore, most entries will
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),
62 and
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,
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.
69
70 The presence of an entry for a service in the
71 .B services
72 file does not necessarily mean that the service is currently running
73 on the machine.
74 See
75 .BR inetd.conf (5)
76 for the configuration of Internet services offered.
77 Note that not all
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
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
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
110 is the type of protocol to be used.
111 This field should match an entry
112 in the
113 .BR protocols (5)
114 file.
115 Typical values include
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
122 service (but see the BUGS section below).
123 Again, the names are case
124 sensitive.
125 .PP
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
129 of the line.
130 Blank lines are skipped.
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
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
141 sensible choice.
142
143 Lines not matching this format should not be present in the
144 file.
145 (Currently, they are silently skipped by
146 .BR getservent (3),
147 .BR getservbyname (3),
148 and
149 .BR getservbyport (3).
150 However, this behavior 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
156 name can in fact be either a slash or a comma (,).
157 Use of the comma in
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
177 # 22 \- unassigned
178 telnet 23/tcp
179 .fi
180 .RE
181 .SH FILES
182 .TP
183 .I /etc/services
184 The Internet network services list
185 .TP
186 .I /usr/include/netdb.h
187 Definition of
188 .B _PATH_SERVICES
189 .SH BUGS
190 There is a maximum of 35 aliases, due to the way the
191 .BR getservent (3)
192 code is written.
193
194 Lines longer than
195 .B BUFSIZ
196 (currently 1024) characters will be ignored by
197 .BR getservent (3),
198 .BR getservbyname (3),
199 and
200 .BR getservbyport (3).
201 However, this will also cause the next line to be mis-parsed.
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
213 Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002)
214
215 Guide to Yellow Pages Service
216
217 Guide to BIND/Hesiod Service