unaligned.h: Add macros for reading and writing little-endian 32-bit words.
[secnet] / secnet.8
1 .\" Man page for secnet.
2 .\"
3 .\" See the secnet.git README, or the Debian copyright file, for full
4 .\" list of copyright holders.
5 .\"
6 .\" secnet is free software; you can redistribute it and/or modify it
7 .\" under the terms of the GNU General Public License as published by
8 .\" the Free Software Foundation; either version 3 of the License, or
9 .\" (at your option) any later version.
10 .\"
11 .\" secnet is distributed in the hope that it will be useful, but
12 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
13 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 .\" General Public License for more details.
15 .\"
16 .\" You should have received a copy of the GNU General Public License
17 .\" version 3 along with secnet; if not, see
18 .\" https://www.gnu.org/licenses/gpl.html.
19 .TH secnet 8
20
21 .SH NAME
22 secnet \- VPN router daemon
23
24 .SH SYNOPSIS
25 \fBsecnet\fR [\fIOPTIONS\fR]
26
27 .SH DESCRIPTION
28 \fBsecnet\fR allows virtual private networks to be constructed
29 spanning multiple separate sites.
30
31 .SH OPTIONS
32 .TP
33 .B --verbose\fR, \fB-v
34 Enable extra diagnostics.
35 .TP
36 .B --nowarnings\fR, \fB-w
37 Suppress warnings.
38 .TP
39 .B --help
40 Display usage message.
41 .TP
42 .B --version
43 Display version string.
44 .TP
45 .B --nodetach\fR, \fB-n
46 Don't go into background.
47 The default behaviour is to become a daemon during startup.
48 .TP
49 .B --silent\fR, \fB--quiet\fR, \fB-f
50 Suppress error messages.
51 .TP
52 .B --debug\fR, \fB-d
53 Enable debug messages.
54 .TP
55 .B --config\fR, \fB-c \fIPATH
56 Specify configuration file.
57 The default is \fI/etc/secnet/secnet.conf\fR.
58 .TP
59 .B --just-check-config\fR, \fB-j
60 Check configuration and exit.
61 .TP
62 .B --sites-key\fR, \fB-s \fIKEY
63 Configuration file key defining active sites.
64 The default is \fBsites\fR.
65
66 .SH "CAPABILITY NEGOTIATION"
67 Sites negotiate with each other during key exchange
68 in order to determine which cryptographic algorithms and other features
69 \(en termed
70 .I capabilities
71 \(en
72 they each support.
73 Capabilities are assigned small integer numbers.
74 In many cases,
75 capability numbers can be assigned in the configuration file,
76 as described below;
77 but secnet's default assignments will often be satisfactory.
78 .PP
79 Capability numbers between 0 and 7 inclusive
80 are reserved for local use:
81 secnet will never make use of them without explicit configuration.
82 This may be useful to migrate from one set of parameters
83 for a particular cryptographic algorithm
84 to different, incompatible, parameters for the same algorithm.
85 Other capability numbers are assigned by default
86 by various kinds of closures.
87 See the descriptions below for details.
88 .PP
89 It is essential that a capability number mean the same thing
90 to each of a pair of peers.
91 It's possible to configure a site
92 so that it uses different capability numbers for the same feature
93 when it communicates with different peer sites,
94 but this is likely to be more confusing than useful.
95
96 .SH "CONFIGURATION FILE"
97 .SS Overview
98 The default configuration file is \fI/etc/secnet/secnet.conf\fR.
99 This can be overridden with the \fB--config\fR option.
100 .PP
101 The configuration file defines a dictionary (a mapping from keys to
102 values) of configuration information for secnet.
103 It is recursive in nature, i.e. values may themselves include dictionaries.
104 Any node in the nested structure thus defined can be identified by a
105 \fIpath\fR, which is the sequence of keys necessary to reach it from
106 the root, separated by "/" characters.
107 See \fBPaths\fR below for how this is used.
108 .PP
109 Furthermore, when a key is looked up in a dictionary, if it cannot be
110 found, it is sought in the parent dictionary, and so on back to the
111 root.
112 For instance, each \fIsite\fR must contain the \fBresolver\fR key, but
113 in a typical configuration there is no value in having different
114 resolvers for each site.
115 Therefore \fBresolver\fR is defined at the root and thus automatically
116 incorporated into all sites.
117 .SS Whitespace
118 Whitespace, including newlines, is ignored except to the extent that
119 it bounds other symbols.
120 .PP
121 Comment begin with "#" and continues to the end of the line.
122 Comments are ignored.
123 .SS Inclusion
124 A file may be recursively included into the configuration file using a
125 line of the form:
126 .IP
127 \fBinclude \fIPATH
128 .PP
129 This is handled at a higher level than the main parser and so
130 precludes the possibility of using the string \fBinclude\fR for any
131 other purpose.
132 .\" check if this is true. it's probably a bug!
133 .SS Assignments
134 The configuration file contains one or more assigments.
135 Each assignment is written:
136 .IP
137 \fIkey\fR [\fB=\fR] \fIlist\fR\fB;\fR
138 .PP
139 i.e. the equals sign is optional.
140 The semicolon is mandatory in all contexts.
141 .PP
142 Keys start with a letter or "_" and continue with any numbers of
143 letters, digits, "_" and "-".
144 .PP
145 Each \fIkey\fR is a list of one or more \fIvalues\fR, separated by commas.
146 Possible values types are \fIboolean\fR, \fIstring\fR, \fInumber\fR,
147 \fIdictionary\fR, \fIpath\fR and \fIclosure evaluation\fR.
148 .\" This man page draws a distinction between a closure (the thing
149 .\" evaluated) and a closure evaluation (the closure plus is
150 .\" arguments).
151 .SS "Strings"
152 Strings are contained within "double quotes".
153 There is (currently) no escape syntax and no way to include quotes
154 inside strings.
155 .PP
156 Example:
157 .nf
158 filename "/var/log/secnet";
159 .fi
160 .SS "Numbers"
161 Numbers are encoded in decimal and do not include a sign.
162 Numbers must lie in the range 0 to 4294967295.
163 .PP
164 Example:
165 .nf
166 mtu 1400;
167 .fi
168 .SS "Dictionaries"
169 .\" In conffile.y dictionaries can be preceded by a search path, but
170 .\" this is not implemented elsewhere, so not documented here.
171 Dictionaries consist of one or more assignments, in the same syntax as
172 given above, enclosed in "{" and "}".
173 .PP
174 Example:
175 .nf
176 system {
177 userid "secnet";
178 pidfile "/var/run/secnet.pid";
179 };
180 .fi
181 .SS "Paths"
182 Paths allow a key already defined in the configuration to be aliased.
183 .PP
184 Paths consist of a sequence of keys separated by "/".
185 If the path starts with a "/" then it is an \fIabsolute path\fR and
186 the search starts at the root of the configuration.
187 Otherwise it is a \fIrelative path\fR and starts in the containing
188 dictionary or in any of its parents, down to and including the root.
189 If there is more than one match, the one furthest from the root "wins".
190 .PP
191 The value of a path is the list assigned to the key it refers to.
192 Lists are flattened; for example if a key is defined as a list of two
193 paths, and each of those refers to a list of two integers, the
194 original key is therefore defined to be a list of four integers, not
195 a list consisting of two lists.
196 .PP
197 It is not possible to refer to a \fIlater\fR key using a path.
198 .PP
199 Example:
200 .nf
201 vpn {
202 test {
203 kakajou vpn-data/test/kakajou/kakajou;
204 araminta vpn-data/test/araminta/araminta;
205 deodand vpn-data/test/deodand/deodand;
206 all-sites kakajou,araminta,deodand;
207 };
208 };
209 all-sites vpn/test/all-sites;
210 .fi
211 .PP
212 Here, each of \fBvpn/test/kakajou\fR, \fBvpn/test/araminta\fR and
213 \fBvpn/test/deodand\fR are defined as aliases to values defined
214 elsewhere.
215 \fBvpn/tests/all-sites\fR is defined as the list of all three of those
216 values, and \fBall-sites\fR is then defined to be an alias for that.
217 .SS "Booleans"
218 The (single-element) paths \fBfalse\fR, \fBno\fR and \fBnowise\fR are
219 predefined and refer to a boolean false value.
220 Similarly \fBtrue\fR, \fByes\fR and \fBverily\fR point at a boolean
221 true value.
222 .PP
223 In all six cases, variants with just the first letter capitalized, and
224 with all letters capitalized, are also provided.
225 .PP
226 Example:
227 .nf
228 random randomfile("/dev/urandom",no);
229 .fi
230 .SS "Closure Evaluation"
231 Closure evaluation uses the following syntax:
232 .IP
233 \fICLOSURE \fB( \fIARGUMENTS \fB)
234 .PP
235 \fICLOSURE\fR may be a path referring to a closure, or may itself be a
236 closure evaluation.
237 .PP
238 \fIARGUMENTS\fR is a list of zero or more values, separated by commas.
239 As a shortcut, if the arguments consist of a single dictionary, the
240 parentheses may be ommitted:
241 .IP
242 \fICLOSURE \fB{ \fR... \fB}
243 .PP
244 Example:
245 .nf
246 sites map(site, vpn/test/all-sites);
247 .fi
248 .PP
249 When a closure is evaluated it returns a value (a list, much as above)
250 and may also have side effects (which may be immediate or may be
251 deferred to some later phase of execution).
252 A list of built-in closures is given below.
253 .SS "Mandatory Keys"
254 Two keys are mandatory.
255 \fBsystem\fR must be a dictionary in which the following keys can be
256 looked up:
257 .TP
258 .B log
259 A \fIlog closure\fR; see the \fBlogfile\fR documentation below.
260 The destination for log messages.
261 Mandatory.
262 .TP
263 .B userid
264 A string.
265 The userid to run as after dropping privilege.
266 Optional.
267 .TP
268 .B pidfile
269 A string.
270 The path to write a pidfile.
271 Optional.
272 .PP
273 \fBsites\fR should be a list of \fIsite closures\fR; see the \fBsite\fR documentation below.
274 This defines the collection of tunnel endpoints that \fBsecnet\fR will
275 communicate with.
276 .PP
277 Recall the recursive lookup logic described in \fBOverview\fR above:
278 if (for instance) \fBlog\fR is defined in the top level dictionary but
279 not in \fBsystem\fR, it will nevertheless be found when looked up in
280 the latter.
281
282 .SH CLOSURES
283 \fBsecnet\fR contains a collection of built-in closures
284 with names (i.e. single-element paths) given below.
285 .PP
286 Most of them return anonymous closures of various types,
287 which are described contextually.
288
289 .SS adns
290 \fBadns(\fIDICT\fB)\fR => \fIresolver closure\fR
291 .TP
292 .I DICT
293 This either be empty or contain the single key \fBconfig\fR, with a
294 string value giving configuration to supply to ADNS.
295 This might be read from a file using \fBreadfile\fR.
296 .PP
297 A \fIresolver closure\fR is a means of converting hostnames into
298 network addresses.
299
300 .SS diffie-hellman
301 .PP
302 \fBdiffie-hellman(\fIMODULUS\fB, \fIGENERATOR\fR[\fB, \fICHECK\fR]\fB)\fR => \fIdh closure\fR
303 .br
304 \fBdiffie-hellman(\fIDICT\fB)\fR => \fIdh closure\fR
305 Defines a Diffie\(enHellman group which uses
306 traditional Diffie\(enHellman modulo a large prime number.
307 Arguments may be provided
308 either as positional arguments
309 or in a dictionary.
310 Dictionary keys are described below;
311 those keys which correspond with positional arguments
312 are mentioned in the individual descriptions.
313 .TP
314 .B p
315 String.
316 The prime modulus \fIp\fR in hex.
317 Corresponds to the
318 .I MODULUS
319 argument.
320 .TP
321 .B g
322 String.
323 The generator \fIg\fR in hex.
324 Corresponds to the
325 .I GENERATOR
326 argument.
327 .TP
328 .B check
329 Boolean.
330 If \fBtrue\fR (the default) then check if \fIp\fR is prime.
331 Corresponds to the
332 .I CHECK
333 argument.
334 .TP
335 .B capab-num
336 The capability number to use when advertising
337 this Diffie\(enHellman group.
338 The default capability number is 10.
339
340 .PP
341 A \fIdh closure\fR defines a group to be used for key exchange.
342
343 .SS logfile
344 \fBlogfile(\fIDICT\fB)\fR => \fIlog closure\fR
345 .PP
346 Valid keys in the \fIDICT\fR argument are:
347 .TP
348 .B filename
349 The path to log to.
350 .TP
351 .B class
352 A list of strings defining which classes of message to log.
353 The possible message classes are \fBdebug-config\fR,
354 \fBdebug-phase\fR, \fBdebug\fR, \fBinfo\fR, \fBnotice\fR,
355 \fBwarning\fR, \fBerror\fR, \fBsecurity\fR and \fBfatal\fR.
356 .IP
357 \fBall-debug\fR is the union of all the \fBdebug\fR... classes.
358 \fBdefault\fR is equivalent to \fBwarning, error, security, fatal\fR.
359 \fBverbose\fR is equivalent to \fBinfo, notice, warning, error,
360 security, fatal\fR.
361 \fBquiet\fR is equivalent to \fBfatal\fR.
362 .PP
363 A \fIlog closure\fR is a means of saving log messages.
364 See also \fBsyslog\fR below.
365
366 .SS makelist
367 \fBmakelist(\fIDICT\fB)\fR => \fILIST\fR
368 .PP
369 Returns the (flattened) list of values from the dictionary, discarding
370 the keys.
371
372 .SS map
373 \fBmap(\fICLOSURE\fB, \fIINPUT\fR...\fB)\fR => \fILIST\fR
374 .PP
375 Applies \fICLOSURE\fR to all its additional input arguments and
376 returns the resulting list.
377
378 .SS md5
379 \fBmd5\fR is a \fIhash closure\fR implementing the MD5 algorithm.
380
381 .SS null-netlink
382 \fBnull-netlink(\fIDICT\fB)\fR => \fInetlink closure\fR
383 .br
384 \fBnull-netlink(\fIDICT\fB)\fR => \fIpure closure\fR
385 .\" TODO pure closure is what it's called internally but this is a
386 .\" very opaque name to use in docs
387 .PP
388 Valid keys in the \fIDICT\fR argument are:
389 .TP
390 .B name
391 String.
392 The name for the netlink device.
393 The default is \fBnull-netlink\fR.
394 .TP
395 .B networks
396 List of strings.
397 The networks on the host side of the netlink device.
398 .TP
399 .B remote-networks
400 List of strings.
401 Networks that may be claimed by remote sites using this netlink device.
402 .TP
403 .B secnet-address
404 String.
405 IP address of this netlink.
406 Incompatible with \fBptp-address\fR.
407 .TP
408 .B ptp-address
409 String.
410 IP address of the other end of a point-to-point link.
411 Incompatible with \fBsecnet-address\fR.
412 .TP
413 .B mtu
414 Number.
415 The MTU of the netlink device.
416 The default is 1000.
417 .PP
418 If \fBptp-address\fR is used then the result is a \fInetlink closure\fR.
419 This can be used directly with the \fBlink\fR key in the \fBsites\fR
420 closure (see below).
421 .PP
422 If \fBsecnet-address\fR is used then the result is a \fIpure
423 closure\fR.
424 This must be evaluated to yield a \fInetlink closure\fR, using a
425 dictionary argument with the following keys:
426 .TP
427 .B routes
428 String list.
429 networks reachable via this tunnel, in \fIaddress\fB/\fIbits\fR format.
430 .TP
431 .B options
432 String list.
433 A list of options:
434 .RS
435 .TP
436 .B allow-route
437 Allow packets received via this tunnel to be routed down other tunnels
438 (without this option only packets from the host will be routed).
439 .TP
440 .B soft
441 Remove these routes from the host routing table when the link quality
442 is 0.
443 .RE
444 .TP
445 .B mtu
446 Number.
447 Default MTU over this link.
448 The default is inherited from the \fIpure closure\fR.
449 .TP
450 .B priority
451 Number.
452 The priority of this link.
453 Higher values beat lower values.
454 The default is 0.
455
456 .\" TODO ptp-address turns up in sites.conf, but why? I think this
457 .\" is a bug in make-secnet-sites; it is not used by
458 \" netlink_inst_create.
459
460 .PP
461 A \fInetlink closure\fR is a virtual IP link, and is supplied to the
462 \fBlink\fR key of a \fIsite\fR closure.
463 .PP
464 The netlink created by \fBnull-netlink\fR has no connection to the
465 host.
466 See \fBtun\fR and \fBuserv-ipif\fR below for more useful alternatives.
467
468
469
470 .SS randomfile
471 \fBrandomfile(\fIFILENAME\fR[\fB, \fIBLOCKING\fR]\fB)\fR => \fIrandomsource closure\fR
472 .TP
473 .I FILENAME
474 String.
475 Path to random device, e.g. \fI/dev/urandom\fR.
476 .TP
477 .I BLOCKING
478 Boolean.
479 \fBTrue\fR if this is a blocking device and \fBfalse\fR otherwise (the default).
480 Blocking device support is not implemented so this must always be
481 \fBFalse\fR or absent.
482 .PP
483 A \fIrandomsource closure\fR is a source of random numbers.
484
485 .SS readfile
486 \fBreadfile(\fIPATH\fB)\fR => \fISTRING\fR
487 .PP
488 Read the contents of the file \fIPATH\fR (a string) and return it as a string.
489
490 .SS eax-serpent
491 \fBeax-serpent(\fIDICT\fB)\fR => \fItransform closure\fR
492 .PP
493 Valid keys in the \fIDICT\fR argument are:
494 .TP
495 .B max-sequence-skew
496 The maximum acceptable difference between the sequence number in a
497 received, decrypted message and the previous one.
498 The default is 10.
499 It may be necessary to increase this is if connectivity is poor.
500 .TP
501 .B tag-length-bytes
502 The length of the message authentication tag. The default is 16,
503 for a 128-bit tag length. It must be no longer than the Serpent
504 blocksize, 16. Must be have the same value at both ends.
505 .TP
506 .B padding-rounding
507 Messages are padded to a multiple of this many bytes. This
508 serves to obscure the exact length of messages. The default is 16,
509 .TP
510 .B capab-num
511 The capability number to use when advertising this
512 transform. The default for serpent-eax is 9.
513 .PP
514 A \fItransform closure\fR is a reversible means of transforming
515 messages for transmission over a (presumably) insecure network.
516 It is responsible for both confidentiality and integrity.
517
518 .SS serpent256-cbc
519 \fBserpent256-cbc(\fIDICT\fB)\fR => \fItransform closure\fR
520 .PP
521 This transform
522 is deprecated as its security properties are poor; it should be
523 specified only alongside a better transform such as eax-serpent.
524 .PP
525 Valid keys in the \fIDICT\fR argument are:
526 .TP
527 .B capab-num
528 As above. The default for serpent256-cbc is 8.
529 .TP
530 .B max-sequence-skew
531 As above.
532 .PP
533 Note that this uses a big-endian variant of the Serpent block cipher
534 (which is not compatible with most other Serpent implementations).
535 .SS rsa-private
536 \fBrsa-private(\fIPATH\fB\fR[, \fICHECK\fR]\fB)\fR => \fIrsaprivkey closure\fR
537 .TP
538 .I PATH
539 String.
540 The path to a file containing an RSA private key in SSH format
541 (version 1).
542 There must be no passphrase.
543 .TP
544 .I CHECK
545 Boolean.
546 If \fBtrue\fR (the default) then check that the key is valid.
547
548 .SS rsa-public
549 \fBrsa-public(\fIKEY\fB, \fIMODULUS\fB)\fR => \fIrsapubkey closure\fR
550 .TP
551 .I KEY
552 String.
553 The public key exponent (\fIe\fR), in decimal.
554 .TP
555 .I MODULUS
556 String.
557 The modulus (\fIn\fR), in decimal.
558
559 .SS sha1
560 \fBsha1\fR is a \fIhash closure\fR implementing the SHA-1 algorithm.
561
562 .SS sha512
563 \fBsha512\fR is a \fIhash closure\fR implementing the SHA-512 algorithm.
564
565 .SS site
566 \fBsite(\fIDICT\fB)\fR => \fIsite closure\fR
567 .PP
568 Valid keys in the \fIDICT\fR argument are:
569 .TP
570 .B local-name
571 String.
572 The site's name for itself.
573 .TP
574 .B name
575 String.
576 The name of the site's peer.
577 .TP
578 .B link
579 A \fInetlink closure\fR.
580 .TP
581 .B comm
582 A \fIcomm closure\fR.
583 .TP
584 .B resolver
585 A \fIresolver closure\fR.
586 .TP
587 .B random
588 A \fIrandomsource closure\fR.
589 .TP
590 .B local-key
591 An \fIrsaprivkey closure\fR.
592 The key used to prove our identity to the peer.
593 .TP
594 .B address
595 String.
596 The DNS name of the peer.
597 Optional, but if it is missing then it will not be possible to
598 initiate new connections to the peer.
599 .TP
600 .B port
601 Number.
602 The port to contact the peer.
603 .TP
604 .B key
605 An \fIrsapubkey closure\fR.
606 The key used to verify the peer's identity.
607 .TP
608 .B transform
609 One or more \fItransform closures\fR.
610 Used to protect packets exchanged with the peer. These should
611 all have distinct \fBcapab-num\fR values, and the same \fBcapab-num\fR
612 value should have the same (or a compatible) meaning at both
613 ends. The list should be in order of preference, most preferred
614 first. (The end which sends MSG1,MSG3 ends up choosing; the ordering
615 at the other end is irrelevant.)
616 .TP
617 .B dh
618 A list of one or more \fIdh closure\fRs.
619 The groups to use in key exchange.
620 These should all have distinct
621 .B capab-num
622 values,
623 and the same
624 .B capab-num
625 value should have the same (or a compatible) meaning at both ends.
626 The list should be in order of preference,
627 most preferred first.
628 (The end which sends MSG1,MSG3 ends up choosing;
629 the ordering at the other end is irrelevant.)
630 .TP
631 .B hash
632 The hash function used during setup.
633 .\" TODO clarify what we actually use it for!
634 .TP
635 .B key-lifetime
636 Number.
637 The maximum lifetime of a session key in milliseconds.
638 The default is one hour.
639 .TP
640 .B setup-retries
641 Number.
642 The maximum number of times a key negotiation packet will be
643 transmitted before giving up.
644 The default is 5.
645 .TP
646 .B setup-timeout
647 Number.
648 The time between retransmissions of key negotiation packets, in milliseconds.
649 The default is one second.
650 .TP
651 .B wait-time
652 Number.
653 The time to wait after a failed key setup before making another
654 attempt, in milliseconds.
655 The default is 20s.
656 .TP
657 .B renegotiate-time
658 Number.
659 The time after which a new session key will be negotiated, \fIif\fR
660 there is traffic on the link, in milliseconds.
661 It must not be greater than the \fBkey-lifetime\fR.
662 The default 5 minutes less than the key lifetime, unless the lifetime
663 is less than 10 minutes in which case the default is half the
664 lifetime.
665 .TP
666 .B keepalive
667 Boolean.
668 If \fBtrue\fR then attempt to always maintain a live session key.
669 Not implemented.
670 .TP
671 .B log-events
672 String list.
673 Types of event to log for this site.
674 .RS
675 .TP
676 .B unexpected
677 Unexpected key setup packets (including late retransmissions).
678 .TP
679 .B setup-init
680 Start of attempt to setup a session key.
681 .TP
682 .B setup-timeout
683 Failure of attempt to setup a session key, through timeout.
684 .TP
685 .B activate-key
686 Activation of a new session key.
687 .TP
688 .B timeout-key
689 Deletion of current session key through age.
690 .TP
691 .B security
692 Anything potentially suspicious.
693 .TP
694 .B state-change
695 Steps in the key setup protocol.
696 .TP
697 .B packet-drop
698 Whenever we throw away an outgoing packet.
699 .TP
700 .B dump-packets
701 Every key setup packet we see.
702 .TP
703 .B errors
704 Failure of name resolution, internal errors.
705 .TP
706 .B all
707 Everything (too much!)
708 .RE
709 .PP
710 A \fIsite closure\fR defines one site to communicate with.
711 \fBsecnet\fR expects the (root) key \fBsite\fR to be a list of site
712 closures.
713
714 .SS sysbuffer
715 \fBsysbuffer(\fR[\fISIZE\fR[\fB, \fIOPTIONS\fR]]\fB)\fR => \fIbuffer closure\fR
716 .TP
717 .I SIZE
718 Number.
719 The size of the buffer in bytes.
720 This must be between 64 and 131072.
721 The default is 4096.
722 .TP
723 .I OPTIONS
724 Dictionary.
725 Optional and presently unused.
726 .\" lockdown is accepted but ignored.
727 .PP
728 A \fIbuffer closure\fR is a means of buffering packets to send or that
729 have been received.
730
731 .SS syslog
732 \fBsyslog(\fIDICT\fB)\fR => \fIlog closure\fR
733 .PP
734 Valid keys in the \fIDICT\fR argument are:
735 .TP
736 .B ident
737 String.
738 The ident string to pass to \fBopenlog\fR(3); this value will appear
739 in each message.
740 .TP
741 .B facility
742 String.
743 The facility to log as.
744 The possible values are \fBauthpriv\fR, \fBcron\fR, \fBdaemon\fR,
745 \fBkern\fR, \fBlocal0\fR-\fB7\fR, \fBlpr\fR, \fBmail\fR, \fBnews\fR,
746 \fBsyslog\fR, \fBuser\fR and \fBuucp\fR.
747 .PP
748 See also \fBlogfile\fR above.
749
750 .SS tun
751 \fBtun(\fIDICT\fB)\fR => \fInetlink closure\fR
752 .br
753 \fBtun(\fIDICT\fB)\fR => \fIpure closure\fR
754 .PP
755 Valid keys in the \fIDICT\fR argument are those documented for
756 \fBnull-netlink\fR above, plus:
757 .TP
758 .B flavour
759 String.
760 The type of TUN interface to use.
761 Possible values are \fBlinux\fR, \fBbsd\fR, \fBstreams\fR and \fBguess\fR.
762 The default is \fBguess\fR.
763 .TP
764 .B device
765 String.
766 The path to the TUN/TAP device file.
767 The default is \fI/dev/net/tun\fR for the \fBlinux\fR flavour and
768 \fI/dev/tun\fR for the others.
769 .TP
770 .B interface
771 String.
772 The interface to use.
773 The default is to pick one automatically.
774 This cannot be used with the \fBstreams\fR flavour.
775 .TP
776 .B local-address
777 String.
778 IP address of the host's tunnel interface.
779 .\" README says this belongs to netlink-null but actually it's
780 \" duplicated between slip & tun
781 .TP
782 .B ifconfig-path
783 String.
784 The name of the \fBifconfig\fR command.
785 The default is simply "ifconfig".
786 .TP
787 .B route-path
788 String.
789 The name of the \fBroute\fR command.
790 The default is simply "route".
791 .TP
792 .B ifconfig-type
793 String.
794 The syntax expected by the \fBifconfig\fR command.
795 Possible values are \fBlinux\fR, \fBbsd\fR, \fBioctl\fR,
796 \fBsolaris-2.5\fR and \fBguess\fR.
797 The default is \fBguess\fR.
798 .TP
799 .B route-type
800 String.
801 The syntax expected by the \fBifconfig\fR command.
802 Possible values are \fBlinux\fR, \fBbsd\fR, \fBioctl\fR,
803 \fBsolaris-2.5\fR and \fBguess\fR.
804 The default is \fBguess\fR.
805 .TP
806 .B buffer
807 A \fIbuffer closure\fR to use for packets transferred from the host to secnet.
808 The buffer size must be at least 60 greater than the MTU.
809 .\" TODO rumour has is that buffers are sometimes shareable between
810 .\" netlink devices - document that if the conditions are reasonable
811 .\" ones.
812 .PP
813 The \fBifconfig-type\fR and \fBroute-type\fR values determine how
814 those commands are executed.
815 If they are set to \fBioctl\fR then low-level system calls are used
816 directly instead of invoking the commands.
817 .PP
818 The netlink created by \fBtun\fR uses the \fBtun\fR device to
819 communicate with the host kernel.
820
821 .SS udp
822 \fBudp(\fIDICT\fB)\fR => \fIcomm closure\fR
823 .PP
824 Valid keys in the \fIDICT\fR argument are:
825 .TP
826 .B address
827 String.
828 The IP address to bind on.
829 The default is 0.0.0.0, i.e. "any".
830 .TP
831 .B port
832 Number.
833 The port number to bind to.
834 The default is 0, i.e. the OS will choose one.
835 It is suggested that any given VPN agree a common port number.
836 .TP
837 .B buffer
838 A \fIbuffer closure\fR.
839 See the \fBsysbuffer\fR closure above.
840 .TP
841 .B authbind
842 String.
843 The path to a helper program to bind the socket.
844 Optional.
845 .IP
846 The program will be invoked with the address and port number as its
847 arguments, and with the socket to bind as file descriptor 0.
848 It should either bind the socket as requested, or exit with nonzero
849 status.
850 .PP
851 A \fIcomm closure\fR is a means of sending and receiving messages via
852 a network.
853 It does not provide confidentiality, reliablity or availability.
854
855 .SS userv-ipif
856 \fBuserv-ipif(\fIDICT\fB)\fR => \fInetlink closure\fR
857 .br
858 \fBuserv-ipif(\fIDICT\fB)\fR => \fIpure closure\fR
859 .PP
860 Valid keys in the \fIDICT\fR argument are those documented for
861 \fBnull-netlink\fR above, plus:
862 .TP
863 .B local-address
864 String.
865 IP address of the host's SLIP interface.
866 .\" README says this belongs to netlink-null but actually it's
867 \" duplicated between SLIP & tun
868 .TP
869 .B userv-path
870 String.
871 Where to find \fBuserv\fR(1).
872 The default is \fB"userv"\fR.
873 .TP
874 .B service-user
875 String.
876 The name of the user that owns the service.
877 The default is \fB"root"\fR.
878 .TP
879 .B service-name
880 String.
881 The name of the service to request.
882 The default is \fB"ipif"\fR.
883 .TP
884 .B buffer
885 A \fIbuffer closure\fR to use for packets transferred from the host to secnet.
886 .PP
887 The netlink created by \fBuserv-ipif\fR invokes the specified \fBuserv\fR service with pipes connected to its standard input and output.
888 It uses SLIP to communicate with the host kernel via these pipes.
889
890 .SH FILES
891 .TP
892 .I /etc/secnet/secnet.conf
893 Configuration file.
894
895 .SH "SEE ALSO"
896 \fBuserv\fR(1)