Document lots of new features and syntax.
[fwd] / fw.1
CommitLineData
10a454ad 1.\" -*-nroff-*-
667fb920 2.\"
3.\" $Id: fw.1,v 1.2 1999/07/26 23:31:04 mdw Exp $
4.\"
5.\" Manual page for fw
6.\"
7.\" (c) 1999 Straylight/Edgeware
8.\"
9.
10.\"----- Licensing notice ---------------------------------------------------
11.\"
12.\" This file is part of the `fw' port forwarder.
13.\"
14.\" `fw' is free software; you can redistribute it and/or modify
15.\" it under the terms of the GNU General Public License as published by
16.\" the Free Software Foundation; either version 2 of the License, or
17.\" (at your option) any later version.
18.\"
19.\" `fw' is distributed in the hope that it will be useful,
20.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
21.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.\" GNU General Public License for more details.
23.\"
24.\" You should have received a copy of the GNU General Public License
25.\" along with `fw'; if not, write to the Free Software Foundation,
26.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27.
28.\" ---- Revision history ---------------------------------------------------
29.\"
30.\" $Log: fw.1,v $
31.\" Revision 1.2 1999/07/26 23:31:04 mdw
32.\" Document lots of new features and syntax.
33.\"
34.
35.\"----- Various bits of fancy styling --------------------------------------
36.
37.\" --- Indented paragraphs with right-aligned tags ---
38.
10a454ad 39.de hP
40.IP
41\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
42..
667fb920 43.
44.\" --- Verbatim-oid typesetting ---
45.de VS
46.sp 1
47.RS
48.nf
49.ft B
50..
51.de VE
52.ft R
53.fi
54.RE
55.sp 1
56..
57.
58.\" --- Other bits of styling ---
59.
60.ie t \{\
61. ds o \(bu
62. ds ss \s8\u
63. ds se \d\s0
64. if \n(.g \{\
65. fam P
66. \}
67.\}
68.el \{\
69. ds o o
70. ds ss ^
71. ds se
72.\}
73.
74.\"--------------------------------------------------------------------------
75.
10a454ad 76.TH fw 1 "1 July 1999" fw
667fb920 77.
78.\"--------------------------------------------------------------------------
10a454ad 79.SH NAME
667fb920 80.
10a454ad 81fw \- port forwarder
667fb920 82.
83.\"--------------------------------------------------------------------------
10a454ad 84.SH SYNOPSIS
667fb920 85.
10a454ad 86.B fw
667fb920 87.RB [ \-dq ]
10a454ad 88.RB [ \-f
89.IR file ]
90.IR config-stmt ...
667fb920 91.
92.\"--------------------------------------------------------------------------
93.SH "DESCRIPTION"
94.
10a454ad 95The
96.B fw
97program is a simple port forwarder. It supports a number of features
98the author hasn't found in similar programs:
99.TP
100.I "Connection logging"
101Each connection attempt to the forwarder is logged, giving the time of
102the connection, the DNS-resolved hostname (if available), and the user
103name resulting from an RFC931 lookup. These lookups are done
104asynchronously to the main forwarder's operation.
105.TP
106.I "Access control"
107Each forwarded port may have an access control list attached to it.
108Only authorized hosts are allowed to connect. Access control checks are
109performed by quick checks on the client's IP address.
110.TP
111.I "Nonblocking single-process design"
112The internal structure of the server is completely nonblocking. The
113connections don't block; the reading and writing don't block; the name
114lookups don't block. This is all done in a single process, with the
115single exception of the DNS resolver.
667fb920 116.TP
117.I "Support for Unix-domain sockets"
118Connections from and to Unix-domain sockets can be handled just as
119easily as more normal Internet sckets. Access control doesn't work on
120Unix domain sockets, though. (Yet.)
10a454ad 121.SS "Command line options"
122The
123.B fw
124program understands a few simple command line options:
125.TP
126.B "\-h, \-\-help"
127Displays a screen of help text on standard output and exits
128successfully.
129.TP
130.B "\-v, \-\-version"
131Writes the version number to standard output and exits successfully.
132.TP
133.B "\-u, \-\-usage"
134Writes a terse usage summary to standard output and exits successfully.
135.TP
136.BI "\-f, \-\-file=" file
137Read configuration information from
138.IR file .
667fb920 139Equivalent to an
140.RB ` include
141.IR file '
142configuration file statement.
10a454ad 143.TP
667fb920 144.B "\-d, \-\-daemon, \-\-fork"
10a454ad 145Forks into the background after reading the configuration and
146initializing properly.
667fb920 147.TP
148.B "-q, \-\-quiet"
149Don't output any logging information. This option is not recommended
150for normal use, although it can make system call traces clearer so I use
151it when debugging.
10a454ad 152.PP
153Any further command line arguments are interpreted as configuration
154lines to be read. Configuration supplied in command line arguments has
155precisely the same syntax as configuration in files. If there are no
156configurmation statements on the command line, and no
157.B \-f
158options were supplied, configuration is read from standard input, if
159stdin is not a terminal.
667fb920 160.
161.\"--------------------------------------------------------------------------
162.SH "CONFIGURATION LANGUAGE"
163.
164The
165.B fw
166program has a fairly sophisticated configuration language to let you
167describe which things should be forwarded where and what special
168features there should be.
169.SS "Lexical structure"
170There are four types of characters.
171.TP
172.I "word constituent characters"
173Word consistituent characters are gathered together into words.
174Depending on its surrounding context, a word might act as a keyword or a
175string. All alphanumerics are word constituents, as is the hyphen
176.RB ` \- '.
177Other characters may change their status in future versions.
178.TP
179.I "self-delimiting characters"
180Self-delimiting characters always stand alone. They act as punctuation,
181shaping the sequence of words into more complex grammatical forms. The
182characters
183.RB ` { ',
184.RB ` } ',
185.RB ` [ ',
186.RB ` ] ',
187.RB ` / ',
188.RB ` , ',
189.RB ` = ',
190.RB ` : ',
191.RB ` ; '
192and
193.RB ` . '
194are self-delimiting. Note that while some characters, e.g.,
195.RB ` [ '
196and
197.RB ` ; ',
198require escaping by the shell, they are strictly optional in the grammar
199and can be omitted in quick hacks at the shell prompt.
200.TP
201.I "whitespace characters"
202Whitespace characters separate words but are otherwise ignored. All
203`normal' whitespace characters (e.g., space, tab and newline) are
204considered to be whitespace for these purposes.
205.TP
206.I "special characters"
207There are three special characters. The
208.RB ` # '
209character, if it appears at the start of a word, introduces a
210.I comment
211which extends to the end of the current line or command-line argument.
212Within a word, it behaves like a normal word-constituent character. The
213backslash
214.RB ` \e '
215escapes the following character causing it to be interpreted as a word
216constituent regardless of its normal type. The double-quote
217.RB ` """" '
218escapes all characters other than backslashes up to the next
219double-quote and causes them to be regarded as word constituents. Note
220that you don't have to quote a whole word. The backslash can escape a
221quote character allowing you to insert it into a word if really
222necessary.
223.
224.SS "Basic syntax"
225The overall syntax looks a bit like this:
10a454ad 226.PP
667fb920 227.I file
10a454ad 228::=
667fb920 229.I empty
230|
231.I file
232.I stmt
233.RB [ ; ]
10a454ad 234.br
235.I stmt
236::=
667fb920 237.I option-stmt
238|
239.I fw-stmt
240.br
241.I fw-stmt
242::=
243.B fw
244.I source
245.I options
246.RB [ to | \-> ]
247.I target
248.I options
249.br
250.I options
251::=
252.B {
253.I option-seq
254.B }
255.br
256.I option-seq
257::=
258.I empty
259|
260.I option-stmt
261.RB [ ; ]
262.I option-seq
263.PP
264If you prefer, the keyword
265.RB ` fw '
266may be spelt
267.RB ` forward '
268or
269.RB ` from '.
270All are equivalent.
271.
272.SS "Sources and targets"
273Forwarding is set up by attaching
274.I targets
275to
276.IR sources .
277Sources are things which are capable of
278.I initiating
279one end of a data flow on their own, while targets are things which are
280capable of setting up the other end on demand. In the case of a TCP
281port forwarder, the part which listens for incoming client connections
282is the source, while the part which sets up outgoing connections to the
283destination server is the target.
284.PP
285Essentially, all
286.B fw
287does is set up a collection of sources and targets based on your
288configuration file so that when a source decides to initiate a data
289flow, it tells its target to set its end up, and then squirts data back
290and forth between the two until there's no more.
291.PP
292Some sources are
293.IR persistent :
294they stay around indefinitely setting up multiple attachments to
295targets. Others are
296.IR transient :
297they set up one connection and then disappear. If all the sources
298defined are transient, then
299.B fw
300will quit when no more active sources remain and all connections have
301terminated.
302.PP
303The
304.B fw
305program is fairly versatile. It allows you to attach any supported type
306of source to any supported type of target. This will, I hope, be the
307case in all future versions.
308.PP
309The syntax of a
310.I source
311or
312.I target
313depend on the source or target type, and are therefore described in the
314sections specific to the various types.
315.
316.SS "Options structure"
317Most of the objects that
318.B fw
319knows about (including sources and targets, but also other more specific
320things such as socket address types) can have their behaviour modified
321by
322.IR options .
323The options available at a particular point in the configuration depend
324on the
325.IR context .
326A global option, outside of a
327.I fw-stmt
328has no context unless it is explicitly qualified, and affects global
329behaviour. Local options, applied to a source or target in a
330.I fw-stmt
331has the context of the type of source or target to which it is applied,
332and affects only that source or target.
333.PP
334Note that it's important to distinguish between an option's context
335(which is affected by its qualification) and its local or global
336status. No matter how qualified, a global option will always control
337default options for objects, and a local option will only affect a
338specific source or target.
339.PP
340The syntax for qualifying options is like this:
341.PP
342.I option-stmt
343::=
344.I q-option
345.br
346.I q-option
347::=
348.I option
349.br
350 |
351.I prefix
352.B .
353.I q-option
354.br
355 |
356.I prefix
357.B {
358.I option-seq
359.B }
360.br
361.I prefix
362::=
363.I word
364.PP
365Thus, you may qualify either an individual option or a sequence of
366options. The two are equivalent; for example,
367.VS
368exec.rlimit {
369 core = 0;
370 cpu = 60;
371}
372.VE
373is equivalent to
374.VS
375exec.rlimit.core = 0;
376exec.rlimit.cpu = 0;
377.VE
378For each option, there is a sequence of prefixes which maximally qualify
379that option. An option prefixed with this sequence is
380.IR "fully qualified" .
381In actual use, some or all of those prefixes may be omitted. However,
382it's possible for the option to become
383.I ambiguous
384if you do this. For example, the option
385.B fattr.owner
386may refer either to
387.B file.fattr.owner
388or to
389.BR socket.unix.fattr.owner .
390In this case, the ambiguity is benign: a local option will have as its
391context an appropriate source or target, and both global options
392actually control the same default. However, the option
393.B logging
394may mean either
395.B socket.logging
396or
397.BR exec.logging ,
398which have separate defaults, and which one you actually get depends on
399the exact implementation of
400.BR fw 's
401option parser. (Currently this would resolve to
402.BR exec.logging ,
403although this may change in a later version.)
404.PP
405In this manual, options are usually shown in their fully-qualified form.
406.
407.SS "The `file' source and target types"
408The
409.B file
410source and target allow data to move to and from objects other
411than sockets within the Unix filesystem. (Unix-domain sockets are
412handled using the
413.B socket
414source and target.)
415.PP
416If a
417.B file
418is used as a source, it is set up immediately.
419.PP
420The syntax of
421.B file
422sources and targets is like this:
423.PP
424.I source
425::=
426.I file
427.br
428.I target
429::=
430.I file
431.br
432.I file
433::=
434.B file
435.RB [ . ]
436.I fspec
437.RB [ ,
438.IR fspec ]
439.br
440.I fspec
441::=
442.I fd-spec
443|
444.I name-spec
445|
446.I null-spec
447.br
448.I fd-spec
449::=
450.RB [[ : ] fd [ : ]]
451.IR number \c
452.RB | stdin | stdout
453.br
454.I name-spec
455::=
456.RB [[ : ] file [ : ]]
457.I file-name
458.br
459.I file-name
460::=
461.I path-seq
462|
463.B [
464.I path-seq
465.B ]
466.br
467.I path-seq
468::=
469.I path-elt
470|
471.I path-seq
472.I path-elt
473.br
474.I path-elt
475::=
476.B /
477|
478.I word
479.br
480.I null-spec
481::=
482.RB [[ : ] null [ : ]]
483.PP
484The
485.I file
486specification describes two files, the first to be used as input, the
487second to be used as output, each described by an
488.IR fspec .
489.PP
490If none of the keywords
491.RB ` fd ',
492.RB ` name '
493or
494.RB ` null '
495are given, the type of an
496.I fspec
497is deduced from its nature: if it matches one of the strings
498.RB ` stdin '
499or
500.RB ` stdout ',
501or begins with a digit, it's considered to be a file descriptor;
502otherwise it's interpreted as a filename.
503.PP
504A
505.RB ` name '
506spec describes a file by its name within the filesystem. It is opened
507when needed and closed again after use. For output files, the precise
508behaviour is controlled by options described below.
509.PP
510A
511.RB ` null '
512spec attaches the input or output of the source or target to
513.BR /dev/null .
514.PP
515An
516.RB ` fd '
517spec uses an existing open file descriptor, given either by number or a
518symbolic name. The name
519.RB ` stdin '
520refers to standard input (file descriptor 0 on normal systems) and
521.RB ` stdout '
522refers to standard output (file descriptor 1). The names work in
523exactly the same way as the equivalent file descriptor numbers.
524.PP
525If the output
526.I fspec
527is omitted, the input
528.I fspec
529is used for both input and output. Exception: if the input refers to
530standard input then the output will refer to standard output instead.
531.PP
532All
533.B file
534options apply equally to sources and targets. The options are as
535follows:
536.PP
537.B file.create
538.RB [ = ]
539.BR yes | no
540.RS
541Whether to create the output file if it doesn't exist. If
542.B no
543(the default), an error is reported if the file doesn't exist. If
544.BR yes ,
545the file is created if it doesn't exist.
546.RE
547.PP
548.B file.open
549.RB [ = ]
550.BR no | truncate | append
551.RS
552Controls the behaviour if the output file already exists. If
553.BR no ,
554an error is reported. If
555.B truncate
556(the default), the existing file is replaced by the new data. If
557.BR append ,
558the new data is appended to the file.
559.RE
560.PP
561Under no circumstances will
562.B fw
563create a file through a `dangling' symbolic link.
564.PP
565The
566.B file
567source and target also accept
568.B fattr
569options for controlling the attributes of the created file. The prefix
570for setting file attributes is
571.BR file.fattr .
572.
573.SS "File attributes for created files `fattr'"
574Both the
575.B file
576and
577.B socket
578sources and targets can create new filesystem objects. The
579.B fattr
580options allow control over the attributes of the newly-created objects.
581Both
582.B file
583and
584.B socket
585use the same set of defaults, so a prefix of
586.B fattr
587is good enough for setting global options, and the implicit context
588disambiguates local options.
589.PP
590The following file attribute options are supported:
591.PP
592.IB prefix .fattr.mode
593.RB [ = ]
594.I mode
595.RS
596Sets the permissions mode for a new file. The
597.I mode
598argument may be either an octal number or a
599.BR chmod (1)-style
600string which acts on the default permissions established by the
601prevailing
602.BR umask (2)
603setting. Note that
604.BR chmod -style
605strings may contain
606.RB ` = '
607and
608.RB ` , '
609characters that will need to be escaped or quoted.
610.RE
611.PP
612.IB prefix .fattr.owner
613.RB [ = ]
614.I user
615.RS
616Sets the owner for newly created files. On non-broken systems you will
617need to be the superuser to set the owner on a file. The
618.I user
619may either be a numeric uid or a username. The default is not to change
620the owner of the file once it's created. The synonyms
621.B uid
622and
623.B user
624are accepted in place of
625.BR owner .
626.RE
627.PP
628.IB prefix .fattr.group
629.RB [ = ]
630.I group
631.RS
632Sets the group for newly created files. You will usually need to be a
633member of the group in question order to set the group of a file. The
634.I group
635may either be a numeric gid or a group name. The default is not to
636change the group of the file once it's created. The synonym
637.B gid
638is accepted in place of
639.BR group .
640.RE
641.
642.SS "The `exec' source and target types"
643The
644.B exec
645source and target execute programs and allow access to their standard
646input and output streams. Both source and target have the same syntax,
647which is as follows:
648.PP
649.I source
650::=
651.I exec
652.br
653.I target
654::=
655exec
656.br
657.I exec
658::=
659.BR exec
660.RB [ . ]
661.I cmd-spec
662.br
663.I cmd-spec
664::=
665.I shell-cmd
10a454ad 666|
667fb920 667.RI [ prog-name ]
668.B [
669.I argv0
670.I arg-seq
671.B ]
672.br
673.I arg-seq
674::=
675.I word
676|
677.I arg-seq
678.I word
679.br
680.I shell-cmd
681::=
682.I word
683.br
684.I argv0
685::=
686.I word
687.PP
688If a single word is given, it is a
689.I shell-cmd
690and will be passed to the Bourne shell for execution. If a
691bracket-enclosed sequence of words is given, it is considered to be a
692list of arguments to pass to the program: if a
693.I prog-name
694is also supplied, it names the file containing the program to execute;
695otherwise the file named by the first argument
696.RI ( argv0 )
697is used.
698.PP
699The standard input and output of the program are forwarded to the other
700end of the connection. The standard error stream is caught by
701.B fw
702and logged.
703.PP
704The
705.B exec
706source and target both understand the same set of options. The list of
707options supported is as follows:
708.PP
709.B exec.logging
710.RB [ = ]
711.BR yes | no
712.RS
713Whether to log the start and end of executed programs. If
714.B yes
715(the default), a log message is emitted when the program is started
716listing its process id, and another is emitted when the program finishes
717giving its process id and exit status. If
718.BR no ,
719these messages are not emitted. However the standard error stream is
720still logged. The
721.B log
722abbreviation is accepted as a synonym for
723.BR logging .
724.RE
725.PP
726.B exec.dir
727.RB [ = ]
728.I file-name
729.RS
730Sets the current directory from which the the program should be run.
731The default is not to change directory. The synonyms
732.BR cd ,
733.B chdir
734and
735.B cwd
736are accepted in place of
737.BR dir .
738.RE
739.PP
740.B exec.root
741.RB [ = ]
742.I file-name
743.RS
744Sets the root directory for the program, using the
745.BR chroot (2)
746system call. You must be the superuser for this option to work. The
747default is not to set a root directory. The synonyms
748.BR cd ,
749.B chdir
750and
751.B cwd
752are accepted in place of
753.B dir .
754.RE
755.PP
756.B exec.user
757.RB [ = ]
758.I user
759.RS
760Sets the user (real and effective uid) to run the program as. This will
761usually require superuser privileges to work. The default is not to
762change uid. The synonym
763.B uid
764is accepted in place of
765.BR user .
766.RE
767.PP
768.B exec.group
769.RB [ = ]
770.I group
771.RS
772Sets the group (real and effective gid) to run the program as. If
773running with superuser privileges, the supplementary groups list is
774cleared at the same time. The default is not to change gid (or clear
775the supplementary groups list). The synonym
776.B gid
777is accepted in place of
778.BR group .
779.RE
780.PP
781.BI exec.rlimit. limit \c
782.RB [ .hard | .soft ]
783.RB [ = ]
784.I value
785.RS
786Set resource limits for the program. The
787.I limit
788may be one of the resource limit names described in
789.BR setrlimit (2),
790in lower-case and without the
791.B RLIMIT_
792prefix; for example,
793.B RLIMIT_CORE
794becomes simply
795.BR core .
796The
797.I value
798is a number, followed optionally by
799.B k
800to multiply by 1024 (2\*(ss10\*(se),
801.B m
802to multiply by 1048576 (2\*(ss20\*(se), or
803.B g
804to multiply by 1073741824 (2\*(ss30\*(se); purists can use upper-case
805versions of these if they want. If
806.B .hard
807or
808.B .soft
809was specified, only the hard or soft limit is set; otherwise both are
810set to the same value. Only the superuser can raise the hard limit.
811The soft limit cannot be set above the hard limit.
812.RE
813.PP
814.B exec.env.clear
815.RS
816Clears the program's environment.
817.RE
818.PP
819.B exec.env.unset
820.I var
821.RS
822Removes
823.I var
824from the program's environment. It is not an error if no variable named
825.I var
826exists.
827.RE
828.PP
829.BR exec.env. [ set ]
830.I var
831.RB [ = ]
832.I value
833.RS
834Assignes the variable
835.I var
836the value
837.I value
838in the program's environment, possibly replacing the existing value.
839The
840.B set
841may be omitted if the
842.B env
843qualifier is present.
844.RE
845.PP
846Note that environment variable modifications are performed in order,
847global modifications before local ones.
848.
849.SS "The `socket' source and target types"
850The
851.B socket
852source and target provide access to network services. Support is
853currently provided for TCP/IP and Unix-domain sockets, although other
854address types can be added with reasonable ease.
855.PP
856The syntax for socket sources and targets is:
857.PP
858.ll +8i
859.I source
860::=
861.I socket-source
10a454ad 862.br
667fb920 863.I target
864::=
865.I socket-target
866.br
867.I socket-source
868::=
869.RB [ socket [ . ]]
870.RB [[ : ] \c
871.IR addr-type \c
872.RB [ : ]]
873.I source-addr
874.br
875.I socket-target
876::=
877.RB [ socket [ . ]]
878.RB [[ : ] \c
879.IR addr-type \c
880.RB [ : ]]
881.I target-addr
882.ll -8i
883.PP
884The syntax of the source and target addresses depend on the address
885types, which are described below. The default address type, if no
886.I addr-type
887is given, is
888.BR inet .
889.PP
890Socket sources support options; socket targets do not. The source
891options provided are:
892.PP
893.B socket.conn
894.RB [ = ]
895.I number
896.RS
897Limits the number of simultaneous connections to this socket to the
898.I number
899given. The default is 256.
900.RE
901.PP
902.B socket.logging
903.RB [ = ]
904.BR yes | no
905.RS
906Whether to log incoming connections. If
907.B yes
908(the default) incoming connections are logged, together with information
909about the client (where available) and whether the connection was
910accepted or refused. If
911.BR no ,
912log messages are not generated.
913.RE
914.PP
915Address types also provide their own options.
916.
917.SS "The `inet' socket address type"
918The
919.B inet
920address type provides access to TCP ports. The
921.B inet
922source and target addresses have the following syntax:
923.PP
924.I inet-source-addr
10a454ad 925::=
10a454ad 926.RB [ port ]
927.I port
667fb920 928.br
929.I inet-target-addr
930::=
931.I address
10a454ad 932.RB [ : ]
933.I port
10a454ad 934.br
667fb920 935.I address
10a454ad 936::=
667fb920 937.I addr-elt
938|
939.I address
940.I addr-elt
10a454ad 941.br
667fb920 942.I addr-elt
10a454ad 943::=
667fb920 944.B .
10a454ad 945|
667fb920 946.I word
947.PP
948A
949.I port
950may be given as a port number or a service name from the
951.B /etc/services
952file (or YP map if you do that sort of thing). A
953.B hostname
954may be a textual hostname or a numerical IP address.
955.PP
956The
957.B inet
958source address accepts the following options:
959.PP
960.BR socket.inet. [ allow | deny ]
10a454ad 961.RB [ from ]
667fb920 962.I address
10a454ad 963.RB [ /
667fb920 964.IR address ]
965.RS
966Adds an entry to the source's access control list. If only one
967.I address
968is given, the entry applies only to that address; if two are given, the
969first is a network address and the second is a netmask either in
970dotted-quad format or a simple number of bits (e.g.,
971.B /255.255.255.192
972and
973.B /26
974mean the same), and the entry applies to any address which, when masked
975by the netmask, is equal to the masked network address.
10a454ad 976.PP
667fb920 977The access
978control rules are examined in the order: local entries first, then
979global ones, each in the order given in the configuration file. The
980first matching entry is used. If no entries match, the behaviour is the
981.I opposite
982of the last entry tried. If there are no entries defined, the default
983is to allow all clients.
984.RE
985.
986.SS "The `unix' socket address type"
10a454ad 987The
667fb920 988.B unix
989address type allows access to Unix-domain sockets. The syntax for
990.B unix
991source and target addresses is like this:
992.PP
993.I source-addr
994::=
995.I unix-addr
996.br
997.I target-addr
998::=
999.I unix-addr
1000.br
1001.I unix-addr
1002::=
1003.I file-name
1004.PP
1005The
1006.B unix
1007source address accepts
1008.B fattr
1009options to control the attributes of the socket file created. Sockets
1010are removed if
10a454ad 1011.B fw
667fb920 1012exits normally (which it will do if it runs out of sources or
1013connections, or if killed by SIGINT or SIGTERM).
1014.SH "EXAMPLES"
1015To forward the local port 25 to a main mail server:
1016.VS
1017from 25 to mailserv:25
1018.VE
1019To attach a fortune server to a Unix-domain socket:
1020.VS
1021from unix:/tmp/fortunes
1022to exec [/usr/games/fortune] { user nobody }
1023.VE
1024To fetch a fortune from the server:
1025.VS
1026from file stdin, stdout to unix:/tmp/fortunes
1027.VE
1028To emulate
1029.BR cat (1):
1030.VS
1031from stdin, null to null, stdout
1032.VE
1033.
1034.\"--------------------------------------------------------------------------
10a454ad 1035.SH "BUGS"
667fb920 1036.
1037The syntax for IP addresses and filenames is nasty. The requirement
1038that textual permissions strings be quoted is probably nastier.
10a454ad 1039.PP
667fb920 1040IPv6 is not supported yet. It's probably not a major piece of work to
1041add.
10a454ad 1042.PP
667fb920 1043Please inform me of any security problems you think you've identified in
1044this program. I take security very seriously, and I will fix security
1045holes as a matter of priority when I find out about them. I will be
1046annoyed if I have to read about problems on Bugtraq because they weren't
1047mailed to me first.
1048.
1049.\"--------------------------------------------------------------------------
10a454ad 1050.SH "AUTHOR"
667fb920 1051.
10a454ad 1052Mark Wooding, <mdw@nsict.org>
667fb920 1053.
1054.\"----- That's all, folks --------------------------------------------------