chiark / gitweb /
server: Repurpose the flags in `peerspec'.
[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.\"--------------------------------------------------------------------------
30.TH peers.in 5 "27 March 2008" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
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.
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
86.BI $[ host ]
87is replaced by the IP address of the named
88.IR host .
89Note that
90.I host
91may itself contain
92.BI $( key )
93substitutions.
94.PP
95There is a simple concept of
96.I inheritance
97for sections. If a section contains an assignment
98.IP
99.BI "@inherits = " parent
100.PP
101then any lookups which can't be satisfied in that section will be
102satisfied instead from the
103.I parent
104section (and, if necessary, its parent in turn, and so on). Note that
105.BI $( key )
106substitutions in the resulting value will be satisfied from the original
107section (though falling back to scanning the parent section). For
108example, given the sections
109.VS
110[parent]
111detail = in parent
112blurb = expand $(detail)
2273401c 113.VE
6005ef9b
MW
114Apart from its effect on lookups, as just described, the
115.B @inherits
116key is entirely ignored. In particular, it is never written to the
117database.
118.SS "Standard keys and their meanings"
119The following keys have meanings to programs in the TrIPE suite. Other
120keys may be used by separately distributed extensions or for local use.
121The descriptions given are summaries only; see the references for
122details.
123.TP
124.B auto
125If true, include the peer in the
126.B %AUTO
127record. Used by
a62f8e8a
MW
128.BR connect (8)
129and
6005ef9b
MW
130.BR tripe-newpeers (8);
131described below.
132.TP
a62f8e8a
MW
133.B connect
134Shell command for initiating connection to this peer. Used by
135.BR watch (8).
136.TP
137.B cork
138Don't initiate immediate key exchange.. Used by
139.BR connect (8).
140.TP
141.B every
142Interval for checking that the peer is still alive and well. Used by
143.BR watch (8).
144.TP
145.B ifdown
146Script to bring down tunnel interface connected to the peer. Used by
147.BR watch (8).
148.TP
149.B ifname
150Interface name to set for the tunnel interface to the peer. Used by
151.BR tripe-ifup (8).
152.TP
153.B ifup
154Script to bring up tunnel interface connected to the peer. Used by
155.BR watch (8).
156.TP
157.B ifupextra
158Script containing additional interface setup. Used by
159.BR tripe-ifup (8).
160.TP
161.B laddr
162Local address for the tunnel interface to the peer. Used by
163.BR tripe-ifup (8).
164.TP
165.B keepalive
166Interval for sending keepalive pings. Used by
167.BR connect (8).
168.TP
48b84569
MW
169.B key
170Key tag to use to authenticate the peer. Used by
171.BR connect (8).
172.TP
a62f8e8a
MW
173.B mtu
174Maximum transmission unit for the tunnel interface. Used by
175.BR tripe-ifup (8).
176.TP
177.B nets
178Networks to be routed over the tunnel interface. Used by
179.BR tripe-ifup (8).
180.TP
181.B peer
182Network address for this peer, or
183.BR PASSIVE .
184Used by
185.BR connect (8).
186.TP
187.B raddr
188Remote address for the tunnel interface to the peer. Used by
189.BR tripe-ifup (8).
190.TP
191.B retries
192Number of failed ping attempts before attempting reconnection. Used by
193.BR watch (8).
194.TP
195.B timeout
196Timeout for ping probes. Used by
197.BR watch (8).
198.TP
199.B tunnel
200Tunnel driver to use when adding the peer. Used by
201.BR connect (8)).
202.TP
6005ef9b
MW
203.B user
204Peer will make active connection as
205.IR user .
206Used by
a62f8e8a
MW
207.BR connect (8)
208and
6005ef9b
MW
209.BR tripe-newpeers (8);
210described below.
211.SS "Conversion"
212This section describes how the textual
213.B peers.in
214file is converted into the
215.BR peers.cdb (5)
216database.
217.PP
218The handling of each section depends on its name.
219.hP \*o
220Sections whose names have the form
221.BI @ whatever
222are ignored (though their contents may be relevant if the section is
223named in another section's
224.B @inherits
225key).
226.hP \*o
227Sections whose names have the form
228.BI $ whatever
229are written to local-type database records with the same name. The keys
230and values defined in the section (and its parent section, if it
231contains an
232.B @inherits
233key) are stored in the record using
234.B form-urlencoding
235as defined in RFC1822, except that the key-value pairs are separated by
236semicolons
237.RB ` ; '
238rather than ampersands
239.RB ` & '.
240The
241.B @inherits
242key-value pair is not written to the database.
243.hP \*o
244Other sections are written to peer-type database records, named
245.BI P name \fR,
246in exactly the same way as for local-type records. However, two special
247actions are also taken.
248.IP
249Firstly, if there is a key
250.B auto
251in the section (or in its parent, etc.), and the value is
252.BR y ,
253.BR yes .
254.BR t ,
255.BR true ,
256.BR 1 ,
257or
258.BR on ,
259then the section's name is added in the special
260.B %AUTO
261record.
262.IP
263Secondly, if there is a key
264.B user
265in the section (or in its parent, etc.), then a user record
266.BI U user
267is created whose contents is the section name.
268.
269.\"--------------------------------------------------------------------------
270.SH "SEE ALSO"
271.
272.BR cdb (5),
273.BR tripe (8).
274.PP
275.BR tripe-newpeers (8),
276.BR peers.cdb (5),
a62f8e8a
MW
277.BR connect (8),
278.BR watch (8),
6005ef9b
MW
279.BR tripe-ifup (8).
280.
281.\"--------------------------------------------------------------------------
282.SH "AUTHOR"
283.
284Mark Wooding, <mdw@distorted.org.uk>
285.
286.\"----- That's all, folks --------------------------------------------------