chiark / gitweb /
peerdb/tripe-newpeers.in: Add support for v4 and v6 address literals.
[tripe] / peerdb / peers.in.5.in
CommitLineData
6005ef9b
MW
1.\" -*-nroff-*-
2.\".
3.\" Manual for the peer configuration file
4.\"
5.\" (c) 2008 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of Trivial IP Encryption (TrIPE).
11.\"
11ad66c2
MW
12.\" TrIPE is free software: you can redistribute it and/or modify it under
13.\" the terms of the GNU General Public License as published by the Free
14.\" Software Foundation; either version 3 of the License, or (at your
15.\" option) any later version.
6005ef9b 16.\"
11ad66c2
MW
17.\" TrIPE is distributed in the hope that it will be useful, but WITHOUT
18.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20.\" for more details.
6005ef9b
MW
21.\"
22.\" You should have received a copy of the GNU General Public License
11ad66c2 23.\" along with TrIPE. If not, see <https://www.gnu.org/licenses/>.
6005ef9b
MW
24.
25.\"--------------------------------------------------------------------------
cd450424 26.so ../common/defs.man \"@@@PRE@@@
6005ef9b
MW
27.
28.\"--------------------------------------------------------------------------
0647ba7c 29.TH peers.in 5tripe "27 March 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
6005ef9b
MW
30.
31.\"--------------------------------------------------------------------------
32.SH "NAME"
33.
34peers.in \- source form for TrIPE peer database
35.
36.\"--------------------------------------------------------------------------
37.SH "DESCRIPTION"
38.
39The
40.B peers.in
41file is a plain text configuration file. It is read by
42.BR tripe-newpeers (8)
43in order to produce the
44.BR tripe.cdb (8)
45database used by services and other tools.
d64ce4ae 46.
6005ef9b
MW
47.SS "General structure"
48The configuration file is line-oriented. Blank lines are ignored; lines
49beginning with a hash
50.RB ` # '
51or semicolon
52.RB ` ; '
53are ignored. The file is divided into sections by section headers,
54which are lines of the form
55.IP
56.BI [ name ]
57.PP
58Within each section are a number of assignments, of the form
59.IP
60.IB key " = " value
61.PP
62or (entirely equivalent)
63.IP
64.IB key ": " value
65.PP
66The
67.I key
68must start in the left hand column. The
69.I value
70may span multiple lines if subsequent lines begin with whitespace, in
71the manner of RFC822 headers.
72.PP
73There is a special case to be aware of: if a section doesn't specify a
74value for the key
75.B name
76then the section's own name is used as a default.
77.PP
78The following substitutions are made in the body of a value.
79.hP \*o
80An occurrence of
81.BI $( key )
82is replaced by the value assigned to the given
83.IR key .
84.hP \*o
85An occurrence of
ef7d7afb 86.BI $ flags [ host ]
6005ef9b
MW
87is replaced by the IP address of the named
88.IR host .
89Note that
90.I host
91may itself contain
92.BI $( key )
ef7d7afb
MW
93substitutions. The
94.I flags
95consist of zero or more of the following characters:
cc72e4b3
MW
96.RB ` 4 '
97looks up the
98.IR host 's
99IPv4 address(es);
97567475
MW
100.RB ` 6 '
101looks up the
102.IR host 's
103IPv6 address(es);
104and
ef7d7afb
MW
105.RB ` * '
106returns all of the found addresses, separated by spaces, rather than
97567475
MW
107just the first one. If neither address family is requested, then
108.RB ` 46 '
109is assumed. Currently,
110.BR tripe-newpeers(8)
111can only resolve hostnames to IPv4 addresses, but it can `resolve'
112numeric addresses of either kind.
6005ef9b
MW
113.PP
114There is a simple concept of
115.I inheritance
116for sections. If a section contains an assignment
117.IP
833bdc38 118.BI "@inherit = " parent
bd3db76c
MW
119.RB [[,]
120.I parent
121\&...]
6005ef9b
MW
122.PP
123then any lookups which can't be satisfied in that section will be
bd3db76c 124satisfied instead from its
6005ef9b 125.I parent
bd3db76c
MW
126sections (and, if necessary, their parents in turn, and so on).
127.PP
128.hP \*o
129If a value can be found for a key via multiple parents then all of them
130must report the
131.I same
132value. This restriction may be relaxed somewhat, if it turns out that a
133more flexible notion of multiple inheritance is useful.
134.hP \*o
135It's not allowed for a section to inherit, possibly indirectly, from
136itself. Currently errors of this kind are only diagnosed when a cycle
137is encountered while looking up a key and none of the sections on the
138path from the original section up to and round the cycle define a value
139for it. Future versions of this program might be more picky.
140.PP
141Note that
6005ef9b
MW
142.BI $( key )
143substitutions in the resulting value will be satisfied from the original
bd3db76c 144section (though falling back to scanning parent sections). For
6005ef9b
MW
145example, given the sections
146.VS
147[parent]
f08fe72e 148detail = in $(name)
6005ef9b 149blurb = expand $(detail)
f08fe72e
MW
150
151[child]
152@inherit = parent
2273401c 153.VE
f08fe72e
MW
154the key
155.B blurb
156takes the value
157.RB ` "expand in parent" '
158in section
159.BR parent ,
160and
161.RB ` "expand in child" '
162in section
163.BR child .
164.PP
6005ef9b 165Apart from its effect on lookups, as just described, the
833bdc38 166.B @inherit
6005ef9b
MW
167key is entirely ignored. In particular, it is never written to the
168database.
d64ce4ae 169.
6005ef9b
MW
170.SS "Standard keys and their meanings"
171The following keys have meanings to programs in the TrIPE suite. Other
172keys may be used by separately distributed extensions or for local use.
173The descriptions given are summaries only; see the references for
174details.
175.TP
176.B auto
177If true, include the peer in the
178.B %AUTO
179record. Used by
a62f8e8a
MW
180.BR connect (8)
181and
6005ef9b
MW
182.BR tripe-newpeers (8);
183described below.
184.TP
a62f8e8a
MW
185.B connect
186Shell command for initiating connection to this peer. Used by
d64ce4ae 187.BR connect (8).
a62f8e8a
MW
188.TP
189.B cork
6411163d 190Don't initiate immediate key exchange. Used by
a62f8e8a
MW
191.BR connect (8).
192.TP
d3731285
MW
193.B disconnect
194Shell command for closing down connection to this peer. Used by
d64ce4ae 195.BR connect (8).
d3731285 196.TP
a62f8e8a
MW
197.B every
198Interval for checking that the peer is still alive and well. Used by
d64ce4ae 199.BR connect (8).
a62f8e8a
MW
200.TP
201.B ifdown
202Script to bring down tunnel interface connected to the peer. Used by
d64ce4ae 203.BR connect (8).
a62f8e8a
MW
204.TP
205.B ifname
206Interface name to set for the tunnel interface to the peer. Used by
207.BR tripe-ifup (8).
208.TP
209.B ifup
210Script to bring up tunnel interface connected to the peer. Used by
d64ce4ae 211.BR connect (8).
a62f8e8a
MW
212.TP
213.B ifupextra
214Script containing additional interface setup. Used by
215.BR tripe-ifup (8).
216.TP
217.B laddr
218Local address for the tunnel interface to the peer. Used by
219.BR tripe-ifup (8).
220.TP
221.B keepalive
222Interval for sending keepalive pings. Used by
223.BR connect (8).
224.TP
48b84569
MW
225.B key
226Key tag to use to authenticate the peer. Used by
227.BR connect (8).
228.TP
6411163d
MW
229.B mobile
230Peer's IP address is highly volatile. Used by
231.BR connect (8).
232.TP
a62f8e8a
MW
233.B mtu
234Maximum transmission unit for the tunnel interface. Used by
235.BR tripe-ifup (8).
236.TP
237.B nets
238Networks to be routed over the tunnel interface. Used by
239.BR tripe-ifup (8).
240.TP
241.B peer
242Network address for this peer, or
243.BR PASSIVE .
244Used by
245.BR connect (8).
246.TP
fe2a5dcf
MW
247.B priv
248Tag of the private key to use when communicating with the peer.
d64ce4ae
MW
249Used by
250.BR connect (8).
fe2a5dcf 251.TP
a62f8e8a
MW
252.B raddr
253Remote address for the tunnel interface to the peer. Used by
254.BR tripe-ifup (8).
255.TP
256.B retries
257Number of failed ping attempts before attempting reconnection. Used by
d64ce4ae 258.BR connect (8).
a62f8e8a
MW
259.TP
260.B timeout
261Timeout for ping probes. Used by
d64ce4ae 262.BR connect (8).
a62f8e8a
MW
263.TP
264.B tunnel
265Tunnel driver to use when adding the peer. Used by
266.BR connect (8)).
267.TP
6005ef9b
MW
268.B user
269Peer will make active connection as
270.IR user .
271Used by
a62f8e8a
MW
272.BR connect (8)
273and
6005ef9b
MW
274.BR tripe-newpeers (8);
275described below.
d64ce4ae 276.
6005ef9b
MW
277.SS "Conversion"
278This section describes how the textual
279.B peers.in
280file is converted into the
281.BR peers.cdb (5)
282database.
283.PP
284The handling of each section depends on its name.
285.hP \*o
286Sections whose names have the form
287.BI @ whatever
288are ignored (though their contents may be relevant if the section is
289named in another section's
833bdc38 290.B @inherit
6005ef9b
MW
291key).
292.hP \*o
293Sections whose names have the form
294.BI $ whatever
295are written to local-type database records with the same name. The keys
296and values defined in the section (and its parent section, if it
297contains an
833bdc38 298.B @inherit
6005ef9b
MW
299key) are stored in the record using
300.B form-urlencoding
301as defined in RFC1822, except that the key-value pairs are separated by
302semicolons
303.RB ` ; '
304rather than ampersands
305.RB ` & '.
6c2ee518
MW
306Keys whose names begin with
307.RB ` @ '
308are not written to the database.
6005ef9b
MW
309.hP \*o
310Other sections are written to peer-type database records, named
311.BI P name \fR,
312in exactly the same way as for local-type records. However, two special
313actions are also taken.
314.IP
315Firstly, if there is a key
316.B auto
317in the section (or in its parent, etc.), and the value is
318.BR y ,
319.BR yes .
320.BR t ,
321.BR true ,
322.BR 1 ,
323or
324.BR on ,
325then the section's name is added in the special
326.B %AUTO
327record.
328.IP
329Secondly, if there is a key
330.B user
331in the section (or in its parent, etc.), then a user record
332.BI U user
333is created whose contents is the section name.
334.
335.\"--------------------------------------------------------------------------
336.SH "SEE ALSO"
337.
338.BR cdb (5),
339.BR tripe (8).
340.PP
341.BR tripe-newpeers (8),
342.BR peers.cdb (5),
a62f8e8a 343.BR connect (8),
6005ef9b
MW
344.BR tripe-ifup (8).
345.
346.\"--------------------------------------------------------------------------
347.SH "AUTHOR"
348.
349Mark Wooding, <mdw@distorted.org.uk>
350.
351.\"----- That's all, folks --------------------------------------------------