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