chiark / gitweb /
peerdb/tripe-newpeers.in: Enhance addr-lookup syntax; return multiple addrs.
[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:
96.RB ` * '
97returns all of the found addresses, separated by spaces, rather than
98just the first one.
6005ef9b
MW
99.PP
100There is a simple concept of
101.I inheritance
102for sections. If a section contains an assignment
103.IP
833bdc38 104.BI "@inherit = " parent
bd3db76c
MW
105.RB [[,]
106.I parent
107\&...]
6005ef9b
MW
108.PP
109then any lookups which can't be satisfied in that section will be
bd3db76c 110satisfied instead from its
6005ef9b 111.I parent
bd3db76c
MW
112sections (and, if necessary, their parents in turn, and so on).
113.PP
114.hP \*o
115If a value can be found for a key via multiple parents then all of them
116must report the
117.I same
118value. This restriction may be relaxed somewhat, if it turns out that a
119more flexible notion of multiple inheritance is useful.
120.hP \*o
121It's not allowed for a section to inherit, possibly indirectly, from
122itself. Currently errors of this kind are only diagnosed when a cycle
123is encountered while looking up a key and none of the sections on the
124path from the original section up to and round the cycle define a value
125for it. Future versions of this program might be more picky.
126.PP
127Note that
6005ef9b
MW
128.BI $( key )
129substitutions in the resulting value will be satisfied from the original
bd3db76c 130section (though falling back to scanning parent sections). For
6005ef9b
MW
131example, given the sections
132.VS
133[parent]
f08fe72e 134detail = in $(name)
6005ef9b 135blurb = expand $(detail)
f08fe72e
MW
136
137[child]
138@inherit = parent
2273401c 139.VE
f08fe72e
MW
140the key
141.B blurb
142takes the value
143.RB ` "expand in parent" '
144in section
145.BR parent ,
146and
147.RB ` "expand in child" '
148in section
149.BR child .
150.PP
6005ef9b 151Apart from its effect on lookups, as just described, the
833bdc38 152.B @inherit
6005ef9b
MW
153key is entirely ignored. In particular, it is never written to the
154database.
d64ce4ae 155.
6005ef9b
MW
156.SS "Standard keys and their meanings"
157The following keys have meanings to programs in the TrIPE suite. Other
158keys may be used by separately distributed extensions or for local use.
159The descriptions given are summaries only; see the references for
160details.
161.TP
162.B auto
163If true, include the peer in the
164.B %AUTO
165record. Used by
a62f8e8a
MW
166.BR connect (8)
167and
6005ef9b
MW
168.BR tripe-newpeers (8);
169described below.
170.TP
a62f8e8a
MW
171.B connect
172Shell command for initiating connection to this peer. Used by
d64ce4ae 173.BR connect (8).
a62f8e8a
MW
174.TP
175.B cork
6411163d 176Don't initiate immediate key exchange. Used by
a62f8e8a
MW
177.BR connect (8).
178.TP
d3731285
MW
179.B disconnect
180Shell command for closing down connection to this peer. Used by
d64ce4ae 181.BR connect (8).
d3731285 182.TP
a62f8e8a
MW
183.B every
184Interval for checking that the peer is still alive and well. Used by
d64ce4ae 185.BR connect (8).
a62f8e8a
MW
186.TP
187.B ifdown
188Script to bring down tunnel interface connected to the peer. Used by
d64ce4ae 189.BR connect (8).
a62f8e8a
MW
190.TP
191.B ifname
192Interface name to set for the tunnel interface to the peer. Used by
193.BR tripe-ifup (8).
194.TP
195.B ifup
196Script to bring up tunnel interface connected to the peer. Used by
d64ce4ae 197.BR connect (8).
a62f8e8a
MW
198.TP
199.B ifupextra
200Script containing additional interface setup. Used by
201.BR tripe-ifup (8).
202.TP
203.B laddr
204Local address for the tunnel interface to the peer. Used by
205.BR tripe-ifup (8).
206.TP
207.B keepalive
208Interval for sending keepalive pings. Used by
209.BR connect (8).
210.TP
48b84569
MW
211.B key
212Key tag to use to authenticate the peer. Used by
213.BR connect (8).
214.TP
6411163d
MW
215.B mobile
216Peer's IP address is highly volatile. Used by
217.BR connect (8).
218.TP
a62f8e8a
MW
219.B mtu
220Maximum transmission unit for the tunnel interface. Used by
221.BR tripe-ifup (8).
222.TP
223.B nets
224Networks to be routed over the tunnel interface. Used by
225.BR tripe-ifup (8).
226.TP
227.B peer
228Network address for this peer, or
229.BR PASSIVE .
230Used by
231.BR connect (8).
232.TP
fe2a5dcf
MW
233.B priv
234Tag of the private key to use when communicating with the peer.
d64ce4ae
MW
235Used by
236.BR connect (8).
fe2a5dcf 237.TP
a62f8e8a
MW
238.B raddr
239Remote address for the tunnel interface to the peer. Used by
240.BR tripe-ifup (8).
241.TP
242.B retries
243Number of failed ping attempts before attempting reconnection. Used by
d64ce4ae 244.BR connect (8).
a62f8e8a
MW
245.TP
246.B timeout
247Timeout for ping probes. Used by
d64ce4ae 248.BR connect (8).
a62f8e8a
MW
249.TP
250.B tunnel
251Tunnel driver to use when adding the peer. Used by
252.BR connect (8)).
253.TP
6005ef9b
MW
254.B user
255Peer will make active connection as
256.IR user .
257Used by
a62f8e8a
MW
258.BR connect (8)
259and
6005ef9b
MW
260.BR tripe-newpeers (8);
261described below.
d64ce4ae 262.
6005ef9b
MW
263.SS "Conversion"
264This section describes how the textual
265.B peers.in
266file is converted into the
267.BR peers.cdb (5)
268database.
269.PP
270The handling of each section depends on its name.
271.hP \*o
272Sections whose names have the form
273.BI @ whatever
274are ignored (though their contents may be relevant if the section is
275named in another section's
833bdc38 276.B @inherit
6005ef9b
MW
277key).
278.hP \*o
279Sections whose names have the form
280.BI $ whatever
281are written to local-type database records with the same name. The keys
282and values defined in the section (and its parent section, if it
283contains an
833bdc38 284.B @inherit
6005ef9b
MW
285key) are stored in the record using
286.B form-urlencoding
287as defined in RFC1822, except that the key-value pairs are separated by
288semicolons
289.RB ` ; '
290rather than ampersands
291.RB ` & '.
6c2ee518
MW
292Keys whose names begin with
293.RB ` @ '
294are not written to the database.
6005ef9b
MW
295.hP \*o
296Other sections are written to peer-type database records, named
297.BI P name \fR,
298in exactly the same way as for local-type records. However, two special
299actions are also taken.
300.IP
301Firstly, if there is a key
302.B auto
303in the section (or in its parent, etc.), and the value is
304.BR y ,
305.BR yes .
306.BR t ,
307.BR true ,
308.BR 1 ,
309or
310.BR on ,
311then the section's name is added in the special
312.B %AUTO
313record.
314.IP
315Secondly, if there is a key
316.B user
317in the section (or in its parent, etc.), then a user record
318.BI U user
319is created whose contents is the section name.
320.
321.\"--------------------------------------------------------------------------
322.SH "SEE ALSO"
323.
324.BR cdb (5),
325.BR tripe (8).
326.PP
327.BR tripe-newpeers (8),
328.BR peers.cdb (5),
a62f8e8a 329.BR connect (8),
6005ef9b
MW
330.BR tripe-ifup (8).
331.
332.\"--------------------------------------------------------------------------
333.SH "AUTHOR"
334.
335Mark Wooding, <mdw@distorted.org.uk>
336.
337.\"----- That's all, folks --------------------------------------------------