Make `tripe' be the default key type.
[tripe] / peerdb / peers.in.5.in
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 .
35 peers.in \- source form for TrIPE peer database
36 .
37 .\"--------------------------------------------------------------------------
38 .SH "DESCRIPTION"
39 .
40 The
41 .B peers.in
42 file is a plain text configuration file. It is read by
43 .BR tripe-newpeers (8)
44 in order to produce the
45 .BR tripe.cdb (8)
46 database used by services and other tools.
47 .SS "General structure"
48 The configuration file is line-oriented. Blank lines are ignored; lines
49 beginning with a hash
50 .RB ` # '
51 or semicolon
52 .RB ` ; '
53 are ignored. The file is divided into sections by section headers,
54 which are lines of the form
55 .IP
56 .BI [ name ]
57 .PP
58 Within each section are a number of assignments, of the form
59 .IP
60 .IB key " = " value
61 .PP
62 or (entirely equivalent)
63 .IP
64 .IB key ": " value
65 .PP
66 The
67 .I key
68 must start in the left hand column. The
69 .I value
70 may span multiple lines if subsequent lines begin with whitespace, in
71 the manner of RFC822 headers.
72 .PP
73 There is a special case to be aware of: if a section doesn't specify a
74 value for the key
75 .B name
76 then the section's own name is used as a default.
77 .PP
78 The following substitutions are made in the body of a value.
79 .hP \*o
80 An occurrence of
81 .BI $( key )
82 is replaced by the value assigned to the given
83 .IR key .
84 .hP \*o
85 An occurrence of
86 .BI $[ host ]
87 is replaced by the IP address of the named
88 .IR host .
89 Note that
90 .I host
91 may itself contain
92 .BI $( key )
93 substitutions.
94 .PP
95 There is a simple concept of
96 .I inheritance
97 for sections. If a section contains an assignment
98 .IP
99 .BI "@inherits = " parent
100 .PP
101 then any lookups which can't be satisfied in that section will be
102 satisfied instead from the
103 .I parent
104 section (and, if necessary, its parent in turn, and so on). Note that
105 .BI $( key )
106 substitutions in the resulting value will be satisfied from the original
107 section (though falling back to scanning the parent section). For
108 example, given the sections
109 .VS
110 [parent]
111 detail = in parent
112 blurb = expand $(detail)
113
114 .PP
115 Apart from its effect on lookups, as just described, the
116 .B @inherits
117 key is entirely ignored. In particular, it is never written to the
118 database.
119 .SS "Standard keys and their meanings"
120 The following keys have meanings to programs in the TrIPE suite. Other
121 keys may be used by separately distributed extensions or for local use.
122 The descriptions given are summaries only; see the references for
123 details.
124 .TP
125 .B auto
126 If true, include the peer in the
127 .B %AUTO
128 record. Used by
129 .BR connect (8)
130 and
131 .BR tripe-newpeers (8);
132 described below.
133 .TP
134 .B connect
135 Shell command for initiating connection to this peer. Used by
136 .BR watch (8).
137 .TP
138 .B cork
139 Don't initiate immediate key exchange.. Used by
140 .BR connect (8).
141 .TP
142 .B every
143 Interval for checking that the peer is still alive and well. Used by
144 .BR watch (8).
145 .TP
146 .B ifdown
147 Script to bring down tunnel interface connected to the peer. Used by
148 .BR watch (8).
149 .TP
150 .B ifname
151 Interface name to set for the tunnel interface to the peer. Used by
152 .BR tripe-ifup (8).
153 .TP
154 .B ifup
155 Script to bring up tunnel interface connected to the peer. Used by
156 .BR watch (8).
157 .TP
158 .B ifupextra
159 Script containing additional interface setup. Used by
160 .BR tripe-ifup (8).
161 .TP
162 .B laddr
163 Local address for the tunnel interface to the peer. Used by
164 .BR tripe-ifup (8).
165 .TP
166 .B keepalive
167 Interval for sending keepalive pings. Used by
168 .BR connect (8).
169 .TP
170 .B mtu
171 Maximum transmission unit for the tunnel interface. Used by
172 .BR tripe-ifup (8).
173 .TP
174 .B nets
175 Networks to be routed over the tunnel interface. Used by
176 .BR tripe-ifup (8).
177 .TP
178 .B peer
179 Network address for this peer, or
180 .BR PASSIVE .
181 Used by
182 .BR connect (8).
183 .TP
184 .B raddr
185 Remote address for the tunnel interface to the peer. Used by
186 .BR tripe-ifup (8).
187 .TP
188 .B retries
189 Number of failed ping attempts before attempting reconnection. Used by
190 .BR watch (8).
191 .TP
192 .B timeout
193 Timeout for ping probes. Used by
194 .BR watch (8).
195 .TP
196 .B tunnel
197 Tunnel driver to use when adding the peer. Used by
198 .BR connect (8)).
199 .TP
200 .B user
201 Peer will make active connection as
202 .IR user .
203 Used by
204 .BR connect (8)
205 and
206 .BR tripe-newpeers (8);
207 described below.
208 .SS "Conversion"
209 This section describes how the textual
210 .B peers.in
211 file is converted into the
212 .BR peers.cdb (5)
213 database.
214 .PP
215 The handling of each section depends on its name.
216 .hP \*o
217 Sections whose names have the form
218 .BI @ whatever
219 are ignored (though their contents may be relevant if the section is
220 named in another section's
221 .B @inherits
222 key).
223 .hP \*o
224 Sections whose names have the form
225 .BI $ whatever
226 are written to local-type database records with the same name. The keys
227 and values defined in the section (and its parent section, if it
228 contains an
229 .B @inherits
230 key) are stored in the record using
231 .B form-urlencoding
232 as defined in RFC1822, except that the key-value pairs are separated by
233 semicolons
234 .RB ` ; '
235 rather than ampersands
236 .RB ` & '.
237 The
238 .B @inherits
239 key-value pair is not written to the database.
240 .hP \*o
241 Other sections are written to peer-type database records, named
242 .BI P name \fR,
243 in exactly the same way as for local-type records. However, two special
244 actions are also taken.
245 .IP
246 Firstly, if there is a key
247 .B auto
248 in the section (or in its parent, etc.), and the value is
249 .BR y ,
250 .BR yes .
251 .BR t ,
252 .BR true ,
253 .BR 1 ,
254 or
255 .BR on ,
256 then the section's name is added in the special
257 .B %AUTO
258 record.
259 .IP
260 Secondly, if there is a key
261 .B user
262 in the section (or in its parent, etc.), then a user record
263 .BI U user
264 is created whose contents is the section name.
265 .
266 .\"--------------------------------------------------------------------------
267 .SH "SEE ALSO"
268 .
269 .BR cdb (5),
270 .BR tripe (8).
271 .PP
272 .BR tripe-newpeers (8),
273 .BR peers.cdb (5),
274 .BR connect (8),
275 .BR watch (8),
276 .BR tripe-ifup (8).
277 .
278 .\"--------------------------------------------------------------------------
279 .SH "AUTHOR"
280 .
281 Mark Wooding, <mdw@distorted.org.uk>
282 .
283 .\"----- That's all, folks --------------------------------------------------