chiark / gitweb /
server: Repurpose the flags in `peerspec'.
[tripe] / server / tripe-admin.5.in
1 .\" -*-nroff-*-
2 .\".
3 .\" Manual for the administration protocol
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 ../common/defs.man \" @@@PRE@@@
28 .
29 .\"--------------------------------------------------------------------------
30 .TH tripe-admin 5 "18 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
31 .
32 .\"--------------------------------------------------------------------------
33 .SH "NAME"
34 .
35 tripe-admin \- administrator commands for TrIPE
36 .
37 .\"--------------------------------------------------------------------------
38 .SH "DESCRIPTION"
39 .
40 This manual page describes the administration interface provided by the
41 .BR tripe (8)
42 daemon.
43 .PP
44 The
45 .BR tripectl (8)
46 program can be used either interactively or in scripts to communicate
47 with the server using this interface.  Alternatively, simple custom
48 clients can be written in scripting languages such as Perl, Python or
49 Tcl, or more advanced clients such as GUI monitors can be written in C
50 with little difficulty.
51 .PP
52 Administration commands use a textual protocol.  Each client command or
53 server response consists of a line of ASCII text terminated by a single
54 linefeed character.  No command may be longer than 255 characters.
55 .SS "General structure"
56 Each command or response line consists of a sequence of
57 whitespace-separated tokens.  The number and nature of whitespace
58 characters separating two tokens in a client command is not significant;
59 the server always uses a single space character.  The first token in a
60 line is a
61 .I keyword
62 identifying the type of command or response contained.  Keywords in
63 client commands are not case-sensitive; the server always uses uppercase
64 for its keywords.
65 .PP
66 In order to allow tokens to contain internal whitespace, a quoting
67 mechanism is provided.  Whitespace within matched pairs of quotes \(en
68 either single
69 .RB ` ' '
70 or double
71 .RB ` """" '
72 \(en is considered to be internal.  Any character (other than newline)
73 may be escaped by preceding it with a backslash
74 .RB ` \e ':
75 in particular, this can be used to include quote characters.  It is
76 impossible for a token to contain a newline character.
77 .PP
78 On output, the server will use double quotes when necessary.
79 .SS "Simple commands"
80 For simple client command, the server responds with zero or more
81 .B INFO
82 lines, followed by either an
83 .B OK
84 line or a
85 .B FAIL
86 line.  Each
87 .B INFO
88 provides information requested in the command.  An
89 .B OK
90 response contains no further data.  A
91 .B FAIL
92 code is followed by a machine-readable explanation of why the command
93 failed.
94 .PP
95 Simple command processing is strictly synchronous: the server reads a
96 command, processes it, and responds, before reading the next command.
97 All commands can be run as simple commands.  Long-running commands
98 (e.g.,
99 .B ADD
100 and
101 .BR PING )
102 block the client until they finish, but the rest of the server continues
103 running.  See
104 .B "Background commands"
105 to find out how to issue long-running commands without blocking.
106 .SS "Asynchronous broadcasts"
107 There are three types of asynchronous broadcast messages which aren't
108 associated with any particular command.  Clients can select which
109 broadcast messages they're interested in using the
110 .B WATCH
111 command.
112 .PP
113 The
114 .B WARN
115 message contains a machine-readable message warning of an error
116 encountered while processing a command, unexpected or unusual behaviour
117 by a peer, or a possible attack by an adversary.  Under normal
118 conditions, the server shouldn't emit any warnings.
119 .PP
120 The
121 .B TRACE
122 message contains a human-readable tracing message containing diagnostic
123 information.  Trace messages are controlled using the
124 .B \-T
125 command-line option to the server, or the
126 .B TRACE
127 administration command (see below).  Support for tracing can be disabled
128 when the package is being configured, and may not be available in your
129 version.
130 .PP
131 Finally, the
132 .B NOTE
133 message is a machine-readable notification about some routine but
134 interesting event such as creation or destruction of peers.
135 .SS "Background commands"
136 Some commands (e.g.,
137 .B ADD
138 and
139 .BR PING )
140 take a long time to complete.  To prevent these long-running commands
141 from tying up a server connection, they can be run in the background.
142 Not all commands can be run like this: the ones that can provide a
143 .B \-background
144 option, which must be supplied with a
145 .IR tag .
146 .PP
147 A command may fail before it starts running in the background.  In this
148 case, the server emits a
149 .B FAIL
150 response, as usual.  To indicate that a command has started running in
151 the background, the server emits a response of the form
152 .BI "BGDETACH " tag \fR,
153 where
154 .I tag
155 is the value passed to the
156 .B \-background
157 option.  From this point on, the server is ready to process more
158 commands and reply to them.
159 .PP
160 Responses to background commands are indicated by a line beginning with
161 one of the tokens
162 .BR BGOK ,
163 .BR BGFAIL ,
164 or
165 .BR BGINFO ,
166 followed by the command tag.  These correspond to the
167 .BR OK ,
168 .BR FAIL ,
169 and
170 .B INFO
171 responses for simple commands:
172 .B BGINFO
173 indicates information from a background command which has not completed
174 yet; and
175 .B BGOK
176 and
177 .B BGFAIL
178 indicates that a background command succeeded or failed, respectively.
179 .PP
180 A background command will never issue an
181 .B OK
182 or
183 .B INFO
184 response: it will always detach and then issue any
185 .B BGINFO
186 lines followed by
187 .B BGOK
188 response.
189 .SS "Client-provided services"
190 .\"* 25 Service-related messages
191 An administration client can provide services to other clients.
192 Services are given names and versions.  A client can attempt to
193 .I claim
194 a particular service by issuing the
195 .B SVCCLAIM
196 command.  This may fail, for example, if some other client already
197 provides the same or later version of the service.
198 .PP
199 Other clients can issue
200 .I "service commands"
201 using the
202 .B "SVCSUBMIT"
203 command; the service provider is expected to handle these commands and
204 reply to them.
205 .PP
206 There are three important asynchronous messages which will be sent to
207 service providers.
208 .SP
209 .BI "SVCCANCEL " jobid
210 The named job has been cancelled, either because the issuing client has
211 disconnected or explicitly cancelled the job using the
212 .B BGCANCEL
213 command.
214 .SP
215 .BI "SVCCLAIM " service " " version
216 Another client has claimed a later version of the named
217 .IR service .
218 The recipient is no longer the provider of this service.
219 .SP
220 .BI "SVCJOB " jobid " " service " " command " " args \fR...
221 Announces the arrival of a new job.  The
222 .I jobid
223 is a simple token consisting of alphanumeric characters which
224 .B tripe
225 uses to identify this job.
226 .PP
227 The service provider can reply to the job using the commands
228 .BR SVCINFO ,
229 .B SVCOK
230 and
231 .BR SVCFAIL .
232 The first of these sends an
233 .B INFO
234 response and leaves the job active; the other two send an
235 .B OK
236 or
237 .B FAIL
238 response respectively, and mark the job as being complete.
239 .PP
240 (Since
241 .B SVCSUBMIT
242 is a potentially long-running command, it can be run in the background.
243 This detail is hidden from service providers:
244 .B tripe
245 will issue the corresponding
246 .BR BG ...
247 responses when appropriate.)
248 .SS "Network addresses"
249 A network address is a sequence of tokens.  The first is a token
250 identifying the network address family.  The length of an address and
251 the meanings of the subsequent tokens depend on the address family.
252 Address family tokens are not case-sensitive on input; on output, they
253 are always in upper-case.
254 .PP
255 At present, only one address family is understood.
256 .TP
257 .BI "INET " address " \fR[" port \fR]
258 An Internet socket, naming an IPv4 address and UDP port.  On output, the
259 address is always in numeric dotted-quad form, and the port is given as
260 a plain number.  On input, DNS hostnames and symbolic port names are
261 permitted; if omitted, the default port 4070 is used.  Name resolution
262 does not block the main server, but will block the requesting client,
263 unless the command is run in the background.
264 .PP
265 If, on input, no recognized address family token is found, the following
266 tokens are assumed to represent an
267 .B INET
268 address.  Addresses output by the server always have an address family
269 token.
270 .SS "Key-value output"
271 Some commands (e.g.,
272 .B STATS
273 and
274 .BR SERVINFO )
275 produce output in the form of
276 .IB key = value
277 pairs, one per token.  Neither the
278 .I key
279 nor the
280 .I value
281 contain spaces.
282 .SS "Trace lists"
283 Commands which enable or disable kinds of output (e.g.,
284 .B TRACE
285 and
286 .BR WATCH )
287 work in similar ways.  They take a single optional argument, which
288 consists of a string of letters selecting message types, optionally
289 interspersed with
290 .RB ` + '
291 to enable, or
292 .RB ` \- '
293 to disable, the subsequently listed types.
294 .PP
295 If the argument is omitted, the available message types are displayed,
296 one to an
297 .B INFO
298 line, in a fixed-column format.  Column zero contains the key letter for
299 selecting that message type; column one contains either a space or a
300 .RB ` + '
301 sign, if the message type is disabled or enabled respectively; and a
302 textual description of the message type begins at column 3 and continues
303 to the end of the line.
304 .PP
305 Lowercase key letters control individual message types.  Uppercase key
306 letters control collections of message types.
307 .
308 .\"--------------------------------------------------------------------------
309 .SH "COMMAND REFERENCE"
310 .
311 .\"* 10 Commands
312 The commands provided are:
313 .SP
314 .BI "ADD \fR[" options "\fR] " peer " " address "\fR..."
315 Adds a new peer.  The peer is given the name
316 .IR peer ;
317 the peer's public key is assumed to be in the file
318 .B keyring.pub
319 (or whatever alternative file was specified in the
320 .B \-K
321 option on the command line).  The
322 .I address
323 is the network address (see above for the format) at which the peer can
324 be contacted.  The following options are recognized.
325 .RS
326 .\"+opts
327 .TP
328 .BI "\-background " tag
329 Run the command in the background, using the given
330 .IR tag .
331 .TP
332 .B "\-cork"
333 Don't send an immediate challenge to the peer; instead, wait until it
334 sends us something before responding.
335 .TP
336 .BI "\-keepalive " time
337 Send a no-op packet if we've not sent a packet to the peer in the last
338 .I time
339 interval.  This is useful for persuading port-translating firewalls to
340 believe that the `connection' is still active.  The
341 .I time
342 is expressed as a nonnegative integer followed optionally by
343 .BR d ,
344 .BR h ,
345 .BR m ,
346 or
347 .BR s
348 for days, hours, minutes, or seconds respectively; if no suffix is
349 given, seconds are assumed.
350 .TP
351 .BI "\-key " tag
352 Use the public key
353 .I tag
354 to authenticate the peer.  The default is to use the key tagged
355 .IR peer .
356 .TP
357 .BI "\-tunnel " tunnel
358 Use the named tunnel driver, rather than the default.
359 .\"-opts
360 .RE
361 .SP
362 .BI "ADDR " peer
363 Emits an
364 .B INFO
365 line reporting the IP address and port number stored for
366 .IR peer .
367 .SP
368 .B "ALGS"
369 Emits information about the cryptographic algorithms in use, in
370 key-value form.  The keys are as follows.
371 .RS
372 .TP
373 .B kx-group
374 Type of key-exchange group in use, currently either
375 .B ec
376 or
377 .BR prime .
378 .TP
379 .B kx-group-order-bits
380 Length of the group order, in bits.  This gives an approximate measure
381 of the group strength.
382 .TP
383 .B kx-group-elt-bits
384 Length of a group element, in bits.  This may be useful when analyzing
385 protocol traces.
386 .TP
387 .B hash
388 The hash function in use, e.g.,
389 .BR sha256 .
390 .TP
391 .B mgf
392 The mask-generating function in use, e.g.,
393 .BR whirlpool-mgf .
394 .TP
395 .B hashsz
396 The size of the hash function's output, in octets.
397 .TP
398 .B cipher
399 The name of the bulk data cipher in use, e.g.,
400 .BR blowfish-cbc .
401 .TP
402 .B cipher-keysz
403 The length of key used by the bulk data cipher, in octets.
404 .TP
405 .B cipher-blksz
406 The block size of the bulk data cipher, or zero if it's not based on a
407 block cipher.
408 .TP
409 .B cipher-data-limit
410 The maximum amount of data to be encrypted using a single key.  (A new
411 key exchange is instigated well before the limit is reached, in order to
412 allow for a seamless changeover of keys.)
413 .TP
414 .B mac
415 The message authentication algorithm in use, e.g.,
416 .BR ripemd160-hmac ..
417 .TP
418 .B mac-keysz
419 The length of the key used by the message authentication algorithm, in
420 octets.
421 .TP
422 .B mac-tagsz
423 The length of the message authentication tag, in octets.
424 .PP
425 The various sizes are useful, for example, when computing the MTU for a
426 tunnel interface.  If
427 .I MTU
428 is the MTU of the path to the peer, then the tunnel MTU should be
429 .IP
430 .I MTU
431 \- 33 \-
432 .I cipher-blksz
433 \-
434 .I mac-tagsz
435 .PP
436 allowing 20 bytes of IP header, 8 bytes of UDP header, a packet type
437 octet, a four-octet sequence number, an IV, and a MAC tag.
438 .RE
439 .SP
440 .BI "BGCANCEL " tag
441 Cancels the background job with the named
442 .IR tag .
443 .SP
444 .BI "CHECKCHAL " challenge
445 Verifies a challenge as being one earlier issued by
446 .B GETCHAL
447 and not previously either passed to
448 .B CHECKCHAL
449 or in a greeting message.
450 .SP
451 .B "DAEMON"
452 Causes the server to disassociate itself from its terminal and become a
453 background task.  This only works once.  A warning is issued.
454 .SP
455 .BI "EPING \fR[" options "\fR] " peer
456 Sends an encrypted ping to the peer, and expects an encrypted response.
457 This checks that the peer is running (and not being impersonated), and
458 that it can encrypt and decrypt packets correctly.  Options and
459 responses are the same as for the
460 .B PING
461 command.
462 .SP
463 .BI "FORCEKX " peer
464 Requests the server to begin a new key exchange with
465 .I peer
466 immediately.
467 .SP
468 .B "GETCHAL"
469 Requests a challenge.  The challenge is returned in an
470 .B INFO
471 line, as a base64-encoded string.  See
472 .BR CHECKCHAL .
473 .SP
474 .BI "GREET " peer " " challenge
475 Sends a greeting packet containing the
476 .I challenge
477 (base-64 encoded) to the named
478 .IR peer .
479 The expectation is that this will cause the peer to recognize us and
480 begin a key-exchange.
481 .SP
482 .B "HELP"
483 Causes the server to emit an
484 .B INFO
485 line for each command it supports.  Each line lists the command name,
486 followed by the names of the arguments.  This may be helpful as a memory
487 aid for interactive use, or for program clients probing for features.
488 .SP
489 .BI "IFNAME " peer
490 Emits an
491 .B INFO
492 line containing the name of the network interface used to collect IP
493 packets which are to be encrypted and sent to
494 .IR peer .
495 Used by configuration scripts so that they can set up routing tables
496 appropriately after adding new peers.
497 .SP
498 .B "JOBS"
499 Emits an
500 .B INFO
501 line giving the tag for each outstanding background job.
502 .SP
503 .BI "KILL " peer
504 Causes the server to forget all about
505 .IR peer .
506 All keys are destroyed, and no more packets are sent.  No notification
507 is sent to the peer: if it's important that the peer be notified, you
508 must think of a way to do that yourself.
509 .SP
510 .B "LIST"
511 For each currently-known peer, an
512 .B INFO
513 line is written containing the peer's name, as given to
514 .BR ADD .
515 .SP
516 .BI "NOTIFY " tokens\fR...
517 Issues a
518 .B USER
519 notification to all interested administration clients.
520 .SP
521 .BI "PEERINFO " peer
522 Returns information about a peer, in key-value form.  The following keys
523 are returned.
524 .RS
525 .TP
526 .B tunnel
527 The tunnel driver used for this peer.
528 .TP
529 .B keepalive
530 The keepalive interval, in seconds, or zero if no keepalives are to be
531 sent.
532 .TP
533 .B key
534 The key tag being used for the peer, as passed to the
535 .B ADD
536 command.  (You don't get a full key-id, since that might change while
537 the daemon's running.)
538 .RE
539 .SP
540 .BI "PING \fR[" options "\fR] " peer
541 Send a transport-level ping to the peer.  The ping and its response are
542 not encrypted or authenticated.  This command, possibly in conjunction
543 with tracing, is useful for ensuring that UDP packets are actually
544 flowing in both directions.  See also the
545 .B EPING
546 command.
547 .IP
548 An
549 .B INFO
550 line is printed describing the outcome:
551 .RS
552 .TP
553 .BI "ping-ok " millis
554 A response was received
555 .I millis
556 after the ping was sent.
557 .TP
558 .BI "ping-timeout"
559 No response was received within the time allowed.
560 .TP
561 .BI "ping-peer-died"
562 The peer was killed (probably by another admin connection) before a
563 response was received.
564 .RE
565 .IP
566 Options recognized for this command are:
567 .RS
568 .\"+opts
569 .TP
570 .BI "\-background " tag
571 Run the command in the background, using the given
572 .IR tag .
573 .TP
574 .BI "\-timeout " time
575 Wait for
576 .I time
577 seconds before giving up on a response.  The default is 5 seconds.  The
578 .I time
579 is expressed as a nonnegative integer followed optionally by
580 .BR d ,
581 .BR h ,
582 .BR m ,
583 or
584 .BR s
585 for days, hours, minutes, or seconds respectively; if no suffix is
586 given, seconds are assumed.
587 .\"-opts
588 .RE
589 .SP
590 .B "PORT"
591 Emits an
592 .B INFO
593 line containing just the number of the UDP port used by the
594 .B tripe
595 server.  If you've allowed your server to allocate a port dynamically,
596 this is how to find out which one it chose.
597 .SP
598 .B "RELOAD"
599 Instructs the server to recheck its keyring files.  The server checks
600 these periodically anyway but it may be necessary to force a recheck,
601 for example after adding a new peer key.
602 .SP
603 .B "QUIT"
604 Instructs the server to exit immediately.  A warning is sent.
605 .SP
606 .B "SERVINFO"
607 Returns information about the server, in the form of key-value pairs.
608 The following keys are used.
609 .RS
610 .TP
611 .B implementation
612 A keyword naming the implementation of the
613 .BR tripe (8)
614 server.  The current implementation is called
615 .BR edgeware-tripe .
616 .TP
617 .B version
618 The server's version number, as reported by
619 .BR VERSION .
620 .TP
621 .B daemon
622 Either
623 .B t
624 or
625 .BR nil ,
626 if the server has or hasn't (respectively) become a daemon.
627 .RE
628 .SP
629 .BI "SETIFNAME " peer " " new-name
630 Informs the server that the
631 .IR peer 's
632 tunnel-interface name has been changed to
633 .IR new-name .
634 This is useful if firewalling decisions are made based on interface
635 names: a setup script for a particular peer can change the name, and
636 then update the server's records so that they're accurate.
637 .SP
638 .BI "SVCCLAIM " service " " version
639 Attempts to claim the named
640 .IR service ,
641 offering the given
642 .IR version .
643 The claim is successful if the service is currently unclaimed, or if
644 a version earlier than
645 .I version
646 is provided; otherwise the command fails with the error
647 .BR "service-exists" .
648 .SP
649 .BI "SVCENSURE " service " \fR[" version \fR]
650 Ensure that
651 .I service
652 is provided, and (if specified) to at least the given
653 .IR version .
654 An error is reported if these conditions are not met; otherwise the
655 command succeeds silently.
656 .SP
657 .BI "SVCFAIL " jobid " " tokens \fR...
658 Send a
659 .B FAIL
660 (or
661 .BR BGFAIL )
662 response to the service job with the given
663 .IR jobid ,
664 passing the
665 .I tokens
666 as the reason for failure.  The job is closed.
667 .SP
668 .BI "SVCINFO " jobid " " tokens \fR...
669 Send an
670 .B INFO
671 (or
672 .BR BGINFO )
673 response to the service job with the given
674 .IR jobid ,
675 passing the
676 .I tokens
677 as the info message.  The job remains open.
678 .SP
679 .B "SVCLIST"
680 Output a line of the form
681 .RS
682 .IP
683 .B INFO
684 .I service
685 .I version
686 .PP
687 for each service currently provided.
688 .RE
689 .SP
690 .BI "SVCOK " jobid
691 Send an
692 .B OK
693 (or
694 .BR BGINFO )
695 response to the service job with the given
696 .IR jobid .
697 The job is closed.
698 .SP
699 .BI "SVCQUERY " service
700 Emits a number of
701 .B info
702 lines in key-value format, describing the named
703 .IR service.
704 The following keys are used.
705 .RS
706 .TP
707 .B name
708 The service's name.
709 .TP
710 .B version
711 The service's version string.
712 .RE
713 .SP
714 .BI "SVCRELEASE " service
715 Announce that the client no longer wishes to provide the named
716 .IR service .
717 .SP
718 .BI "SVCSUBMIT \fR[" options "\fR] " service " " command " " arguments \fR...
719 Submit a job to the provider of the given
720 .IR service ,
721 passing it the named
722 .I command
723 and the given
724 .IR arguments .
725 The following options are accepted.
726 .RS
727 .\"+opts
728 .TP
729 .BI "\-background " tag
730 Run the command in the background, using the given
731 .IR tag .
732 .TP
733 .BI "\-version " version
734 Ensure that at least the given
735 .I version
736 of the service is available before submitting the job.
737 .RE
738 .\"-opts
739 .SP
740 .BI "STATS " peer
741 Emits a number of
742 .B INFO
743 lines, each containing one or more statistics in the form
744 .IB name = value \fR.
745 The statistics-gathering is experimental and subject to change.
746 .SP
747 .BR "TRACE " [\fIoptions\fP]
748 Selects trace outputs: see
749 .B "Trace lists"
750 above.  Message types provided are:
751 .RS
752 .PP
753 Currently, the following tracing options are supported:
754 .TP
755 .B t
756 Tunnel events: reception of packets to be encrypted, and injection of
757 successfully-decrypted packets.
758 .TP
759 .B r
760 Peer management events: creation and destruction of peer attachments,
761 and arrival of messages.
762 .TP
763 .B a
764 Administration interface: acceptance of new connections, and handling of
765 the backgroud name-resolution required by the
766 .B ADD
767 command.
768 .TP
769 .B s
770 Handling of symmetric keysets: creation and expiry of keysets, and
771 encryption and decryption of messages.
772 .TP
773 .B x
774 Key exchange: reception, parsing and emission of key exchange messages.
775 .TP
776 .B m
777 Key management: loading keys and checking for file modifications.
778 .TP
779 .B l
780 Display information about challenge issuing and verification.
781 .TP
782 .B p
783 Display contents of packets sent and received by the tunnel and/or peer
784 modules.
785 .TP
786 .B c
787 Display inputs, outputs and intermediate results of cryptographic
788 operations.  This includes plaintext and key material.  Use with
789 caution.
790 .TP
791 .B A
792 All of the above.
793 .PP
794 Note that the
795 .B p
796 (packet contents)
797 and
798 .B c
799 (crypto details)
800 outputs provide extra detail for other outputs.  Specifying
801 .B p
802 without
803 .BR r
804 or
805 .B t
806 isn't useful; neither is specifying
807 .B c
808 without one of
809 .BR s ,
810 .BR l ,
811 .B x
812 or
813 .BR m .
814 .RE
815 .SP
816 .B "TUNNELS"
817 For each available tunnel driver, an
818 .B INFO
819 line is printed giving its name.
820 .SP
821 .B "VERSION"
822 Causes the server to emit an
823 .B INFO
824 line stating its software version, as two tokens: the server name, and
825 its version string.  The server name
826 .B tripe
827 is reserved to the Straylight/Edgeware implementation.
828 .SP
829 .BR "WATCH " [\fIoptions\fP]
830 Enables or disables asynchronous broadcasts
831 .IR "for the current connection only" .
832 See
833 .B "Trace lists"
834 above.  The default watch state for the connection the server opens
835 automatically on stdin/stdout is to show warnings and trace messages;
836 other connections show no asynchronous broadcast messages.  (This is
837 done in order to guarantee that a program reading the server's stdout
838 does not miss any warnings.)
839 .RS
840 .PP
841 Message types provided are:
842 .TP
843 .B t
844 .B TRACE
845 messages.
846 .TP
847 .B n
848 .B NOTE
849 messages.
850 .TP
851 .B w
852 .B WARN
853 messages.
854 .TP
855 .B A
856 All of the above.
857 .RE
858 .SP
859 .BI "WARN " tokens\fR...
860 Issues a
861 .B USER
862 warning to all interested administration clients.
863 .
864 .\"--------------------------------------------------------------------------
865 .SH "ERROR MESSAGES"
866 .
867 .\"* 20 Error messages (FAIL codes)
868 The following
869 .B FAIL
870 (or
871 .BR BGFAIL )
872 messages are sent to clients as a result of errors during command
873 processing.
874 .SP
875 .BI "already-daemon"
876 (For
877 .BR DAEMON .)
878 The
879 .B tripe
880 server is already running as a daemon.
881 .SP
882 .BI "bad-addr-syntax " message
883 (For commands accepting socket addresses.)  The address couldn't be
884 understood.
885 .SP
886 .BI "bad-syntax " cmd " " message
887 (For any command.)  The command couldn't be understood: e.g., the number
888 of arguments was wrong.
889 .SP
890 .BI "bad-time-spec " token
891 The
892 .I token
893 is not a valid time interval specification.  Acceptable time
894 specifications are nonnegative integers followed optionally by
895 .BR d ,
896 .BR h ,
897 .BR m ,
898 or
899 .BR s ,
900 for days, hours, minutes, or seconds, respectively.
901 .SP
902 .BI "bad-trace-option " char
903 (For
904 .BR TRACE .)
905 An unknown trace option was requested.
906 .SP
907 .BI "bad-watch-option " char
908 (For
909 .BR WATCH .)
910 An unknown watch option was requested.
911 .SP
912 .BI "daemon-error " ecode " " message
913 (For
914 .BR DAEMON .)
915 An error occurred during the attempt to become a daemon, as reported by
916 .IR message .
917 .SP
918 .BI "invalid-port " number
919 (For
920 .BR ADD .)
921 The given port number is out of range.
922 .SP
923 .BI "not-service-provider " service
924 (For
925 .BR SVCRELEASE .)
926 The invoking client is not the current provider of the named
927 .IR service ,
928 and is therefore not allowed to release it.
929 .SP
930 .BI "peer-create-fail " peer
931 (For
932 .BR ADD .)
933 Adding
934 .I peer
935 failed for some reason.  A warning should have been emitted explaining
936 why.
937 .SP
938 .BI "peer-addr-exists " address\fR...
939 (For
940 .BR ADD .)
941 There is already a peer with the given
942 .IR address .
943 .SP
944 .BI "peer-exists " peer
945 (For
946 .BR ADD .)
947 There is already a peer named
948 .IR peer .
949 .SP
950 .B "ping-send-failed"
951 The attempt to send a ping packet failed, probably due to lack of
952 encryption keys.
953 .SP
954 .BI "resolve-error " hostname
955 (For
956 .BR ADD .)
957 The DNS name
958 .I hostname
959 could not be resolved.
960 .SP
961 .BI "resolver-timeout " hostname
962 (For
963 .BR ADD .)
964 The DNS name
965 .I hostname
966 took too long to resolve.
967 .SP
968 .BI "service-exists " service " " version
969 (For
970 .BR SVCCLAIM .)
971 Another client is already providing the stated
972 .I version
973 of the
974 .IR service .
975 .SP
976 .BI "service-too-old " service " " version
977 (For
978 .B SVCENSURE
979 and
980 .BR SVCSUBMIT .)
981 Only the given
982 .I version
983 of the requested
984 .I service
985 is available, which does not meet the stated requirements.
986 .SP
987 .BI "tag-exists " tag
988 (For long-running commands.)  The named
989 .I tag
990 is already the tag of an outstanding job.
991 .SP
992 .BI "unknown-command " token
993 The command
994 .I token
995 was not recognized.
996 .SP
997 .BI "unknown-jobid " jobid
998 (For
999 .BR SVCOK ,
1000 .BR SVCFAIL ,
1001 and
1002 .BR SVCINFO .)
1003 The token
1004 .I jobid
1005 is not recognized as identifying an outstanding job.  It may have just
1006 been cancelled.
1007 .SP
1008 .BI "unknown-peer " name
1009 (For
1010 .BR ADDR ,
1011 .BR IFNAME ,
1012 .BR KILL ,
1013 .BR SETIFNAME ,
1014 and
1015 .BR STATS .)
1016 There is no peer called
1017 .IR name .
1018 .SP
1019 .BI "unknown-port " port
1020 (For
1021 .BR ADD .)
1022 The port name
1023 .I port
1024 couldn't be found in
1025 .BR /etc/services .
1026 .TP
1027 .BI "unknown-service " service
1028 (For
1029 .BR SVCENSURE ,
1030 .BR SVCQUERY ,
1031 .BR SVCRELEASE ,
1032 and
1033 .BR SVCSUBMIT .)
1034 The token
1035 .I service
1036 is not recognized as the name of a client-provided service.
1037 .TP
1038 .BI "unknown-tag " tag
1039 (For
1040 .BR BGCANCEL .)
1041 The given
1042 .I tag
1043 is not the tag for any outstanding background job.  It may have just
1044 finished.
1045 .
1046 .\"--------------------------------------------------------------------------
1047 .SH "NOTIFICATIONS"
1048 .
1049 .\"* 30 Notification broadcasts (NOTE codes)
1050 The following notifications are sent to clients who request them.
1051 .SP
1052 .BI "ADD " peer " " ifname " " address \fR...
1053 A new peer has been added.  The peer's name is
1054 .IR peer ,
1055 its tunnel is network interface
1056 .IR ifname ,
1057 and its network address is
1058 .IR address .
1059 .SP
1060 .BI "DAEMON"
1061 The server has forked off into the sunset and become a daemon.
1062 .SP
1063 .BI "GREET " challenge " " address \fR...
1064 A valid greeting was received, with the given challenge (exactly as it
1065 was returned by
1066 .B GETCHAL
1067 earlier).
1068 .SP
1069 .BI "KILL " peer
1070 The peer
1071 .I peer
1072 has been killed.
1073 .SP
1074 .BI "KXDONE " peer
1075 Key exchange with
1076 .I peer
1077 finished successfully.
1078 .SP
1079 .BI "KXSTART " peer
1080 Key exchange with
1081 .I peer
1082 has begun or restarted.  If key exchange keeps failing, this message
1083 will be repeated periodically.
1084 .SP
1085 .BI "NEWIFNAME " peer " " old-name " " new-name
1086 The given
1087 .IR peer 's
1088 tunnel interface name has been changed from
1089 .I old-name
1090 to
1091 .IR new-name ,
1092 as a result of a
1093 .B SETIFNAME
1094 command.
1095 .SP
1096 .BI "SVCCLAIM " service " " version
1097 The named
1098 .I service
1099 is now available, at the stated
1100 .IR version .
1101 .SP
1102 .BI "SVCRELEASE " service
1103 The named
1104 .I service
1105 is no longer available.
1106 .SP
1107 .BI "USER " tokens\fR...
1108 An administration client issued a notification using the
1109 .B NOTIFY
1110 command.
1111 .
1112 .\"--------------------------------------------------------------------------
1113 .SH "WARNINGS"
1114 .
1115 .\"* 40 Warning broadcasts (WARN codes)
1116 .\"+sep
1117 There are many possible warnings.  They are categorized according to
1118 their first tokens.
1119 .PP
1120 Many of these warnings report system errors.  These are reported as a
1121 pair of tokens, described below as
1122 .I ecode
1123 and
1124 .IR message .
1125 The
1126 .I ecode
1127 is a string of the form
1128 .BI E number
1129 giving the
1130 .BR errno (3)
1131 value of the error; the
1132 .I message
1133 is the `human-readable' form of the message, as reported by
1134 .BR strerror (3).
1135 .SS "ABORT warnings"
1136 These all indicate that the
1137 .B tripe
1138 server has become unable to continue.  If enabled, the server will dump
1139 core in its configuration directory.
1140 .SP
1141 .BI "ABORT repeated-select-errors"
1142 The main event loop is repeatedly failing.  If the server doesn't quit,
1143 it will probably waste all available CPU doing nothing.
1144 .SS "ADMIN warnings"
1145 These indicate a problem with the administration socket interface.
1146 .SP
1147 .BI "ADMIN accept-error " ecode " " message
1148 There was an error while attempting to accept a connection from a new
1149 client.
1150 .SP
1151 .BI "ADMIN client-write-error " ecode " " message
1152 There was an error sending data to a client.  The connection to the
1153 client has been closed.
1154 .SS "CHAL warnings"
1155 These indicate errors in challenges, either in the
1156 .B CHECKCHAL
1157 command or in greeting packets.
1158 .SP
1159 .B "CHAL impossible-challenge"
1160 The server hasn't issued any challenges yet.  Quite how anyone else
1161 thought he could make one up is hard to imagine.
1162 .SP
1163 .B "CHAL incorrect-tag"
1164 Challenge received contained the wrong authentication data.  It might be
1165 very stale, or a forgery.
1166 .SP
1167 .B "CHAL invalid-challenge"
1168 Challenge received was the wrong length.  We might have changed MAC
1169 algorithms since the challenge was issued, or it might just be rubbish.
1170 .SP
1171 .B "CHAL replay duplicated-sequence"
1172 Challenge received was a definite replay of an old challenge.  Someone's
1173 up to something!
1174 .SP
1175 .B "CHAL replay old-sequence"
1176 Challenge received was old, but maybe not actually a replay.  Try again.
1177 .SS "KEYMGMT warnings"
1178 These indicate a problem with the keyring files, or the keys stored in
1179 them.
1180 .SP
1181 .BI "KEYMGMT bad-private-key " message
1182 The private key could not be read, or failed a consistency check.  If
1183 there was a problem with the file, usually there will have been
1184 .B key-file-error
1185 warnings before this.
1186 .SP
1187 .BI "KEYMGMT bad-public-keyring " message
1188 The public keyring couldn't be read.  Usually, there will have been
1189 .B key-file-error
1190 warnings before this.
1191 .SP
1192 .BI "KEYMGMT key-file-error " file ":" line " " message
1193 Reports a specific error with the named keyring file.  This probably
1194 indicates a bug in
1195 .BR key (1).
1196 .SP
1197 .BI "KEYMGMT public-key " tag " " tokens\fR...
1198 These messages all indicate a problem with the public key named
1199 .IR tag .
1200 .SP
1201 .BI "KEYMGMT public-key " tag " algorithm-mismatch"
1202 The algorithms specified on the public key don't match the ones for our
1203 private key.  All the peers in a network have to use the same
1204 algorithms.
1205 .SP
1206 .BI "KEYMGMT public-key " tag " bad " message
1207 The public key couldn't be read, or is invalid.
1208 .SP
1209 .BI "KEYMGMT public-key " tag " bad-public-group-element"
1210 The public key is invalid.  This may indicate a malicious attempt to
1211 introduce a bogus key.
1212 .SP
1213 .BI "KEYMGMT public-key " tag " bad-algorithm-selection"
1214 The algorithms listed on the public key couldn't be understood.  The
1215 algorithm selection attributes are probably malformed and need fixing.
1216 .SP
1217 .BI "KEYMGMT public-key " tag " incorrect-group"
1218 The public key doesn't use the same group as our private key.  All the
1219 peers in a network have to use the same group.
1220 .SP
1221 .BI "KEYMGMT public-key " tag " not-found"
1222 The public key for peer
1223 .I tag
1224 wasn't in the public keyring.
1225 .SP
1226 .BI "KEYMGMT public-key " tag " unknown-type"
1227 The type of the public key isn't understood.  Maybe you need to upgrade
1228 your copy of
1229 .BR tripe .
1230 (Even if you do, you'll have to regenerate your keys.)
1231 .SS "KX warnings"
1232 These indicate problems during key-exchange.  Many indicate either a bug
1233 in the server (either yours or the remote one), or some kind of attack
1234 in progress.  All name a
1235 .I peer
1236 as the second token: this is the peer the packet is apparently from,
1237 though it may have been sent by an attacker instead.
1238 .PP
1239 In the descriptions below,
1240 .I msgtoken
1241 is one of the tokens
1242 .BR pre-challenge ,
1243 .BR cookie ,
1244 .BR challenge ,
1245 .BR reply ,
1246 .BR switch-rq ,
1247 or
1248 .BR switch-ok .
1249 .SP
1250 .BI "KX " peer " bad-expected-reply-log"
1251 The challenges
1252 .B tripe
1253 uses in its protocol contain a check value which proves that the
1254 challenge is honest.  This message indicates that the check value
1255 supplied is wrong: someone is attempting to use bogus challenges to
1256 persuade your
1257 .B tripe
1258 server to leak private key information.  No chance!
1259 .SP
1260 .BI "KX " peer " decrypt-failed reply\fR|\fBswitch-ok"
1261 A symmetrically-encrypted portion of a key-exchange message failed to
1262 decrypt.
1263 .SP
1264 .BI "KX " peer " invalid " msgtoken
1265 A key-exchange message was malformed.  This almost certainly indicates a
1266 bug somewhere.
1267 .SP
1268 .BI "KX " peer " incorrect cookie\fR|\fBswitch-rq\fR|\fBswitch-ok"
1269 A message didn't contain the right magic data.  This may be a replay of
1270 some old exchange, or random packets being sent in an attempt to waste
1271 CPU.
1272 .SP
1273 .BI "KX " peer " public-key-expired"
1274 The peer's public key has expired.  It's maintainer should have given
1275 you a replacement before now.
1276 .SP
1277 .BI "KX " peer " sending-cookie"
1278 We've received too many bogus pre-challenge messages.  Someone is trying
1279 to flood us with key-exchange messages and make us waste CPU on doing
1280 hard asymmetric crypto sums.
1281 .SP
1282 .BI "KX " peer " unexpected " msgtoken
1283 The message received wasn't appropriate for this stage of the key
1284 exchange process.  This may mean that one of our previous packets got
1285 lost.  For
1286 .BR pre-challenge ,
1287 it may simply mean that the peer has recently restarted.
1288 .SP
1289 .BI "KX " peer " unknown-challenge"
1290 The peer is asking for an answer to a challenge which we don't know
1291 about.  This may mean that we've been inundated with challenges from
1292 some malicious source
1293 .I who can read our messages
1294 and discarded the valid one.
1295 .SP
1296 .BI "KX " peer " unknown-message 0x" nn
1297 An unknown key-exchange message arrived.
1298 .SS "PEER warnings"
1299 These are largely concerned with management of peers and the low-level
1300 details of the network protocol.  The second token is usually the name of
1301 a peer, or
1302 .RB ` \- '
1303 if none is relevant.
1304 .SP
1305 .BI "PEER " peer " bad-packet no-type"
1306 An empty packet arrived.  This is very strange.
1307 .SP
1308 .BI "PEER " peer " bad-packet unknown-category 0x" nn
1309 The message category
1310 .I nn
1311 (in hex) isn't understood.  Probably a strange random packet from
1312 somewhere; could be an unlikely bug.
1313 .SP
1314 .BI "PEER " peer " bad-packet unknown-type 0x" nn
1315 The message type
1316 .I nn
1317 (in hex) isn't understood.  Probably a strange random packet from
1318 somewhere; could be an unlikely bug.
1319 .SP
1320 .BI "PEER " peer " corrupt-encrypted-ping"
1321 The peer sent a ping response which matches an outstanding ping, but its
1322 payload is wrong.  There's definitely a bug somewhere.
1323 .SP
1324 .BI "PEER " peer " corrupt-transport-ping"
1325 The peer (apparently) sent a ping response which matches an outstanding
1326 ping, but its payload is wrong.  Either there's a bug, or the bad guys
1327 are playing tricks on you.
1328 .SP
1329 .BI "PEER " peer " decrypt-failed"
1330 An encrypted IP packet failed to decrypt.  It may have been mangled in
1331 transit, or may be a very old packet from an expired previous session
1332 key.  There is usually a considerable overlap in the validity periods of
1333 successive session keys, so this shouldn't occur unless the key exchange
1334 takes ages or fails.
1335 .SP
1336 .BI "PEER " peer " malformed-encrypted-ping"
1337 The peer sent a ping response which is hopelessly invalid.  There's
1338 definitely a bug somewhere.
1339 .SP
1340 .BI "PEER " peer " malformed-transport-ping"
1341 The peer (apparently) sent a ping response which is hopelessly invalid.
1342 Either there's a bug, or the bad guys are playing tricks on you.
1343 .SP
1344 .BI "PEER " peer " packet-build-failed"
1345 There wasn't enough space in our buffer to put the packet we wanted to
1346 send.  Shouldn't happen.
1347 .SP
1348 .BI "PEER \- socket-read-error " ecode " " message
1349 An error occurred trying to read an incoming packet.
1350 .SP
1351 .BI "PEER " peer " socket-write-error " ecode " " message
1352 An error occurred attempting to send a network packet.  We lost that
1353 one.
1354 .SP
1355 .BI "PEER " peer " unexpected-encrypted-ping 0x" id
1356 The peer sent an encrypted ping response whose id doesn't match any
1357 outstanding ping.  Maybe it was delayed for longer than the server was
1358 willing to wait, or maybe the peer has gone mad.
1359 .SP
1360 .BI "PEER \- unexpected-source " address\fR...
1361 A packet arrived from
1362 .I address
1363 (a network address \(en see above), but no peer is known at that
1364 address.  This may indicate a misconfiguration, or simply be a result of
1365 one end of a connection being set up before the other.
1366 .SP
1367 .BI "PEER " peer " unexpected-transport-ping 0x" id
1368 The peer (apparently) sent a transport ping response whose id doesn't
1369 match any outstanding ping.  Maybe it was delayed for longer than the
1370 server was willing to wait, or maybe the peer has gone mad; or maybe
1371 there are bad people trying to confuse you.
1372 .SS "SERVER warnings"
1373 These indicate problems concerning the server process as a whole.
1374 .SP
1375 .BI "SERVER ignore signal " name
1376 A signal arrived, but the server ignored it.  Currently this happens for
1377 .B SIGHUP
1378 because that's a popular way of telling daemons to re-read their
1379 configuration files.  Since
1380 .B tripe
1381 re-reads its keyrings automatically and has no other configuration
1382 files, it's not relevant, but it seemed better to ignore the signal than
1383 let the server die.
1384 .SP
1385 .BI "SERVER quit signal " \fR[\fInn\fR|\fIname\fR]
1386 A signal arrived and
1387 .B tripe
1388 is going to quit.
1389 .SP
1390 .BI "SERVER quit admin-request"
1391 A client of the administration interface issued a
1392 .B QUIT
1393 command.
1394 .SP
1395 .BI "SERVER quit foreground-eof"
1396 The server is running in foreground mode (the
1397 .B \-F
1398 option), and encountered end-of-file on standard input.
1399 .SP
1400 .BI "SERVER select-error " ecode " " message
1401 An error occurred in the server's main event loop.  This is bad: if it
1402 happens too many times, the server will abort.
1403 .SS "SYMM warnings"
1404 These are concerned with the symmetric encryption and decryption
1405 process.
1406 .SP
1407 .BI "SYMM replay old-sequence"
1408 A packet was received with an old sequence number.  It may just have
1409 been delayed or duplicated, or it may have been an attempt at a replay
1410 attack.
1411 .SP
1412 .BI "SYMM replay duplicated-sequence"
1413 A packet was received with a sequence number we've definitely seen
1414 before.  It may be an accidental duplication because the 'net is like
1415 that, or a deliberate attempt at a replay.
1416 .SS "TUN warnings"
1417 These concern the workings of the system-specific tunnel driver.  The
1418 second token is the name of the tunnel interface in question, or
1419 .RB ` \- '
1420 if none.
1421 .SP
1422 .BI "TUN \- bsd no-tunnel-devices"
1423 The driver couldn't find an available tunnel device.  Maybe if you
1424 create some more
1425 .BI /dev/tun nn
1426 files, it will work.
1427 .SP
1428 .BI "TUN \- " tun-name " open-error " device " " ecode " " message
1429 An attempt to open the tunnel device file
1430 .I device
1431 failed.
1432 .SP
1433 .BI "TUN \- linux config-error " ecode " " message
1434 Configuring the Linux TUN/TAP interface failed.
1435 .SP
1436 .BI "TUN " ifname " " tun-name " read-error " ecode " " message
1437 Reading from the tunnel device failed.
1438 .SP
1439 .BI "TUN " ifname " " tun-name " write-error " ecode " " message
1440 Writing from the tunnel device failed.
1441 .SP
1442 .BI "TUN " ifname " slip bad-escape"
1443 The SLIP driver encountered a escaped byte it wasn't expecting to see.
1444 The erroneous packet will be ignored.
1445 .SP
1446 .BI "TUN " ifname " slip eof"
1447 The SLIP driver encountered end-of-file on its input descriptor.
1448 Pending data is discarded, and no attempt is made to read any more data
1449 from that interface ever.
1450 .SP
1451 .BI "TUN " ifname " slip escape-end"
1452 The SLIP driver encountered an escaped `end' marker.  This probably
1453 means that someone's been sending it junk.  The erroneous packet is
1454 discarded, and we hope that we've rediscovered synchronization.
1455 .SP
1456 .BI "TUN \- slip fork-error " ecode " " message
1457 The SLIP driver encountered an error forking a child process while
1458 allocating a new dynamic interface.
1459 .SP
1460 .BI "TUN \- slip no-slip-interfaces"
1461 The driver ran out of static SLIP interfaces.  Either preallocate more,
1462 or use dynamic SLIP interface allocation.
1463 .SP
1464 .BI "TUN " ifname " slip overflow"
1465 The SLIP driver gave up reading a packet because it got too large.
1466 .SP
1467 .BI "TUN \- slip pipe-error " ecode " " message
1468 The SLIP driver encountered an error creating pipes while allocating a
1469 new dynamic interface.
1470 .SP
1471 .BI "TUN \- slip read-ifname-failed " ecode " " message
1472 The SLIP driver encountered an error reading the name of a dynamically
1473 allocated interface.  Maybe the allocation script is broken.
1474 .SP
1475 .BI "TUN \- unet config-error " ecode " " message
1476 Configuring the Linux Unet interface failed.  Unet is obsolete and
1477 shouldn't be used any more.
1478 .SP
1479 .BI "TUN \- unet getinfo-error " ecode " " message
1480 Reading information about the Unet interface failed.  Unet is obsolete
1481 and shouldn't be used any more.
1482 .SS "USER warnings"
1483 These are issued by administration clients using the
1484 .B WARN
1485 command.
1486 .SP
1487 .BI "USER " tokens\fR...
1488 An administration client issued a warning.
1489 .\"-sep
1490 .
1491 .\"--------------------------------------------------------------------------
1492 .SH "SUMMARY"
1493 .
1494 .SS "Command responses"
1495 .nf
1496 .BI "BGDETACH " tag
1497 .BI "BGFAIL " tag " " tokens \fR...
1498 .BI "BGINFO " tag " " tokens \fR...
1499 .BI "BGOK " tag
1500 .BI "FAIL " tokens \fR...
1501 .BI "INFO " tokens \fR...
1502 .B OK
1503 .fi
1504 .\"= summary
1505 .
1506 .\"--------------------------------------------------------------------------
1507 .SH "SEE ALSO"
1508 .
1509 .BR tripectl (1),
1510 .BR tripe (8).
1511 .PP
1512 .IR "The Trivial IP Encryption Protocol" .
1513 .
1514 .\"--------------------------------------------------------------------------
1515 .SH "AUTHOR"
1516 .
1517 Mark Wooding, <mdw@distorted.org.uk>
1518 .
1519 .\"----- That's all, folks --------------------------------------------------