]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/services.5
hyphen/dash fixes
[thirdparty/man-pages.git] / man5 / services.5
CommitLineData
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.
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
35services \- Internet network services list
36.SH DESCRIPTION
37.B services
38is a plain ASCII file providing a mapping between friendly textual
39names for internet services, and their underlying assigned port
40numbers and protocol types. Every networking program should look into
41this file to get the port number (and protocol) for its service.
42The C library routines
43.BR getservent (3),
44.BR getservbyname (3),
45.BR getservbyport (3),
46.BR setservent (3),
47and
48.BR endservent (3)
49support querying this file from programs.
50
51Port numbers are assigned by the IANA (Internet Assigned Numbers
52Authority), and their current policy is to assign both TCP and UDP
53protocols when assigning a port number. Therefore, most entries will
54have two entries, even for TCP only services.
55
56Port numbers below 1024 (so-called 'low numbered' ports) can only be
57bound to by root (see
58.BR bind (2),
59.BR tcp (7),
60and
61.BR udp (7)).
62This is so clients connecting to low numbered ports can trust
63that the service running on the port is the standard implementation,
64and not a rogue service run by a user of the machine. Well-known port
65numbers specified by the IANA are normally located in this root-only
66space.
67
68The presence of an entry for a service in the
69.B services
70file does not necessarily mean that the service is currently running
71on the machine. See
72.BR inetd.conf (5)
73for the configuration of Internet services offered. Note that not all
74networking services are started by
75.BR inetd (8),
76and so won't appear in
77.BR inetd.conf (5).
78In particular, news (NNTP) and mail (SMTP) servers are often
79initialized from the system boot scripts.
80
81The location of the
82.B services
83file is defined by
84.B _PATH_SERVICES
85in
86.IR /usr/include/netdb.h "."
87This is usually set to
88.IR /etc/services "."
89
90Each line describes one service, and is of the form:
91.IP
92\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
93.TP
94where:
95.TP 10
96.I service-name
97is the friendly name the service is known by and looked up under. It
98is case sensitive. Often, the client program is named after the
99.IR service-name "."
100.TP
101.I port
102is the port number (in decimal) to use for this service.
103.TP
104.I protocol
105is the type of protocol to be used. This field should match an entry
106in the
107.BR protocols (5)
108file. Typical values include
109.B tcp
110and
111.BR udp .
112.TP
113.I aliases
114is an optional space or tab separated list of other names for this
115service (but see the BUGS section below). Again, the names are case
116sensitive.
117.PP
118
119Either spaces or tabs may be used to separate the fields.
120
121Comments are started by the hash sign (#) and continue until the end
122of the line. Blank lines are skipped.
123
124The
125.I service-name
126should begin in the first column of the file, since leading spaces are
127not stripped.
128.I service-names
129can be any printable characters excluding space and tab. However,
130a conservative choice of characters should be used to minimize
131inter-operability problems. E.g., a-z, 0-9, and hyphen (\-) would seem a
132sensible choice.
133
134Lines not matching this format should not be present in the
135file. (Currently, they are silently skipped by
136.BR getservent (3),
137.BR getservbyname (3),
138and
139.BR getservbyport (3).
140However, this behaviour should not be relied on.)
141
142As a backwards compatibility feature, the slash (/) between the
143.I port
144number and
145.I protocol
146name can in fact be either a slash or a comma (,). Use of the comma in
147modern installations is depreciated.
148
149This file might be distributed over a network using a network-wide
150naming service like Yellow Pages/NIS or BIND/Hesiod.
151
152A sample
153.B services
154file might look like this:
155.RS
156.nf
157.sp
158.ta 3i
159netstat 15/tcp
160qotd 17/tcp quote
161msp 18/tcp # message send protocol
162msp 18/udp # message send protocol
163chargen 19/tcp ttytst source
164chargen 19/udp ttytst source
165ftp 21/tcp
2bc2f479 166# 22 \- unassigned
fea681da
MK
167telnet 23/tcp
168.sp
169.fi
170.RE
171.SH BUGS
172There is a maximum of 35 aliases, due to the way the
173.BR getservent (3)
174code is written.
175
176Lines longer than
177.B BUFSIZ
178(currently 1024) characters will be ignored by
179.BR getservent (3),
180.BR getservbyname (3),
181and
182.BR getservbyport (3).
183However, this will also cause the next line to be mis-parsed.
184.SH FILES
185.TP
186.I /etc/services
187The Internet network services list
188.TP
189.I /usr/include/netdb.h
190Definition of
191.B _PATH_SERVICES
192.SH "SEE ALSO"
193.BR listen (2),
194.BR endservent (3),
195.BR getservbyname (3),
196.BR getservbyport (3),
197.BR getservent (3),
198.BR setservent (3),
199.BR inetd.conf (5),
200.BR protocols (5),
201.BR inetd (8)
202
203Assigned Numbers RFC, most recently RFC 1700, (AKA STD0002)
204
205Guide to Yellow Pages Service
206
207Guide to BIND/Hesiod Service