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