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