From aa0f5b38aec14428b4b80e06f90ff781f8bca5f1 Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Mon, 22 May 2006 05:12:18 +0000 Subject: Import initial strongswan 2.7.0 version into SVN. --- doc/manpage.d/ipsec.8.html | 215 ++++ doc/manpage.d/ipsec.conf.5.html | 1830 +++++++++++++++++++++++++++ doc/manpage.d/ipsec.secrets.5.html | 227 ++++ doc/manpage.d/ipsec__confread.8.html | 58 + doc/manpage.d/ipsec__copyright.8.html | 62 + doc/manpage.d/ipsec__include.8.html | 67 + doc/manpage.d/ipsec__keycensor.8.html | 64 + doc/manpage.d/ipsec__plutoload.8.html | 64 + doc/manpage.d/ipsec__plutorun.8.html | 70 + doc/manpage.d/ipsec__realsetup.8.html | 68 + doc/manpage.d/ipsec__secretcensor.8.html | 65 + doc/manpage.d/ipsec__startklips.8.html | 63 + doc/manpage.d/ipsec__updown.8.html | 63 + doc/manpage.d/ipsec_addrbytesof.3.html | 232 ++++ doc/manpage.d/ipsec_addrbytesptr.3.html | 232 ++++ doc/manpage.d/ipsec_addrcmp.3.html | 274 ++++ doc/manpage.d/ipsec_addrinsubnet.3.html | 274 ++++ doc/manpage.d/ipsec_addrlenof.3.html | 232 ++++ doc/manpage.d/ipsec_addrtoa.3.html | 448 +++++++ doc/manpage.d/ipsec_addrtosubnet.3.html | 238 ++++ doc/manpage.d/ipsec_addrtot.3.html | 569 +++++++++ doc/manpage.d/ipsec_addrtypeof.3.html | 232 ++++ doc/manpage.d/ipsec_anyaddr.3.html | 166 +++ doc/manpage.d/ipsec_atoaddr.3.html | 448 +++++++ doc/manpage.d/ipsec_atoasr.3.html | 294 +++++ doc/manpage.d/ipsec_atosa.3.html | 347 +++++ doc/manpage.d/ipsec_atosubnet.3.html | 448 +++++++ doc/manpage.d/ipsec_atoul.3.html | 266 ++++ doc/manpage.d/ipsec_auto.8.html | 416 ++++++ doc/manpage.d/ipsec_barf.8.html | 150 +++ doc/manpage.d/ipsec_bitstomask.3.html | 122 ++ doc/manpage.d/ipsec_broadcastof.3.html | 107 ++ doc/manpage.d/ipsec_calcgoo.8.html | 78 ++ doc/manpage.d/ipsec_copyright_notice.3.html | 94 ++ doc/manpage.d/ipsec_datatot.3.html | 439 +++++++ doc/manpage.d/ipsec_eroute.5.html | 370 ++++++ doc/manpage.d/ipsec_eroute.8.html | 421 ++++++ doc/manpage.d/ipsec_goodmask.3.html | 122 ++ doc/manpage.d/ipsec_hostof.3.html | 107 ++ doc/manpage.d/ipsec_ikeping.8.html | 137 ++ doc/manpage.d/ipsec_initaddr.3.html | 232 ++++ doc/manpage.d/ipsec_initsaid.3.html | 453 +++++++ doc/manpage.d/ipsec_initsubnet.3.html | 238 ++++ doc/manpage.d/ipsec_isanyaddr.3.html | 166 +++ doc/manpage.d/ipsec_isloopbackaddr.3.html | 166 +++ doc/manpage.d/ipsec_isunspecaddr.3.html | 166 +++ doc/manpage.d/ipsec_keyblobtoid.3.html | 174 +++ doc/manpage.d/ipsec_klipsdebug.5.html | 229 ++++ doc/manpage.d/ipsec_klipsdebug.8.html | 264 ++++ doc/manpage.d/ipsec_look.8.html | 76 ++ doc/manpage.d/ipsec_loopbackaddr.3.html | 166 +++ doc/manpage.d/ipsec_lwdnsq.8.html | 400 ++++++ doc/manpage.d/ipsec_mailkey.8.html | 97 ++ doc/manpage.d/ipsec_manual.8.html | 414 ++++++ doc/manpage.d/ipsec_maskof.3.html | 238 ++++ doc/manpage.d/ipsec_masktobits.3.html | 122 ++ doc/manpage.d/ipsec_masktocount.3.html | 238 ++++ doc/manpage.d/ipsec_networkof.3.html | 238 ++++ doc/manpage.d/ipsec_newhostkey.8.html | 196 +++ doc/manpage.d/ipsec_optionsfrom.3.html | 275 ++++ doc/manpage.d/ipsec_pf_key.5.html | 176 +++ doc/manpage.d/ipsec_pf_key.8.html | 122 ++ doc/manpage.d/ipsec_pluto.8.html | 1824 ++++++++++++++++++++++++++ doc/manpage.d/ipsec_portof.3.html | 143 +++ doc/manpage.d/ipsec_prng.3.html | 204 +++ doc/manpage.d/ipsec_prng_bytes.3.html | 204 +++ doc/manpage.d/ipsec_prng_final.3.html | 204 +++ doc/manpage.d/ipsec_prng_init.3.html | 204 +++ doc/manpage.d/ipsec_ranbits.8.html | 147 +++ doc/manpage.d/ipsec_rangetoa.3.html | 294 +++++ doc/manpage.d/ipsec_rangetosubnet.3.html | 116 ++ doc/manpage.d/ipsec_rsasigkey.8.html | 401 ++++++ doc/manpage.d/ipsec_sameaddr.3.html | 274 ++++ doc/manpage.d/ipsec_sameaddrtype.3.html | 274 ++++ doc/manpage.d/ipsec_samesaid.3.html | 274 ++++ doc/manpage.d/ipsec_samesubnet.3.html | 274 ++++ doc/manpage.d/ipsec_samesubnettype.3.html | 274 ++++ doc/manpage.d/ipsec_satoa.3.html | 347 +++++ doc/manpage.d/ipsec_satot.3.html | 453 +++++++ doc/manpage.d/ipsec_send-pr.8.html | 427 +++++++ doc/manpage.d/ipsec_setportof.3.html | 143 +++ doc/manpage.d/ipsec_setup.8.html | 237 ++++ doc/manpage.d/ipsec_showdefaults.8.html | 82 ++ doc/manpage.d/ipsec_showhostkey.8.html | 269 ++++ doc/manpage.d/ipsec_showpolicy.8.html | 88 ++ doc/manpage.d/ipsec_sockaddrlenof.3.html | 143 +++ doc/manpage.d/ipsec_sockaddrof.3.html | 143 +++ doc/manpage.d/ipsec_spi.5.html | 305 +++++ doc/manpage.d/ipsec_spi.8.html | 790 ++++++++++++ doc/manpage.d/ipsec_spigrp.5.html | 193 +++ doc/manpage.d/ipsec_spigrp.8.html | 280 ++++ doc/manpage.d/ipsec_splitkeytoid.3.html | 174 +++ doc/manpage.d/ipsec_subnetinsubnet.3.html | 274 ++++ doc/manpage.d/ipsec_subnetishost.3.html | 274 ++++ doc/manpage.d/ipsec_subnetof.3.html | 107 ++ doc/manpage.d/ipsec_subnettoa.3.html | 448 +++++++ doc/manpage.d/ipsec_subnettot.3.html | 569 +++++++++ doc/manpage.d/ipsec_subnettypeof.3.html | 238 ++++ doc/manpage.d/ipsec_tnatoaddr.3.html | 569 +++++++++ doc/manpage.d/ipsec_tncfg.5.html | 175 +++ doc/manpage.d/ipsec_tncfg.8.html | 195 +++ doc/manpage.d/ipsec_trap_count.5.html | 74 ++ doc/manpage.d/ipsec_trap_sendcount.5.html | 72 ++ doc/manpage.d/ipsec_ttoaddr.3.html | 569 +++++++++ doc/manpage.d/ipsec_ttodata.3.html | 439 +++++++ doc/manpage.d/ipsec_ttosa.3.html | 453 +++++++ doc/manpage.d/ipsec_ttosubnet.3.html | 569 +++++++++ doc/manpage.d/ipsec_ttoul.3.html | 310 +++++ doc/manpage.d/ipsec_ultoa.3.html | 266 ++++ doc/manpage.d/ipsec_ultot.3.html | 310 +++++ doc/manpage.d/ipsec_unspecaddr.3.html | 166 +++ doc/manpage.d/ipsec_verify.8.html | 107 ++ doc/manpage.d/ipsec_version.3.html | 94 ++ doc/manpage.d/ipsec_version.5.html | 103 ++ doc/manpage.d/ipsec_version_code.3.html | 94 ++ doc/manpage.d/ipsec_version_string.3.html | 94 ++ doc/manpage.d/ipsec_whack.8.html | 1824 ++++++++++++++++++++++++++ 117 files changed, 32603 insertions(+) create mode 100644 doc/manpage.d/ipsec.8.html create mode 100644 doc/manpage.d/ipsec.conf.5.html create mode 100644 doc/manpage.d/ipsec.secrets.5.html create mode 100644 doc/manpage.d/ipsec__confread.8.html create mode 100644 doc/manpage.d/ipsec__copyright.8.html create mode 100644 doc/manpage.d/ipsec__include.8.html create mode 100644 doc/manpage.d/ipsec__keycensor.8.html create mode 100644 doc/manpage.d/ipsec__plutoload.8.html create mode 100644 doc/manpage.d/ipsec__plutorun.8.html create mode 100644 doc/manpage.d/ipsec__realsetup.8.html create mode 100644 doc/manpage.d/ipsec__secretcensor.8.html create mode 100644 doc/manpage.d/ipsec__startklips.8.html create mode 100644 doc/manpage.d/ipsec__updown.8.html create mode 100644 doc/manpage.d/ipsec_addrbytesof.3.html create mode 100644 doc/manpage.d/ipsec_addrbytesptr.3.html create mode 100644 doc/manpage.d/ipsec_addrcmp.3.html create mode 100644 doc/manpage.d/ipsec_addrinsubnet.3.html create mode 100644 doc/manpage.d/ipsec_addrlenof.3.html create mode 100644 doc/manpage.d/ipsec_addrtoa.3.html create mode 100644 doc/manpage.d/ipsec_addrtosubnet.3.html create mode 100644 doc/manpage.d/ipsec_addrtot.3.html create mode 100644 doc/manpage.d/ipsec_addrtypeof.3.html create mode 100644 doc/manpage.d/ipsec_anyaddr.3.html create mode 100644 doc/manpage.d/ipsec_atoaddr.3.html create mode 100644 doc/manpage.d/ipsec_atoasr.3.html create mode 100644 doc/manpage.d/ipsec_atosa.3.html create mode 100644 doc/manpage.d/ipsec_atosubnet.3.html create mode 100644 doc/manpage.d/ipsec_atoul.3.html create mode 100644 doc/manpage.d/ipsec_auto.8.html create mode 100644 doc/manpage.d/ipsec_barf.8.html create mode 100644 doc/manpage.d/ipsec_bitstomask.3.html create mode 100644 doc/manpage.d/ipsec_broadcastof.3.html create mode 100644 doc/manpage.d/ipsec_calcgoo.8.html create mode 100644 doc/manpage.d/ipsec_copyright_notice.3.html create mode 100644 doc/manpage.d/ipsec_datatot.3.html create mode 100644 doc/manpage.d/ipsec_eroute.5.html create mode 100644 doc/manpage.d/ipsec_eroute.8.html create mode 100644 doc/manpage.d/ipsec_goodmask.3.html create mode 100644 doc/manpage.d/ipsec_hostof.3.html create mode 100644 doc/manpage.d/ipsec_ikeping.8.html create mode 100644 doc/manpage.d/ipsec_initaddr.3.html create mode 100644 doc/manpage.d/ipsec_initsaid.3.html create mode 100644 doc/manpage.d/ipsec_initsubnet.3.html create mode 100644 doc/manpage.d/ipsec_isanyaddr.3.html create mode 100644 doc/manpage.d/ipsec_isloopbackaddr.3.html create mode 100644 doc/manpage.d/ipsec_isunspecaddr.3.html create mode 100644 doc/manpage.d/ipsec_keyblobtoid.3.html create mode 100644 doc/manpage.d/ipsec_klipsdebug.5.html create mode 100644 doc/manpage.d/ipsec_klipsdebug.8.html create mode 100644 doc/manpage.d/ipsec_look.8.html create mode 100644 doc/manpage.d/ipsec_loopbackaddr.3.html create mode 100644 doc/manpage.d/ipsec_lwdnsq.8.html create mode 100644 doc/manpage.d/ipsec_mailkey.8.html create mode 100644 doc/manpage.d/ipsec_manual.8.html create mode 100644 doc/manpage.d/ipsec_maskof.3.html create mode 100644 doc/manpage.d/ipsec_masktobits.3.html create mode 100644 doc/manpage.d/ipsec_masktocount.3.html create mode 100644 doc/manpage.d/ipsec_networkof.3.html create mode 100644 doc/manpage.d/ipsec_newhostkey.8.html create mode 100644 doc/manpage.d/ipsec_optionsfrom.3.html create mode 100644 doc/manpage.d/ipsec_pf_key.5.html create mode 100644 doc/manpage.d/ipsec_pf_key.8.html create mode 100644 doc/manpage.d/ipsec_pluto.8.html create mode 100644 doc/manpage.d/ipsec_portof.3.html create mode 100644 doc/manpage.d/ipsec_prng.3.html create mode 100644 doc/manpage.d/ipsec_prng_bytes.3.html create mode 100644 doc/manpage.d/ipsec_prng_final.3.html create mode 100644 doc/manpage.d/ipsec_prng_init.3.html create mode 100644 doc/manpage.d/ipsec_ranbits.8.html create mode 100644 doc/manpage.d/ipsec_rangetoa.3.html create mode 100644 doc/manpage.d/ipsec_rangetosubnet.3.html create mode 100644 doc/manpage.d/ipsec_rsasigkey.8.html create mode 100644 doc/manpage.d/ipsec_sameaddr.3.html create mode 100644 doc/manpage.d/ipsec_sameaddrtype.3.html create mode 100644 doc/manpage.d/ipsec_samesaid.3.html create mode 100644 doc/manpage.d/ipsec_samesubnet.3.html create mode 100644 doc/manpage.d/ipsec_samesubnettype.3.html create mode 100644 doc/manpage.d/ipsec_satoa.3.html create mode 100644 doc/manpage.d/ipsec_satot.3.html create mode 100644 doc/manpage.d/ipsec_send-pr.8.html create mode 100644 doc/manpage.d/ipsec_setportof.3.html create mode 100644 doc/manpage.d/ipsec_setup.8.html create mode 100644 doc/manpage.d/ipsec_showdefaults.8.html create mode 100644 doc/manpage.d/ipsec_showhostkey.8.html create mode 100644 doc/manpage.d/ipsec_showpolicy.8.html create mode 100644 doc/manpage.d/ipsec_sockaddrlenof.3.html create mode 100644 doc/manpage.d/ipsec_sockaddrof.3.html create mode 100644 doc/manpage.d/ipsec_spi.5.html create mode 100644 doc/manpage.d/ipsec_spi.8.html create mode 100644 doc/manpage.d/ipsec_spigrp.5.html create mode 100644 doc/manpage.d/ipsec_spigrp.8.html create mode 100644 doc/manpage.d/ipsec_splitkeytoid.3.html create mode 100644 doc/manpage.d/ipsec_subnetinsubnet.3.html create mode 100644 doc/manpage.d/ipsec_subnetishost.3.html create mode 100644 doc/manpage.d/ipsec_subnetof.3.html create mode 100644 doc/manpage.d/ipsec_subnettoa.3.html create mode 100644 doc/manpage.d/ipsec_subnettot.3.html create mode 100644 doc/manpage.d/ipsec_subnettypeof.3.html create mode 100644 doc/manpage.d/ipsec_tnatoaddr.3.html create mode 100644 doc/manpage.d/ipsec_tncfg.5.html create mode 100644 doc/manpage.d/ipsec_tncfg.8.html create mode 100644 doc/manpage.d/ipsec_trap_count.5.html create mode 100644 doc/manpage.d/ipsec_trap_sendcount.5.html create mode 100644 doc/manpage.d/ipsec_ttoaddr.3.html create mode 100644 doc/manpage.d/ipsec_ttodata.3.html create mode 100644 doc/manpage.d/ipsec_ttosa.3.html create mode 100644 doc/manpage.d/ipsec_ttosubnet.3.html create mode 100644 doc/manpage.d/ipsec_ttoul.3.html create mode 100644 doc/manpage.d/ipsec_ultoa.3.html create mode 100644 doc/manpage.d/ipsec_ultot.3.html create mode 100644 doc/manpage.d/ipsec_unspecaddr.3.html create mode 100644 doc/manpage.d/ipsec_verify.8.html create mode 100644 doc/manpage.d/ipsec_version.3.html create mode 100644 doc/manpage.d/ipsec_version.5.html create mode 100644 doc/manpage.d/ipsec_version_code.3.html create mode 100644 doc/manpage.d/ipsec_version_string.3.html create mode 100644 doc/manpage.d/ipsec_whack.8.html (limited to 'doc/manpage.d') diff --git a/doc/manpage.d/ipsec.8.html b/doc/manpage.d/ipsec.8.html new file mode 100644 index 000000000..ff9b7ca39 --- /dev/null +++ b/doc/manpage.d/ipsec.8.html @@ -0,0 +1,215 @@ +Content-type: text/html + +Manpage of IPSEC + +

IPSEC

+Section: Maintenance Commands (8)
Updated: 26 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec - invoke IPsec utilities +  +

SYNOPSIS

+ +ipsec + +command [ argument ...] +

+ipsec + +--help + +
+ +ipsec + +--version + +
+ +ipsec + +--versioncode + +
+ +ipsec + +--copyright + +
+ +ipsec + +--directory + +
+ +ipsec + +--confdir + +  +

DESCRIPTION

+ +Ipsec + +invokes any of several utilities involved in controlling the IPsec +encryption/authentication system, +running the specified +command + +with the specified +arguments + +as if it had been invoked directly. +This largely eliminates possible name collisions with other software, +and also permits some centralized services. +

+ +In particular, +ipsec + +supplies the invoked +command + +with a suitable PATH environment variable, +and also provides IPSEC_DIR, +IPSEC_CONFS, and IPSEC_VERSION environment variables, +containing respectively +the full pathname of the directory where the IPsec utilities are stored, +the full pathname of the directory where the configuration files live, +and the IPsec version number. +

+ +ipsec --help + +lists the available commands. +Most have their own manual pages, e.g. +ipsec_auto(8) + +for +auto. + +

+ +ipsec --version + +outputs version information about Linux FreeS/WAN. +A version code of the form ``Uxxx/Kyyy'' +indicates that the user-level utilities are version xxx +but the kernel portion appears to be version yyy +(this form is used only if the two disagree). +

+ +ipsec --versioncode + +outputs just the version code, +with none of +--version's + +supporting information, +for use by scripts. +

+ +ipsec --copyright + +supplies boring copyright details. +

+ +ipsec --directory + +reports where +ipsec + +thinks the IPsec utilities are stored. +

+ +ipsec --confdir + +reports where +ipsec + +thinks the IPsec configuration files are stored. +  +

FILES

+ +/usr/local/lib/ipsec   usual utilities directory
+  +

ENVIRONMENT

+ +

+ +The following environment variables control where FreeS/WAN finds its +components. +The +ipsec + +command sets them if they are not already set. +

+IPSEC_EXECDIR   directory containing published commands
+IPSEC_LIBDIR    directory containing internal executables
+IPSEC_SBINDIR   directory containing ipsec command
+IPSEC_CONFS     directory containing configuration files
+
+ +  +

SEE ALSO

+ + + +ipsec.conf(5), ipsec.secrets(5), +ipsec_auto(8), +ipsec_barf(8), +ipsec_setup(8), +ipsec_showdefaults(8), +ipsec_showhostkey(8) + + +

+ +HTML documentation shipped with the release, starting with +doc/index.html. + +<http://www.freeswan.org/doc.html> + +may also be of use. +  +

HISTORY

+ +Written for Linux FreeS/WAN +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +The provision of centralized services, +while convenient, +does compromise the original concept of making the utilities +invocable directly as well as via +ipsec. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
ENVIRONMENT
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec.conf.5.html b/doc/manpage.d/ipsec.conf.5.html new file mode 100644 index 000000000..36e0452ef --- /dev/null +++ b/doc/manpage.d/ipsec.conf.5.html @@ -0,0 +1,1830 @@ +Content-type: text/html + +Manpage of IPSEC.CONF + +

IPSEC.CONF

+Section: File Formats (5)
Updated: 26 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec.conf - IPsec configuration and connections +  +

DESCRIPTION

+ +The optional +ipsec.conf + +file +specifies most configuration and control information for the +FreeS/WAN IPsec subsystem. +(The major exception is secrets for authentication; +see +ipsec.secrets(5).) + +Its contents are not security-sensitive +unless + +manual keying is being done for more than just testing, +in which case the encryption/authentication keys in the +descriptions for the manually-keyed connections are very sensitive +(and those connection descriptions +are probably best kept in a separate file, +via the include facility described below). +

+ +The file is a text file, consisting of one or more +sections. + +White space followed by +# + +followed by anything to the end of the line +is a comment and is ignored, +as are empty lines which are not within a section. +

+ +A line which contains +include + +and a file name, separated by white space, +is replaced by the contents of that file, +preceded and followed by empty lines. +If the file name is not a full pathname, +it is considered to be relative to the directory containing the +including file. +Such inclusions can be nested. +Only a single filename may be supplied, and it may not contain white space, +but it may include shell wildcards (see +sh(1)); + +for example: +

+ +include + +ipsec.*.conf + +

+ +The intention of the include facility is mostly to permit keeping +information on connections, or sets of connections, +separate from the main configuration file. +This permits such connection descriptions to be changed, +copied to the other security gateways involved, etc., +without having to constantly extract them from the configuration +file and then insert them back into it. +Note also the +also + +and +alsoflip + +parameters (described below) which permit splitting a single logical section +(e.g. a connection description) into several actual sections. +

+ +The first significant line of the file must specify the version +of this specification that it conforms to: +

+ +version 2 +

+ +A section +begins with a line of the form: +

+ +type + +name + +

+ +where +type + +indicates what type of section follows, and +name + +is an arbitrary name which distinguishes the section from others +of the same type. +(Names must start with a letter and may contain only +letters, digits, periods, underscores, and hyphens.) +All subsequent non-empty lines +which begin with white space are part of the section; +comments within a section must begin with white space too. +There may be only one section of a given type with a given name. +

+ +Lines within the section are generally of the form +

+ +     parameter=value +

+ +(note the mandatory preceding white space). +There can be white space on either side of the +=. + +Parameter names follow the same syntax as section names, +and are specific to a section type. +Unless otherwise explicitly specified, +no parameter name may appear more than once in a section. +

+ +An empty +value + +stands for the system default value (if any) of the parameter, +i.e. it is roughly equivalent to omitting the parameter line entirely. +A +value + +may contain white space only if the entire +value + +is enclosed in double quotes ("); +a +value + +cannot itself contain a double quote, +nor may it be continued across more than one line. +

+ +Numeric values are specified to be either an ``integer'' +(a sequence of digits) or a ``decimal number'' +(sequence of digits optionally followed by `.' and another sequence of digits). +

+ +There is currently one parameter which is available in any type of +section: +

+
also + +
+the value is a section name; +the parameters of that section are appended to this section, +as if they had been written as part of it. +The specified section must exist, must follow the current one, +and must have the same section type. +(Nesting is permitted, +and there may be more than one +also + +in a single section, +although it is forbidden to append the same section more than once.) +This allows, for example, keeping the encryption keys +for a connection in a separate file +from the rest of the description, by using both an +also + +parameter and an +include + +line. +(Caution, see BUGS below for some restrictions.) +
alsoflip + +
+can be used in a +conn + +section. +It acts like an +also + +that flips the referenced section's entries left-for-right. +
+

+ +Parameter names beginning with +x- + +(or +X-, + +or +x_, + +or +X_) + +are reserved for user extensions and will never be assigned meanings +by IPsec. +Parameters with such names must still observe the syntax rules +(limits on characters used in the name; +no white space in a non-quoted value; +no newlines or double quotes within the value). +All other as-yet-unused parameter names are reserved for future IPsec +improvements. +

+ +A section with name +%default + +specifies defaults for sections of the same type. +For each parameter in it, +any section of that type which does not have a parameter of the same name +gets a copy of the one from the +%default + +section. +There may be multiple +%default + +sections of a given type, +but only one default may be supplied for any specific parameter name, +and all +%default + +sections of a given type must precede all non-%default + +sections of that type. +%default + +sections may not contain +also + +or +alsoflip + +parameters. +

+ +Currently there are two types of section: +a +config + +section specifies general configuration information for IPsec, +while a +conn + +section specifies an IPsec connection. +  +

CONN SECTIONS

+ +A +conn + +section contains a +connection specification, + +defining a network connection to be made using IPsec. +The name given is arbitrary, and is used to identify the connection to +ipsec_auto(8) + +and +ipsec_manual(8). + +Here's a simple example: +

+ + +

+
+conn snt
+ left=10.11.11.1
+ leftsubnet=10.0.1.0/24
+ leftnexthop=172.16.55.66
+ right=192.168.22.1
+ rightsubnet=10.0.2.0/24
+ rightnexthop=172.16.88.99
+ keyingtries=%forever
+
+ +

+ +A note on terminology... +In automatic keying, there are two kinds of communications going on: +transmission of user IP packets, and gateway-to-gateway negotiations for +keying, rekeying, and general control. +The data path (a set of ``IPsec SAs'') used for user packets is herein +referred to as the ``connection''; +the path used for negotiations (built with ``ISAKMP SAs'') is referred to as +the ``keying channel''. +

+ +To avoid trivial editing of the configuration file to suit it to each system +involved in a connection, +connection specifications are written in terms of +left + +and +right + +participants, +rather than in terms of local and remote. +Which participant is considered +left + +or +right + +is arbitrary; +IPsec figures out which one it is being run on based on internal information. +This permits using identical connection specifications on both ends. +There are cases where there is no symmetry; a good convention is to +use +left + +for the local side and +right + +for the remote side (the first letters are a good mnemonic). +

+ +Many of the parameters relate to one participant or the other; +only the ones for +left + +are listed here, but every parameter whose name begins with +left + +has a +right + +counterpart, +whose description is the same but with +left + +and +right + +reversed. +

+ +Parameters are optional unless marked ``(required)''; +a parameter required for manual keying need not be included for +a connection which will use only automatic keying, and vice versa. +  +

CONN PARAMETERS: GENERAL

+ +The following parameters are relevant to both automatic and manual keying. +Unless otherwise noted, +for a connection to work, +in general it is necessary for the two ends to agree exactly +on the values of these parameters. +
+
type + +
+the type of the connection; currently the accepted values +are +tunnel + +(the default) +signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel; +transport, + +signifying host-to-host transport mode; +passthrough, + +signifying that no IPsec processing should be done at all; +drop, + +signifying that packets should be discarded; and +reject, + +signifying that packets should be discarded and a diagnostic ICMP returned. +
left + +
+(required) +the IP address of the left participant's public-network interface, +in any form accepted by +ipsec_ttoaddr(3) + +or one of several magic values. +If it is +%defaultroute, + +and +the +config + +setup + +section's, +interfaces + +specification contains +%defaultroute, + +left + +will be filled in automatically with the local address +of the default-route interface (as determined at IPsec startup time); +this also overrides any value supplied for +leftnexthop. + +(Either +left + +or +right + +may be +%defaultroute, + +but not both.) +The value +%any + +signifies an address to be filled in (by automatic keying) during +negotiation. +The value +%opportunistic + +signifies that both +left + +and +leftnexthop + +are to be filled in (by automatic keying) from DNS data for +left's + +client. +The values +%group + +and +%opportunisticgroup + +makes this a policy group conn: one that will be instantiated +into a regular or opportunistic conn for each CIDR block listed in the +policy group file with the same name as the conn. +
leftsubnet + +
+private subnet behind the left participant, expressed as +network/netmask +(actually, any form acceptable to +ipsec_ttosubnet(3)); + +if omitted, essentially assumed to be left/32, +signifying that the left end of the connection goes to the left participant only +
leftnexthop + +
+next-hop gateway IP address for the left participant's connection +to the public network; +defaults to +%direct + +(meaning +right). + +If the value is to be overridden by the +left=%defaultroute + +method (see above), +an explicit value must +not + +be given. +If that method is not being used, +but +leftnexthop + +is +%defaultroute, + +and +interfaces=%defaultroute + +is used in the +config + +setup + +section, +the next-hop gateway address of the default-route interface +will be used. +The magic value +%direct + +signifies a value to be filled in (by automatic keying) +with the peer's address. +Relevant only locally, other end need not agree on it. +
leftupdown + +
+what ``updown'' script to run to adjust routing and/or firewalling +when the status of the connection +changes (default +ipsec _updown). + +May include positional parameters separated by white space +(although this requires enclosing the whole string in quotes); +including shell metacharacters is unwise. +See +ipsec_pluto(8) + +for details. +Relevant only locally, other end need not agree on it. +
leftfirewall + +
+whether the left participant is doing forwarding-firewalling +(including masquerading) for traffic from leftsubnet, +which should be turned off (for traffic to the other subnet) +once the connection is established; +acceptable values are +yes + +and (the default) +no. + +May not be used in the same connection description with +leftupdown. + +Implemented as a parameter to the default +updown + +script. +See notes below. +Relevant only locally, other end need not agree on it. +
+

+ +If one or both security gateways are doing forwarding firewalling +(possibly including masquerading), +and this is specified using the firewall parameters, +tunnels established with IPsec are exempted from it +so that packets can flow unchanged through the tunnels. +(This means that all subnets connected in this manner must have +distinct, non-overlapping subnet address blocks.) +This is done by the default +updown + +script (see +ipsec_pluto(8)). + +

+ +The implementation of this makes certain assumptions about firewall setup, +notably the use of the old +ipfwadm + +interface to the firewall. +In situations calling for more control, +it may be preferable for the user to supply his own +updown + +script, +which makes the appropriate adjustments for his system. +  +

CONN PARAMETERS: AUTOMATIC KEYING

+ +The following parameters are relevant only to automatic keying, +and are ignored in manual keying. +Unless otherwise noted, +for a connection to work, +in general it is necessary for the two ends to agree exactly +on the values of these parameters. +
+
keyexchange + +
+method of key exchange; +the default and currently the only accepted value is +ike + +
auto + +
+what operation, if any, should be done automatically at IPsec startup; +currently-accepted values are +add + +(signifying an +ipsec auto + +--add), + +route + +(signifying that plus an +ipsec auto + +--route), + +start + +(signifying that plus an +ipsec auto + +--up), + +manual + +(signifying an +ipsec + +manual + +--up), + +and +ignore + +(also the default) (signifying no automatic startup operation). +See the +config + +setup + +discussion below. +Relevant only locally, other end need not agree on it +(but in general, for an intended-to-be-permanent connection, +both ends should use +auto=start + +to ensure that any reboot causes immediate renegotiation). +
auth + +
+whether authentication should be done as part of +ESP encryption, or separately using the AH protocol; +acceptable values are +esp + +(the default) and +ah. + +
authby + +
+how the two security gateways should authenticate each other; +acceptable values are +secret + +for shared secrets, +rsasig + +for RSA digital signatures (the default), +secret|rsasig + +for either, and +never + +if negotiation is never to be attempted or accepted (useful for shunt-only conns). +Digital signatures are superior in every way to shared secrets. +
leftid + +
+how +the left participant +should be identified for authentication; +defaults to +left. + +Can be an IP address (in any +ipsec_ttoaddr(3) + +syntax) +or a fully-qualified domain name preceded by +@ + +(which is used as a literal string and not resolved). +The magic value +%myid + +stands for the current setting of myid. +This is set in config setup or by ipsec_whack(8)), or, if not set, +it is the IP address in %defaultroute (if that is supported by a TXT record in its reverse domain), or otherwise +it is the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined. +
leftrsasigkey + +
+the left participant's +public key for RSA signature authentication, +in RFC 2537 format using +ipsec_ttodata(3) + +encoding. +The magic value +%none + +means the same as not specifying a value (useful to override a default). +The value +%dnsondemand + +(the default) +means the key is to be fetched from DNS at the time it is needed. +The value +%dnsonload + +means the key is to be fetched from DNS at the time +the connection description is read from +ipsec.conf; + +currently this will be treated as +%none + +if +right=%any + +or +right=%opportunistic. + +The value +%dns + +is currently treated as +%dnsonload + +but will change to +%dnsondemand + +in the future. +The identity used for the left participant +must be a specific host, not +%any + +or another magic value. +Caution: + +if two connection descriptions +specify different public keys for the same +leftid, + +confusion and madness will ensue. +
leftrsasigkey2 + +
+if present, a second public key. +Either key can authenticate the signature, allowing for key rollover. +
pfs + +
+whether Perfect Forward Secrecy of keys is desired on the connection's +keying channel +(with PFS, penetration of the key-exchange protocol +does not compromise keys negotiated earlier); +acceptable values are +yes + +(the default) +and +no. + +
keylife + +
+how long a particular instance of a connection +(a set of encryption/authentication keys for user packets) should last, +from successful negotiation to expiry; +acceptable values are an integer optionally followed by +s + +(a time in seconds) +or a decimal number followed by +m, + +h, + +or +d + +(a time +in minutes, hours, or days respectively) +(default +8.0h, + +maximum +24h). + +Normally, the connection is renegotiated (via the keying channel) +before it expires. +The two ends need not exactly agree on +keylife, + +although if they do not, +there will be some clutter of superseded connections on the end +which thinks the lifetime is longer. +
rekey + +
+whether a connection should be renegotiated when it is about to expire; +acceptable values are +yes + +(the default) +and +no. + +The two ends need not agree, +but while a value of +no + +prevents Pluto from requesting renegotiation, +it does not prevent responding to renegotiation requested from the other end, +so +no + +will be largely ineffective unless both ends agree on it. +
rekeymargin + +
+how long before connection expiry or keying-channel expiry +should attempts to +negotiate a replacement +begin; acceptable values as for +keylife + +(default +9m). + +Relevant only locally, other end need not agree on it. +
rekeyfuzz + +
+maximum percentage by which +rekeymargin + +should be randomly increased to randomize rekeying intervals +(important for hosts with many connections); +acceptable values are an integer, +which may exceed 100, +followed by a `%' +(default set by +ipsec_pluto(8), + +currently +100%). + +The value of +rekeymargin, + +after this random increase, +must not exceed +keylife. + +The value +0% + +will suppress time randomization. +Relevant only locally, other end need not agree on it. +
keyingtries + +
+how many attempts (a whole number or %forever) should be made to +negotiate a connection, or a replacement for one, before giving up +(default +%forever). + +The value %forever +means ``never give up'' (obsolete: this can be written 0). +Relevant only locally, other end need not agree on it. +
ikelifetime + +
+how long the keying channel of a connection (buzzphrase: ``ISAKMP SA'') +should last before being renegotiated; +acceptable values as for +keylife + +(default set by +ipsec_pluto(8), + +currently +1h, + +maximum +8h). + +The two-ends-disagree case is similar to that of +keylife. + +
compress + +
+whether IPComp compression of content is proposed on the connection +(link-level compression does not work on encrypted data, +so to be effective, compression must be done before encryption); +acceptable values are +yes + +and +no + +(the default). +The two ends need not agree. +A value of +yes + +causes IPsec to propose both compressed and uncompressed, +and prefer compressed. +A value of +no + +prevents IPsec from proposing compression; +a proposal to compress will still be accepted. +
disablearrivalcheck + +
+whether KLIPS's normal tunnel-exit check +(that a packet emerging from a tunnel has plausible addresses in its header) +should be disabled; +acceptable values are +yes + +and +no + +(the default). +Tunnel-exit checks improve security and do not break any normal configuration. +Relevant only locally, other end need not agree on it. +
failureshunt + +
+what to do with packets when negotiation fails. +The default is +none: + +no shunt; +passthrough, + +drop, + +and +reject + +have the obvious meanings. +
+  +

CONN PARAMETERS: MANUAL KEYING

+ +The following parameters are relevant only to manual keying, +and are ignored in automatic keying. +Unless otherwise noted, +for a connection to work, +in general it is necessary for the two ends to agree exactly +on the values of these parameters. +A manually-keyed +connection must specify at least one of AH or ESP. +
+
spi + +
+(this or +spibase + +required for manual keying) +the SPI number to be used for the connection (see +ipsec_manual(8)); + +must be of the form 0xhex, +where +hex + +is one or more hexadecimal digits +(note, it will generally be necessary to make +spi + +at least +0x100 + +to be acceptable to KLIPS, +and use of SPIs in the range +0x100-0xfff + +is recommended) +
spibase + +
+(this or +spi + +required for manual keying) +the base number for the SPIs to be used for the connection (see +ipsec_manual(8)); + +must be of the form 0xhex0, +where +hex + +is one or more hexadecimal digits +(note, it will generally be necessary to make +spibase + +at least +0x100 + +for the resulting SPIs +to be acceptable to KLIPS, +and use of numbers in the range +0x100-0xff0 + +is recommended) +
esp + +
+ESP encryption/authentication algorithm to be used +for the connection, e.g. +3des-md5-96 + +(must be suitable as a value of +ipsec_spi(8)'s + +--esp + +option); +default is not to use ESP +
espenckey + +
+ESP encryption key +(must be suitable as a value of +ipsec_spi(8)'s + +--enckey + +option) +(may be specified separately for each direction using +leftespenckey + +(leftward SA) +and +rightespenckey + +parameters) +
espauthkey + +
+ESP authentication key +(must be suitable as a value of +ipsec_spi(8)'s + +--authkey + +option) +(may be specified separately for each direction using +leftespauthkey + +(leftward SA) +and +rightespauthkey + +parameters) +
espreplay_window + +
+ESP replay-window setting, +an integer from +0 + +(the +ipsec_manual + +default, which turns off replay protection) to +64; + +relevant only if ESP authentication is being used +
leftespspi + +
+SPI to be used for the leftward ESP SA, overriding +automatic assignment using +spi + +or +spibase; + +typically a hexadecimal number beginning with +0x + +
ah + +
+AH authentication algorithm to be used +for the connection, e.g. +hmac-md5-96 + +(must be suitable as a value of +ipsec_spi(8)'s + +--ah + +option); +default is not to use AH +
ahkey + +
+(required if +ah + +is present) AH authentication key +(must be suitable as a value of +ipsec_spi(8)'s + +--authkey + +option) +(may be specified separately for each direction using +leftahkey + +(leftward SA) +and +rightahkey + +parameters) +
ahreplay_window + +
+AH replay-window setting, +an integer from +0 + +(the +ipsec_manual + +default, which turns off replay protection) to +64 + +
leftahspi + +
+SPI to be used for the leftward AH SA, overriding +automatic assignment using +spi + +or +spibase; + +typically a hexadecimal number beginning with +0x + +
+  +

CONFIG SECTIONS

+ +At present, the only +config + +section known to the IPsec software is the one named +setup, + +which contains information used when the software is being started +(see +ipsec_setup(8)). + +Here's an example: +

+ + +

+
+config setup
+ interfaces="ipsec0=eth1 ipsec1=ppp0"
+ klipsdebug=none
+ plutodebug=all
+ manualstart=
+
+ +

+ +Parameters are optional unless marked ``(required)''. +The currently-accepted +parameter + +names in a +config + +setup + +section are: +

+
myid + +
+the identity to be used for +%myid. + +%myid + +is used in the implicit policy group conns and can be used as +an identity in explicit conns. +If unspecified, +%myid + +is set to the IP address in %defaultroute (if that is supported by a TXT record in its reverse domain), or otherwise +the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined. +An explicit value generally starts with ``@''. +
interfaces + +
+virtual and physical interfaces for IPsec to use: +a single +virtual=physical pair, a (quoted!) list of pairs separated +by white space, or +%none. + +One of the pairs may be written as +%defaultroute, + +which means: find the interface d that the default route points to, +and then act as if the value was ``ipsec0=d''. +%defaultroute + +is the default; +%none + +must be used to denote no interfaces. +If +%defaultroute + +is used (implicitly or explicitly) +information about the default route and its interface is noted for +use by +ipsec_manual(8) + +and +ipsec_auto(8).) + +
forwardcontrol + +
+whether +setup + +should turn IP forwarding on +(if it's not already on) as IPsec is started, +and turn it off again (if it was off) as IPsec is stopped; +acceptable values are +yes + +and (the default) +no. + +For this to have full effect, forwarding must be +disabled before the hardware interfaces are brought +up (e.g., +net.ipv4.ip_forward = 0 + +in Red Hat 6.x +/etc/sysctl.conf), + +because IPsec doesn't get control early enough to do that. +
rp_filter + +
+whether and how +setup + +should adjust the reverse path filtering mechanism for the +physical devices to be used. +Values are %unchanged (to leave it alone) +or 0, 1, 2 (values to set it to). +/proc/sys/net/ipv4/conf/PHYS/rp_filter +is badly documented; it must be 0 in many cases +for ipsec to function. +The default value for the parameter is 0. +
syslog + +
+the +syslog(2) + +``facility'' name and priority to use for +startup/shutdown log messages, +default +daemon.error. + +
klipsdebug + +
+how much KLIPS debugging output should be logged. +An empty value, +or the magic value +none, + +means no debugging output (the default). +The magic value +all + +means full output. +Otherwise only the specified types of output +(a quoted list, names separated by white space) are enabled; +for details on available debugging types, see +ipsec_klipsdebug(8). + +
plutodebug + +
+how much Pluto debugging output should be logged. +An empty value, +or the magic value +none, + +means no debugging output (the default). +The magic value +all + +means full output. +Otherwise only the specified types of output +(a quoted list, names without the +--debug- + +prefix, +separated by white space) are enabled; +for details on available debugging types, see +ipsec_pluto(8). + +
plutoopts + +
+additional options to pass to pluto upon startup. See +ipsec_pluto(8). + +
plutostderrlog + +
+do not use syslog, but rather log to stderr, and direct stderr to the +argument file. +
dumpdir + +
+in what directory should things started by +setup + +(notably the Pluto daemon) be allowed to +dump core? +The empty value (the default) means they are not +allowed to. +
manualstart + +
+which manually-keyed connections to set up at startup +(empty, a name, or a quoted list of names separated by white space); +see +ipsec_manual(8). + +Default is none. +
pluto + +
+whether to start Pluto or not; +Values are +yes + +(the default) +or +no + +(useful only in special circumstances). +
plutowait + +
+should Pluto wait for each +negotiation attempt that is part of startup to +finish before proceeding with the next? +Values are +yes + +or +no + +(the default). +
prepluto + +
+shell command to run before starting Pluto +(e.g., to decrypt an encrypted copy of the +ipsec.secrets + +file). +It's run in a very simple way; +complexities like I/O redirection are best hidden within a script. +Any output is redirected for logging, +so running interactive commands is difficult unless they use +/dev/tty + +or equivalent for their interaction. +Default is none. +
postpluto + +
+shell command to run after starting Pluto +(e.g., to remove a decrypted copy of the +ipsec.secrets + +file). +It's run in a very simple way; +complexities like I/O redirection are best hidden within a script. +Any output is redirected for logging, +so running interactive commands is difficult unless they use +/dev/tty + +or equivalent for their interaction. +Default is none. +
fragicmp + +
+whether a tunnel's need to fragment a packet should be reported +back with an ICMP message, +in an attempt to make the sender lower his PMTU estimate; +acceptable values are +yes + +(the default) +and +no. + +
hidetos + +
+whether a tunnel packet's TOS field should be set to +0 + +rather than copied from the user packet inside; +acceptable values are +yes + +(the default) +and +no. + +
uniqueids + +
+whether a particular participant ID should be kept unique, +with any new (automatically keyed) +connection using an ID from a different IP address +deemed to replace all old ones using that ID; +acceptable values are +yes + +(the default) +and +no. + +Participant IDs normally are unique, +so a new (automatically-keyed) connection using the same ID is +almost invariably intended to replace an old one. +
overridemtu + +
+value that the MTU of the ipsecn interface(s) should be set to, +overriding IPsec's (large) default. +This parameter is needed only in special situations. +
+  +

IMPLICIT CONNS

+ +

+ +The system automatically defines several conns to implement +default policy groups. Each can be overridden by explicitly +defining a new conn with the same name. If the new conn has auto=ignore, +the definition is suppressed. +

+ +Here are the automatically supplied definitions. +

+ + +

+
+conn clear
+ type=passthrough
+ authby=never
+ left=%defaultroute
+ right=%group
+ auto=route
+
+conn clear-or-private
+ type=passthrough
+ left=%defaultroute
+ leftid=%myid
+ right=%opportunisticgroup
+ failureshunt=passthrough
+ keyingtries=3
+ ikelifetime=1h
+ keylife=1h
+ rekey=no
+ auto=route
+
+conn private-or-clear
+ type=tunnel
+ left=%defaultroute
+ leftid=%myid
+ right=%opportunisticgroup
+ failureshunt=passthrough
+ keyingtries=3
+ ikelifetime=1h
+ keylife=1h
+ rekey=no
+ auto=route
+
+conn private
+ type=tunnel
+ left=%defaultroute
+ leftid=%myid
+ right=%opportunisticgroup
+ failureshunt=drop
+ keyingtries=3
+ ikelifetime=1h
+ keylife=1h
+ rekey=no
+ auto=route
+
+conn block
+ type=reject
+ authby=never
+ left=%defaultroute
+ right=%group
+ auto=route
+
+# default policy
+conn packetdefault
+ type=tunnel
+ left=%defaultroute
+ leftid=%myid
+ left=0.0.0.0/0
+ right=%opportunistic
+ failureshunt=passthrough
+ keyingtries=3
+ ikelifetime=1h
+ keylife=1h
+ rekey=no
+ auto=route
+
+ +

+ +These conns are not affected by anything in conn %default. +They will only work if %defaultroute works. +The leftid will be the interfaces IP address; this +requires that reverse DNS records be set up properly. +

+ +The implicit conns are defined after all others. It is +appropriate and reasonable to use also=private-or-clear +(for example) in any other opportunistic conn. +  +

POLICY GROUP FILES

+ +

+ +The optional files under +/etc/ipsec.d/policy, + +including +

+
+/etc/ipsec.d/policies/clear
+/etc/ipsec.d/policies/clear-or-private
+/etc/ipsec.d/policies/private-or-clear
+/etc/ipsec.d/policies/private
+/etc/ipsec.d/policies/block
+
+
+ +may contain policy group configuration information to +supplement +ipsec.conf. + +Their contents are not security-sensitive. +

+ +These files are text files. +Each consists of a list of CIDR blocks, one per line. +White space followed by # followed by anything to the end of the line +is a comment and is ignored, as are empty lines. +

+ +A connection in +/etc/ipsec.conf + +which has +right=%group + +or +right=%opportunisticgroup + +is a policy group connection. +When a policy group file of the same name is loaded, with +

+ +     ipsec auto --rereadgroups +

+ +or at system start, the connection is instantiated such that each +CIDR block serves as an instance's +right + +value. The system treats the +resulting instances as normal connections. +

+ +For example, given a suitable connection definition +private, + +and the file +/etc/ipsec.d/policy/private + +with an entry 192.0.2.3, +the system creates a connection instance +private#192.0.2.3. + +This connection inherits all details from +private, + +except that its right client is 192.0.2.3. +  +

DEFAULT POLICY GROUPS

+ +

+ +The standard FreeS/WAN install includes several policy groups +which provide a way of classifying possible peers into IPsec security classes: +private + +(talk encrypted only), +private-or-clear + +(prefer encryption), +clear-or-private + +(respond to requests for encryption), +clear + +and +block. + +Implicit policy groups apply to the local host only, +and are implemented by the +IMPLICIT CONNECTIONS + +described above. +  +

CHOOSING A CONNECTION

+ +

+ +When choosing a connection to apply to an outbound packet caught with a +%trap, + +the system prefers the one with the most specific eroute that +includes the packet's source and destination IP addresses. +Source subnets are examined before destination subnets. +For initiating, only routed connections are considered. For responding, +unrouted but added connections are considered. +

+ +When choosing a connection to use to respond to a negotiation which +doesn't match an ordinary conn, an opportunistic connection +may be instantiated. Eventually, its instance will be /32 -> /32, but +for earlier stages of the negotiation, there will not be enough +information about the client subnets to complete the instantiation. +  +

FILES

+ +
+/etc/ipsec.conf
+/etc/ipsec.d/policies/clear
+/etc/ipsec.d/policies/clear-or-private
+/etc/ipsec.d/policies/private-or-clear
+/etc/ipsec.d/policies/private
+/etc/ipsec.d/policies/block
+
+ +  +

SEE ALSO

+ +ipsec(8), ipsec_ttoaddr(8), ipsec_auto(8), ipsec_manual(8), ipsec_rsasigkey(8) +  +

HISTORY

+ +Designed for the FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +

+ +When +type + +or +failureshunt + +is set to +drop + +or +reject, + +FreeS/WAN blocks outbound packets using eroutes, but assumes inbound +blocking is handled by the firewall. FreeS/WAN offers firewall hooks +via an ``updown'' script. However, the default +ipsec _updown + +provides no help in controlling a modern firewall. +

+ +Including attributes of the keying channel +(authentication methods, +ikelifetime, + +etc.) +as an attribute of a connection, +rather than of a participant pair, is dubious and incurs limitations. +

+ +Ipsec_manual + +is not nearly as generous about the syntax of subnets, +addresses, etc. as the usual FreeS/WAN user interfaces. +Four-component dotted-decimal must be used for all addresses. +It +is + +smart enough to translate bit-count netmasks to dotted-decimal form. +

+ +It would be good to have a line-continuation syntax, +especially for the very long lines involved in +RSA signature keys. +

+ +The ability to specify different identities, +authby, + +and public keys for different automatic-keyed connections +between the same participants is misleading; +this doesn't work dependably because the identity of the participants +is not known early enough. +This is especially awkward for the ``Road Warrior'' case, +where the remote IP address is specified as +0.0.0.0, + +and that is considered to be the ``participant'' for such connections. +

+ +In principle it might be necessary to control MTU on an +interface-by-interface basis, +rather than with the single global override that +overridemtu + +provides. +

+ +A number of features which could be implemented in +both manual and automatic keying +actually are not yet implemented for manual keying. +This is unlikely to be fixed any time soon. +

+ +If conns are to be added before DNS is available, +left=FQDN, +leftnextop=FQDN, +and +leftrsasigkey=%dnsonload + +will fail. +ipsec_pluto(8) + +does not actually use the public key for our side of a conn but it +isn't generally known at a add-time which side is ours (Road Warrior +and Opportunistic conns are currently exceptions). +

+ +The myid option does not affect explicit ipsec auto --add or ipsec auto --replace commands for implicit conns. +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
CONN SECTIONS
+
+
CONN PARAMETERS: GENERAL
+
CONN PARAMETERS: AUTOMATIC KEYING
+
CONN PARAMETERS: MANUAL KEYING
+
+
CONFIG SECTIONS
+
IMPLICIT CONNS
+
POLICY GROUP FILES
+
DEFAULT POLICY GROUPS
+
CHOOSING A CONNECTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec.secrets.5.html b/doc/manpage.d/ipsec.secrets.5.html new file mode 100644 index 000000000..8abc1f492 --- /dev/null +++ b/doc/manpage.d/ipsec.secrets.5.html @@ -0,0 +1,227 @@ +Content-type: text/html + +Manpage of IPSEC.SECRETS + +

IPSEC.SECRETS

+Section: File Formats (5)
Updated: 28 March 1999
Index +Return to Main Contents
+ +  +

NAME

+ +ipsec.secrets - secrets for IKE/IPsec authentication +  +

DESCRIPTION

+ +The file ipsec.secrets holds a table of secrets. +These secrets are used by ipsec_pluto(8), the FreeS/WAN Internet Key +Exchange daemon, to authenticate other hosts. +Currently there are two kinds of secrets: preshared secrets and + +RSA private keys. +

+ +It is vital that these secrets be protected. The file should be owned +by the super-user, +and its permissions should be set to block all access by others. +

+ +The file is a sequence of entries and include directives. +Here is an example. Each entry or directive must start at the +left margin, but if it continues beyond a single line, each continuation +line must be indented. +

+ +

+
+# sample /etc/ipsec.secrets file for 10.1.0.1
+10.1.0.1 10.2.0.1: PSK "secret shared by two hosts"
+
+# an entry may be split across lines,
+# but indentation matters
+www.xs4all.nl @www.kremvax.ru
+    10.6.0.1 10.7.0.1 1.8.0.1: PSK "secret shared by 5"
+
+# an RSA private key.
+# note that the lines are too wide for a
+# man page, so ... has been substituted for
+# the truncated part
+@my.com: rsa {
+    Modulus: 0syXpo/6waam+ZhSs8Lt6jnBzu3C4grtt...
+    PublicExponent: 0sAw==
+    PrivateExponent: 0shlGbVR1m8Z+7rhzSyenCaBN...
+    Prime1: 0s8njV7WTxzVzRz7AP+0OraDxmEAt1BL5l...
+    Prime2: 0s1LgR7/oUMo9BvfU8yRFNos1s211KX5K0...
+    Exponent1: 0soaXj85ihM5M2inVf/NfHmtLutVz4r...
+    Exponent2: 0sjdAL9VFizF+BKU4ohguJFzOd55OG6...
+    Coefficient: 0sK1LWwgnNrNFGZsS/2GuMBg9nYVZ...
+    }
+
+include ipsec.*.secrets # get secrets from other files
+
+ +
+ +

+ +Each entry in the file is a list of indices, followed by a secret. +The two parts are separated by a colon (:) that is +followed by whitespace or a newline. For compatability +with the previous form of this file, if the key part is just a +double-quoted string the colon may be left out. +

+ +An index is an IP address, or a Fully Qualified Domain Name, user@FQDN, +%any or %any6 (other kinds may come). An IP address may be written +in the familiar dotted quad form or as a domain name to be looked up +when the file is loaded +(or in any of the forms supported by the FreeS/WAN ipsec_ttoaddr(3) +routine). In many cases it is a bad idea to use domain names because +the name server may not be running or may be insecure. To denote a +Fully Qualified Domain Name (as opposed to an IP address denoted by +its domain name), precede the name with an at sign (@). +

+ +Matching IDs with indices is fairly straightforward: they have to be +equal. In the case of a ``Road Warrior'' connection, if an equal +match is not found for the Peer's ID, and it is in the form of an IP +address, an index of %any will match the peer's IP address if IPV4 +and %any6 will match a the peer's IP address if IPV6. +Currently, the obsolete notation 0.0.0.0 may be used in place of +%any. +

+ +An additional complexity +arises in the case of authentication by preshared secret: the +responder will need to look up the secret before the Peer's ID payload has +been decoded, so the ID used will be the IP address. +

+ +To authenticate a connection between two hosts, the entry that most +specifically matches the host and peer IDs is used. An entry with no +index will match any host and peer. More specifically, an entry with one index will +match a host and peer if the index matches the host's ID (the peer isn't +considered). Still more specifically, an entry with multiple indices will match a host and +peer if the host ID and peer ID each match one of the indices. If the key +is for an asymmetric authentication technique (i.e. a public key +system such as RSA), an entry with multiple indices will match a host +and peer even if only the host ID matches an index (it is presumed that the +multiple indices are all identities of the host). +It is acceptable for two entries to be the best match as +long as they agree about the secret or private key. +

+ +Authentication by preshared secret requires that both systems find the +identical secret (the secret is not actually transmitted by the IKE +protocol). If both the host and peer appear in the index list, the +same entry will be suitable for both systems so verbatim copying +between systems can be used. This naturally extends to larger groups +sharing the same secret. Thus multiple-index entries are best for PSK +authentication. +

+ +Authentication by RSA Signatures requires that each host have its own private +key. A host could reasonably use a different private keys +for different interfaces and for different peers. But it would not +be normal to share entries between systems. Thus thus no-index and +one-index forms of entry often make sense for RSA Signature authentication. +

+ +The key part of an entry may start with a token indicating the kind of +key. ``RSA'' signifies RSA private key and ``PSK'' signifies +PreShared Key (case is ignored). For compatability with previous +forms of this file, PSK is the default. +

+ +A preshared secret is most conveniently represented as a sequence of +characters, delimited by the double-quote +character ("). The sequence cannot contain a newline or +double-quote. Strictly speaking, the secret is actually the sequence +of bytes that is used in the file to represent the sequence of +characters (excluding the delimiters). +A preshared secret may also be represented, without quotes, in any form supported by +ipsec_ttodata(3). +

+ +An RSA private key is a composite of eight generally large numbers. The notation +used is a brace-enclosed list of field name and value pairs (see the example above). +A suitable key, in a suitable format, may be generated by ipsec_rsasigkey(8). +The structure is very similar to that used by BIND 8.2.2 or later, but note that +the numbers must have a ``0s'' prefix if they are in base 64. The order of +the fields is fixed. +

+ +The first token an entry must start in +the first column of its line. Subsequent tokens must be +separated by whitespace, +except for a colon token, which only needs to be followed by whitespace. +A newline is taken as whitespace, but every +line of an entry after the first must be indented. +

+ +Whitespace at the end of a line is ignored (except in the 0t +notation for a key). At the start of line or +after whitespace, # and the following text up to the end of the +line is treated as a comment. Within entries, all lines must be +indented (except for lines with no tokens). +Outside entries, no line may be indented (this is to make sure that +the file layout reflects its structure). +

+ +An include directive causes the contents of the named file to be processed +before continuing with the current file. The filename is subject to +``globbing'' as in sh(1), so every file with a matching name +is processed. Includes may be nested to a modest +depth (10, currently). If the filename doesn't start with a /, the +directory containing the current file is prepended to the name. The +include directive is a line that starts with the word include, +followed by whitespace, followed by the filename (which must not contain +whitespace). +  +

FILES

+ +/etc/ipsec.secrets +  +

SEE ALSO

+ +The rest of the FreeS/WAN distribution, in particular +ipsec.conf(5), +ipsec(8), +ipsec_newhostkey(8), +ipsec_rsasigkey(8), +ipsec_showhostkey(8), +ipsec_auto(8) --rereadsecrets, +and ipsec_pluto(8) --listen,. +
+ +BIND 8.2.2 or later, ftp://ftp.isc.org/isc/bind/src/ +  +

HISTORY

+ +Designed for the FreeS/WAN project +<http://www.freeswan.org> +by D. Hugh Redelmeier. +  +

BUGS

+ +If an ID is 0.0.0.0, it will match %any; +if it is 0::0, it will match %any6. +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__confread.8.html b/doc/manpage.d/ipsec__confread.8.html new file mode 100644 index 000000000..ecc120c7e --- /dev/null +++ b/doc/manpage.d/ipsec__confread.8.html @@ -0,0 +1,58 @@ +Content-type: text/html + +Manpage of _CONFREAD + +

_CONFREAD

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _confread - internal routing to parse config file +  +

DESCRIPTION

+ +_confread + +is an internal script used for parsing /etc/ipsec.conf into a canonical format. +  +

SEE ALSO

+ +ipsec(8), ipsec_conf(8) +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Program written by Henry Spencer. + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__copyright.8.html b/doc/manpage.d/ipsec__copyright.8.html new file mode 100644 index 000000000..7f78b3feb --- /dev/null +++ b/doc/manpage.d/ipsec__copyright.8.html @@ -0,0 +1,62 @@ +Content-type: text/html + +Manpage of _COPYRIGHT + +

_COPYRIGHT

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _copyright - prints FreeSWAN copyright +  +

DESCRIPTION

+ +_copyright + +outputs the FreeSWAN copyright, and version numbers for "ipsec --copyright" +  +

SEE ALSO

+ +ipsec(8) +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Michael Richardson. Program written by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__include.8.html b/doc/manpage.d/ipsec__include.8.html new file mode 100644 index 000000000..d85ee7852 --- /dev/null +++ b/doc/manpage.d/ipsec__include.8.html @@ -0,0 +1,67 @@ +Content-type: text/html + +Manpage of _INCLUDE + +

_INCLUDE

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _include - internal script to process config files +  +

DESCRIPTION

+ +_include + +is used by +_confread + +to process +include + +directives in /etc/ipsec.conf. +  +

SEE ALSO

+ +ipsec(8), ipsec__confread(8) +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Program written by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__keycensor.8.html b/doc/manpage.d/ipsec__keycensor.8.html new file mode 100644 index 000000000..22e574932 --- /dev/null +++ b/doc/manpage.d/ipsec__keycensor.8.html @@ -0,0 +1,64 @@ +Content-type: text/html + +Manpage of _KEYCENSOR + +

_KEYCENSOR

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _keycensor - internal routine to remove sensitive information +  +

DESCRIPTION

+ +_keycensor + +is used by +ipsec barf + +to process the /etc/ipsec.secrets file, removing private key info. +  +

SEE ALSO

+ +ipsec(8), ipsec_barf(8) +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__plutoload.8.html b/doc/manpage.d/ipsec__plutoload.8.html new file mode 100644 index 000000000..2c4968300 --- /dev/null +++ b/doc/manpage.d/ipsec__plutoload.8.html @@ -0,0 +1,64 @@ +Content-type: text/html + +Manpage of _PLUTOLOAD + +

_PLUTOLOAD

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _plutoload - internal script to start pluto +  +

DESCRIPTION

+ +_plutoload + +is called by +_plutorun + +to actually start the pluto executable. +  +

SEE ALSO

+ +ipsec(8), ipsec_setup(8), ipsec__realsetup(8), ipsec__plutorun(8) +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__plutorun.8.html b/doc/manpage.d/ipsec__plutorun.8.html new file mode 100644 index 000000000..1b5a1da11 --- /dev/null +++ b/doc/manpage.d/ipsec__plutorun.8.html @@ -0,0 +1,70 @@ +Content-type: text/html + +Manpage of _PLUTORUN + +

_PLUTORUN

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _plutorun - internal script to start pluto +  +

DESCRIPTION

+ +_plutorun + +is called by +_realsetup + +to configure and bring up +ipsec_pluto(8). + +It calls +_plutoload + +to invoke pluto, and watches to makes sure that pluto is restarted if it fails. +  +

SEE ALSO

+ +ipsec(8), ipsec_setup(8), ipsec__realsetup(8), ipsec__plutoload(8), ipsec_pluto(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program written by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__realsetup.8.html b/doc/manpage.d/ipsec__realsetup.8.html new file mode 100644 index 000000000..f45bec647 --- /dev/null +++ b/doc/manpage.d/ipsec__realsetup.8.html @@ -0,0 +1,68 @@ +Content-type: text/html + +Manpage of _REALSETUP + +

_REALSETUP

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _realsetup - internal routine to start FreeS/WAN. +  +

DESCRIPTION

+ +_realsetup + +is called by the system init scripts to start the FreeS/WAN +system. It starts +KLIPS + +(the kernel component) and +pluto + +(the userspace keying component). +  +

SEE ALSO

+ +ipsec(8), ipsec__klipsstart(8), ipsec__plutorun(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__secretcensor.8.html b/doc/manpage.d/ipsec__secretcensor.8.html new file mode 100644 index 000000000..6c6ea312d --- /dev/null +++ b/doc/manpage.d/ipsec__secretcensor.8.html @@ -0,0 +1,65 @@ +Content-type: text/html + +Manpage of _SECRETCENSOR + +

_SECRETCENSOR

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _secretcensor - internal routing to sanitize files +  +

DESCRIPTION

+ +_secretcensor + +is called by +ipsec barf + +to process the /etc/ipsec.secrets file to remove the private key components +from the file prior to revealing the contents. +  +

SEE ALSO

+ +ipsec(8), ipsec_barf(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__startklips.8.html b/doc/manpage.d/ipsec__startklips.8.html new file mode 100644 index 000000000..3ad565e57 --- /dev/null +++ b/doc/manpage.d/ipsec__startklips.8.html @@ -0,0 +1,63 @@ +Content-type: text/html + +Manpage of _STARTKLIPS + +

_STARTKLIPS

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _startklips - internal script to bring up kernel components +  +

DESCRIPTION

+ +_startklips + +brings up the FreeS/WAN kernel component. This involves loading any +required modules, attaching and configuring the ipsecX pseudo-devices and +attaching the pseudo-devices to the physical devices. +  +

SEE ALSO

+ +ipsec(8), ipsec_tncfg(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec__updown.8.html b/doc/manpage.d/ipsec__updown.8.html new file mode 100644 index 000000000..73bf8a343 --- /dev/null +++ b/doc/manpage.d/ipsec__updown.8.html @@ -0,0 +1,63 @@ +Content-type: text/html + +Manpage of _UPDOWN + +

_UPDOWN

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec _updown - klips manipulation script +  +

SYNOPSIS

+ +_updown + +is invoked by pluto when it has brought up a new connection. This script +is used to insert the appropriate routing entries for IPsec operation. +The interface to the script is documented in the pluto man page. +  +

SEE ALSO

+ +ipsec(8), ipsec_pluto(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program written by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrbytesof.3.html b/doc/manpage.d/ipsec_addrbytesof.3.html new file mode 100644 index 000000000..ca1f857e7 --- /dev/null +++ b/doc/manpage.d/ipsec_addrbytesof.3.html @@ -0,0 +1,232 @@ +Content-type: text/html + +Manpage of IPSEC_INITADDR + +

IPSEC_INITADDR

+Section: C Library Functions (3)
Updated: 11 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initaddr - initialize an ip_address +
+ +ipsec addrtypeof - get address type of an ip_address +
+ +ipsec addrlenof - get length of address within an ip_address +
+ +ipsec addrbytesof - get copy of address within an ip_address +
+ +ipsec addrbytesptr - get pointer to address within an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *dst); + +
+ +int addrtypeof(const ip_address *src); + +
+ +size_t addrlenof(const ip_address *src); + +
+ +size_t addrbytesof(const ip_address *src, + +
+  +unsigned char *dst, size_t dstlen); + +
+ +size_t addrbytesptr(const ip_address *src, + +
+  +const unsigned char **dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_address + +to contain one of the (currently two) types of IP address. +These functions provide basic tools for creating and examining this type. +

+ +Initaddr + +initializes a variable +*dst + +of type +ip_address + +from an address +(in network byte order, +indicated by a pointer +src + +and a length +srclen) + +and an address family +af + +(typically +AF_INET + +or +AF_INET6). + +The length must be consistent with the address family. +

+ +Addrtypeof + +returns the address type of an address, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Addrlenof + +returns the size (in bytes) of the address within an +ip_address, + +to permit storage allocation etc. +

+ +Addrbytesof + +copies the address within the +ip_address + +src + +to the buffer indicated by the pointer +dst + +and the length +dstlen, + +and returns the address length (in bytes). +If the address will not fit, +as many bytes as will fit are copied; +the returned length is still the full length. +It is the caller's responsibility to check the +returned value to ensure that there was enough room. +

+ +Addrbytesptr + +sets +*dst + +to a pointer to the internal address within the +ip_address, + +and returns the address length (in bytes). +If +dst + +is +NULL, + +it just returns the address length. +The pointer points to +const + +to discourage misuse. +

+ +Initaddr + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +The functions which return +size_t + +return +0 + +for a failure. +  +

SEE ALSO

+ +inet(3), ipsec_ttoaddr(3) +  +

DIAGNOSTICS

+ +An unknown address family is a fatal error for any of these functions +except +addrtypeof. + +An address-size mismatch is a fatal error for +initaddr. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Addrtypeof + +should probably have been named +addrfamilyof. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrbytesptr.3.html b/doc/manpage.d/ipsec_addrbytesptr.3.html new file mode 100644 index 000000000..ca1f857e7 --- /dev/null +++ b/doc/manpage.d/ipsec_addrbytesptr.3.html @@ -0,0 +1,232 @@ +Content-type: text/html + +Manpage of IPSEC_INITADDR + +

IPSEC_INITADDR

+Section: C Library Functions (3)
Updated: 11 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initaddr - initialize an ip_address +
+ +ipsec addrtypeof - get address type of an ip_address +
+ +ipsec addrlenof - get length of address within an ip_address +
+ +ipsec addrbytesof - get copy of address within an ip_address +
+ +ipsec addrbytesptr - get pointer to address within an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *dst); + +
+ +int addrtypeof(const ip_address *src); + +
+ +size_t addrlenof(const ip_address *src); + +
+ +size_t addrbytesof(const ip_address *src, + +
+  +unsigned char *dst, size_t dstlen); + +
+ +size_t addrbytesptr(const ip_address *src, + +
+  +const unsigned char **dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_address + +to contain one of the (currently two) types of IP address. +These functions provide basic tools for creating and examining this type. +

+ +Initaddr + +initializes a variable +*dst + +of type +ip_address + +from an address +(in network byte order, +indicated by a pointer +src + +and a length +srclen) + +and an address family +af + +(typically +AF_INET + +or +AF_INET6). + +The length must be consistent with the address family. +

+ +Addrtypeof + +returns the address type of an address, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Addrlenof + +returns the size (in bytes) of the address within an +ip_address, + +to permit storage allocation etc. +

+ +Addrbytesof + +copies the address within the +ip_address + +src + +to the buffer indicated by the pointer +dst + +and the length +dstlen, + +and returns the address length (in bytes). +If the address will not fit, +as many bytes as will fit are copied; +the returned length is still the full length. +It is the caller's responsibility to check the +returned value to ensure that there was enough room. +

+ +Addrbytesptr + +sets +*dst + +to a pointer to the internal address within the +ip_address, + +and returns the address length (in bytes). +If +dst + +is +NULL, + +it just returns the address length. +The pointer points to +const + +to discourage misuse. +

+ +Initaddr + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +The functions which return +size_t + +return +0 + +for a failure. +  +

SEE ALSO

+ +inet(3), ipsec_ttoaddr(3) +  +

DIAGNOSTICS

+ +An unknown address family is a fatal error for any of these functions +except +addrtypeof. + +An address-size mismatch is a fatal error for +initaddr. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Addrtypeof + +should probably have been named +addrfamilyof. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrcmp.3.html b/doc/manpage.d/ipsec_addrcmp.3.html new file mode 100644 index 000000000..93ac522cd --- /dev/null +++ b/doc/manpage.d/ipsec_addrcmp.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrinsubnet.3.html b/doc/manpage.d/ipsec_addrinsubnet.3.html new file mode 100644 index 000000000..93ac522cd --- /dev/null +++ b/doc/manpage.d/ipsec_addrinsubnet.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrlenof.3.html b/doc/manpage.d/ipsec_addrlenof.3.html new file mode 100644 index 000000000..ca1f857e7 --- /dev/null +++ b/doc/manpage.d/ipsec_addrlenof.3.html @@ -0,0 +1,232 @@ +Content-type: text/html + +Manpage of IPSEC_INITADDR + +

IPSEC_INITADDR

+Section: C Library Functions (3)
Updated: 11 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initaddr - initialize an ip_address +
+ +ipsec addrtypeof - get address type of an ip_address +
+ +ipsec addrlenof - get length of address within an ip_address +
+ +ipsec addrbytesof - get copy of address within an ip_address +
+ +ipsec addrbytesptr - get pointer to address within an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *dst); + +
+ +int addrtypeof(const ip_address *src); + +
+ +size_t addrlenof(const ip_address *src); + +
+ +size_t addrbytesof(const ip_address *src, + +
+  +unsigned char *dst, size_t dstlen); + +
+ +size_t addrbytesptr(const ip_address *src, + +
+  +const unsigned char **dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_address + +to contain one of the (currently two) types of IP address. +These functions provide basic tools for creating and examining this type. +

+ +Initaddr + +initializes a variable +*dst + +of type +ip_address + +from an address +(in network byte order, +indicated by a pointer +src + +and a length +srclen) + +and an address family +af + +(typically +AF_INET + +or +AF_INET6). + +The length must be consistent with the address family. +

+ +Addrtypeof + +returns the address type of an address, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Addrlenof + +returns the size (in bytes) of the address within an +ip_address, + +to permit storage allocation etc. +

+ +Addrbytesof + +copies the address within the +ip_address + +src + +to the buffer indicated by the pointer +dst + +and the length +dstlen, + +and returns the address length (in bytes). +If the address will not fit, +as many bytes as will fit are copied; +the returned length is still the full length. +It is the caller's responsibility to check the +returned value to ensure that there was enough room. +

+ +Addrbytesptr + +sets +*dst + +to a pointer to the internal address within the +ip_address, + +and returns the address length (in bytes). +If +dst + +is +NULL, + +it just returns the address length. +The pointer points to +const + +to discourage misuse. +

+ +Initaddr + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +The functions which return +size_t + +return +0 + +for a failure. +  +

SEE ALSO

+ +inet(3), ipsec_ttoaddr(3) +  +

DIAGNOSTICS

+ +An unknown address family is a fatal error for any of these functions +except +addrtypeof. + +An address-size mismatch is a fatal error for +initaddr. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Addrtypeof + +should probably have been named +addrfamilyof. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrtoa.3.html b/doc/manpage.d/ipsec_addrtoa.3.html new file mode 100644 index 000000000..8f0d765e5 --- /dev/null +++ b/doc/manpage.d/ipsec_addrtoa.3.html @@ -0,0 +1,448 @@ +Content-type: text/html + +Manpage of IPSEC_ATOADDR + +

IPSEC_ATOADDR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoaddr, addrtoa - convert Internet addresses to and from ASCII +
+ +ipsec atosubnet, subnettoa - convert subnet/mask ASCII form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoaddr(const char *src, size_t srclen, + +
+  +struct in_addr *addr); + +
+ +size_t addrtoa(struct in_addr addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *atosubnet(const char *src, size_t srclen, + +
+  +struct in_addr *addr, struct in_addr *mask); + +
+ +size_t subnettoa(struct in_addr addr, struct in_addr mask, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoaddr(3) + +for their replacements. +

+ +Atoaddr + +converts an ASCII name or dotted-decimal address into a binary address +(in network byte order). +Addrtoa + +does the reverse conversion, back to an ASCII dotted-decimal address. +Atosubnet + +and +subnettoa + +do likewise for the ``address/mask'' ASCII form used to write a +specification of a subnet. +

+ +An address is specified in ASCII as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +ASCII-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of +addrtoa + +is always complete and does not contain leading zeros. +

+ +The letters in +a hexadecimal address may be uppercase or lowercase or any mixture thereof. +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +Name lookup resorts to +getnetbyname(3) + +only if +gethostbyname(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +atoaddr. + +In addition, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0. + +

+ +Atosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettoa + +generates the decimal-integer-bit-count +form of the mask, +with no leading zeros, +unless the mask is non-contiguous. +

+ +The +srclen + +parameter of +atoaddr + +and +atosubnet + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +addrtoa + +and +subnettoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOA_BUF + +and +SUBNETTOA_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtoa + +and +subnettoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +The ASCII-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-ASCII functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoaddr + +are: +empty input; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal form; +dotted-decimal component too large to fit in 8 bits. +

+ +Fatal errors in +atosubnet + +are: +no +/ + +in +src; + +atoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtoa + +and +subnettoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrtosubnet.3.html b/doc/manpage.d/ipsec_addrtosubnet.3.html new file mode 100644 index 000000000..e442a9100 --- /dev/null +++ b/doc/manpage.d/ipsec_addrtosubnet.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrtot.3.html b/doc/manpage.d/ipsec_addrtot.3.html new file mode 100644 index 000000000..eccb946e6 --- /dev/null +++ b/doc/manpage.d/ipsec_addrtot.3.html @@ -0,0 +1,569 @@ +Content-type: text/html + +Manpage of IPSEC_TTOADDR + +

IPSEC_TTOADDR

+Section: C Library Functions (3)
Updated: 28 Sept 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoaddr, tnatoaddr, addrtot - convert Internet addresses to and from text +
+ +ipsec ttosubnet, subnettot - convert subnet/mask text form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +const char *tnatoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +size_t addrtot(const ip_address *addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *ttosubnet(const char *src, size_t srclen, + +
+  +int af, ip_subnet *dst); + +
+ +size_t subnettot(const ip_subnet *sub, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttoaddr + +converts a text-string name or numeric address into a binary address +(in network byte order). +Tnatoaddr + +does the same conversion, +but the only text forms it accepts are +the ``official'' forms of +numeric address (dotted-decimal for IPv4, colon-hex for IPv6). +Addrtot + +does the reverse conversion, from binary address back to a text form. +Ttosubnet + +and +subnettot + +do likewise for the ``address/mask'' form used to write a +specification of a subnet. +

+ +An IPv4 address is specified in text as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +text-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of applying +addrtot + +to an IPv4 address is always complete and does not contain leading zeros. +

+ +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +An IPv6 address is specified in text with +colon-hex notation (e.g. +0:56:78ab:22:33:44:55:66), + +colon-hex with +:: + +abbreviating at most one subsequence of multiple zeros (e.g. +99:ab::54:068, + +which is synonymous with +99:ab:0:0:0:0:54:68), + +or a DNS name to be looked up via +gethostbyname(3). + +The result of applying +addrtot + +to an IPv6 address will use +:: + +abbreviation if possible, +and will not contain leading zeros. +

+ +The letters in hexadecimal +may be uppercase or lowercase or any mixture thereof. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname2(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +IPv4 name lookup resorts to +getnetbyname(3) + +only if +gethostbyname2(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +ttoaddr. + +In addition, and preferably, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +in IPv4 means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0 + +or +::/0 + +in IPv4 or IPv6 respectively. +

+ +Ttosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettot + +always generates the decimal-integer-bit-count +form of the mask, +with no leading zeros. +

+ +The +srclen + +parameter of +ttoaddr + +and +ttosubnet + +specifies the length of the text string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +af + +parameter of +ttoaddr + +and +ttosubnet + +specifies the address family of interest. +It should be either +AF_INET + +or +AF_INET6. + +

+ +The +dstlen + +parameter of +addrtot + +and +subnettot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOT_BUF + +and +SUBNETTOT_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtot + +and +subnettot + +specifies what format is to be used for the conversion. +The value +0 + +(not the character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available in +subnettot. + +Addrtot + +also accepts format values +'r' + +(signifying a text form suitable for DNS reverse lookups, +e.g. +4.3.2.1.IN-ADDR.ARPA. + +for IPv4 and +RFC 2874 format for IPv6), +and +'R' + +(signifying an alternate reverse-lookup form, +an error for IPv4 and RFC 1886 format for IPv6). +Reverse-lookup names always end with a ``.''. +

+ +The text-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-text functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoaddr + +are: +empty input; +unknown address family; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal or colon-hex form; +dotted-decimal or colon-hex component too large. +

+ +Fatal errors in +ttosubnet + +are: +no +/ + +in +src; + +ttoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtot + +and +subnettot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +Ttoaddr + +does not support the mixed colon-hex-dotted-decimal +convention used to embed an IPv4 address in an IPv6 address. +

+ +Addrtot + +always uses the +:: + +abbreviation (which can appear only once in an address) for the +first + +sequence of multiple zeros in an IPv6 address. +One can construct addresses (unlikely ones) in which this is suboptimal. +

+ +Addrtot + +'r' + +conversion of an IPv6 address uses lowercase hexadecimal, +not the uppercase used in RFC 2874's examples. +It takes careful reading of RFCs 2874, 2673, and 2234 to realize +that lowercase is technically legitimate here, +and there may be software which botches this +and hence would have trouble with lowercase hex. +

+ +Possibly +subnettot + +ought to recognize the +%default + +case and generate that string as its output. +Currently it doesn't. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +Tnatoaddr + +probably should enforce completeness of dotted-decimal addresses. +

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_addrtypeof.3.html b/doc/manpage.d/ipsec_addrtypeof.3.html new file mode 100644 index 000000000..ca1f857e7 --- /dev/null +++ b/doc/manpage.d/ipsec_addrtypeof.3.html @@ -0,0 +1,232 @@ +Content-type: text/html + +Manpage of IPSEC_INITADDR + +

IPSEC_INITADDR

+Section: C Library Functions (3)
Updated: 11 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initaddr - initialize an ip_address +
+ +ipsec addrtypeof - get address type of an ip_address +
+ +ipsec addrlenof - get length of address within an ip_address +
+ +ipsec addrbytesof - get copy of address within an ip_address +
+ +ipsec addrbytesptr - get pointer to address within an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *dst); + +
+ +int addrtypeof(const ip_address *src); + +
+ +size_t addrlenof(const ip_address *src); + +
+ +size_t addrbytesof(const ip_address *src, + +
+  +unsigned char *dst, size_t dstlen); + +
+ +size_t addrbytesptr(const ip_address *src, + +
+  +const unsigned char **dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_address + +to contain one of the (currently two) types of IP address. +These functions provide basic tools for creating and examining this type. +

+ +Initaddr + +initializes a variable +*dst + +of type +ip_address + +from an address +(in network byte order, +indicated by a pointer +src + +and a length +srclen) + +and an address family +af + +(typically +AF_INET + +or +AF_INET6). + +The length must be consistent with the address family. +

+ +Addrtypeof + +returns the address type of an address, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Addrlenof + +returns the size (in bytes) of the address within an +ip_address, + +to permit storage allocation etc. +

+ +Addrbytesof + +copies the address within the +ip_address + +src + +to the buffer indicated by the pointer +dst + +and the length +dstlen, + +and returns the address length (in bytes). +If the address will not fit, +as many bytes as will fit are copied; +the returned length is still the full length. +It is the caller's responsibility to check the +returned value to ensure that there was enough room. +

+ +Addrbytesptr + +sets +*dst + +to a pointer to the internal address within the +ip_address, + +and returns the address length (in bytes). +If +dst + +is +NULL, + +it just returns the address length. +The pointer points to +const + +to discourage misuse. +

+ +Initaddr + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +The functions which return +size_t + +return +0 + +for a failure. +  +

SEE ALSO

+ +inet(3), ipsec_ttoaddr(3) +  +

DIAGNOSTICS

+ +An unknown address family is a fatal error for any of these functions +except +addrtypeof. + +An address-size mismatch is a fatal error for +initaddr. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Addrtypeof + +should probably have been named +addrfamilyof. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_anyaddr.3.html b/doc/manpage.d/ipsec_anyaddr.3.html new file mode 100644 index 000000000..974236005 --- /dev/null +++ b/doc/manpage.d/ipsec_anyaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_atoaddr.3.html b/doc/manpage.d/ipsec_atoaddr.3.html new file mode 100644 index 000000000..8f0d765e5 --- /dev/null +++ b/doc/manpage.d/ipsec_atoaddr.3.html @@ -0,0 +1,448 @@ +Content-type: text/html + +Manpage of IPSEC_ATOADDR + +

IPSEC_ATOADDR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoaddr, addrtoa - convert Internet addresses to and from ASCII +
+ +ipsec atosubnet, subnettoa - convert subnet/mask ASCII form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoaddr(const char *src, size_t srclen, + +
+  +struct in_addr *addr); + +
+ +size_t addrtoa(struct in_addr addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *atosubnet(const char *src, size_t srclen, + +
+  +struct in_addr *addr, struct in_addr *mask); + +
+ +size_t subnettoa(struct in_addr addr, struct in_addr mask, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoaddr(3) + +for their replacements. +

+ +Atoaddr + +converts an ASCII name or dotted-decimal address into a binary address +(in network byte order). +Addrtoa + +does the reverse conversion, back to an ASCII dotted-decimal address. +Atosubnet + +and +subnettoa + +do likewise for the ``address/mask'' ASCII form used to write a +specification of a subnet. +

+ +An address is specified in ASCII as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +ASCII-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of +addrtoa + +is always complete and does not contain leading zeros. +

+ +The letters in +a hexadecimal address may be uppercase or lowercase or any mixture thereof. +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +Name lookup resorts to +getnetbyname(3) + +only if +gethostbyname(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +atoaddr. + +In addition, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0. + +

+ +Atosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettoa + +generates the decimal-integer-bit-count +form of the mask, +with no leading zeros, +unless the mask is non-contiguous. +

+ +The +srclen + +parameter of +atoaddr + +and +atosubnet + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +addrtoa + +and +subnettoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOA_BUF + +and +SUBNETTOA_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtoa + +and +subnettoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +The ASCII-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-ASCII functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoaddr + +are: +empty input; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal form; +dotted-decimal component too large to fit in 8 bits. +

+ +Fatal errors in +atosubnet + +are: +no +/ + +in +src; + +atoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtoa + +and +subnettoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_atoasr.3.html b/doc/manpage.d/ipsec_atoasr.3.html new file mode 100644 index 000000000..7c9e2c4aa --- /dev/null +++ b/doc/manpage.d/ipsec_atoasr.3.html @@ -0,0 +1,294 @@ +Content-type: text/html + +Manpage of IPSEC_ATOASR + +

IPSEC_ATOASR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoasr - convert ASCII to Internet address, subnet, or range +
+ +ipsec rangetoa - convert Internet address range to ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoasr(const char *src, size_t srclen, + +
+  +char *type, struct in_addr *addrs); + +
+ +size_t rangetoa(struct in_addr *addrs, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; +there is no current equivalent, +because so far they have not proved useful. +

+ +Atoasr + +converts an ASCII address, subnet, or address range +into a suitable combination of binary addresses +(in network byte order). +Rangetoa + +converts an address range back into ASCII, +using dotted-decimal form for the addresses +(the other reverse conversions are handled by +ipsec_addrtoa(3) + +and +ipsec_subnettoa(3)). + +

+ +A single address can be any form acceptable to +ipsec_atoaddr(3): + +dotted decimal, DNS name, or hexadecimal number. +A subnet +specification uses the form network/mask +interpreted by +ipsec_atosubnet(3). + +

+ +An address range is two +ipsec_atoaddr(3) + +addresses separated by a +... + +delimiter. +If there are four dots rather than three, the first is taken as +part of the begin address, +e.g. for a complete DNS name which ends with +. + +to suppress completion attempts. +The begin address of a range must be +less than or equal to the end address. +

+ +The +srclen + +parameter of +atoasr + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +type + +parameter of +atoasr + +must point to a +char + +variable used to record which form was found. +The +addrs + +parameter must point to a two-element array of +struct in_addr + +which receives the results. +The values stored into +*type, + +and the corresponding values in the array, are: +

+ + + +   *typeaddrs[0]addrs[1]
+

+address'a'address-
+
+ +subnet 's'networkmask
+
+ +range  'r'beginend
+

+ +The +dstlen + +parameter of +rangetoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +RANGETOA_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +rangetoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +Atoasr + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Rangetoa + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +ipsec_atoaddr(3), ipsec_atosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoasr + +are: +empty input; +error in +ipsec_atoaddr(3) + +or +ipsec_atosubnet(3) + +during conversion; +begin address of range exceeds end address. +

+ +Fatal errors in +rangetoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoasr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_atosa.3.html b/doc/manpage.d/ipsec_atosa.3.html new file mode 100644 index 000000000..9e2dc2f61 --- /dev/null +++ b/doc/manpage.d/ipsec_atosa.3.html @@ -0,0 +1,347 @@ +Content-type: text/html + +Manpage of IPSEC_ATOSA + +

IPSEC_ATOSA

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atosa, satoa - convert IPsec Security Association IDs to and from ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atosa(const char *src, size_t srclen, + +
+  +struct sa_id *sa); + +
+ +size_t satoa(struct sa_id sa, int format, + +
+  +char *dst, size_t dstlen); + +

+struct sa_id { + +
+  +struct in_addr dst; + +
+  +ipsec_spi_t spi; + +
+  +int proto; + +
+ +}; + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttosa(3) + +for their replacements. +

+ +Atosa + +converts an ASCII Security Association (SA) specifier into an +sa_id + +structure (containing +a destination-host address +in network byte order, +an SPI number in network byte order, and +a protocol code). +Satoa + +does the reverse conversion, back to an ASCII SA specifier. +

+ +An SA is specified in ASCII with a mail-like syntax, e.g. +esp507@1.2.3.4. + +An SA specifier contains +a protocol prefix (currently +ah, + +esp, + +or +tun), + +an unsigned integer SPI number, +and an IP address. +The SPI number can be decimal or hexadecimal +(with +0x + +prefix), as accepted by +ipsec_atoul(3). + +The IP address can be any form accepted by +ipsec_atoaddr(3), + +e.g. dotted-decimal address or DNS name. +

+ +As a special case, the SA specifier +%passthrough + +signifies the special SA used to indicate that packets should be +passed through unaltered. +(At present, this is a synonym for +tun0x0@0.0.0.0, + +but that is subject to change without notice.) +This form is known to both +atosa + +and +satoa, + +so the internal form of +%passthrough + +is never visible. +

+ +The +<freeswan.h> + +header file supplies the +sa_id + +structure, as well as a data type +ipsec_spi_t + +which is an unsigned 32-bit integer. +(There is no consistency between kernel and user on what such a type +is called, hence the header hides the differences.) +

+ +The protocol code uses the same numbers that IP does. +For user convenience, given the difficulty in acquiring the exact set of +protocol names used by the kernel, +<freeswan.h> + +defines the names +SA_ESP, + +SA_AH, + +and +SA_IPIP + +to have the same values as the kernel names +IPPROTO_ESP, + +IPPROTO_AH, + +and +IPPROTO_IPIP. + +

+ +The +srclen + +parameter of +atosa + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +satoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +SATOA_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +satoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default +(currently +lowercase protocol prefix, lowercase hexadecimal SPI, dotted-decimal address). +The value +d + +causes the SPI to be generated in decimal instead. +

+ +Atosa + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Satoa + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +ipsec_atoul(3), ipsec_atoaddr(3), inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atosa + +are: +empty input; +input too small to be a legal SA specifier; +no +@ + +in input; +unknown protocol prefix; +conversion error in +atoul + +or +atoaddr. + +

+ +Fatal errors in +satoa + +are: +unknown format; unknown protocol code. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The +tun + +protocol code is a FreeS/WANism which may eventually disappear. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_atosubnet.3.html b/doc/manpage.d/ipsec_atosubnet.3.html new file mode 100644 index 000000000..8f0d765e5 --- /dev/null +++ b/doc/manpage.d/ipsec_atosubnet.3.html @@ -0,0 +1,448 @@ +Content-type: text/html + +Manpage of IPSEC_ATOADDR + +

IPSEC_ATOADDR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoaddr, addrtoa - convert Internet addresses to and from ASCII +
+ +ipsec atosubnet, subnettoa - convert subnet/mask ASCII form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoaddr(const char *src, size_t srclen, + +
+  +struct in_addr *addr); + +
+ +size_t addrtoa(struct in_addr addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *atosubnet(const char *src, size_t srclen, + +
+  +struct in_addr *addr, struct in_addr *mask); + +
+ +size_t subnettoa(struct in_addr addr, struct in_addr mask, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoaddr(3) + +for their replacements. +

+ +Atoaddr + +converts an ASCII name or dotted-decimal address into a binary address +(in network byte order). +Addrtoa + +does the reverse conversion, back to an ASCII dotted-decimal address. +Atosubnet + +and +subnettoa + +do likewise for the ``address/mask'' ASCII form used to write a +specification of a subnet. +

+ +An address is specified in ASCII as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +ASCII-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of +addrtoa + +is always complete and does not contain leading zeros. +

+ +The letters in +a hexadecimal address may be uppercase or lowercase or any mixture thereof. +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +Name lookup resorts to +getnetbyname(3) + +only if +gethostbyname(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +atoaddr. + +In addition, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0. + +

+ +Atosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettoa + +generates the decimal-integer-bit-count +form of the mask, +with no leading zeros, +unless the mask is non-contiguous. +

+ +The +srclen + +parameter of +atoaddr + +and +atosubnet + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +addrtoa + +and +subnettoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOA_BUF + +and +SUBNETTOA_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtoa + +and +subnettoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +The ASCII-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-ASCII functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoaddr + +are: +empty input; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal form; +dotted-decimal component too large to fit in 8 bits. +

+ +Fatal errors in +atosubnet + +are: +no +/ + +in +src; + +atoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtoa + +and +subnettoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_atoul.3.html b/doc/manpage.d/ipsec_atoul.3.html new file mode 100644 index 000000000..923a16131 --- /dev/null +++ b/doc/manpage.d/ipsec_atoul.3.html @@ -0,0 +1,266 @@ +Content-type: text/html + +Manpage of IPSEC_ATOUL + +

IPSEC_ATOUL

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoul, ultoa - convert unsigned-long numbers to and from ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoul(const char *src, size_t srclen, + +
+  +int base, unsigned long *n); + +
+ +size_t ultoa(unsigned long n, int base, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoul(3) + +for their replacements. +

+ +Atoul + +converts an ASCII number into a binary +unsigned long + +value. +Ultoa + +does the reverse conversion, back to an ASCII version. +

+ +Numbers are specified in ASCII as +decimal (e.g. +123), + +octal with a leading zero (e.g. +012, + +which has value 10), +or hexadecimal with a leading +0x + +(e.g. +0x1f, + +which has value 31) +in either upper or lower case. +

+ +The +srclen + +parameter of +atoul + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +base + +parameter of +atoul + +can be +8, + +10, + +or +16, + +in which case the number supplied is assumed to be of that form +(and in the case of +16, + +to lack any +0x + +prefix). +It can also be +0, + +in which case the number is examined for a leading zero +or a leading +0x + +to determine its base, +or +13 + +(halfway between 10 and 16), +which has the same effect as +0 + +except that a non-hexadecimal +number is considered decimal regardless of any leading zero. +

+ +The +dstlen + +parameter of +ultoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +

+ +The +base + +parameter of +ultoa + +must be +8, + +10, + +or +16. + +

+ +Atoul + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Ultoa + +returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +atol(3), strtoul(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoul + +are: +empty input; +unknown +base; + +non-digit character found; +number too large for an +unsigned long. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +There is no provision for reporting an invalid +base + +parameter given to +ultoa. + +

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoul( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_auto.8.html b/doc/manpage.d/ipsec_auto.8.html new file mode 100644 index 000000000..68ca61bdc --- /dev/null +++ b/doc/manpage.d/ipsec_auto.8.html @@ -0,0 +1,416 @@ +Content-type: text/html + +Manpage of IPSEC_AUTO + +

IPSEC_AUTO

+Section: Maintenance Commands (8)
Updated: 31 Jan 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec auto - control automatically-keyed IPsec connections +  +

SYNOPSIS

+ +ipsec + +auto + +[ +--show + +] [ +--showonly + +] [ +--asynchronous + +] +
+ +   [ +--config + +configfile +] [ +--verbose + +] +
+ +   operation +connection +

+ipsec + +auto + +[ +--show + +] [ +--showonly + +] operation +  +

DESCRIPTION

+ +Auto + +manipulates automatically-keyed FreeS/WAN IPsec connections, +setting them up and shutting them down +based on the information in the IPsec configuration file. +In the normal usage, +connection + +is the name of a connection specification in the configuration file; +operation + +is +--add, + +--delete, + +--replace, + +--up, + +--down, + +--route, + +or +--unroute. + +The +--ready, + +--rereadsecrets, + +--rereadgroups, + +and +--status + +operations + +do not take a connection name. +Auto + +generates suitable +commands and feeds them to a shell for execution. +

+ +The +--add + +operation adds a connection specification to the internal database +within +pluto; + +it will fail if +pluto + +already has a specification by that name. +The +--delete + +operation deletes a connection specification from +pluto's + +internal database (also tearing down any connections based on it); +it will fail if the specification does not exist. +The +--replace + +operation is equivalent to +--delete + +(if there is already a specification by the given name) +followed by +--add, + +and is a convenience for updating +pluto's + +internal specification to match an external one. +(Note that a +--rereadsecrets + +may also be needed.) +The +--rereadgroups + +operation causes any changes to the policy group files to take effect +(this is currently a synonym for +--ready, + +but that may change). +None of the other operations alters the internal database. +

+ +The +--up + +operation asks +pluto + +to establish a connection based on an entry in its internal database. +The +--down + +operation tells +pluto + +to tear down such a connection. +

+ +Normally, +pluto + +establishes a route to the destination specified for a connection as +part of the +--up + +operation. +However, the route and only the route can be established with the +--route + +operation. +Until and unless an actual connection is established, +this discards any packets sent there, +which may be preferable to having them sent elsewhere based on a more +general route (e.g., a default route). +

+ +Normally, +pluto's + +route to a destination remains in place when a +--down + +operation is used to take the connection down +(or if connection setup, or later automatic rekeying, fails). +This permits establishing a new connection (perhaps using a +different specification; the route is altered as necessary) +without having a ``window'' in which packets might go elsewhere +based on a more general route. +Such a route can be removed using the +--unroute + +operation +(and is implicitly removed by +--delete). + +

+ +The +--ready + +operation tells +pluto + +to listen for connection-setup requests from other hosts. +Doing an +--up + +operation before doing +--ready + +on both ends is futile and will not work, +although this is now automated as part of IPsec startup and +should not normally be an issue. +

+ +The +--status + +operation asks +pluto + +for current connection status. +The output format is ad-hoc and likely to change. +

+ +The +--rereadsecrets + +operation tells +pluto + +to re-read the +/etc/ipsec.secrets + +secret-keys file, +which it normally reads only at startup time. +(This is currently a synonym for +--ready, + +but that may change.) +

+ +The +--show + +option turns on the +-x + +option of the shell used to execute the commands, +so each command is shown as it is executed. +

+ +The +--showonly + +option causes +auto + +to show the commands it would run, on standard output, +and not run them. +

+ +The +--asynchronous + +option, applicable only to the +up + +operation, +tells +pluto + +to attempt to establish the connection, +but does not delay to report results. +This is especially useful to start multiple connections in parallel +when network links are slow. +

+ +The +--verbose + +option instructs +auto + +to pass through all output from +ipsec_whack(8), + +including log output that is normally filtered out as uninteresting. +

+ +The +--config + +option specifies a non-standard location for the IPsec +configuration file (default +/etc/ipsec.conf). + +

+ +See +ipsec.conf(5) + +for details of the configuration file. +Apart from the basic parameters which specify the endpoints and routing +of a connection (left +and +right, + +plus possibly +leftsubnet, + +leftnexthop, + +leftfirewall, + +their +right + +equivalents, +and perhaps +type), + +an +auto + +connection almost certainly needs a +keyingtries + +parameter (since the +keyingtries + +default is poorly chosen). +  +

FILES

+ + + +/etc/ipsec.conf        default IPSEC configuration file
+
+ +/var/run/ipsec.info   %defaultroute information
+  +

SEE ALSO

+ +ipsec.conf(5), ipsec(8), ipsec_pluto(8), ipsec_whack(8), ipsec_manual(8) +  +

HISTORY

+ +Written for the FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +Although an +--up + +operation does connection setup on both ends, +--down + +tears only one end of the connection down +(although the orphaned end will eventually time out). +

+ +There is no support for +passthrough + +connections. +

+ +A connection description which uses +%defaultroute + +for one of its +nexthop + +parameters but not the other may be falsely +rejected as erroneous in some circumstances. +

+ +The exit status of +--showonly + +does not always reflect errors discovered during processing of the request. +(This is fine for human inspection, but not so good for use in scripts.) +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_barf.8.html b/doc/manpage.d/ipsec_barf.8.html new file mode 100644 index 000000000..e7b7200e0 --- /dev/null +++ b/doc/manpage.d/ipsec_barf.8.html @@ -0,0 +1,150 @@ +Content-type: text/html + +Manpage of IPSEC_BARF + +

IPSEC_BARF

+Section: Maintenance Commands (8)
Updated: 17 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec barf - spew out collected IPsec debugging information +  +

SYNOPSIS

+ +ipsec + +barf + +[ +--short + +] +

+  +

DESCRIPTION

+ +Barf + +outputs (on standard output) a collection of debugging information +(contents of files, selections from logs, etc.) +related to the IPsec encryption/authentication system. +It is primarily a convenience for remote debugging, +a single command which packages up (and labels) all information +that might be relevant to diagnosing a problem in IPsec. +

+ +

+ +The +--short + +option limits the length of +the log portion of +barf's + +output, which can otherwise be extremely voluminous +if debug logging is turned on. +

+ +Barf + +censors its output, +replacing keys +and secrets with brief checksums to avoid revealing sensitive information. +

+ +Beware that the output of both commands is aimed at humans, +not programs, +and the output format is subject to change without warning. +

+ +Barf + +has to figure out which files in +/var/log + +contain the IPsec log messages. +It looks for KLIPS and general log messages first in +messages + +and +syslog, + +and for Pluto messages first in +secure, + +auth.log, + +and +debug. + +In both cases, +if it does not find what it is looking for in one of those ``likely'' places, +it will resort to a brute-force search of most (non-compressed) files in +/var/log. + +  +

FILES

+ +
+/proc/net/*
+/var/log/*
+/etc/ipsec.conf
+/etc/ipsec.secrets
+
+ +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +Barf + +uses heuristics to try to pick relevant material out of the logs, +and relevant messages +which are not labelled with any of the tags that +barf + +looks for will be lost. +We think we've eliminated the last such case, but one never knows... +

+ +Finding +updown + +scripts (so they can be included in output) is, in general, difficult. +Barf + +uses a very simple heuristic that is easily fooled. +

+ +The brute-force search for the right log files can get expensive on +systems with a lot of clutter in +/var/log. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_bitstomask.3.html b/doc/manpage.d/ipsec_bitstomask.3.html new file mode 100644 index 000000000..a67a08d83 --- /dev/null +++ b/doc/manpage.d/ipsec_bitstomask.3.html @@ -0,0 +1,122 @@ +Content-type: text/html + +Manpage of IPSEC_GOODMASK + +

IPSEC_GOODMASK

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec goodmask - is this Internet subnet mask a valid one? +
+ +ipsec masktobits - convert Internet subnet mask to bit count +
+ +ipsec bitstomask - convert bit count to Internet subnet mask +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int goodmask(struct in_addr mask); + +
+ +int masktobits(struct in_addr mask); + +
+ +struct in_addr bitstomask(int n); + +  +

DESCRIPTION

+ +These functions are obsolete; +see +ipsec_masktocount(3) + +for a partial replacement. +

+ +Goodmask + +reports whether the subnet +mask + +is a valid one, +i.e. consists of a (possibly empty) sequence of +1s + +followed by a (possibly empty) sequence of +0s. + +Masktobits + +takes a (valid) subnet mask and returns the number of +1 + +bits in it. +Bitstomask + +reverses this, +returning the subnet mask corresponding to bit count +n. + +

+ +All masks are in network byte order. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

DIAGNOSTICS

+ +Masktobits + +returns +-1 + +for an invalid mask. +Bitstomask + +returns an all-zeros mask for a negative or out-of-range +n. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The error-reporting convention of +bitstomask + +is less than ideal; +zero is sometimes a legitimate mask. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_broadcastof.3.html b/doc/manpage.d/ipsec_broadcastof.3.html new file mode 100644 index 000000000..57d4a5648 --- /dev/null +++ b/doc/manpage.d/ipsec_broadcastof.3.html @@ -0,0 +1,107 @@ +Content-type: text/html + +Manpage of IPSEC_SUBNETOF + +

IPSEC_SUBNETOF

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec subnetof - given Internet address and subnet mask, return subnet number +
+ +ipsec hostof - given Internet address and subnet mask, return host part +
+ +ipsec broadcastof - given Internet address and subnet mask, return broadcast address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+struct in_addr subnetof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr hostof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr broadcastof(struct in_addr addr, + +
+  +struct in_addr mask); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_networkof(3) + +for their replacements. +

+ +Subnetof + +takes an Internet +address + +and a subnet +mask + +and returns the network part of the address +(all in network byte order). +Hostof + +similarly returns the host part, and +broadcastof + +returns the broadcast address (all-1s convention) for the network. +

+ +These functions are provided to hide the Internet bit-munging inside +an API, in hopes of easing the eventual transition to IPv6. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Calling functions for this is more costly than doing it yourself. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_calcgoo.8.html b/doc/manpage.d/ipsec_calcgoo.8.html new file mode 100644 index 000000000..8379ac6a4 --- /dev/null +++ b/doc/manpage.d/ipsec_calcgoo.8.html @@ -0,0 +1,78 @@ +Content-type: text/html + +Manpage of IPSEC_CALCGOO + +

IPSEC_CALCGOO

+Section: Maintenance Commands (8)
Updated: 8 June 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec calcgoo - calculate hex value for matching modules and kernels +  +

SYNOPSIS

+ +ipsec + +calcgoo + +  +

DESCRIPTION

+ +calcgoo + +accepts the output of +nm -ao + +or +/proc/ksyms + +and extracts a release dependant list of symbols from it. The symbols +are processed to extract the values assigned during the MODVERSIONS +process. This process makes sure that Linux modules are only loaded +on matching kernels. + +This routine is used to find an appropriate module to match the currently +running kernel by _startklips. +  +

FILES

+ +
+/proc/ksyms
+
+ +  +

SEE ALSO

+ +ipsec__startklips(8), genksyms(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Michael Richardson. +  +

BUGS

+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_copyright_notice.3.html b/doc/manpage.d/ipsec_copyright_notice.3.html new file mode 100644 index 000000000..c832e01f7 --- /dev/null +++ b/doc/manpage.d/ipsec_copyright_notice.3.html @@ -0,0 +1,94 @@ +Content-type: text/html + +Manpage of IPSEC_VERSION + +

IPSEC_VERSION

+Section: C Library Functions (3)
Updated: 21 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ipsec_version_code - get IPsec version code +
+ +ipsec ipsec_version_string - get full IPsec version string +
+ +ipsec ipsec_copyright_notice - get IPsec copyright notice +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ipsec_version_code(void); + +
+ +const char *ipsec_version_string(void); + +
+ +const char **ipsec_copyright_notice(void); + +  +

DESCRIPTION

+ +These functions provide information on version numbering and copyright +of the Linux FreeS/WAN IPsec implementation. +

+ +Ipsec_version_code + +returns a pointer to a string constant +containing the current IPsec version code, +such as ``1.92'' or ``snap2001Nov19b''. +

+ +Ipsec_version_string + +returns a pointer to a string constant giving a full version identification, +consisting of the version code preceded by a prefix identifying the software, +e.g. ``Linux FreeS/WAN 1.92''. +

+ +Ipsec_copyright_notice + +returns a pointer to a vector of pointers, +terminated by a +NULL, + +which is the text of a suitable copyright notice. +Each pointer points to a string constant (possibly empty) which is one line +of the somewhat-verbose copyright notice. +The strings are NUL-terminated and do not contain a newline; +supplying suitable line termination for the output device is +the caller's responsibility. +  +

SEE ALSO

+ +ipsec(8) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_datatot.3.html b/doc/manpage.d/ipsec_datatot.3.html new file mode 100644 index 000000000..628558001 --- /dev/null +++ b/doc/manpage.d/ipsec_datatot.3.html @@ -0,0 +1,439 @@ +Content-type: text/html + +Manpage of IPSEC_TTODATA + +

IPSEC_TTODATA

+Section: C Library Functions (3)
Updated: 16 August 2003
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttodata, datatot - convert binary data bytes from and to text formats +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttodata(const char *src, size_t srclen, + +
+  +int base, char *dst, size_t dstlen, size_t *lenp); + +
+ +const char *ttodatav(const char *src, size_t srclen, + +
+  +int base, char *dst, size_t dstlen, size_t *lenp, + +
+  +char *errp, size_t errlen, int flags); + +
+ +size_t datatot(const char *src, size_t srclen, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttodata, + +ttodatav, + +and +datatot + +convert arbitrary binary data (e.g. encryption or authentication keys) +from and to more-or-less human-readable text formats. +

+ +Currently supported formats are hexadecimal, base64, and characters. +

+ +A hexadecimal text value begins with a +0x + +(or +0X) + +prefix and continues with two-digit groups +of hexadecimal digits (0-9, and a-f or A-F), +each group encoding the value of one binary byte, high-order digit first. +A single +_ + +(underscore) +between consecutive groups is ignored, permitting punctuation to improve +readability; doing this every eight digits seems about right. +

+ +A base64 text value begins with a +0s + +(or +0S) + +prefix +and continues with four-digit groups of base64 digits (A-Z, a-z, 0-9, +, and /), +each group encoding the value of three binary bytes as described in +section 6.8 of RFC 2045. +If +flags + +has the +TTODATAV_IGNORESPACE + +bit on, blanks are ignore (after the prefix). +Note that the last one or two digits of a base64 group can be += + +to indicate that fewer than three binary bytes are encoded. +

+ +A character text value begins with a +0t + +(or +0T) + +prefix +and continues with text characters, each being the value of one binary byte. +

+ +All these functions basically copy data from +src + +(whose size is specified by +srclen) + +to +dst + +(whose size is specified by +dstlen), + +doing the conversion en route. +If the result will not fit in +dst, + +it is truncated; +under no circumstances are more than +dstlen + +bytes of result written to +dst. + +Dstlen + +can be zero, in which case +dst + +need not be valid and no result bytes are written at all. +

+ +The +base + +parameter of +ttodata + +and +ttodatav + +specifies what format the input is in; +normally it should be +0 + +to signify that this gets figured out from the prefix. +Values of +16, + +64, + +and +256 + +respectively signify hexadecimal, base64, and character-text formats +without prefixes. +

+ +The +format + +parameter of +datatot, + +a single character used as a type code, +specifies which text format is wanted. +The value +0 + +(not ASCII +'0', + +but a zero value) specifies a reasonable default. +Other currently-supported values are: +

+
+
'x' + +
+continuous lower-case hexadecimal with a +0x + +prefix +
'h' + +
+lower-case hexadecimal with a +0x + +prefix and a +_ + +every eight digits +
':' + +
+lower-case hexadecimal with no prefix and a +: + +(colon) every two digits +
16 + +
+lower-case hexadecimal with no prefix or +_ + +
's' + +
+continuous base64 with a +0s + +prefix +
64 + +
+continuous base64 with no prefix +
+
+ +

+ +The default format is currently +'h'. + +

+ +Ttodata + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +On success, +if and only if +lenp + +is non-NULL, +*lenp + +is set to the number of bytes required to contain the full untruncated result. +It is the caller's responsibility to check this against +dstlen + +to determine whether he has obtained a complete result. +The +*lenp + +value is correct even if +dstlen + +is zero, which offers a way to determine how much space would be needed +before having to allocate any. +

+ +Ttodatav + +is just like +ttodata + +except that in certain cases, +if +errp + +is non-NULL, +the buffer pointed to by +errp + +(whose length is given by +errlen) + +is used to hold a more detailed error message. +The return value is NULL for success, +and is either +errp + +or a pointer to a string literal for failure. +If the size of the error-message buffer is +inadequate for the desired message, +ttodatav + +will fall back on returning a pointer to a literal string instead. +The +freeswan.h + +header file defines a constant +TTODATAV_BUF + +which is the size of a buffer large enough for worst-case results. +

+ +The normal return value of +datatot + +is the number of bytes required +to contain the full untruncated result. +It is the caller's responsibility to check this against +dstlen + +to determine whether he has obtained a complete result. +The return value is correct even if +dstlen + +is zero, which offers a way to determine how much space would be needed +before having to allocate any. +A return value of +0 + +signals a fatal error of some kind +(see DIAGNOSTICS). +

+ +A zero value for +srclen + +in +ttodata + +(but not +datatot!) + +is synonymous with +strlen(src). + +A non-zero +srclen + +in +ttodata + +must not include the terminating NUL. +

+ +Unless +dstlen + +is zero, +the result supplied by +datatot + +is always NUL-terminated, +and its needed-size return value includes space for the terminating NUL. +

+ +Several obsolete variants of these functions +(atodata, + +datatoa, + +atobytes, + +and +bytestoa) + +are temporarily also supported. +  +

SEE ALSO

+ +sprintf(3), ipsec_atoaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttodata + +and +ttodatav + +are: +unknown characters in the input; +unknown or missing prefix; +unknown base; +incomplete digit group; +non-zero padding in a base64 less-than-three-bytes digit group; +zero-length input. +

+ +Fatal errors in +datatot + +are: +unknown format code; +zero-length input. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Datatot + +should have a format code to produce character-text output. +

+ +The +0s + +and +0t + +prefixes are the author's inventions and are not a standard +of any kind. +They have been chosen to avoid collisions with existing practice +(some C implementations use +0b + +for binary) +and possible confusion with unprefixed hexadecimal. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_eroute.5.html b/doc/manpage.d/ipsec_eroute.5.html new file mode 100644 index 000000000..158b57015 --- /dev/null +++ b/doc/manpage.d/ipsec_eroute.5.html @@ -0,0 +1,370 @@ +Content-type: text/html + +Manpage of IPSEC_EROUTE + +

IPSEC_EROUTE

+Section: File Formats (5)
Updated: 20 Sep 2001
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_eroute - list of existing eroutes +  +

SYNOPSIS

+ +ipsec + +eroute + +

+ +cat + +/proc/net/ipsec_eroute + +  +

DESCRIPTION

+ +/proc/net/ipsec_eroute + +lists the IPSEC extended routing tables, +which control what (if any) processing is applied +to non-encrypted packets arriving for IPSEC processing and forwarding. +At this point it is a read-only file. +

+ +A table entry consists of: +

+
+
+packet count, +
+
+source address with mask, +
+
+a '->' separator for visual and automated parsing between src and dst +
+
+destination address with mask +
+
+a '=>' separator for visual and automated parsing between selection +criteria and SAID to use +
+
+SAID (Security Association IDentifier), comprised of: +
+
+protocol +(proto), +
+
+address family +(af), +where '.' stands for IPv4 and ':' for IPv6 +
+
+Security Parameters Index +(SPI), +
+
+effective destination +(edst), +where the packet should be forwarded after processing +(normally the other security gateway) +together indicate which Security Association should be used to process +the packet, +
+
+source identity text string with no whitespace, in parens, +
+
+destination identity text string with no whitespace, in parens +
+

+ +Addresses are written as IPv4 dotted quads or IPv6 coloned hex, +protocol is one of "ah", "esp", "comp" or "tun" +and +SPIs are prefixed hexadecimal numbers where the prefix '.' is for IPv4 and the prefix ':' is for IPv6 +

+ +SAIDs are written as "protoafSPI@edst". There are also 5 +"magic" SAIDs which have special meaning: +

+
+
+%drop + +means that matches are to be dropped +
+
+%reject + +means that matches are to be dropped and an ICMP returned, if +possible to inform +
+
+%trap + +means that matches are to trigger an ACQUIRE message to the Key +Management daemon(s) and a hold eroute will be put in place to +prevent subsequent packets also triggering ACQUIRE messages. +
+
+%hold + +means that matches are to stored until the eroute is replaced or +until that eroute gets reaped +
+
+%pass + +means that matches are to allowed to pass without IPSEC processing +
+ + +
+  +

EXAMPLES

+ +

+ +1867 172.31.252.0/24 -> 0.0.0.0/0 => tun.130@192.168.43.1 + +
+ + ()    () + +

+ +means that 1,867 packets have been sent to an
+eroute + +that has been set up to protect traffic between the subnet +172.31.252.0 + +with a subnet mask of +24 + +bits and the default address/mask represented by an address of +0.0.0.0 + +with a subnet mask of +0 + +bits using the local machine as a security gateway on this end of the +tunnel and the machine +192.168.43.1 + +on the other end of the tunnel with a Security Association IDentifier of +tun0x130@192.168.43.1 + +which means that it is a tunnel mode connection (4, IPPROTO_IPIP) with a +Security Parameters Index of +130 + +in hexadecimal with no identies defined for either end. +

+ +125 3049:1::/64 -> 0:0/0 => tun:130@3058:4::5 ()      () + +

+ +means that 125 packets have been sent to an
+eroute + +that has been set up to protect traffic between the subnet +3049:1:: + +with a subnet mask of +64 + +bits and the default address/mask represented by an address of +0:0 + +with a subnet mask of +0 + +bits using the local machine as a security gateway on this end of the +tunnel and the machine +3058:4::5 + +on the other end of the tunnel with a Security Association IDentifier of +tun:130@3058:4::5 + +which means that it is a tunnel mode connection with a +Security Parameters Index of +130 + +in hexadecimal with no identies defined for either end. +

+ +42 192.168.6.0/24 -> 192.168.7.0/24 => %passthrough + +

+ +means that 42 packets have been sent to an +eroute + +that has been set up to pass the traffic from the subnet +192.168.6.0 + +with a subnet mask of +24 + +bits and to subnet +192.168.7.0 + +with a subnet mask of +24 + +bits without any IPSEC processing with no identies defined for either end. +

+ +2112 192.168.8.55/32 -> 192.168.9.47/24 => %hold     (east)  () + +

+ +means that 2112 packets have been sent to an
+eroute + +that has been set up to hold the traffic from the host +192.168.8.55 + +and to host +192.168.9.47 + +until a key exchange from a Key Management daemon +succeeds and puts in an SA or fails and puts in a pass +or drop eroute depending on the default configuration with the local client +defined as "east" and no identy defined for the remote end. +

+ +2001 192.168.2.110/32 -> 192.168.2.120/32 => + +
+ + esp.e6de@192.168.2.120        ()      () + +

+ +means that 2001 packets have been sent to an
+eroute + +that has been set up to protect traffic between the host +192.168.2.110 + +and the host +192.168.2.120 + +using +192.168.2.110 + +as a security gateway on this end of the +connection and the machine +192.168.2.120 + +on the other end of the connection with a Security Association IDentifier of +esp.e6de@192.168.2.120 + +which means that it is a transport mode connection with a Security +Parameters Index of +e6de + +in hexadecimal using Encapsuation Security Payload protocol (50, +IPPROTO_ESP) with no identies defined for either end. +

+ +1984 3049:1::110/128 -> 3049:1::120/128 => + +
+ + ah:f5ed@3049:1::120   ()      () + +

+ +means that 1984 packets have been sent to an
+eroute + +that has been set up to authenticate traffic between the host +3049:1::110 + +and the host +3049:1::120 + +using +3049:1::110 + +as a security gateway on this end of the +connection and the machine +3049:1::120 + +on the other end of the connection with a Security Association IDentifier of +ah:f5ed@3049:1::120 + +which means that it is a transport mode connection with a Security +Parameters Index of +f5ed + +in hexadecimal using Authentication Header protocol (51, +IPPROTO_AH) with no identies defined for either end. +  +

FILES

+ +/proc/net/ipsec_eroute, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_spi(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_eroute(8), ipsec_version(5), +ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_eroute.8.html b/doc/manpage.d/ipsec_eroute.8.html new file mode 100644 index 000000000..7489462d7 --- /dev/null +++ b/doc/manpage.d/ipsec_eroute.8.html @@ -0,0 +1,421 @@ +Content-type: text/html + +Manpage of IPSEC_EROUTE + +

IPSEC_EROUTE

+Section: Maintenance Commands (8)
Updated: 21 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec eroute - manipulate IPSEC extended routing tables +  +

SYNOPSIS

+ +ipsec + +eroute + +

+ +ipsec + +eroute + +--add + +--eraf (inet | inet6) + +--src + +src/srcmaskbits|srcmask +--dst + +dst/dstmaskbits|dstmask +<SAID> +

+ +ipsec + +eroute + +--replace + +--eraf (inet | inet6) + +--src + +src/srcmaskbits|srcmask +--dst + +dst/dstmaskbits|dstmask +<SAID> +

+ +ipsec + +eroute + +--del + +--eraf (inet | inet6) + +--src + +src/srcmaskbits|srcmask +--dst + +dst/dstmaskbits|dstmask +

+ +ipsec + +eroute + +--clear + +

+ +ipsec + +eroute + +--help + +

+ +ipsec + +eroute + +--version + +

+ +Where <SAID> is +--af + +(inet | inet6) +--edst + +edst +--spi + +spi +--proto + +proto +OR +--said + +said +OR +--said + +(%passthrough | %passthrough4 | %passthrough6) + +  +

DESCRIPTION

+ +Eroute + +manages the IPSEC extended routing tables, +which control what (if any) processing is applied +to non-encrypted packets arriving for IPSEC processing and forwarding. +The form with no additional arguments lists the contents of +/proc/net/ipsec_eroute. +The +--add + +form adds a table entry, the +--replace + +form replaces a table entry, while the +--del + +form deletes one. The +--clear + +form deletes the entire table. +

+ +A table entry consists of: +

+
+
+source and destination addresses, +with masks, +for selection of packets +
+
+Security Association IDentifier, comprised of: +
+
+protocol +(proto), indicating (together with the +effective destination and the security parameters index) +which Security Association should be used to process the packet +
+
+address family +(af), +
+
+Security Parameters Index +(spi), indicating (together with the +effective destination and protocol) +which Security Association should be used to process the packet +(must be larger than or equal to 0x100) +
+
+effective destination +(edst), +where the packet should be forwarded after processing +(normally the other security gateway) +
+
+OR +
+
+SAID +(said), indicating +which Security Association should be used to process the packet +
+

+ +Addresses are written as IPv4 dotted quads or IPv6 coloned hex, +protocol is one of "ah", "esp", "comp" or "tun" and SPIs are +prefixed hexadecimal numbers where '.' represents IPv4 and ':' +stands for IPv6. +

+ +SAIDs are written as "protoafSPI@address". There are also 5 +"magic" SAIDs which have special meaning: +

+
+
+%drop + +means that matches are to be dropped +
+
+%reject + +means that matches are to be dropped and an ICMP returned, if +possible to inform +
+
+%trap + +means that matches are to trigger an ACQUIRE message to the Key +Management daemon(s) and a hold eroute will be put in place to +prevent subsequent packets also triggering ACQUIRE messages. +
+
+%hold + +means that matches are to stored until the eroute is replaced or +until that eroute gets reaped +
+
+%pass + +means that matches are to allowed to pass without IPSEC processing +
+

+ +The format of /proc/net/ipsec_eroute is listed in ipsec_eroute(5). +
+ + +  +

EXAMPLES

+ +

+ +ipsec eroute --add --eraf inet --src 192.168.0.1/32 \ + +
+ + --dst 192.168.2.0/24 --af inet --edst 192.168.0.2 \ + +
+ + --spi 0x135 --proto tun + +

+ +sets up an +eroute + +on a Security Gateway to protect traffic between the host +192.168.0.1 + +and the subnet +192.168.2.0 + +with +24 + +bits of subnet mask via Security Gateway +192.168.0.2 + +using the Security Association with address +192.168.0.2, + +Security Parameters Index +0x135 + +and protocol +tun + +(50, IPPROTO_ESP). +

+ +ipsec eroute --add --eraf inet6 --src 3049:1::1/128 \ + +
+ + --dst 3049:2::/64 --af inet6 --edst 3049:1::2 \ + +
+ + --spi 0x145 --proto tun + +

+ +sets up an +eroute + +on a Security Gateway to protect traffic between the host +3049:1::1 + +and the subnet +3049:2:: + +with +64 + +bits of subnet mask via Security Gateway +3049:1::2 + +using the Security Association with address +3049:1::2, + +Security Parameters Index +0x145 + +and protocol +tun + +(50, IPPROTO_ESP). +

+ +ipsec eroute --replace --eraf inet --src company.com/24 \ + +
+ + --dst ftp.ngo.org/32 --said tun.135@gw.ngo.org + +

+ +replaces an +eroute + +on a Security Gateway to protect traffic between the subnet +company.com + +with +24 + +bits of subnet mask and the host +ftp.ngo.org + +via Security Gateway +gw.ngo.org + +using the Security Association with Security Association ID +tun0x135@gw.ngo.org + +

+ +ipsec eroute --del --eraf inet --src company.com/24 \ + +
+ + --dst www.ietf.org/32 --said %passthrough4 + +

+ +deletes an +eroute + +on a Security Gateway that allowed traffic between the subnet +company.com + +with +24 + +bits of subnet mask and the host +www.ietf.org + +to pass in the clear, unprocessed. +  +

FILES

+ +/proc/net/ipsec_eroute, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_spi(8), +ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_eroute(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_goodmask.3.html b/doc/manpage.d/ipsec_goodmask.3.html new file mode 100644 index 000000000..a67a08d83 --- /dev/null +++ b/doc/manpage.d/ipsec_goodmask.3.html @@ -0,0 +1,122 @@ +Content-type: text/html + +Manpage of IPSEC_GOODMASK + +

IPSEC_GOODMASK

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec goodmask - is this Internet subnet mask a valid one? +
+ +ipsec masktobits - convert Internet subnet mask to bit count +
+ +ipsec bitstomask - convert bit count to Internet subnet mask +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int goodmask(struct in_addr mask); + +
+ +int masktobits(struct in_addr mask); + +
+ +struct in_addr bitstomask(int n); + +  +

DESCRIPTION

+ +These functions are obsolete; +see +ipsec_masktocount(3) + +for a partial replacement. +

+ +Goodmask + +reports whether the subnet +mask + +is a valid one, +i.e. consists of a (possibly empty) sequence of +1s + +followed by a (possibly empty) sequence of +0s. + +Masktobits + +takes a (valid) subnet mask and returns the number of +1 + +bits in it. +Bitstomask + +reverses this, +returning the subnet mask corresponding to bit count +n. + +

+ +All masks are in network byte order. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

DIAGNOSTICS

+ +Masktobits + +returns +-1 + +for an invalid mask. +Bitstomask + +returns an all-zeros mask for a negative or out-of-range +n. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The error-reporting convention of +bitstomask + +is less than ideal; +zero is sometimes a legitimate mask. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_hostof.3.html b/doc/manpage.d/ipsec_hostof.3.html new file mode 100644 index 000000000..57d4a5648 --- /dev/null +++ b/doc/manpage.d/ipsec_hostof.3.html @@ -0,0 +1,107 @@ +Content-type: text/html + +Manpage of IPSEC_SUBNETOF + +

IPSEC_SUBNETOF

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec subnetof - given Internet address and subnet mask, return subnet number +
+ +ipsec hostof - given Internet address and subnet mask, return host part +
+ +ipsec broadcastof - given Internet address and subnet mask, return broadcast address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+struct in_addr subnetof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr hostof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr broadcastof(struct in_addr addr, + +
+  +struct in_addr mask); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_networkof(3) + +for their replacements. +

+ +Subnetof + +takes an Internet +address + +and a subnet +mask + +and returns the network part of the address +(all in network byte order). +Hostof + +similarly returns the host part, and +broadcastof + +returns the broadcast address (all-1s convention) for the network. +

+ +These functions are provided to hide the Internet bit-munging inside +an API, in hopes of easing the eventual transition to IPv6. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Calling functions for this is more costly than doing it yourself. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ikeping.8.html b/doc/manpage.d/ipsec_ikeping.8.html new file mode 100644 index 000000000..03ed961f3 --- /dev/null +++ b/doc/manpage.d/ipsec_ikeping.8.html @@ -0,0 +1,137 @@ +Content-type: text/html + +Manpage of IPSEC_IKEPING + +

IPSEC_IKEPING

+Section: Maintenance Commands (8)
Updated: 23 Feb 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ikeping - send/receive ISAKMP/IKE echo requests/replies +  +

SYNOPSIS

+ +ipsec + +ikeping + +[ +--listen + +] [ +--verbose + +] [ +--wait + +time ] [ +--exchangenum + +num ] [ +--ikeport + +localport ] [ +--ikeaddress + +address ] [ +--inet + +] [ +--inet6 + +] destaddr[/dstport] ... +  +

DESCRIPTION

+ +Ikeping + +sends and receives ISAKMP/IKE echo request and echo reply packets. These +packets are intended for diagnostics purposes, in a manner similar to +ping(8) + +does for ICMP echo request/reply packets. +

+ +At the time of this writing, the ISAKMP echo request/reply exchange is still +an internet-draft, and is therefore completely non-standard. +

+ +Ikeping + +will bind to the local address given by +--ikeaddress + +and the port number given by +--ikeport + +defaulting to the wildcard address and the ISAKMP port 500. An ISAKMP +exchange of type 244 (a private use number) is sent to each of the +address/ports listed on the command line. The exchange number may be +overridden by the +--exchangenum + +option. +

+ +Ikeping + +then listens for replies, printing them as they are received. Replies +are of exchange type 245 or the specified exchange number plus 1. +Ikeping + +will keep listening until it either receives as many echo responses as it sent, +or until the timeout period (10 seconds) has been reached. Receipt of a +packet will reset the timer. The +--wait + +option can be used to specify a different timeout period. +

+ +If the +--listen + +option is given, then +ikeping + +will not send any packets. Instead, it will listen for them and reply to +each request received. +  +

FILES

+ +no external files +  +

SEE ALSO

+ +ping(8), ipsec_pluto(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Michael Richardson. +  +

BUGS

+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_initaddr.3.html b/doc/manpage.d/ipsec_initaddr.3.html new file mode 100644 index 000000000..ca1f857e7 --- /dev/null +++ b/doc/manpage.d/ipsec_initaddr.3.html @@ -0,0 +1,232 @@ +Content-type: text/html + +Manpage of IPSEC_INITADDR + +

IPSEC_INITADDR

+Section: C Library Functions (3)
Updated: 11 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initaddr - initialize an ip_address +
+ +ipsec addrtypeof - get address type of an ip_address +
+ +ipsec addrlenof - get length of address within an ip_address +
+ +ipsec addrbytesof - get copy of address within an ip_address +
+ +ipsec addrbytesptr - get pointer to address within an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *dst); + +
+ +int addrtypeof(const ip_address *src); + +
+ +size_t addrlenof(const ip_address *src); + +
+ +size_t addrbytesof(const ip_address *src, + +
+  +unsigned char *dst, size_t dstlen); + +
+ +size_t addrbytesptr(const ip_address *src, + +
+  +const unsigned char **dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_address + +to contain one of the (currently two) types of IP address. +These functions provide basic tools for creating and examining this type. +

+ +Initaddr + +initializes a variable +*dst + +of type +ip_address + +from an address +(in network byte order, +indicated by a pointer +src + +and a length +srclen) + +and an address family +af + +(typically +AF_INET + +or +AF_INET6). + +The length must be consistent with the address family. +

+ +Addrtypeof + +returns the address type of an address, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Addrlenof + +returns the size (in bytes) of the address within an +ip_address, + +to permit storage allocation etc. +

+ +Addrbytesof + +copies the address within the +ip_address + +src + +to the buffer indicated by the pointer +dst + +and the length +dstlen, + +and returns the address length (in bytes). +If the address will not fit, +as many bytes as will fit are copied; +the returned length is still the full length. +It is the caller's responsibility to check the +returned value to ensure that there was enough room. +

+ +Addrbytesptr + +sets +*dst + +to a pointer to the internal address within the +ip_address, + +and returns the address length (in bytes). +If +dst + +is +NULL, + +it just returns the address length. +The pointer points to +const + +to discourage misuse. +

+ +Initaddr + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +The functions which return +size_t + +return +0 + +for a failure. +  +

SEE ALSO

+ +inet(3), ipsec_ttoaddr(3) +  +

DIAGNOSTICS

+ +An unknown address family is a fatal error for any of these functions +except +addrtypeof. + +An address-size mismatch is a fatal error for +initaddr. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Addrtypeof + +should probably have been named +addrfamilyof. + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_initsaid.3.html b/doc/manpage.d/ipsec_initsaid.3.html new file mode 100644 index 000000000..2ba79a8ac --- /dev/null +++ b/doc/manpage.d/ipsec_initsaid.3.html @@ -0,0 +1,453 @@ +Content-type: text/html + +Manpage of IPSEC_TTOSA + +

IPSEC_TTOSA

+Section: C Library Functions (3)
Updated: 26 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttosa, satot - convert IPsec Security Association IDs to and from text +
+ +ipsec initsaid - initialize an SA ID +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+typedef struct { + +
+  +ip_address dst; + +
+  +ipsec_spi_t spi; + +
+  +int proto; + +
+ +} ip_said; + +

+const char *ttosa(const char *src, size_t srclen, + +
+  +ip_said *sa); + +
+ +size_t satot(const ip_said *sa, int format, + +
+  +char *dst, size_t dstlen); + +
+ +void initsaid(const ip_address *addr, ipsec_spi_t spi, + +
+  +int proto, ip_said *dst); + +  +

DESCRIPTION

+ +Ttosa + +converts an ASCII Security Association (SA) specifier into an +ip_said + +structure (containing +a destination-host address +in network byte order, +an SPI number in network byte order, and +a protocol code). +Satot + +does the reverse conversion, back to a text SA specifier. +Initsaid + +initializes an +ip_said + +from separate items of information. +

+ +An SA is specified in text with a mail-like syntax, e.g. +esp.5a7@1.2.3.4. + +An SA specifier contains +a protocol prefix (currently +ah, + +esp, + +tun, + +comp, + +or +int), + +a single character indicating the address family +(. + +for IPv4, +: + +for IPv6), +an unsigned integer SPI number in hexadecimal (with no +0x + +prefix), +and an IP address. +The IP address can be any form accepted by +ipsec_ttoaddr(3), + +e.g. dotted-decimal IPv4 address, +colon-hex IPv6 address, +or DNS name. +

+ +As a special case, the SA specifier +%passthrough4 + +or +%passthrough6 + +signifies the special SA used to indicate that packets should be +passed through unaltered. +(At present, these are synonyms for +tun.0@0.0.0.0 + +and +tun:0@:: + +respectively, +but that is subject to change without notice.) +%passthrough + +is a historical synonym for +%passthrough4. + +These forms are known to both +ttosa + +and +satot, + +so the internal representation is never visible. +

+ +Similarly, the SA specifiers +%pass, + +%drop, + +%reject, + +%hold, + +%trap, + +and +%trapsubnet + +signify special ``magic'' SAs used to indicate that packets should be +passed, dropped, rejected (dropped with ICMP notification), +held, +and trapped (sent up to +ipsec_pluto(8), + +with either of two forms of +%hold + +automatically installed) +respectively. +These forms too are known to both routines, +so the internal representation of the magic SAs should never be visible. +

+ +The +<freeswan.h> + +header file supplies the +ip_said + +structure, as well as a data type +ipsec_spi_t + +which is an unsigned 32-bit integer. +(There is no consistency between kernel and user on what such a type +is called, hence the header hides the differences.) +

+ +The protocol code uses the same numbers that IP does. +For user convenience, given the difficulty in acquiring the exact set of +protocol names used by the kernel, +<freeswan.h> + +defines the names +SA_ESP, + +SA_AH, + +SA_IPIP, + +and +SA_COMP + +to have the same values as the kernel names +IPPROTO_ESP, + +IPPROTO_AH, + +IPPROTO_IPIP, + +and +IPPROTO_COMP. + +

+ +<freeswan.h> + +also defines +SA_INT + +to have the value +61 + +(reserved by IANA for ``any host internal protocol'') +and +SPI_PASS, + +SPI_DROP, + +SPI_REJECT, + +SPI_HOLD, + +and +SPI_TRAP + +to have the values 256-260 (in host byte order) respectively. +These are used in constructing the magic SAs +(which always have address +0.0.0.0). + +

+ +If +satot + +encounters an unknown protocol code, e.g. 77, +it yields output using a prefix +showing the code numerically, e.g. ``unk77''. +This form is +not + +recognized by +ttosa. + +

+ +The +srclen + +parameter of +ttosa + +specifies the length of the string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +satot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +<freeswan.h> + +header file defines a constant, +SATOT_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +satot + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default +(currently +lowercase protocol prefix, lowercase hexadecimal SPI, +dotted-decimal or colon-hex address). +The value +'f' + +is similar except that the SPI is padded with +0s + +to a fixed 32-bit width, to ease aligning displayed tables. +

+ +Ttosa + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Satot + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +

+ +There is also, temporarily, support for some obsolete +forms of SA specifier which lack the address-family indicator. +  +

SEE ALSO

+ +ipsec_ttoul(3), ipsec_ttoaddr(3), ipsec_samesaid(3), inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttosa + +are: +empty input; +input too small to be a legal SA specifier; +no +@ + +in input; +unknown protocol prefix; +conversion error in +ttoul + +or +ttoaddr. + +

+ +Fatal errors in +satot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttosa( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_initsubnet.3.html b/doc/manpage.d/ipsec_initsubnet.3.html new file mode 100644 index 000000000..e442a9100 --- /dev/null +++ b/doc/manpage.d/ipsec_initsubnet.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_isanyaddr.3.html b/doc/manpage.d/ipsec_isanyaddr.3.html new file mode 100644 index 000000000..974236005 --- /dev/null +++ b/doc/manpage.d/ipsec_isanyaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_isloopbackaddr.3.html b/doc/manpage.d/ipsec_isloopbackaddr.3.html new file mode 100644 index 000000000..974236005 --- /dev/null +++ b/doc/manpage.d/ipsec_isloopbackaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_isunspecaddr.3.html b/doc/manpage.d/ipsec_isunspecaddr.3.html new file mode 100644 index 000000000..974236005 --- /dev/null +++ b/doc/manpage.d/ipsec_isunspecaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:17 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_keyblobtoid.3.html b/doc/manpage.d/ipsec_keyblobtoid.3.html new file mode 100644 index 000000000..109cfafa7 --- /dev/null +++ b/doc/manpage.d/ipsec_keyblobtoid.3.html @@ -0,0 +1,174 @@ +Content-type: text/html + +Manpage of IPSEC_KEYBLOBTOID + +

IPSEC_KEYBLOBTOID

+Section: C Library Functions (3)
Updated: 25 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec keyblobtoid, splitkeytoid - generate key IDs from RSA keys +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+size_t keyblobtoid(const unsigned char *blob, + +
+  +size_t bloblen, char *dst, size_t dstlen); + +
+ +size_t splitkeytoid(const unsigned char *e, size_t elen, + +
+  +const unsigned char *m, size_t mlen, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +Keyblobtoid + +and +splitkeytoid + +generate +key IDs +from RSA keys, +for use in messages and reporting, +writing the result to +dst. + +A +key ID + +is a short ASCII string identifying a key; +currently it is just the first nine characters of the base64 +encoding of the RFC 2537/3110 ``byte blob'' representation of the key. +(Beware that no finite key ID can be collision-proof: +there is always some small chance of two random keys having the +same ID.) +

+ +Keyblobtoid + +generates a key ID from a key which is already in the form of an +RFC 2537/3110 binary key +blob + +(encoded exponent length, exponent, modulus). +

+ +Splitkeytoid + +generates a key ID from a key given in the form of a separate +(binary) exponent +e + +and modulus +m. + +

+ +The +dstlen + +parameter of either +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant +KEYID_BUF + +which is the size of a buffer large enough for worst-case results. +

+ +Both functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. + +With keys generated by +ipsec_rsasigkey(3), + +the first two base64 digits are always the same, +and the third carries only about one bit of information. +It's worse with keys using longer fixed exponents, +e.g. the 24-bit exponent that's common in X.509 certificates. +However, being able to relate key IDs to the full +base64 text form of keys by eye is sufficiently useful that this +waste of space seems justifiable. +The choice of nine digits is a compromise between bulk and +probability of collision. +  +

SEE ALSO

+ +RFC 3110, +RSA/SHA-1 SIGs and RSA KEYs in the Domain Name System (DNS), +Eastlake, 2001 +(superseding the older but better-known RFC 2537). +  +

DIAGNOSTICS

+ +Fatal errors are: +key too short to supply enough bits to construct a complete key ID +(almost certainly indicating a garbage key); +exponent too long for its length to be representable. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_klipsdebug.5.html b/doc/manpage.d/ipsec_klipsdebug.5.html new file mode 100644 index 000000000..964329256 --- /dev/null +++ b/doc/manpage.d/ipsec_klipsdebug.5.html @@ -0,0 +1,229 @@ +Content-type: text/html + +Manpage of IPSEC_KLIPSDEBUG + +

IPSEC_KLIPSDEBUG

+Section: File Formats (5)
Updated: 26 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_klipsdebug - list KLIPS (kernel IPSEC support) debug features and level +  +

SYNOPSIS

+ +ipsec + +klipsdebug + +

+ +cat + +/proc/net/ipsec_klipsdebug + +  +

DESCRIPTION

+ +/proc/net/ipsec_klipsdebug + +lists flags that control various parts of the debugging output of Klips +(the kernel portion of FreeS/WAN IPSEC). +At this point it is a read-only file. +

+ +A table entry consists of: +

+
+
+a KLIPS debug variable +
+
+a '=' separator for visual and automated parsing between the variable +name and its current value +
+
+hexadecimal bitmap of variable's flags. +
+

+ +The variable names roughly describe the scope of the debugging variable. +Currently, no flags are documented or individually accessible yet except +tunnel-xmit. + +

+ +The variable names are: +

+
tunnel + +
+tunnelling code +
netlink + +
+userspace communication code (obsolete) +
xform + +
+transform selection and manipulation code +
eroute + +
+eroute table manipulation code +
spi + +
+SA table manipulation code +
radij + +
+radij tree manipulation code +
esp + +
+encryptions transforms code +
ah + +
+authentication transforms code +
rcv + +
+receive code +
ipcomp + +
+ip compression transforms code +
verbose + +
+give even more information, beware this will probably trample the 4k kernel printk buffer giving inaccurate output +
+

+ +All KLIPS debug output appears as +kernel.info + +messages to +syslogd(8). + +Most systems are set up +to log these messages to +/var/log/messages. + +

+ +  +

EXAMPLES

+ +

+ +debug_tunnel=00000010. + +
+ +debug_netlink=00000000. + +
+ +debug_xform=00000000. + +
+ +debug_eroute=00000000. + +
+ +debug_spi=00000000. + +
+ +debug_radij=00000000. + +
+ +debug_esp=00000000. + +
+ +debug_ah=00000000. + +
+ +debug_rcv=00000000. + +
+ +debug_pfkey=ffffffff. + +

+ +means that one +tunnel + +flag has been set (tunnel-xmit), +full +pfkey + +sockets debugging has been set and everything else is not set. +

+ +  +

FILES

+ +/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), +ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(5), ipsec_version(5), +ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_klipsdebug.8.html b/doc/manpage.d/ipsec_klipsdebug.8.html new file mode 100644 index 000000000..67b1c3a5d --- /dev/null +++ b/doc/manpage.d/ipsec_klipsdebug.8.html @@ -0,0 +1,264 @@ +Content-type: text/html + +Manpage of IPSEC_KLIPSDEBUG + +

IPSEC_KLIPSDEBUG

+Section: Maintenance Commands (8)
Updated: 21 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec klipsdebug - set KLIPS (kernel IPSEC support) debug features and level +  +

SYNOPSIS

+ +ipsec + +klipsdebug + +

+ +ipsec + +klipsdebug + +--set + +flagname +

+ +ipsec + +klipsdebug + +--clear + +flagname +

+ +ipsec + +klipsdebug + +--all + +

+ +ipsec + +klipsdebug + +--none + +

+ +ipsec + +klipsdebug + +--help + +

+ +ipsec + +klipsdebug + +--version + +  +

DESCRIPTION

+ +Klipsdebug + +sets and clears flags that control +various parts of the debugging output of Klips +(the kernel portion of FreeS/WAN IPSEC). +The form with no additional arguments lists the present contents of +/proc/net/ipsec_klipsdebug. +The +--set + +form turns the specified flag on, +while the +--clear + +form turns the specified flag off. +The +--all + +form +turns all flags on except verbose, while the +--none + +form turns all flags off. +

+ +The current flag names are: +

+
tunnel + +
+tunnelling code +
tunnel-xmit + +
+tunnelling transmit only code +
pfkey + +
+userspace communication code +
xform + +
+transform selection and manipulation code +
eroute + +
+eroute table manipulation code +
spi + +
+SA table manipulation code +
radij + +
+radij tree manipulation code +
esp + +
+encryptions transforms code +
ah + +
+authentication transforms code +rcv + +receive code +
ipcomp + +
+ip compression transforms code +
verbose + +
+give even more information, BEWARE: +a)this will print authentication and encryption keys in the logs +b)this will probably trample the 4k kernel printk buffer giving inaccurate output +
+

+ +All Klips debug output appears as +kernel.info + +messages to +syslogd(8). + +Most systems are set up +to log these messages to +/var/log/messages. + +Beware that +klipsdebug + +--all + +produces a lot of output and the log file will grow quickly. +

+ +The file format for /proc/net/ipsec_klipsdebug is discussed in +ipsec_klipsdebug(5). +  +

EXAMPLES

+ +
+
klipsdebug --all + +
+turns on all KLIPS debugging except verbose. +
klipsdebug --clear tunnel + +
+turns off only the +tunnel + +debugging messages. +
+

+ +  +

FILES

+ +/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), +ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. +  +

BUGS

+ +It really ought to be possible to set or unset selective combinations +of flags. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_look.8.html b/doc/manpage.d/ipsec_look.8.html new file mode 100644 index 000000000..ffe07a57c --- /dev/null +++ b/doc/manpage.d/ipsec_look.8.html @@ -0,0 +1,76 @@ +Content-type: text/html + +Manpage of look + +

look

+Section: Maintenance Commands (8)
Updated: 25 Apr 2002
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec look - get a quick summary of FreeS/WAN status +  +

SYNOPSIS

+ +look + +is used to get a quick overview of what the status of FreeSWAN is. +It is equivalent to: +   ipsec eroute +

+   ipsec spigrp +

+   ipsec tncfg +

+   ipsec spi +

+   netstat -rn +

+

+ +However a bit of processing is done to combine the outputs. +  +

SEE ALSO

+ +ipsec(8), ipsec_tncfg(8), ipsec_spi(8), ipsec_spigrp(8), ipsec_eroute(5), +netstat(8). +  +

HISTORY

+ +Man page written for the Linux FreeS/WAN project <http://www.freeswan.org/> +by Michael Richardson. Original program written by Henry Spencer. + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_loopbackaddr.3.html b/doc/manpage.d/ipsec_loopbackaddr.3.html new file mode 100644 index 000000000..92f69d99c --- /dev/null +++ b/doc/manpage.d/ipsec_loopbackaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_lwdnsq.8.html b/doc/manpage.d/ipsec_lwdnsq.8.html new file mode 100644 index 000000000..1122b188a --- /dev/null +++ b/doc/manpage.d/ipsec_lwdnsq.8.html @@ -0,0 +1,400 @@ +Content-type: text/html + +Manpage of IPSEC LWDNSQ + +

IPSEC LWDNSQ

+Section:  (8)
Updated:
Index +Return to Main Contents
+ +  +

NAME

+ +lwdnsq - lookup items in DNS to help pluto (and others) +  +

SYNOPSIS

+ +

+

+ipsec lwdnsq lwdnsq [--prompt] [--serial]
+
+ +

+

+ipsec lwdnsq lwdnsq [--help]
+
+ +

+  +

DESCRIPTION

+ +

+

+ +The ipsec lwdnsq is a helper program that does DNS lookups for other programs. It implements an asynchronous interface on stdin/stdout, with an ASCII driven command language. +

+

+ +If stdin is a tty or if the --prompt option is given, then it issues a prompt to the user. Otherwise, it is silent, except for results. +

+

+ +The program will accept multiple queries concurrently, with each result being marked with the ID provided on the output. The IDs are strings. +

+

+ +If the --serial option is given, then the program will not attempt to execute concurrent queries, but will serialize all input and output. +

+  +

QUERY LANGUAGE

+ +

+

+ +There are eleven command that the program understands. This is to lookup different types of records in both the forward and reverse maps. Every query includes a queryid, which is returned in the output, on every single line to identify the transaction. +

+  +

KEY queryid FQDN

+ +

+

+ +This request looks up the KEY resource record for the given FQDN.. +

+  +

KEY4 queryid A.B.C.D

+ +

+

+ +This request looks up the KEY resource record found in the reverse map for the IP version 4 address A.B.C.D, i.e. it looks up D.C.B.A.in-addr.arpa. +

+  +

KEY6 queryid A:B::C:D

+ +

+

+ +This request looks up the KEY resource record found in the reverse map for the IPv6 address A:B::C:D, i.e. it looks the 32-nibble long entry in ip6.arpa (and ip6.int). +

+  +

TXT4 queryid A.B.C.D

+ +

+

+ +This request looks up the TXT resource record found in the reverse map for the IP version 4 address A.B.C.D, i.e. it looks up D.C.B.A.in-addr.arpa. +

+  +

TXT6 queryid A:B::C:D

+ +

+

+ +This request looks up the TXT resource record found in the reverse map for the IPv6 address A:B::C:D, i.e. it looks the 32-nibble long entry in ip6.arpa (and ip6.int). +

+  +

KEY queryid FQDN

+ +

+

+ +This request looks up the IPSECKEY resource record for the given FQDN.. See note about IPSECKEY processing, below. +

+  +

IPSECKEY4 queryid A.B.C.D

+ +

+

+ +This request looks up the IPSECKEY resource record found in the reverse map for the IP version 4 address A.B.C.D, i.e. it looks up D.C.B.A.in-addr.arpa. See special note about IPSECKEY processing, below. +

+  +

IPSECKEY6 queryid A:B::C:D

+ +

+

+ +This request looks up the IPSECKEY resource record found in the reverse map for the IPv6 address A:B::C:D, i.e. it looks the 32-nibble long entry in ip6.arpa (and ip6.int). See special note about IPSECKEY processing, below. +

+  +

OE4 queryid A.B.C.D

+ +

+

+ +This request looks an appropriate record for Opportunistic Encryption for the given IP address. This attempts to look for the delegation record. This may be one of IPSECKEY, KEY, or TXT record. Unless configured otherwise, (see OE4 Directives, below), then a query type of ANY will be used to retrieve all relevant records, and all will be returned. +

+  +

OE6 queryid A:B::C:D

+ +

+

+ +This request looks an appropriate record for Opportunistic Encryption for the given IPv6 address. This attempts to look for the delegation record. This may be one of IPSECKEY, KEY, or TXT record. Unless configured otherwise, (see OE Directives, below), then a query type of ALL will be used to retrieve all relevant records, and all will be returned. i.e. it looks the 32-nibble long entry in ip6.arpa (and ip6.int). +

+  +

A queryid FQDN

+ +

+

+ +This request looks up the A (IPv4) resource record for the given FQDN.. +

+  +

AAAA queryid FQDN

+ +

+

+ +This request looks up the AAAA (IPv6) resource record for the given FQDN.. +

+  +

REPLIES TO QUERIES

+ +

+

+ +All replies from the queries are in the following format: +

+

+
+<ID> <TIME> <TTL> <TYPE> <TYPE-SPECIFIC> \n
+
+
+ +
   +

+

+
ID
+this is the queryid value that was provided in the query. It is repeated on every line to permit the replies to be properly associated with the query. When the response is not ascribable to particular query (such as for a mis-formed query), then the query ID "0" will be used. +

+

TIME
+this is the current time in seconds since epoch. +

+

TTL
+for answers which have a time to live, this is the current value. The answer is valid for this number of seconds. If there is no useful value here, then the number 0 is used. +

+

TYPE
+This is the type of the record that is being returned. The types are described in the next section. The TYPE specific data that follows is specific to the type. +
  +

+

+

+ +The replies are limited to 4096 bytes, a value defined as LWDNSQ_RESULT_LEN_MAX. This is defined in freeswan.h. +

+

+ +All of the replies which include resource records use the standard presentation format (with no line feeds or carriage returns) in their answer. +

+  +

START

+ +

+

+ +This reply indicates that a query has been received and has been started. It serves as an anchor point for timing, as well as an acknowledgement. +

+  +

DONE

+ +

+

+ +This reply indicates that a query is entirely over, and no further information from this query will be sent. +

+  +

RETRY

+ +

+

+ +This reply indicates that a query is entirely over, but that no data was found. The records may exist, but appropriate servers could not be reached. +

+  +

FATAL

+ +

+

+ +This reply indicates that a query is entirely over, and that no data of the type requested could be found. There were no timeouts, and all servers were available and confirmed non-existances. There may be NXT records returned prior to this. +

+  +

CNAME

+ +

+

+ +This is an interim reply, and indicates that a CNAME was found (and followed) while performing the query. The value of the CNAME is present in the type specific section. +

+  +

CNAMEFROM

+ +

+

+ +This is an interim reply, and indicates that a CNAME was found. The original name that was queries for was not the canonical name, and this reply indicates the name that was actually followed. +

+  +

NAME

+ +

+

+ +This is an interim reply. The original name that was queries for was not the canonical name. This reply indicates the canonical name. +

+  +

DNSSEC

+ +

+

+ +This is an interim reply. It is followed either by "OKAY" or "not present. It indicates if DNSSEC was available on the reply. +

+  +

TXT and AD-TXT

+ +

+

+ +This is an interim reply. If there are TXT resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

A and AD-A

+ +

+

+ +This is an interim reply. If there are A resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

AAAA and AD-AAAA

+ +

+

+ +This is an interim reply. If there are AAAA resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

PTR and AD-PTR

+ +

+

+ +This is an interim reply. If there are PTR resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

KEY and AD-KEY

+ +

+

+ +This is an interim reply. If there are KEY resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

IPSECKEY and AD-IPSECKEY

+ +

+

+ +This is an interim reply. If there are IPSEC resource records in the reply, then each one is presented using this type. If preceeded by AD-, then this record was signed with DNSSEC. +

+  +

SPECIAL IPSECKEY PROCESSING

+ +

+

+ +At the time of this writing, the IPSECKEY resource record is not entirely specified. In particular no resource record number has been assigned. This program assumes that it is resource record number 45. If the file /etc/ipsec.d/lwdnsq.conf exists, and contains a line like +

+

+
+ipseckey_rr=number
+
+
+ +
 then this number will be used instead. The file is read only once at startup. +

+  +

OE DIRECTIVES

+ +

+

+ +If the file /etc/ipsec.d/lwdnsq.conf exists, and contains a line like +

+

+
+queryany=false
+
+
+ +
 then instead of doing an ALL query when looking for OE delegation records, lwdnsq will do a series of queries. It will first look for IPSECKEY, and then TXT record. If it finds neither, it will then look for KEY records of all kinds, although they do not contain delegation information. +

+  +

SPECIAL IPSECKEY PROCESSING

+ +

+

+
+/etc/ipsec.d/lwdnsq.conf
+
+
+ +

+  +

AUTHOR

+ +Michael Richardson <mcr@sandelman.ottawa.on.ca>. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
QUERY LANGUAGE
+
+
KEY queryid FQDN
+
KEY4 queryid A.B.C.D
+
KEY6 queryid A:B::C:D
+
TXT4 queryid A.B.C.D
+
TXT6 queryid A:B::C:D
+
KEY queryid FQDN
+
IPSECKEY4 queryid A.B.C.D
+
IPSECKEY6 queryid A:B::C:D
+
OE4 queryid A.B.C.D
+
OE6 queryid A:B::C:D
+
A queryid FQDN
+
AAAA queryid FQDN
+
+
REPLIES TO QUERIES
+
+
START
+
DONE
+
RETRY
+
FATAL
+
CNAME
+
CNAMEFROM
+
NAME
+
DNSSEC
+
TXT and AD-TXT
+
A and AD-A
+
AAAA and AD-AAAA
+
PTR and AD-PTR
+
KEY and AD-KEY
+
IPSECKEY and AD-IPSECKEY
+
+
SPECIAL IPSECKEY PROCESSING
+
OE DIRECTIVES
+
SPECIAL IPSECKEY PROCESSING
+
AUTHOR
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_mailkey.8.html b/doc/manpage.d/ipsec_mailkey.8.html new file mode 100644 index 000000000..83a532563 --- /dev/null +++ b/doc/manpage.d/ipsec_mailkey.8.html @@ -0,0 +1,97 @@ +Content-type: text/html + +Manpage of IPSEC_MAILKEY + +

IPSEC_MAILKEY

+Section: Maintenance Commands (8)
Updated: 21 Feb 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec mailkey - mail DNS records for Opportunistic Encryption +  +

SYNOPSIS

+ +ipsec + +mailkey + +--me +my@address.tld +[ +--reverse + +1.2.3.4 +] [ +--forward + +hostname.domain.tld +] +  +

DESCRIPTION

+ +mailkey + +is a meta-program. It generates a script which will attempt to mail the TXT +records required to enable Opportunistic Encryption (OE). +

+ +An e-mail address for the domain's DNS administrator is derived from SOA records. +The mail body and destination address are freely editable in the script. +

+ +If no administrator can be located, the output file will not be executable. +

+ +

+
--me my@address.tld
+set the Reply-To: address of the mail to be sent. +
--forward hostname.domain.tld
+the domain name to be used for initator-only OE. +
--reverse 1.2.3.4
+the IP address to be used for full Opportunistic Encryption. +
+

+ +Only one of --forward or --reverse may be specified. +  +

FILES

+ +
+/etc/ipsec.secrets
+
+ +  +

SEE ALSO

+ +ipsec_showhostkey(8), host(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project <http://www.freeswan.org> by Sam Sgro. +  +

BUGS

+ +May produce indeterminate results when processing non-routable IPs. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_manual.8.html b/doc/manpage.d/ipsec_manual.8.html new file mode 100644 index 000000000..77134f7d0 --- /dev/null +++ b/doc/manpage.d/ipsec_manual.8.html @@ -0,0 +1,414 @@ +Content-type: text/html + +Manpage of IPSEC_MANUAL + +

IPSEC_MANUAL

+Section: Maintenance Commands (8)
Updated: 17 July 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec manual - take manually-keyed IPsec connections up and down +  +

SYNOPSIS

+ +ipsec + +manual + +[ +--show + +] [ +--showonly + +] [ +--other + +] +
+ +   [ +--iam + +address@interface + +] [ +--config + +configfile +] +
+ +   operation connection +

+ipsec + +manual + +[ +options + +] +--union + +operation part ... +  +

DESCRIPTION

+ +Manual + +manipulates manually-keyed FreeS/WAN IPsec connections, +setting them up and shutting them down, +based on the information in the IPsec configuration file. +In the normal usage, +connection + +is the name of a connection specification in the configuration file; +operation + +is +--up, + +--down, + +--route, + +or +--unroute. + +Manual + +generates setup (--route + +or +--up) + +or +teardown (--down + +or +--unroute) + +commands for the connection and feeds them to a shell for execution. +

+ +The +--up + +operation brings the specified connection up, including establishing a +suitable route for it if necessary. +

+ +The +--route + +operation just establishes the route for a connection. +Unless and until an +--up + +operation is done, packets routed by that route will simply be discarded. +

+ +The +--down + +operation tears the specified connection down, +except + +that it leaves the route in place. +Unless and until an +--unroute + +operation is done, packets routed by that route will simply be discarded. +This permits establishing another connection to the same destination +without any ``window'' in which packets can pass without encryption. +

+ +The +--unroute + +operation (and only the +--unroute + +operation) deletes any route established for a connection. +

+ +In the +--union + +usage, each +part + +is the name of a partial connection specification in the configuration file, +and the union of all the partial specifications is the +connection specification used. +The effect is as if the contents of the partial specifications were +concatenated together; +restrictions on duplicate parameters, etc., do apply to the result. +(The same effect can now be had, more gracefully, using the +also + +parameter in connection descriptions; +see +ipsec.conf(5) + +for details.) +

+ +The +--show + +option turns on the +-x + +option of the shell used to execute the commands, +so each command is shown as it is executed. +

+ +The +--showonly + +option causes +manual + +to show the commands it would run, on standard output, +and not run them. +

+ +The +--other + +option causes +manual + +to pretend it is the other end of the connection. +This is probably not useful except in combination with +--showonly. + +

+ +The +--iam + +option causes +manual + +to believe it is running on the host with the specified IP +address, + +and that it should use the specified +interface + +(normally it determines all this automatically, +based on what IPsec interfaces are up and how they are configured). +

+ +The +--config + +option specifies a non-standard location for the FreeS/WAN IPsec +configuration file (default +/etc/ipsec.conf). + +

+ +See +ipsec.conf(5) + +for details of the configuration file. +Apart from the basic parameters which specify the endpoints and routing +of a connection (left +and +right, + +plus possibly +leftsubnet, + +leftnexthop, + +leftfirewall, + +their +right + +equivalents, +and perhaps +type), + +a non-passthrough +manual + +connection needs an +spi + +or +spibase + +parameter and some parameters specifying encryption, authentication, or +both, most simply +esp, + +espenckey, + +and +espauthkey. + +Moderately-secure keys can be obtained from +ipsec_ranbits(8). + +For production use of manually-keyed connections, +it is strongly recommended that the keys be kept in a separate file +(with permissions +rw-------) + +using the +include + +and +also + +facilities of the configuration file (see +ipsec.conf(5)). + +

+ +If an +spi + +parameter is given, +manual + +uses that value as the SPI number for all the SAs +(which are in separate number spaces anyway). +If an +spibase + +parameter is given instead, +manual + +assigns SPI values by altering the bottom digit +of that value; +SAs going from left to right get even digits starting at 0, +SAs going from right to left get odd digits starting at 1. +Either way, it is suggested that manually-keyed connections use +three-digit SPIs with the first digit non-zero, +i.e. in the range +0x100 + +through +0xfff; + +FreeS/WAN reserves those for manual keying and will not +attempt to use them for automatic keying (unless requested to, +presumably by a non-FreeS/WAN other end). +  +

FILES

+ + + +/etc/ipsec.conf           default IPsec configuration file
+
+ +/var/run/ipsec.info      %defaultroute information
+  +

SEE ALSO

+ +ipsec(8), ipsec.conf(5), ipsec_spi(8), ipsec_eroute(8), ipsec_spigrp(8), +route(8) +  +

HISTORY

+ +Written for the FreeS/WAN project +<http://www.freeswan.org/> +by Henry Spencer. +  +

BUGS

+ +It's not nearly as generous about the syntax of subnets, +addresses, etc. as the usual FreeS/WAN user interfaces. +Four-component dotted-decimal must be used for all addresses. +It +is + +smart enough to translate bit-count netmasks to dotted-decimal form. +

+ +If the connection specification for a connection is changed between an +--up + +and the ensuing +--down, + +chaos may ensue. +

+ +The +--up + +operation is not smart enough to notice whether the connection is already up. +

+ +Manual + +is not smart enough to reject insecure combinations of algorithms, +e.g. encryption with no authentication at all. +

+ +Any non-IPsec route to the other end which is replaced by the +--up + +or +--route + +operation will not be re-established by +--unroute. + +Whether this is a feature or a bug depends on your viewpoint. +

+ +The optional parameters which +override the automatic +spibase-based + +SPI assignment are a messy area of the code and bugs are likely. +

+ +``Road warrior'' handling, +and other special forms of setup which +require negotiation between the two security gateways, +inherently cannot be done with +manual. + +

+ +Manual + +generally lags behind +auto + +in support of various features, +even when implementation would be possible. +For example, currently it does not do IPComp content compression. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_maskof.3.html b/doc/manpage.d/ipsec_maskof.3.html new file mode 100644 index 000000000..ea0f83f82 --- /dev/null +++ b/doc/manpage.d/ipsec_maskof.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_masktobits.3.html b/doc/manpage.d/ipsec_masktobits.3.html new file mode 100644 index 000000000..6eccdd8d5 --- /dev/null +++ b/doc/manpage.d/ipsec_masktobits.3.html @@ -0,0 +1,122 @@ +Content-type: text/html + +Manpage of IPSEC_GOODMASK + +

IPSEC_GOODMASK

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec goodmask - is this Internet subnet mask a valid one? +
+ +ipsec masktobits - convert Internet subnet mask to bit count +
+ +ipsec bitstomask - convert bit count to Internet subnet mask +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int goodmask(struct in_addr mask); + +
+ +int masktobits(struct in_addr mask); + +
+ +struct in_addr bitstomask(int n); + +  +

DESCRIPTION

+ +These functions are obsolete; +see +ipsec_masktocount(3) + +for a partial replacement. +

+ +Goodmask + +reports whether the subnet +mask + +is a valid one, +i.e. consists of a (possibly empty) sequence of +1s + +followed by a (possibly empty) sequence of +0s. + +Masktobits + +takes a (valid) subnet mask and returns the number of +1 + +bits in it. +Bitstomask + +reverses this, +returning the subnet mask corresponding to bit count +n. + +

+ +All masks are in network byte order. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

DIAGNOSTICS

+ +Masktobits + +returns +-1 + +for an invalid mask. +Bitstomask + +returns an all-zeros mask for a negative or out-of-range +n. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The error-reporting convention of +bitstomask + +is less than ideal; +zero is sometimes a legitimate mask. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_masktocount.3.html b/doc/manpage.d/ipsec_masktocount.3.html new file mode 100644 index 000000000..ea0f83f82 --- /dev/null +++ b/doc/manpage.d/ipsec_masktocount.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_networkof.3.html b/doc/manpage.d/ipsec_networkof.3.html new file mode 100644 index 000000000..ea0f83f82 --- /dev/null +++ b/doc/manpage.d/ipsec_networkof.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_newhostkey.8.html b/doc/manpage.d/ipsec_newhostkey.8.html new file mode 100644 index 000000000..e6cf302bf --- /dev/null +++ b/doc/manpage.d/ipsec_newhostkey.8.html @@ -0,0 +1,196 @@ +Content-type: text/html + +Manpage of IPSEC_NEWHOSTKEY + +

IPSEC_NEWHOSTKEY

+Section: Maintenance Commands (8)
Updated: 4 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec newhostkey - generate a new host authentication key +  +

SYNOPSIS

+ +ipsec + +newhostkey + +--output + +filename +[ +--quiet + +] +\ + +
+ + +[ +--bits + +n +] +[ +--hostname + +host +] +  +

DESCRIPTION

+ +Newhostkey + +outputs (into +filename, + +which can be `-' for standard output) +an RSA private key suitable for this host, +in +/etc/ipsec.secrets + +format +(see +ipsec.secrets(5)). + +Normally, +newhostkey + +invokes +rsasigkey + +(see +ipsec_rsasigkey(8)) + +with the +--verbose + +option, so a narrative of what is being done appears on standard error. +

+ +The +--output + +specifier, although it is syntactically an option and can appear at +any point among the options (it doesn't have to be first), +is not optional. +The specified +filename + +is created under umask +077 + +if nonexistent; +if it already exists and is non-empty, +a warning message about that is sent to standard error, +and the output is appended to the file. +

+ +The +--quiet + +option suppresses both the +rsasigkey + +narrative and the existing-file warning message. +

+ +The +--bits + +option specifies the number of bits in the key; +the current default is 2192 and we do not recommend use of anything +shorter unless unusual constraints demand it. +

+ +The +--hostname + +option is passed through to +rsasigkey + +to tell it what host name to label the output with +(via its +--hostname + +option). +

+ +The output format is that of +rsasigkey, + +with bracketing added to complete the +ipsec.secrets + +format. +In the usual case, where +ipsec.secrets + +contains only the host's own private key, +the output of +newhostkey + +is sufficient as a complete +ipsec.secrets + +file. +  +

SEE ALSO

+ +ipsec.secrets(5), ipsec_rsasigkey(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +As with +rsasigkey, + +the run time is difficult to predict, +since depletion of the system's randomness pool can cause +arbitrarily long waits for random bits, +and the prime-number searches can also take unpredictable +(and potentially large) amounts of CPU time. +See +ipsec_rsasigkey(8) + +for some typical performance numbers. +

+ +A higher-level tool which could handle the clerical details +of changing to a new key would be helpful. +

+ +The requirement for +--output + +is a blemish, +but private keys are extremely sensitive information +and unusual precautions seem justified. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_optionsfrom.3.html b/doc/manpage.d/ipsec_optionsfrom.3.html new file mode 100644 index 000000000..05d045e4d --- /dev/null +++ b/doc/manpage.d/ipsec_optionsfrom.3.html @@ -0,0 +1,275 @@ +Content-type: text/html + +Manpage of IPSEC_OPTIONSFROM + +

IPSEC_OPTIONSFROM

+Section: C Library Functions (3)
Updated: 16 Oct 1998
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec optionsfrom - read additional ``command-line'' options from file +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *optionsfrom(char *filename, int *argcp, + +
+  +char ***argvp, int optind, FILE *errsto); + +  +

DESCRIPTION

+ +Optionsfrom + +is called from within a +getopt_long(3) + +scan, +as the result of the appearance of an option (preferably +--optionsfrom) + +to insert additional ``command-line'' arguments +into the scan immediately after +the option. +Typically this would be done to pick up options which are +security-sensitive and should not be visible to +ps(1) + +and similar commands, +and hence cannot be supplied as part +of the actual command line or the environment. +

+ +Optionsfrom + +reads the additional arguments from the specified +filename, + +allocates a new argument vector to hold pointers to the existing +arguments plus the new ones, +and amends +argc + +and +argv + +(via the pointers +argcp + +and +argvp, + +which must point to the +argc + +and +argv + +being supplied to +getopt_long(3)) + +accordingly. +Optind + +must be the index, in the original argument vector, +of the next argument. +

+ +If +errsto + +is NULL, +optionsfrom + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +If +errsto + +is non-NULL and an error occurs, +optionsfrom + +prints a suitable complaint onto the +errsto + +descriptor and invokes +exit + +with an exit status of 2; +this is a convenience for cases where more sophisticated +responses are not required. +

+ +The text of existing arguments is not disturbed by +optionsfrom, + +so pointers to them and into them remain valid. +

+ +The file of additional arguments is an ASCII text file. +Lines consisting solely of white space, +and lines beginning with +#, + +are comments and are ignored. +Otherwise, a line which does not begin with +- + +is taken to be a single argument; +if it both begins and ends with double-quote ("), +those quotes are stripped off (note, no other processing is done within +the line!). +A line beginning with +- + +is considered to contain multiple arguments separated by white space. +

+ +Because +optionsfrom + +reads its entire file before the +getopt_long(3) + +scan is resumed, an +optionsfrom + +file can contain another +--optionsfrom + +option. +Obviously, infinite loops are possible here. +If +errsto + +is non-NULL, +optionsfrom + +considers it an error to be called more than 100 times. +If +errsto + +is NULL, +loop detection is up to the caller +(and the internal loop counter is zeroed out). +  +

EXAMPLE

+ +A reasonable way to invoke +optionsfrom + +would be like so: +

+ +

+#include <getopt.h>
+
+struct option opts[] = {
+        /* ... */
+        "optionsfrom",  1,      NULL,   '+',
+        /* ... */
+};
+
+int
+main(argc, argv)
+int argc;
+char *argv[];
+{
+        int opt;
+        extern char *optarg;
+        extern int optind;
+
+        while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF)
+                switch (opt) {
+                /* ... */
+                case '+':       /* optionsfrom */
+                        optionsfrom(optarg, &argc, &argv, optind, stderr);
+                        /* does not return on error */
+                        break;
+                /* ... */
+                }
+        /* ... */
+
+ +  +

SEE ALSO

+ +getopt_long(3) +  +

DIAGNOSTICS

+ +Errors in +optionsfrom + +are: +unable to open file; +attempt to allocate temporary storage for argument or +argument vector failed; +read error in file; +line too long. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The double-quote convention is rather simplistic. +

+ +Line length is currently limited to 1023 bytes, +and there is no continuation convention. +

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +

+ +There is a certain element of unwarranted chumminess with +the insides of +getopt_long(3) + +here. +No non-public interfaces are actually used, but +optionsfrom + +does rely on +getopt_long(3) + +being well-behaved in certain ways that are not actually +promised by the specs. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLE
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_pf_key.5.html b/doc/manpage.d/ipsec_pf_key.5.html new file mode 100644 index 000000000..420c12900 --- /dev/null +++ b/doc/manpage.d/ipsec_pf_key.5.html @@ -0,0 +1,176 @@ +Content-type: text/html + +Manpage of IPSEC_PF_KEY + +

IPSEC_PF_KEY

+Section: File Formats (5)
Updated: 29 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_pf_key - lists PF_KEY sockets registered with KLIPS +  +

SYNOPSIS

+ +cat + +/proc/net/pf_key + +  +

DESCRIPTION

+ +/proc/net/pf_key + +is a read-only file which lists the presently open PF_KEY sockets on the +local system and their parameters. +

+ +Each line lists one PF_KEY socket. +A table entry consists of: +

+
+
+sock pointer (sock) +
+
+PID of the socket owner (pid) +
+
+flag to indicate if the socket is dead (d) +
+
+socket wait queue (sleep) +
+
+socket pointer (socket) +
+
+next socket in chain (next) +
+
+previous socket in chain (prev) +
+
+last socket error (e) +
+
+pointer to destruct routine (destruct) +
+
+is this a reused socket (r) +
+
+has this socket been zapped (z) +
+
+socket family to which this socket belongs (fa) +
+
+local port number (n) +
+
+protocol version number (p) +
+
+Receive queue bytes committed (r) +
+
+Transmit queue bytes committed (w) +
+
+option memory allocations (o) +
+
+size of send buffer in bytes (sndbf) +
+
+timestamp in seconds (stamp) +
+
+socket flags (Flags) +
+
+socket type (Type) +
+
+connection state (St) +.SHEXAMPLES + +
+
+
c3b8c140 3553 0 c0599818 c05997fc 0 0 0 0 1 0 15 0 2 0 0 0 65535 0.103232 00000000 00000003 01 + +
+
+

+ +shows that there is one pf_key socket set up that starts at +c3b8c140, + +whose owning process has PID +3553, + +the socket is not dead, its wait queue is at +c0599818, + +whose owning socket is at +c05997fc, + +with no other sockets in the chain, no errors, no destructor, it is a +reused socket which has not been zapped, from protocol family +15 + +(PF_KEY), local port number +0, + +protocol socket version +2, + +no memory allocated to transmit, receive or option queues, a send buffer +of almost +64kB, + +a timestamp of +0.103232, + +no flags set, type +3, + +in state +1. + +  +

FILES

+ +/proc/net/pf_key +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_eroute(5), ipsec_spi(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_tncfg(8), ipsec_version(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_pf_key.8.html b/doc/manpage.d/ipsec_pf_key.8.html new file mode 100644 index 000000000..e40cfb15b --- /dev/null +++ b/doc/manpage.d/ipsec_pf_key.8.html @@ -0,0 +1,122 @@ +Content-type: text/html + +Manpage of IPSEC_PF_KEY + +

IPSEC_PF_KEY

+Section: User Commands (1)
Updated: 17 Oct 2001
Index +Return to Main Contents
+ + + + +  +

NAME

+ +pf_key - shows pfkey messages emitted by the kernel +  +

SYNOPSIS

+ +pf_key + +--ah + +--esp + +--ipip + +--ipcomp + +--daemon + +file + +hmac-md5-96|hmac-sha1-96 + +  +

DESCRIPTION

+ +pf_key + +is a program to open a PF_KEY socket and print all messages that are received +from it. With no options, it will register itself to receive key requests for +AH, ESP, IPIP and IPCOMP security associations. If given more specific +options, then it will listen only to those protocols which are listed. +

+ +If the messages are recognized, the messages will be decoded. +

+ +If the option +--daemon + +is provided, then after doing the registrations, the program will fork +into the background. The provided file will be opened and the process ID of +the background process will be written to it. This option is present to +present race conditions in regression testing. +  +

EXAMPLES

+ +
+
+
+
+  +

FILES

+ +/proc/net/pf_key +  +

SEE ALSO

+ +pf_key(5), ipsec(8), ipsec_manual(8), ipsec_eroute(5), ipsec_spi(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_tncfg(8), ipsec_version(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Michael Richardson <mcr@freeswan.org> + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_pluto.8.html b/doc/manpage.d/ipsec_pluto.8.html new file mode 100644 index 000000000..2e2ce4c2f --- /dev/null +++ b/doc/manpage.d/ipsec_pluto.8.html @@ -0,0 +1,1824 @@ +Content-type: text/html + +Manpage of IPSEC_PLUTO + +

IPSEC_PLUTO

+Section: Maintenance Commands (8)
Updated: 28 March 1999
Index +Return to Main Contents
+ +  +

NAME

+ +ipsec pluto - IPsec IKE keying daemon +
+ +ipsec whack - control interface for IPSEC keying daemon +  +

SYNOPSIS

+ + + +
+
+ +
ipsec pluto +[--help] +[--version] +[--optionsfrom filename] +[--nofork] +[--stderrlog] +[--noklips] +[--uniqueids] +[--interface interfacename] +[--ikeport portnumber] +[--ctlbase path] +[--secretsfile secrets-file] +[--adns pathname] +[--lwdnsq pathname] +[--perpeerlog] +[--perpeerlogbase dirname] +[--debug-none] +[--debug-all] +[--debug-raw] +[--debug-crypt] +[--debug-parsing] +[--debug-emitting] +[--debug-control] +[--debug-lifecycle] +[--debug-klips] +[--debug-dns] +[--debug-oppo] +[--debug-private] +
+ +
ipsec whack +[--help] +[--version] +
+ +
ipsec whack +--name connection-name +
+ +[--id id] [--host ip-address] +[--ikeport port-number] +[--nexthop ip-address] +[--client subnet] +[--dnskeyondemand] +[--updown updown] +
+ +--to +
+ +[--id id] +[--host ip-address] +[--ikeport port-number] +[--nexthop ip-address] +[--client subnet] +[--dnskeyondemand] +[--updown updown] +
+ +[--psk] +[--rsasig] +[--encrypt] +[--authenticate] +[--compress] +[--tunnel] +[--pfs] +[--disablearrivalcheck] +[--ipv4] +[--ipv6] +[--tunnelipv4] +[--tunnelipv6] +[--ikelifetime seconds] +[--ipseclifetime seconds] +[--rekeymargin seconds] +[--rekeyfuzz percentage] +[--keyingtries count] +[--dontrekey] +[--delete] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--keyid id +[--addkey] +[--pubkeyrsa key] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--myid id +
+ +
ipsec whack +--listen|--unlisten +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--route|--unroute +--name connection-name +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--initiate|--terminate +--name connection-name +[--asynchronous] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +[--tunnelipv4] +[--tunnelipv6] +--oppohere ip-address +--oppothere ip-address +
+ +
ipsec whack +--delete +--name connection-name +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--deletestate state-number +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +[--name connection-name] +[--debug-none] +[--debug-all] +[--debug-raw] +[--debug-crypt] +[--debug-parsing] +[--debug-emitting] +[--debug-control] +[--debug-lifecycle] +[--debug-klips] +[--debug-dns] +[--debug-oppo] +[--debug-private] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--status +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--shutdown +[--ctlbase path] +[--optionsfrom filename] +[--label string] + + + +
+  +

DESCRIPTION

+ +pluto + +is an IKE (``IPsec Key Exchange'') daemon. +whack + +is an auxiliary program to allow requests to be made to a running +pluto. + +

+ +pluto + +is used to automatically build shared ``security associations'' on a +system that has IPsec, the secure IP protocol. +In other words, +pluto + +can eliminate much of the work of manual keying. +The actual +secure transmission of packets is the responsibility of other parts of +the system (see +KLIPS, + +the companion implementation of IPsec). +ipsec_auto(8) provides a more convenient interface to +pluto and whack. +  +

IKE's Job

+ +

+ +A Security Association (SA) is an agreement between two network nodes on +how to process certain traffic between them. This processing involves +encapsulation, authentication, encryption, or compression. +

+ +IKE can be deployed on a network node to negotiate Security +Associations for that node. These IKE implementations can only +negotiate with other IKE implementations, so IKE must be on each node +that is to be an endpoint of an IKE-negotiated Security Association. +No other nodes need to be running IKE. +

+ +An IKE instance (i.e. an IKE implementation on a particular network +node) communicates with another IKE instance using UDP IP packets, so +there must be a route between the nodes in each direction. +

+ +The negotiation of Security Associations requires a number of choices +that involve tradeoffs between security, convenience, trust, and +efficiency. These are policy issues and are normally specified to the +IKE instance by the system administrator. +

+ +IKE deals with two kinds of Security Associations. The first part of +a negotiation between IKE instances is to build an ISAKMP SA. An +ISAKMP SA is used to protect communication between the two IKEs. +IPsec SAs can then be built by the IKEs - these are used to carry +protected IP traffic between the systems. +

+ +The negotiation of the ISAKMP SA is known as Phase 1. In theory, +Phase 1 can be accomplished by a couple of different exchange types, +but we only implement one called Main Mode (we don't implement +Aggressive Mode). +

+ +Any negotiation under the protection of an ISAKMP SA, including the +negotiation of IPsec SAs, is part of Phase 2. The exchange type +that we use to negotiate an IPsec SA is called Quick Mode. +

+ +IKE instances must be able to authenticate each other as part of their +negotiation of an ISAKMP SA. This can be done by several mechanisms +described in the draft standards. +

+ +IKE negotiation can be initiated by any instance with any other. If +both can find an agreeable set of characteristics for a Security +Association, and both recognize each others authenticity, they can set +up a Security Association. The standards do not specify what causes +an IKE instance to initiate a negotiation. +

+ +In summary, an IKE instance is prepared to automate the management of +Security Associations in an IPsec environment, but a number of issues +are considered policy and are left in the system administrator's hands. +  +

Pluto

+ +

+ +pluto is an implementation of IKE. It runs as a daemon on a network +node. Currently, this network node must be a LINUX system running the +KLIPS implementation of IPsec. +

+ +pluto only implements a subset of IKE. This is enough for it to +interoperate with other instances of pluto, and many other IKE +implementations. We are working on implementing more of IKE. +

+ +The policy for acceptable characteristics for Security Associations is +mostly hardwired into the code of pluto (spdb.c). Eventually +this will be moved into a security policy database with reasonable +expressive power and more convenience. +

+ +pluto uses shared secrets or RSA signatures to authenticate +peers with whom it is negotiating. +

+ +pluto initiates negotiation of a Security Association when it is +manually prodded: the program whack is run to trigger this. +It will also initiate a negotiation when KLIPS traps an outbound packet +for Opportunistic Encryption. +

+ +pluto implements ISAKMP SAs itself. After it has negotiated the +characteristics of an IPsec SA, it directs KLIPS to implement it. +It also invokes a script to adjust any firewall and issue route(8) +commands to direct IP packets through KLIPS. +

+ +When pluto shuts down, it closes all Security Associations. +  +

Before Running Pluto

+ +

+ +pluto runs as a daemon with userid root. Before running it, a few +things must be set up. +

+ +pluto requires KLIPS, the FreeS/WAN implementation of IPsec. +All of the components of KLIPS and pluto should be installed. +

+ +pluto supports multiple public networks (that is, networks +that are considered insecure and thus need to have their traffic +encrypted or authenticated). It discovers the +public interfaces to use by looking at all interfaces that are +configured (the --interface option can be used to limit +the interfaces considered). +It does this only when whack tells it to --listen, +so the interfaces must be configured by then. Each interface with a name of the form +ipsec[0-9] is taken as a KLIPS virtual public interface. +Another network interface with the same IP address (there should be only +one) is taken as the corresponding real public +interface. ifconfig(8) with the -a flag will show +the name and status of each network interface. +

+ +pluto requires a database of preshared secrets and RSA private keys. +This is described in the +ipsec.secrets(5). + +pluto is told of RSA public keys via whack commands. +If the connection is Opportunistic, and no RSA public key is known, +pluto will attempt to fetch RSA keys using the Domain Name System. +  +

Setting up KLIPS for pluto

+ +

+ +The most basic network topology that pluto supports has two security +gateways negotiating on behalf of client subnets. The diagram of RGB's +testbed is a good example (see klips/doc/rgb_setup.txt). +

+ +The file INSTALL in the base directory of this distribution +explains how to start setting up the whole system, including KLIPS. +

+ +Make sure that the security gateways have routes to each other. This +is usually covered by the default route, but may require issuing +route(8) + +commands. The route must go through a particular IP +interface (we will assume it is eth0, but it need not be). The +interface that connects the security gateway to its client must be a +different one. +

+ +It is necessary to issue a +ipsec_tncfg(8) + +command on each gateway. The required command is: +

+   ipsec tncfg --attach --virtual ipsec0 --physical eth0 +

+A command to set up the ipsec0 virtual interface will also need to be +run. It will have the same parameters as the command used to set up +the physical interface to which it has just been connected using +ipsec_tncfg(8). + +  +

ipsec.secrets file

+ +

+ +A pluto daemon and another IKE daemon (for example, another instance +of pluto) must convince each other that they are who they are supposed +to be before any negotiation can succeed. This authentication is +accomplished by using either secrets that have been shared beforehand +(manually) or by using RSA signatures. There are other techniques, +but they have not been implemented in pluto. +

+ +The file /etc/ipsec.secrets is used to keep preshared secret keys +and RSA private keys for +authentication with other IKE daemons. For debugging, there is an +argument to the pluto command to use a different file. +This file is described in +ipsec.secrets(5). + +  +

Running Pluto

+ +

+ +To fire up the daemon, just type pluto (be sure to be running as +the superuser). +The default IKE port number is 500, the UDP port assigned by IANA for IKE Daemons. +pluto must be run by the superuser to be able to use the UDP 500 port. +

+ +pluto attempts to create a lockfile with the name +/var/run/pluto.pid. If the lockfile cannot be created, +pluto exits - this prevents multiple plutos from +competing Any ``leftover'' lockfile must be removed before +pluto will run. pluto writes its pid into this file so +that scripts can find it. This lock will not function properly if it +is on an NFS volume (but sharing locks on multiple machines doesn't +make sense anyway). +

+ +pluto then forks and the parent exits. This is the conventional +``daemon fork''. It can make debugging awkward, so there is an option +to suppress this fork. +

+ +All logging, including diagnostics, is sent to +syslog(3) + +with facility=authpriv; +it decides where to put these messages (possibly in /var/log/secure). +Since this too can make debugging awkward, there is an option to +steer logging to stderr. +

+ +If the --perpeerlog option is given, then pluto will open +a log file per connection. By default, this is in /var/log/pluto/peer, +in a subdirectory formed by turning all dot (.) [IPv4} or colon (:) +[IPv6] into slashes (/). +

+ +The base directory can be changed with the --perpeerlogbase. +

+ +Once pluto is started, it waits for requests from whack. +  +

Pluto's Internal State

+ +

+ +To understand how to use pluto, it is helpful to understand a little +about its internal state. Furthermore, the terminology is needed to decipher +some of the diagnostic messages. +

+ +The (potential) connection database describes attributes of a +connection. These include the IP addresses of the hosts and client +subnets and the security characteristics desired. pluto +requires this information (simply called a connection) before it can +respond to a request to build an SA. Each connection is given a name +when it is created, and all references are made using this name. +

+ +During the IKE exchange to build an SA, the information about the +negotiation is represented in a state object. Each state object +reflects how far the negotiation has reached. Once the negotiation is +complete and the SA established, the state object remains to represent +the SA. When the SA is terminated, the state object is discarded. +Each State object is given a serial number and this is used to refer +to the state objects in logged messages. +

+ +Each state object corresponds to a connection and can be thought of +as an instantiation of that connection. +At any particular time, there may be any number of state objects +corresponding to a particular connection. +Often there is one representing an ISAKMP SA and another representing +an IPsec SA. +

+ +KLIPS hooks into the routing code in a LINUX kernel. +Traffic to be processed by an IPsec SA must be directed through +KLIPS by routing commands. Furthermore, the processing to be +done is specified by ipsec eroute(8) commands. +pluto takes the responsibility of managing both of these special +kinds of routes. +

+ +Each connection may be routed, and must be while it has an IPsec SA. +The connection specifies the characteristics of the route: the +interface on this machine, the ``gateway'' (the nexthop), +and the peer's client subnet. Two +connections may not be simultaneously routed if they are for the same +peer's client subnet but use different interfaces or gateways +(pluto's logic does not reflect any advanced routing capabilities). +

+ +Each eroute is associated with the state object for an IPsec SA +because it has the particular characteristics of the SA. +Two eroutes conflict if they specify the identical local +and remote clients (unlike for routes, the local clients are +taken into account). +

+ +When pluto needs to install a route for a connection, +it must make sure that no conflicting route is in use. If another +connection has a conflicting route, that route will be taken down, as long +as there is no IPsec SA instantiating that connection. +If there is such an IPsec SA, the attempt to install a route will fail. +

+ +There is an exception. If pluto, as Responder, needs to install +a route to a fixed client subnet for a connection, and there is +already a conflicting route, then the SAs using the route are deleted +to make room for the new SAs. The rationale is that the new +connection is probably more current. The need for this usually is a +product of Road Warrior connections (these are explained later; they +cannot be used to initiate). +

+ +When pluto needs to install an eroute for an IPsec SA (for a +state object), first the state object's connection must be routed (if +this cannot be done, the eroute and SA will not be installed). +If a conflicting eroute is already in place for another connection, +the eroute and SA will not be installed (but note that the routing +exception mentioned above may have already deleted potentially conflicting SAs). +If another IPsec +SA for the same connection already has an eroute, all its outgoing traffic +is taken over by the new eroute. The incoming traffic will still be +processed. This characteristic is exploited during rekeying. +

+ +All of these routing characteristics are expected change when +KLIPS is modified to use the firewall hooks in the LINUX 2.4.x +kernel. +  +

Using Whack

+ +

+ +whack is used to command a running pluto. +whack uses a UNIX domain socket to speak to pluto +(by default, /var/pluto.ctl). +

+ +whack has an intricate argument syntax. +This syntax allows many different functions to be specified. +The help form shows the usage or version information. +The connection form gives pluto a description of a potential connection. +The public key form informs pluto of the RSA public key for a potential peer. +The delete form deletes a connection description and all SAs corresponding +to it. +The listen form tells pluto to start or stop listening on the public interfaces +for IKE requests from peers. +The route form tells pluto to set up routing for a connection; +the unroute form undoes this. +The initiate form tells pluto to negotiate an SA corresponding to a connection. +The terminate form tells pluto to remove all SAs corresponding to a connection, +including those being negotiated. +The status form displays the pluto's internal state. +The debug form tells pluto to change the selection of debugging output +``on the fly''. The shutdown form tells +pluto to shut down, deleting all SAs. +

+ +Most options are specific to one of the forms, and will be described +with that form. There are three options that apply to all forms. +

+
--ctlbase path
+path.ctl is used as the UNIX domain socket for talking +to pluto. +This option facilitates debugging. +
--optionsfrom filename
+adds the contents of the file to the argument list. +
--label string
+adds the string to all error messages generated by whack. +
+

+ +The help form of whack is self-explanatory. +

+
--help
+display the usage message. +
--version
+display the version of whack. +
+

+ +The connection form describes a potential connection to pluto. +pluto needs to know what connections can and should be negotiated. +When pluto is the initiator, it needs to know what to propose. +When pluto is the responder, it needs to know enough to decide whether +is is willing to set up the proposed connection. +

+ +The description of a potential connection can specify a large number +of details. Each connection has a unique name. This name will appear +in a updown shell command, so it should not contain punctuation +that would make the command ill-formed. +

+
--name connection-name
+
+

+ +The topology of +a connection is symmetric, so to save space here is half a picture: +

+   client_subnet<-->host:ikeport<-->nexthop<--- +

+A similar trick is used in the flags. The same flag names are used for +both ends. Those before the --to flag describe the left side +and those afterwards describe the right side. When pluto attempts +to use the connection, it decides whether it is the left side or the right +side of the connection, based on the IP numbers of its interfaces. +

+
--id id
+the identity of the end. Currently, this can be an IP address (specified +as dotted quad or as a Fully Qualified Domain Name, which will be resolved +immediately) or as a Fully Qualified Domain Name itself (prefixed by ``@'' +to signify that it should not be resolved), or as user@FQDN, or as the +magic value %myid. +Pluto only authenticates the identity, and does not use it for +addressing, so, for example, an IP address need not be the one to which +packets are to be sent. If the option is absent, the +identity defaults to the IP address specified by --host. +%myid allows the identity to be separately specified (by the pluto or whack option --myid +or by the ipsec.conf(5) config setup parameter myid). +Otherwise, pluto tries to guess what %myid should stand for: +the IP address of %defaultroute, if it is supported by a suitable TXT record in the reverse domain for that IP address, +or the system's hostname, if it is supported by a suitable TXT record in its forward domain. + +
--host ip-address
+
--host %any
+
--host %opportunistic
+the IP address of the end (generally the public interface). +If pluto is to act as a responder +for IKE negotiations initiated from unknown IP addresses (the +``Road Warrior'' case), the +IP address should be specified as %any (currently, +the obsolete notation 0.0.0.0 is also accepted for this). +If pluto is to opportunistically initiate the connection, +use %opportunistic +
--ikeport port-number
+the UDP port that IKE listens to on that host. The default is 500. +(pluto on this machine uses the port specified by its own command +line argument, so this only affects where pluto sends messages.) +
--nexthop ip-address
+where to route packets for the peer's client (presumably for the peer too, +but it will not be used for this). +When pluto installs an IPsec SA, it issues a route command. +It uses the nexthop as the gateway. +The default is the peer's IP address (this can be explicitly written as +%direct; the obsolete notation 0.0.0.0 is accepted). +This option is necessary if pluto's host's interface used for sending +packets to the peer is neither point-to-point nor directly connected to the +peer. +
--client subnet
+the subnet for which the IPsec traffic will be destined. If not specified, +the host will be the client. +The subnet can be specified in any of the forms supported by ipsec_atosubnet(3). +The general form is address/mask. The address can be either +a domain name or four decimal numbers (specifying octets) separated by dots. +The most convenient form of the mask is a decimal integer, specifying +the number of leading one bits in the mask. So, for example, 10.0.0.0/8 +would specify the class A network ``Net 10''. +
--dnskeyondemand]
+specifies that when an RSA public key is needed to authenticate this +host, and it isn't already known, fetch it from DNS. +
--updown updown
+specifies an external shell command to be run whenever pluto +brings up or down a connection. +The script is used to build a shell command, so it may contain positional +parameters, but ought not to have punctuation that would cause the +resulting command to be ill-formed. +The default is ipsec _updown. +
--to
+separates the specification of the left and right ends of the connection. +
+

+ +The potential connection description also specifies characteristics of +rekeying and security. +

+
--psk
+Propose and allow preshared secret authentication for IKE peers. This authentication +requires that each side use the same secret. May be combined with --rsasig; +at least one must be specified. +
--rsasig
+Propose and allow RSA signatures for authentication of IKE peers. This authentication +requires that each side have have a private key of its own and know the +public key of its peer. May be combined with --psk; +at least one must be specified. +
--encrypt
+All proposed or accepted IPsec SAs will include non-null ESP. +The actual choices of transforms are wired into pluto. +
--authenticate
+All proposed IPsec SAs will include AH. +All accepted IPsec SAs will include AH or ESP with authentication. +The actual choices of transforms are wired into pluto. +Note that this has nothing to do with IKE authentication. +
--compress
+All proposed IPsec SAs will include IPCOMP (compression). +This will be ignored if KLIPS is not configured with IPCOMP support. +
--tunnel
+the IPsec SA should use tunneling. Implicit if the SA is for clients. +Must only be used with --authenticate or --encrypt. +
--ipv4
+The host addresses will be interpreted as IPv4 addresses. This is the +default. Note that for a connection, all host addresses must be of +the same Address Family (IPv4 and IPv6 use different Address Families). +
--ipv6
+The host addresses (including nexthop) will be interpreted as IPv6 addresses. +Note that for a connection, all host addresses must be of +the same Address Family (IPv4 and IPv6 use different Address Families). +
--tunnelipv4
+The client addresses will be interpreted as IPv4 addresses. The default is +to match what the host will be. This does not imply --tunnel so the +flag can be safely used when no tunnel is actually specified. +Note that for a connection, all tunnel addresses must be of the same +Address Family. +
--tunnelipv6
+The client addresses will be interpreted as IPv6 addresses. The default is +to match what the host will be. This does not imply --tunnel so the +flag can be safely used when no tunnel is actually specified. +Note that for a connection, all tunnel addresses must be of the same +Address Family. +
--pfs
+There should be Perfect Forward Secrecy - new keying material will +be generated for each IPsec SA rather than being derived from the ISAKMP +SA keying material. +Since the group to be used cannot be negotiated (a dubious feature of the +standard), pluto will propose the same group that was used during Phase 1. +We don't implement a stronger form of PFS which would require that the +ISAKMP SA be deleted after the IPSEC SA is negotiated. +
--disablearrivalcheck
+If the connection is a tunnel, allow packets arriving through the tunnel +to have any source and destination addresses. +
+

+ +If none of the --encrypt, --authenticate, --compress, +or --pfs flags is given, the initiating the connection will +only build an ISAKMP SA. For such a connection, client subnets have +no meaning and must not be specified. +

+ +More work is needed to allow for flexible policies. Currently +policy is hardwired in the source file spdb.c. The ISAKMP SAs may use +Oakley groups MODP1024 and MODP1536; 3DES encryption; SHA1-96 +and MD5-96 authentication. The IPsec SAs may use 3DES and +MD5-96 or SHA1-96 for ESP, or just MD5-96 or SHA1-96 for AH. +IPCOMP Compression is always Deflate. +

+
--ikelifetime seconds
+how long pluto will propose that an ISAKMP SA be allowed to live. +The default is 3600 (one hour) and the maximum is 28800 (8 hours). +This option will not affect what is accepted. +pluto will reject proposals that exceed the maximum. +
--ipseclifetime seconds
+how long pluto will propose that an IPsec SA be allowed to live. +The default is 28800 (eight hours) and the maximum is 86400 (one day). +This option will not affect what is accepted. +pluto will reject proposals that exceed the maximum. +
--rekeymargin seconds
+how long before an SA's expiration should pluto try to negotiate +a replacement SA. This will only happen if pluto was the initiator. +The default is 540 (nine minutes). +
--rekeyfuzz percentage
+maximum size of random component to add to rekeymargin, expressed as +a percentage of rekeymargin. pluto will select a delay uniformly +distributed within this range. By default, the percentage will be 100. +If greater determinism is desired, specify 0. It may be appropriate +for the percentage to be much larger than 100. +
--keyingtries count
+how many times pluto should try to negotiate an SA, +either for the first time or for rekeying. +A value of 0 is interpreted as a very large number: never give up. +The default is three. +
--dontrekey
+A misnomer. +Only rekey a connection if we were the Initiator and there was recent +traffic on the existing connection. +This applies to Phase 1 and Phase 2. +This is currently the only automatic way for a connection to terminate. +It may be useful with Road Warrior or Opportunistic connections. +
+ +Since SA lifetime negotiation is take-it-or-leave it, a Responder +normally uses the shorter of the negotiated or the configured lifetime. +This only works because if the lifetime is shorter than negotiated, +the Responder will rekey in time so that everything works. +This interacts badly with --dontrekey. In this case, +the Responder will end up rekeying to rectify a shortfall in an IPsec SA +lifetime; for an ISAKMP SA, the Responder will accept the negotiated +lifetime. +
--delete
+when used in the connection form, it causes any previous connection +with this name to be deleted before this one is added. Unlike a +normal delete, no diagnostic is produced if there was no previous +connection to delete. Any routing in place for the connection is undone. +
+

+ +The delete form deletes a named connection description and any +SAs established or negotiations initiated using this connection. +Any routing in place for the connection is undone. +

+
--delete
+
--name connection-name
+
+

+ +The deletestate form deletes the state object with the specified serial number. +This is useful for selectively deleting instances of connections. +

+
--deletestate state-number
+
+

+ +The route form of the whack command tells pluto to set up +routing for a connection. +Although like a traditional route, it uses an ipsec device as a +virtual interface. +Once routing is set up, no packets will be +sent ``in the clear'' to the peer's client specified in the connection. +A TRAP shunt eroute will be installed; if outbound traffic is caught, +Pluto will initiate the connection. +An explicit whack route is not always needed: if it hasn't been +done when an IPsec SA is being installed, one will be automatically attempted. +

+ +When a routing is attempted for a connection, there must not already +be a routing for a different connection with the same subnet but different +interface or destination, or if +there is, it must not be being used by an IPsec SA. Otherwise the +attempt will fail. +

+
--route
+
--name connection-name
+
+

+ +The unroute form of the whack command tells pluto to undo +a routing. pluto will refuse if an IPsec SA is using the connection. +If another connection is sharing the same routing, it will be left in place. +Without a routing, packets will be sent without encryption or authentication. +

+
--unroute
+
--name connection-name
+
+

+ +The initiate form tells pluto to initiate a negotiation with another +pluto (or other IKE daemon) according to the named connection. +Initiation requires a route that --route would provide; +if none is in place at the time an IPsec SA is being installed, +pluto attempts to set one up. +

+
--initiate
+
--name connection-name
+
--asynchronous
+
+

+ +The initiate form of the whack command will relay back from +pluto status information via the UNIX domain socket (unless +--asynchronous is specified). The status information is meant to +look a bit like that from FTP. Currently whack simply +copies this to stderr. When the request is finished (eg. the SAs are +established or pluto gives up), pluto closes the channel, +causing whack to terminate. +

+ +The opportunistic initiate form is mainly used for debugging. +

+
--tunnelipv4
+
--tunnelipv6
+
--oppohere ip-address
+
--oppothere ip-address
+
+

+ +This will cause pluto to attempt to opportunistically initiate a +connection from here to the there, even if a previous attempt +had been made. +The whack log will show the progress of this attempt. +

+ +The terminate form tells pluto to delete any SAs that use the specified +connection and to stop any negotiations in process. +It does not prevent new negotiations from starting (the delete form +has this effect). +

+
--terminate
+
--name connection-name
+
+

+ +The public key for informs pluto of the RSA public key for a potential peer. +Private keys must be kept secret, so they are kept in +ipsec.secrets(5). + +

+
--keyid id
+specififies the identity of the peer for which a public key should be used. +Its form is identical to the identity in the connection. +If no public key is specified, pluto attempts to find KEY records +from DNS for the id (if a FQDN) or through reverse lookup (if an IP address). +Note that there several interesting ways in which this is not secure. +
--addkey
+specifies that the new key is added to the collection; otherwise the +new key replaces any old ones. +
--pubkeyrsa key
+specifies the value of the RSA public key. It is a sequence of bytes +as described in RFC 2537 ``RSA/MD5 KEYs and SIGs in the Domain Name System (DNS)''. +It is denoted in a way suitable for ipsec_ttodata(3). +For example, a base 64 numeral starts with 0s. +
+

+ +The listen form tells pluto to start listening for IKE requests +on its public interfaces. To avoid race conditions, it is normal to +load the appropriate connections into pluto before allowing it +to listen. If pluto isn't listening, it is pointless to +initiate negotiations, so it will refuse requests to do so. Whenever +the listen form is used, pluto looks for public interfaces and +will notice when new ones have been added and when old ones have been +removed. This is also the trigger for pluto to read the +ipsec.secrets file. So listen may useful more than once. +

+
--listen
+start listening for IKE traffic on public interfaces. +
--unlisten
+stop listening for IKE traffic on public interfaces. +
+

+ +The status form will display information about the internal state of +pluto: information about each potential connection, about +each state object, and about each shunt that pluto is managing +without an associated connection. +

+
--status
+
+

+ +The shutdown form is the proper way to shut down pluto. +It will tear down the SAs on this machine that pluto has negotiated. +It does not inform its peers, so the SAs on their machines remain. +

+
--shutdown
+
+  +

Examples

+ +

+ +It would be normal to start pluto in one of the system initialization +scripts. It needs to be run by the superuser. Generally, no arguments are needed. +To run in manually, the superuser can simply type +

+   ipsec pluto +

+The command will immediately return, but a pluto process will be left +running, waiting for requests from whack or a peer. +

+ +Using whack, several potential connections would be described: +

+
+ +   ipsec whack --name silly +--host 127.0.0.1 --to --host 127.0.0.2 +--ikelifetime 900 --ipseclifetime 800 --keyingtries 3 + +
+

+ +

Since this silly connection description specifies neither encryption, +authentication, nor tunneling, it could only be used to establish +an ISAKMP SA. +
+
+ +   ipsec whack --name secret --host 10.0.0.1 --client 10.0.1.0/24 +--to --host 10.0.0.2 --client 10.0.2.0/24 +--encrypt + +
+

+ +

This is something that must be done on both sides. If the other +side is pluto, the same whack command could be used on it +(the command syntax is designed to not distinguish which end is ours). +

+ +Now that the connections are specified, pluto is ready to handle +requests and replies via the public interfaces. We must tell it to discover +those interfaces and start accepting messages from peers: +

+   ipsec whack --listen +

+ +If we don't immediately wish to bring up a secure connection between +the two clients, we might wish to prevent insecure traffic. +The routing form asks pluto to cause the packets sent from +our client to the peer's client to be routed through the ipsec0 +device; if there is no SA, they will be discarded: +

+   ipsec whack --route secret +

+ +Finally, we are ready to get pluto to initiate negotiation +for an IPsec SA (and implicitly, an ISAKMP SA): +

+   ipsec whack --initiate --name secret +

+A small log of interesting events will appear on standard output +(other logging is sent to syslog). +

+ +whack can also be used to terminate pluto cleanly, tearing down +all SAs that it has negotiated. +

+   ipsec whack --shutdown +

+Notification of any IPSEC SA deletion, but not ISAKMP SA deletion +is sent to the peer. Unfortunately, such Notification is not reliable. +Furthermore, pluto itself ignores Notifications. +  +

The updown command

+ +

+ +Whenever pluto brings a connection up or down, it invokes +the updown command. This command is specified using the --updown +option. This allows for customized control over routing and firewall manipulation. +

+ +The updown is invoked for five different operations. Each of +these operations can be for our client subnet or for our host itself. +

+
prepare-host or prepare-client
+is run before bringing up a new connection if no other connection +with the same clients is up. Generally, this is useful for deleting a +route that might have been set up before pluto was run or +perhaps by some agent not known to pluto. +
route-host or route-client
+is run when bringing up a connection for a new peer client subnet +(even if prepare-host or prepare-client was run). The +command should install a suitable route. Routing decisions are based +only on the destination (peer's client) subnet address, unlike eroutes +which discriminate based on source too. +
unroute-host or unroute-client
+is run when bringing down the last connection for a particular peer +client subnet. It should undo what the route-host or route-client +did. +
up-host or up-client
+is run when bringing up a tunnel eroute with a pair of client subnets +that does not already have a tunnel eroute. +This command should install firewall rules as appropriate. +It is generally a good idea to allow IKE messages (UDP port 500) +travel between the hosts. +
down-host or down-client
+is run when bringing down the eroute for a pair of client subnets. +This command should delete firewall rules as appropriate. Note that +there may remain some inbound IPsec SAs with these client subnets. +
+

+ +The script is passed a large number of environment variables to specify +what needs to be done. +

+
PLUTO_VERSION
+indicates what version of this interface is being used. This document +describes version 1.1. This is upwardly compatible with version 1.0. +
PLUTO_VERB
+specifies the name of the operation to be performed +(prepare-host,r prepare-client, +up-host, up-client, +down-host, or down-client). If the address family for +security gateway to security gateway communications is IPv6, then +a suffix of -v6 is added to the verb. +
PLUTO_CONNECTION
+is the name of the connection for which we are routing. +
PLUTO_NEXT_HOP
+is the next hop to which packets bound for the peer must be sent. +
PLUTO_INTERFACE
+is the name of the ipsec interface to be used. +
PLUTO_ME
+is the IP address of our host. +
PLUTO_MY_CLIENT
+is the IP address / count of our client subnet. +If the client is just the host, this will be the host's own IP address / max +(where max is 32 for IPv4 and 128 for IPv6). +
PLUTO_MY_CLIENT_NET
+is the IP address of our client net. +If the client is just the host, this will be the host's own IP address. +
PLUTO_MY_CLIENT_MASK
+is the mask for our client net. +If the client is just the host, this will be 255.255.255.255. +
PLUTO_PEER
+is the IP address of our peer. +
PLUTO_PEER_CLIENT
+is the IP address / count of the peer's client subnet. +If the client is just the peer, this will be the peer's own IP address / max +(where max is 32 for IPv4 and 128 for IPv6). +
PLUTO_PEER_CLIENT_NET
+is the IP address of the peer's client net. +If the client is just the peer, this will be the peer's own IP address. +
PLUTO_PEER_CLIENT_MASK
+is the mask for the peer's client net. +If the client is just the peer, this will be 255.255.255.255. +
+

+ +All output sent by the script to stderr or stdout is logged. The +script should return an exit status of 0 if and only if it succeeds. +

+ +Pluto waits for the script to finish and will not do any other +processing while it is waiting. +The script may assume that pluto will not change anything +while the script runs. +The script should avoid doing anything that takes much time and it +should not issue any command that requires processing by pluto. +Either of these activities could be performed by a background +subprocess of the script. +  +

Rekeying

+ +

+ +When an SA that was initiated by pluto has only a bit of +lifetime left, +pluto will initiate the creation of a new SA. This applies to +ISAKMP and IPsec SAs. +The rekeying will be initiated when the SA's remaining lifetime is +less than the rekeymargin plus a random percentage, between 0 and +rekeyfuzz, of the rekeymargin. +

+ +Similarly, when an SA that was initiated by the peer has only a bit of +lifetime left, pluto will try to initiate the creation of a +replacement. +To give preference to the initiator, this rekeying will only be initiated +when the SA's remaining lifetime is half of rekeymargin. +If rekeying is done by the responder, the roles will be reversed: the +responder for the old SA will be the initiator for the replacement. +The former initiator might also initiate rekeying, so there may +be redundant SAs created. +To avoid these complications, make sure that rekeymargin is generous. +

+ +One risk of having the former responder initiate is that perhaps +none of its proposals is acceptable to the former initiator +(they have not been used in a successful negotiation). +To reduce the chances of this happening, and to prevent loss of security, +the policy settings are taken from the old SA (this is the case even if +the former initiator is initiating). +These may be stricter than those of the connection. +

+ +pluto will not rekey an SA if that SA is not the most recent of its +type (IPsec or ISAKMP) for its potential connection. +This avoids creating redundant SAs. +

+ +The random component in the rekeying time (rekeyfuzz) is intended to +make certain pathological patterns of rekeying unstable. If both +sides decide to rekey at the same time, twice as many SAs as necessary +are created. This could become a stable pattern without the +randomness. +

+ +Another more important case occurs when a security gateway has SAs +with many other security gateways. Each of these connections might +need to be rekeyed at the same time. This would cause a high peek +requirement for resources (network bandwidth, CPU time, entropy for +random numbers). The rekeyfuzz can be used to stagger the rekeying +times. +

+ +Once a new set of SAs has been negotiated, pluto will never send +traffic on a superseded one. Traffic will be accepted on an old SA +until it expires. +  +

Selecting a Connection When Responding: Road Warrior Support

+ +

+ +When pluto receives an initial Main Mode message, it needs to +decide which connection this message is for. It picks based solely on +the source and destination IP addresses of the message. There might +be several connections with suitable IP addresses, in which case one +of them is arbitrarily chosen. (The ISAKMP SA proposal contained in +the message could be taken into account, but it is not.) +

+ +The ISAKMP SA is negotiated before the parties pass further +identifying information, so all ISAKMP SA characteristics specified in +the connection description should be the same for every connection +with the same two host IP addresses. At the moment, the only +characteristic that might differ is authentication method. +

+ +Up to this point, +all configuring has presumed that the IP addresses +are known to all parties ahead of time. This will not work +when either end is mobile (or assigned a dynamic IP address for other +reasons). We call this situation ``Road Warrior''. It is fairly tricky +and has some important limitations, most of which are features of +the IKE protocol. +

+ +Only the initiator may be mobile: +the initiator may have an IP number unknown to the responder. When +the responder doesn't recognize the IP address on the first Main Mode +packet, it looks for a connection with itself as one end and %any +as the other. +If it cannot find one, it refuses to negotiate. If it +does find one, it creates a temporary connection that is a duplicate +except with the %any replaced by the source IP address from the +packet; if there was no identity specified for the peer, the new IP +address will be used. +

+ +When pluto is using one of these temporary connections and +needs to find the preshared secret or RSA private key in ipsec.secrets, +and and the connection specified no identity for the peer, %any +is used as its identity. After all, the real IP address was apparently +unknown to the configuration, so it is unreasonable to require that +it be used in this table. +

+ +Part way into the Phase 1 (Main Mode) negotiation using one of these +temporary connection descriptions, pluto will be receive an +Identity Payload. At this point, pluto checks for a more +appropriate connection, one with an identity for the peer that matches +the payload but which would use the same keys so-far used for +authentication. If it finds one, it will switch to using this better +connection (or a temporary derived from this, if it has %any +for the peer's IP address). It may even turn out that no connection +matches the newly discovered identity, including the current connection; +if so, pluto terminates negotiation. +

+ +Unfortunately, if preshared secret authentication is being used, the +Identity Payload is encrypted using this secret, so the secret must be +selected by the responder without knowing this payload. This +limits there to being at most one preshared secret for all Road Warrior +systems connecting to a host. RSA Signature authentications does not +require that the responder know how to select the initiator's public key +until after the initiator's Identity Payload is decoded (using the +responder's private key, so that must be preselected). +

+ +When pluto is responding to a Quick Mode negotiation via one of these +temporary connection descriptions, it may well find that the subnets +specified by the initiator don't match those in the temporary +connection description. If so, it will look for a connection with +matching subnets, its own host address, a peer address of %any +and matching identities. +If it finds one, a new temporary connection is derived from this one +and used for the Quick Mode negotiation of IPsec SAs. If it does not +find one, pluto terminates negotiation. +

+ +Be sure to specify an appropriate nexthop for the responder +to send a message to the initiator: pluto has no way of guessing +it (if forwarding isn't required, use an explicit %direct as the nexthop +and the IP address of the initiator will be filled in; the obsolete +notation 0.0.0.0 is still accepted). +

+ +pluto has no special provision for the initiator side. The current +(possibly dynamic) IP address and nexthop must be used in defining +connections. These must be +properly configured each time the initiator's IP address changes. +pluto has no mechanism to do this automatically. +

+ +Although we call this Road Warrior Support, it could also be used to +support encrypted connections with anonymous initiators. The +responder's organization could announce the preshared secret that would be used +with unrecognized initiators and let anyone connect. Of course the initiator's +identity would not be authenticated. +

+ +If any Road Warrior connections are supported, pluto cannot +reject an exchange initiated by an unknown host until it has +determined that the secret is not shared or the signature is invalid. +This must await the +third Main Mode message from the initiator. If no Road Warrior +connection is supported, the first message from an unknown source +would be rejected. This has implications for ease of debugging +configurations and for denial of service attacks. +

+ +Although a Road Warrior connection must be initiated by the mobile +side, the other side can and will rekey using the temporary connection +it has created. If the Road Warrior wishes to be able to disconnect, +it is probably wise to set --keyingtries to 1 in the +connection on the non-mobile side to prevent it trying to rekey the +connection. Unfortunately, there is no mechanism to unroute the +connection automatically. +  +

Debugging

+ +

+ +pluto accepts several optional arguments, useful mostly for debugging. +Except for --interface, each should appear at most once. +

+
--interface interfacename
+specifies that the named real public network interface should be considered. +The interface name specified should not be ipsecN. +If the option doesn't appear, all interfaces are considered. +To specify several interfaces, use the option once for each. +One use of this option is to specify which interface should be used +when two or more share the same IP address. +
--ikeport port-number
+changes the UDP port that pluto will use +(default, specified by IANA: 500) +
--ctlbase path
+basename for control files. +path.ctl is the socket through which whack communicates with +pluto. +path.pid is the lockfile to prevent multiple pluto instances. +The default is /var/run/pluto). +
--secretsfile file
+specifies the file for authentication secrets +(default: /etc/ipsec.secrets). +This name is subject to ``globbing'' as in sh(1), +so every file with a matching name is processed. +Quoting is generally needed to prevent the shell from doing the globbing. +
--adns pathname
+
--lwdnsq pathname
+specifies where to find pluto's helper program for asynchronous DNS lookup. +pluto can be built to use one of two helper programs: _pluto_adns +or lwdnsq. You must use the program for which it was built. +By default, pluto will look for the program in +$IPSEC_DIR (if that environment variable is defined) or, failing that, +in the same directory as pluto. +
--nofork
+disable ``daemon fork'' (default is to fork). In addition, after the +lock file and control socket are created, print the line ``Pluto +initialized'' to standard out. +
--noklips
+don't actually implement negotiated IPsec SAs +
--uniqueids
+if this option has been selected, whenever a new ISAKMP SA is +established, any connection with the same Peer ID but a different +Peer IP address is unoriented (causing all its SAs to be deleted). +This helps clean up dangling SAs when a connection is lost and +then regained at another IP address. +
--stderrlog
+log goes to standard out {default is to use syslogd(8)) +
+

+ +For example +

+
pluto --secretsfile ipsec.secrets --ctlbase pluto.base --ikeport 8500 --nofork --noklips --stderrlog
+
+

+ +lets one test pluto without using the superuser account. +

+ +pluto is willing to produce a prodigious amount of debugging +information. To do so, it must be compiled with -DDEBUG. There are +several classes of debugging output, and pluto may be directed to +produce a selection of them. All lines of +debugging output are prefixed with ``| '' to distinguish them from error +messages. +

+ +When pluto is invoked, it may be given arguments to specify +which classes to output. The current options are: +

+
--debug-raw
+show the raw bytes of messages +
--debug-crypt
+show the encryption and decryption of messages +
--debug-parsing
+show the structure of input messages +
--debug-emitting
+show the structure of output messages +
--debug-control
+show pluto's decision making +
--debug-lifecycle
+[this option is temporary] log more detail of lifecycle of SAs +
--debug-klips
+show pluto's interaction with KLIPS +
--debug-dns
+show pluto's interaction with DNS for KEY and TXT records +
--debug-oppo
+show why pluto didn't find a suitable DNS TXT record to authorize opportunistic initiation +
--debug-all
+all of the above +
--debug-private
+allow debugging output with private keys. +
--debug-none
+none of the above +
+

+ +The debug form of the +whack command will change the selection in a running +pluto. +If a connection name is specified, the flags are added whenever +pluto has identified that it is dealing with that connection. +Unfortunately, this is often part way into the operation being observed. +

+ +For example, to start a pluto with a display of the structure of input +and output: +

+
+pluto --debug-emitting --debug-parsing +
+

+ +To later change this pluto to only display raw bytes: +

+
+whack --debug-raw +
+

+ +For testing, SSH's IKE test page is quite useful: +

+
+http://isakmp-test.ssh.fi/ +
+

+ +Hint: ISAKMP SAs are often kept alive by IKEs even after the IPsec SA +is established. This allows future IPsec SA's to be negotiated +directly. If one of the IKEs is restarted, the other may try to use +the ISAKMP SA but the new IKE won't know about it. This can lead to +much confusion. pluto is not yet smart enough to get out of such a +mess. +  +

Pluto's Behaviour When Things Go Wrong

+ +

+ +When pluto doesn't understand or accept a message, it just +ignores the message. It is not yet capable of communicating the +problem to the other IKE daemon (in the future it might use +Notifications to accomplish this in many cases). It does log a diagnostic. +

+ +When pluto gets no response from a message, it resends the same +message (a message will be sent at most three times). This is +appropriate: UDP is unreliable. +

+ +When pluto gets a message that it has already seen, there are many +cases when it notices and discards it. This too is appropriate for UDP. +

+ +Combine these three rules, and you can explain many apparently +mysterious behaviours. In a pluto log, retrying isn't usually the +interesting event. The critical thing is either earlier (pluto +got a message which it didn't like and so ignored, so it was still +awaiting an acceptable message and got impatient) or on the other +system (pluto didn't send a reply because it wasn't happy with +the previous message). +  +

Notes

+ +

+ +If pluto is compiled without -DKLIPS, it negotiates Security +Associations but never ask the kernel to put them in place and never +makes routing changes. This allows pluto to be tested on systems +without KLIPS, but makes it rather useless. +

+ +Each IPsec SA is assigned an SPI, a 32-bit number used to refer to the SA. +The IKE protocol lets the destination of the SA choose the SPI. +The range 0 to 0xFF is reserved for IANA. +Pluto also avoids choosing an SPI in the range 0x100 to 0xFFF, +leaving these SPIs free for manual keying. +Remember that the peer, if not pluto, may well chose +SPIs in this range. +  +

Policies

+ +

+ +This catalogue of policies may be of use when trying to configure +Pluto and another IKE implementation to interoperate. +

+ +In Phase 1, only Main Mode is supported. We are not sure that +Aggressive Mode is secure. For one thing, it does not support +identity protection. It may allow more severe Denial Of Service +attacks. +

+ +No Informational Exchanges are supported. These are optional and +since their delivery is not assured, they must not matter. +It is the case that some IKE implementations won't interoperate +without Informational Exchanges, but we feel they are broken. +

+ +No Informational Payloads are supported. These are optional, but +useful. It is of concern that these payloads are not authenticated in +Phase 1, nor in those Phase 2 messages authenticated with HASH(3). +

+
*
+Diffie Hellman Groups MODP 1024 and MODP 1536 (2 and 5) +are supported. +Group MODP768 (1) is not supported because it is too weak. +
*
+Host authetication can be done by RSA Signatures or Pre-Shared +Secrets. +
*
+3DES CBC (Cypher Block Chaining mode) is the only encryption +supported, both for ISAKMP SAs and IPSEC SAs. +
*
+MD5 and SHA1 hashing are supported for packet authentication in both +kinds of SAs. +
*
+The ESP, AH, or AH plus ESP are supported. If, and only if, AH and +ESP are combined, the ESP need not have its own authentication +component. The selection is controlled by the --encrypt and +--authenticate flags. +
*
+Each of these may be combined with IPCOMP Deflate compression, +but only if the potential connection specifies compression and only +if KLIPS is configured with IPCOMP support. +
*
+The IPSEC SAs may be tunnel or transport mode, where appropriate. +The --tunnel flag controls this when pluto is initiating. +
*
+When responding to an ISAKMP SA proposal, the maximum acceptable +lifetime is eight hours. The default is one hour. There is no +minimum. The --ikelifetime flag controls this when pluto +is initiating. +
*
+When responding to an IPSEC SA proposal, the maximum acceptable +lifetime is one day. The default is eight hours. There is no +minimum. The --ipseclifetime flag controls this when pluto +is initiating. +
*
+PFS is acceptable, and will be proposed if the --pfs flag was +specified. The DH group proposed will be the same as negotiated for +Phase 1. +
+  +

SIGNALS

+ +

+ +Pluto responds to SIGHUP by issuing a suggestion that ``whack +--listen'' might have been intended. +

+ +Pluto exits when it recieves SIGTERM. +  +

EXIT STATUS

+ +

+ +pluto normally forks a daemon process, so the exit status is +normally a very preliminary result. +

+
0
+means that all is OK so far. +
1
+means that something was wrong. +
10
+means that the lock file already exists. +
+

+ +If whack detects a problem, it will return an exit status of 1. +If it received progress messages from pluto, it returns as status +the value of the numeric prefix from the last such message +that was not a message sent to syslog or a comment +(but the prefix for success is treated as 0). +Otherwise, the exit status is 0. +  +

FILES

+ +/var/run/pluto.pid +
+ +/var/run/pluto.ctl +
+ +/etc/ipsec.secrets +
+ +$IPSEC_LIBDIR/_pluto_adns +
+ +$IPSEC_EXECDIR/lwdnsq +
+ +/dev/urandom +  +

ENVIRONMENT

+ +IPSEC_LIBDIR +
+ +IPSEC_EXECDIR +
+ +IPSECmyid +  +

SEE ALSO

+ +

+ +The rest of the FreeS/WAN distribution, in particular ipsec(8). +

+ +ipsec_auto(8) is designed to make using pluto more pleasant. +Use it! +

+ +ipsec.secrets(5) + +describes the format of the secrets file. +

+ +ipsec_atoaddr(3), part of the FreeS/WAN distribution, describes the +forms that IP addresses may take. +ipsec_atosubnet(3), part of the FreeS/WAN distribution, describes the +forms that subnet specifications. +

+ +For more information on IPsec, the mailing list, and the relevant +documents, see: +

+
+ +http://www.ietf.cnri.reston.va.us/html.charters/ipsec-charter.html + +
+

+ +At the time of writing, the most relevant IETF RFCs are: +

+
+RFC2409 The Internet Key Exchange (IKE) +
+RFC2408 Internet Security Association and Key Management Protocol (ISAKMP) +
+RFC2407 The Internet IP Security Domain of Interpretation for ISAKMP +
+

+ +The FreeS/WAN web site <htp://www.freeswan.org> +and the mailing lists described there. +  +

HISTORY

+ +This code is released under the GPL terms. +See the accompanying file COPYING-2.0 for more details. +The GPL does NOT apply to those pieces of code written by others +which are included in this distribution, except as noted by the +individual authors. +

+ +This software was originally written +for the FreeS/WAN project +<http://www.freeswan.org> +by Angelos D. Keromytis +(angelos@dsl.cis.upenn.edu), in May/June 1997, in Athens, Greece. +Thanks go to John Ioannidis for his help. +

+ +It is currently (2000) +being developed and maintained by D. Hugh Redelmeier +(hugh@mimosa.com), in Canada. The regulations of Greece and Canada +allow us to make the code freely redistributable. +

+ +Kai Martius (admin@imib.med.tu-dresden.de) contributed the initial +version of the code supporting PFS. +

+ +Richard Guy Briggs <rgb@conscoop.ottawa.on.ca> and Peter Onion +<ponion@srd.bt.co.uk> added the PFKEY2 support. +

+ +We gratefully acknowledge that we use parts of Eric Young's libdes +package; see ../libdes/COPYRIGHT. +  +

BUGS

+ +pluto + +is a work-in-progress. It currently has many limitations. +For example, it ignores notification messages that it receives, and +it generates only Delete Notifications and those only for IPSEC SAs. +

+ +pluto does not support the Commit Flag. +The Commit Flag is a bad feature of the IKE protocol. +It isn't protected -- neither encrypted nor authenticated. +A man in the middle could turn it on, leading to DoS. +We just ignore it, with a warning. +This should let us interoperate with +implementations that insist on it, with minor damage. +

+ +pluto does not check that the SA returned by the Responder +is actually one that was proposed. It only checks that the SA is +acceptable. The difference is not large, but can show up in attributes +such as SA lifetime. +

+ +There is no good way for a connection to be automatically terminated. +This is a problem for Road Warrior and Opportunistic connections. +The --dontrekey option does prevent the SAs from +being rekeyed on expiry. +Additonally, if a Road Warrior connection has a client subnet with a fixed IP +address, a negotiation with that subnet will cause any other +connection instantiations with that same subnet to be unoriented +(deleted, in effect). +See also the --uniqueids option for an extension of this. +

+ +When pluto sends a message to a peer that has disappeared, +pluto receives incomplete information from the kernel, so it +logs the unsatisfactory message ``some IKE message we sent has been +rejected with ECONNREFUSED (kernel supplied no details)''. John +Denker suggests that this command is useful for tracking down the +source of these problems: +
+ +       tcpdump -i eth0 icmp[0] != 8 and icmp[0] != 0
+
+ +Substitute your public interface for eth0 if it is different. +

+ +The word ``authenticate'' is used for two different features. We must +authenticate each IKE peer to the other. This is an important task of +Phase 1. Each packet must be authenticated, both in IKE and in IPsec, +and the method for IPsec is negotiated as an AH SA or part of an ESP SA. +Unfortunately, the protocol has no mechanism for authenticating the Phase 2 +identities. +

+ +Bugs should be reported to the <users@lists.freeswan.org> mailing list. +Caution: we cannot accept +actual code from US residents, or even US citizens living outside the +US, because that would bring FreeS/WAN under US export law. Some +other countries cause similar problems. In general, we would prefer +that you send detailed problem reports rather than code: we want +FreeS/WAN to be unquestionably freely exportable, which means being +very careful about where the code comes from, and for a small bug fix, +that is often more time-consuming than just reinventing the fix +ourselves. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
+
IKE's Job
+
Pluto
+
Before Running Pluto
+
Setting up KLIPS for pluto
+
ipsec.secrets file
+
Running Pluto
+
Pluto's Internal State
+
Using Whack
+
Examples
+
The updown command
+
Rekeying
+
Selecting a Connection When Responding: Road Warrior Support
+
Debugging
+
Pluto's Behaviour When Things Go Wrong
+
Notes
+
Policies
+
+
SIGNALS
+
EXIT STATUS
+
FILES
+
ENVIRONMENT
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_portof.3.html b/doc/manpage.d/ipsec_portof.3.html new file mode 100644 index 000000000..3965ca62d --- /dev/null +++ b/doc/manpage.d/ipsec_portof.3.html @@ -0,0 +1,143 @@ +Content-type: text/html + +Manpage of IPSEC_PORTOF + +

IPSEC_PORTOF

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec portof - get port field of an ip_address +
+ +ipsec setportof - set port field of an ip_address +
+ +ipsec sockaddrof - get pointer to internal sockaddr of an ip_address +
+ +ipsec sockaddrlenof - get length of internal sockaddr of an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int portof(const ip_address *src); + +
+ +void setportof(int port, ip_address *dst); + +
+ +struct sockaddr *sockaddrof(ip_address *src); + +
+ +size_t sockaddrlenof(const ip_address *src); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +internal type +ip_address + +contains one of the +sockaddr + +types internally. +Reliance on this feature is discouraged, +but it may occasionally be necessary. +These functions provide low-level tools for this purpose. +

+ +Portof + +and +setportof + +respectively read and write the port-number field of the internal +sockaddr. + +The values are in network byte order. +

+ +Sockaddrof + +returns a pointer to the internal +sockaddr, + +for passing to other functions. +

+ +Sockaddrlenof + +reports the size of the internal +sockaddr, + +for use in storage allocation. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

DIAGNOSTICS

+ +Portof + +returns +-1, + +sockaddrof + +returns +NULL, + +and +sockaddrlenof + +returns +0 + +if an unknown address family is found within the +ip_address. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +These functions all depend on low-level details of the +ip_address + +type, which are in principle subject to change. +Avoid using them unless really necessary. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_prng.3.html b/doc/manpage.d/ipsec_prng.3.html new file mode 100644 index 000000000..27763a2bb --- /dev/null +++ b/doc/manpage.d/ipsec_prng.3.html @@ -0,0 +1,204 @@ +Content-type: text/html + +Manpage of IPSEC_PRNG + +

IPSEC_PRNG

+Section: C Library Functions (3)
Updated: 1 April 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec prng_init - initialize IPsec pseudorandom-number generator +
+ +ipsec prng_bytes - get bytes from IPsec pseudorandom-number generator +
+ +ipsec prng_final - close down IPsec pseudorandom-number generator +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+void prng_init(struct prng *prng, + +
+  +const unsigned char *key, size_t keylen); + +
+ +void prng_bytes(struct prng *prng, char *dst, + +
+  +size_t dstlen); + +
+ +unsigned long prng_count(struct prng *prng); + +
+ +void prng_final(struct prng *prng); + +  +

DESCRIPTION

+ +Prng_init + +initializes a crypto-quality pseudo-random-number generator from a key; +prng_bytes + +obtains pseudo-random bytes from it; +prng_count + +reports the number of bytes extracted from it to date; +prng_final + +closes it down. +It is the user's responsibility to initialize a PRNG before using it, +and not to use it again after it is closed down. +

+ +Prng_init + +initializes, +or re-initializes, +the specified +prng + +from the +key, + +whose length is given by +keylen. + +The user must allocate the +struct prng + +pointed to by +prng. + +There is no particular constraint on the length of the key, +although a key longer than 256 bytes is unnecessary because +only the first 256 would be used. +Initialization requires on the order of 3000 integer operations, +independent of key length. +

+ +Prng_bytes + +obtains +dstlen + +pseudo-random bytes from the PRNG and puts them in +buf. + +This is quite fast, +on the order of 10 integer operations per byte. +

+ +Prng_count + +reports the number of bytes obtained from the PRNG +since it was (last) initialized. +

+ +Prng_final + +closes down a PRNG by +zeroing its internal memory, +obliterating all trace of the state used to generate its previous output. +This requires on the order of 250 integer operations. +

+ +The +<freeswan.h> + +header file supplies the definition of the +prng + +structure. +Examination of its innards is discouraged, as they may change. +

+ +The PRNG algorithm +used by these functions is currently identical to that of RC4(TM). +This algorithm is cryptographically strong, +sufficiently unpredictable that even a hostile observer will +have difficulty determining the next byte of output from past history, +provided it is initialized from a reasonably large key composed of +highly random bytes (see +random(4)). + +The usual run of software pseudo-random-number generators +(e.g. +random(3)) + +are +not + +cryptographically strong. +

+ +The well-known attacks against RC4(TM), +e.g. as found in 802.11b's WEP encryption system, +apply only if multiple PRNGs are initialized with closely-related keys +(e.g., using a counter appended to a base key). +If such keys are used, the first few hundred pseudo-random bytes +from each PRNG should be discarded, +to give the PRNGs a chance to randomize their innards properly. +No useful attacks are known if the key is well randomized to begin with. +  +

SEE ALSO

+ +random(3), random(4) +
+ +Bruce Schneier, +Applied Cryptography, 2nd ed., 1996, ISBN 0-471-11709-9, +pp. 397-8. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +If an attempt is made to obtain more than 4e9 bytes +between initializations, +the PRNG will continue to work but +prng_count's + +output will stick at +4000000000. + +Fixing this would require a longer integer type and does +not seem worth the trouble, +since you should probably re-initialize before then anyway... +

+ +``RC4'' is a trademark of RSA Data Security, Inc. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_prng_bytes.3.html b/doc/manpage.d/ipsec_prng_bytes.3.html new file mode 100644 index 000000000..27763a2bb --- /dev/null +++ b/doc/manpage.d/ipsec_prng_bytes.3.html @@ -0,0 +1,204 @@ +Content-type: text/html + +Manpage of IPSEC_PRNG + +

IPSEC_PRNG

+Section: C Library Functions (3)
Updated: 1 April 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec prng_init - initialize IPsec pseudorandom-number generator +
+ +ipsec prng_bytes - get bytes from IPsec pseudorandom-number generator +
+ +ipsec prng_final - close down IPsec pseudorandom-number generator +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+void prng_init(struct prng *prng, + +
+  +const unsigned char *key, size_t keylen); + +
+ +void prng_bytes(struct prng *prng, char *dst, + +
+  +size_t dstlen); + +
+ +unsigned long prng_count(struct prng *prng); + +
+ +void prng_final(struct prng *prng); + +  +

DESCRIPTION

+ +Prng_init + +initializes a crypto-quality pseudo-random-number generator from a key; +prng_bytes + +obtains pseudo-random bytes from it; +prng_count + +reports the number of bytes extracted from it to date; +prng_final + +closes it down. +It is the user's responsibility to initialize a PRNG before using it, +and not to use it again after it is closed down. +

+ +Prng_init + +initializes, +or re-initializes, +the specified +prng + +from the +key, + +whose length is given by +keylen. + +The user must allocate the +struct prng + +pointed to by +prng. + +There is no particular constraint on the length of the key, +although a key longer than 256 bytes is unnecessary because +only the first 256 would be used. +Initialization requires on the order of 3000 integer operations, +independent of key length. +

+ +Prng_bytes + +obtains +dstlen + +pseudo-random bytes from the PRNG and puts them in +buf. + +This is quite fast, +on the order of 10 integer operations per byte. +

+ +Prng_count + +reports the number of bytes obtained from the PRNG +since it was (last) initialized. +

+ +Prng_final + +closes down a PRNG by +zeroing its internal memory, +obliterating all trace of the state used to generate its previous output. +This requires on the order of 250 integer operations. +

+ +The +<freeswan.h> + +header file supplies the definition of the +prng + +structure. +Examination of its innards is discouraged, as they may change. +

+ +The PRNG algorithm +used by these functions is currently identical to that of RC4(TM). +This algorithm is cryptographically strong, +sufficiently unpredictable that even a hostile observer will +have difficulty determining the next byte of output from past history, +provided it is initialized from a reasonably large key composed of +highly random bytes (see +random(4)). + +The usual run of software pseudo-random-number generators +(e.g. +random(3)) + +are +not + +cryptographically strong. +

+ +The well-known attacks against RC4(TM), +e.g. as found in 802.11b's WEP encryption system, +apply only if multiple PRNGs are initialized with closely-related keys +(e.g., using a counter appended to a base key). +If such keys are used, the first few hundred pseudo-random bytes +from each PRNG should be discarded, +to give the PRNGs a chance to randomize their innards properly. +No useful attacks are known if the key is well randomized to begin with. +  +

SEE ALSO

+ +random(3), random(4) +
+ +Bruce Schneier, +Applied Cryptography, 2nd ed., 1996, ISBN 0-471-11709-9, +pp. 397-8. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +If an attempt is made to obtain more than 4e9 bytes +between initializations, +the PRNG will continue to work but +prng_count's + +output will stick at +4000000000. + +Fixing this would require a longer integer type and does +not seem worth the trouble, +since you should probably re-initialize before then anyway... +

+ +``RC4'' is a trademark of RSA Data Security, Inc. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_prng_final.3.html b/doc/manpage.d/ipsec_prng_final.3.html new file mode 100644 index 000000000..27763a2bb --- /dev/null +++ b/doc/manpage.d/ipsec_prng_final.3.html @@ -0,0 +1,204 @@ +Content-type: text/html + +Manpage of IPSEC_PRNG + +

IPSEC_PRNG

+Section: C Library Functions (3)
Updated: 1 April 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec prng_init - initialize IPsec pseudorandom-number generator +
+ +ipsec prng_bytes - get bytes from IPsec pseudorandom-number generator +
+ +ipsec prng_final - close down IPsec pseudorandom-number generator +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+void prng_init(struct prng *prng, + +
+  +const unsigned char *key, size_t keylen); + +
+ +void prng_bytes(struct prng *prng, char *dst, + +
+  +size_t dstlen); + +
+ +unsigned long prng_count(struct prng *prng); + +
+ +void prng_final(struct prng *prng); + +  +

DESCRIPTION

+ +Prng_init + +initializes a crypto-quality pseudo-random-number generator from a key; +prng_bytes + +obtains pseudo-random bytes from it; +prng_count + +reports the number of bytes extracted from it to date; +prng_final + +closes it down. +It is the user's responsibility to initialize a PRNG before using it, +and not to use it again after it is closed down. +

+ +Prng_init + +initializes, +or re-initializes, +the specified +prng + +from the +key, + +whose length is given by +keylen. + +The user must allocate the +struct prng + +pointed to by +prng. + +There is no particular constraint on the length of the key, +although a key longer than 256 bytes is unnecessary because +only the first 256 would be used. +Initialization requires on the order of 3000 integer operations, +independent of key length. +

+ +Prng_bytes + +obtains +dstlen + +pseudo-random bytes from the PRNG and puts them in +buf. + +This is quite fast, +on the order of 10 integer operations per byte. +

+ +Prng_count + +reports the number of bytes obtained from the PRNG +since it was (last) initialized. +

+ +Prng_final + +closes down a PRNG by +zeroing its internal memory, +obliterating all trace of the state used to generate its previous output. +This requires on the order of 250 integer operations. +

+ +The +<freeswan.h> + +header file supplies the definition of the +prng + +structure. +Examination of its innards is discouraged, as they may change. +

+ +The PRNG algorithm +used by these functions is currently identical to that of RC4(TM). +This algorithm is cryptographically strong, +sufficiently unpredictable that even a hostile observer will +have difficulty determining the next byte of output from past history, +provided it is initialized from a reasonably large key composed of +highly random bytes (see +random(4)). + +The usual run of software pseudo-random-number generators +(e.g. +random(3)) + +are +not + +cryptographically strong. +

+ +The well-known attacks against RC4(TM), +e.g. as found in 802.11b's WEP encryption system, +apply only if multiple PRNGs are initialized with closely-related keys +(e.g., using a counter appended to a base key). +If such keys are used, the first few hundred pseudo-random bytes +from each PRNG should be discarded, +to give the PRNGs a chance to randomize their innards properly. +No useful attacks are known if the key is well randomized to begin with. +  +

SEE ALSO

+ +random(3), random(4) +
+ +Bruce Schneier, +Applied Cryptography, 2nd ed., 1996, ISBN 0-471-11709-9, +pp. 397-8. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +If an attempt is made to obtain more than 4e9 bytes +between initializations, +the PRNG will continue to work but +prng_count's + +output will stick at +4000000000. + +Fixing this would require a longer integer type and does +not seem worth the trouble, +since you should probably re-initialize before then anyway... +

+ +``RC4'' is a trademark of RSA Data Security, Inc. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_prng_init.3.html b/doc/manpage.d/ipsec_prng_init.3.html new file mode 100644 index 000000000..27763a2bb --- /dev/null +++ b/doc/manpage.d/ipsec_prng_init.3.html @@ -0,0 +1,204 @@ +Content-type: text/html + +Manpage of IPSEC_PRNG + +

IPSEC_PRNG

+Section: C Library Functions (3)
Updated: 1 April 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec prng_init - initialize IPsec pseudorandom-number generator +
+ +ipsec prng_bytes - get bytes from IPsec pseudorandom-number generator +
+ +ipsec prng_final - close down IPsec pseudorandom-number generator +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+void prng_init(struct prng *prng, + +
+  +const unsigned char *key, size_t keylen); + +
+ +void prng_bytes(struct prng *prng, char *dst, + +
+  +size_t dstlen); + +
+ +unsigned long prng_count(struct prng *prng); + +
+ +void prng_final(struct prng *prng); + +  +

DESCRIPTION

+ +Prng_init + +initializes a crypto-quality pseudo-random-number generator from a key; +prng_bytes + +obtains pseudo-random bytes from it; +prng_count + +reports the number of bytes extracted from it to date; +prng_final + +closes it down. +It is the user's responsibility to initialize a PRNG before using it, +and not to use it again after it is closed down. +

+ +Prng_init + +initializes, +or re-initializes, +the specified +prng + +from the +key, + +whose length is given by +keylen. + +The user must allocate the +struct prng + +pointed to by +prng. + +There is no particular constraint on the length of the key, +although a key longer than 256 bytes is unnecessary because +only the first 256 would be used. +Initialization requires on the order of 3000 integer operations, +independent of key length. +

+ +Prng_bytes + +obtains +dstlen + +pseudo-random bytes from the PRNG and puts them in +buf. + +This is quite fast, +on the order of 10 integer operations per byte. +

+ +Prng_count + +reports the number of bytes obtained from the PRNG +since it was (last) initialized. +

+ +Prng_final + +closes down a PRNG by +zeroing its internal memory, +obliterating all trace of the state used to generate its previous output. +This requires on the order of 250 integer operations. +

+ +The +<freeswan.h> + +header file supplies the definition of the +prng + +structure. +Examination of its innards is discouraged, as they may change. +

+ +The PRNG algorithm +used by these functions is currently identical to that of RC4(TM). +This algorithm is cryptographically strong, +sufficiently unpredictable that even a hostile observer will +have difficulty determining the next byte of output from past history, +provided it is initialized from a reasonably large key composed of +highly random bytes (see +random(4)). + +The usual run of software pseudo-random-number generators +(e.g. +random(3)) + +are +not + +cryptographically strong. +

+ +The well-known attacks against RC4(TM), +e.g. as found in 802.11b's WEP encryption system, +apply only if multiple PRNGs are initialized with closely-related keys +(e.g., using a counter appended to a base key). +If such keys are used, the first few hundred pseudo-random bytes +from each PRNG should be discarded, +to give the PRNGs a chance to randomize their innards properly. +No useful attacks are known if the key is well randomized to begin with. +  +

SEE ALSO

+ +random(3), random(4) +
+ +Bruce Schneier, +Applied Cryptography, 2nd ed., 1996, ISBN 0-471-11709-9, +pp. 397-8. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +If an attempt is made to obtain more than 4e9 bytes +between initializations, +the PRNG will continue to work but +prng_count's + +output will stick at +4000000000. + +Fixing this would require a longer integer type and does +not seem worth the trouble, +since you should probably re-initialize before then anyway... +

+ +``RC4'' is a trademark of RSA Data Security, Inc. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ranbits.8.html b/doc/manpage.d/ipsec_ranbits.8.html new file mode 100644 index 000000000..036b2a351 --- /dev/null +++ b/doc/manpage.d/ipsec_ranbits.8.html @@ -0,0 +1,147 @@ +Content-type: text/html + +Manpage of IPSEC_RANBITS + +

IPSEC_RANBITS

+Section: Maintenance Commands (8)
Updated: 22 Aug 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ranbits - generate random bits in ASCII form +  +

SYNOPSIS

+ +ipsec + +ranbits + +[ +--quick + +] [ +--continuous + +] [ +--bytes + +] nbits +  +

DESCRIPTION

+ +Ranbits + +obtains +nbits + +(rounded up to the nearest byte) +high-quality random bits from +random(4), + +and emits them on standard output as an ASCII string. +The default output format is +datatot(3) + +h + +format: +lowercase hexadecimal with a +0x + +prefix and an underscore every 32 bits. +

+ +The +--quick + +option produces quick-and-dirty random bits: +instead of using the high-quality random bits from +/dev/random, + +which may take some time to supply the necessary bits if +nbits + +is large, +ranbits + +uses +/dev/urandom, + +which yields prompt results but lower-quality randomness. +

+ +The +--continuous + +option uses +datatot(3) + +x + +output format, like +h + +but without the underscores. +

+ +The +--bytes + +option causes +nbits + +to be interpreted as a byte count rather than a bit count. +  +

FILES

+ +/dev/random, /dev/urandom +  +

SEE ALSO

+ +ipsec_datatot(3), random(4) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +There is an internal limit on +nbits, + +currently 20000. +

+ +Without +--quick, + +ranbits's + +run time is difficult to predict. +A request for a large number of bits, +at a time when the system's entropy pool is low on randomness, +may take quite a while to satisfy. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_rangetoa.3.html b/doc/manpage.d/ipsec_rangetoa.3.html new file mode 100644 index 000000000..3bacd5943 --- /dev/null +++ b/doc/manpage.d/ipsec_rangetoa.3.html @@ -0,0 +1,294 @@ +Content-type: text/html + +Manpage of IPSEC_ATOASR + +

IPSEC_ATOASR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoasr - convert ASCII to Internet address, subnet, or range +
+ +ipsec rangetoa - convert Internet address range to ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoasr(const char *src, size_t srclen, + +
+  +char *type, struct in_addr *addrs); + +
+ +size_t rangetoa(struct in_addr *addrs, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; +there is no current equivalent, +because so far they have not proved useful. +

+ +Atoasr + +converts an ASCII address, subnet, or address range +into a suitable combination of binary addresses +(in network byte order). +Rangetoa + +converts an address range back into ASCII, +using dotted-decimal form for the addresses +(the other reverse conversions are handled by +ipsec_addrtoa(3) + +and +ipsec_subnettoa(3)). + +

+ +A single address can be any form acceptable to +ipsec_atoaddr(3): + +dotted decimal, DNS name, or hexadecimal number. +A subnet +specification uses the form network/mask +interpreted by +ipsec_atosubnet(3). + +

+ +An address range is two +ipsec_atoaddr(3) + +addresses separated by a +... + +delimiter. +If there are four dots rather than three, the first is taken as +part of the begin address, +e.g. for a complete DNS name which ends with +. + +to suppress completion attempts. +The begin address of a range must be +less than or equal to the end address. +

+ +The +srclen + +parameter of +atoasr + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +type + +parameter of +atoasr + +must point to a +char + +variable used to record which form was found. +The +addrs + +parameter must point to a two-element array of +struct in_addr + +which receives the results. +The values stored into +*type, + +and the corresponding values in the array, are: +

+ + + +   *typeaddrs[0]addrs[1]
+

+address'a'address-
+
+ +subnet 's'networkmask
+
+ +range  'r'beginend
+

+ +The +dstlen + +parameter of +rangetoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +RANGETOA_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +rangetoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +Atoasr + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Rangetoa + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +ipsec_atoaddr(3), ipsec_atosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoasr + +are: +empty input; +error in +ipsec_atoaddr(3) + +or +ipsec_atosubnet(3) + +during conversion; +begin address of range exceeds end address. +

+ +Fatal errors in +rangetoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoasr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_rangetosubnet.3.html b/doc/manpage.d/ipsec_rangetosubnet.3.html new file mode 100644 index 000000000..9e03244ea --- /dev/null +++ b/doc/manpage.d/ipsec_rangetosubnet.3.html @@ -0,0 +1,116 @@ +Content-type: text/html + +Manpage of IPSEC_RANGETOSUBNET + +

IPSEC_RANGETOSUBNET

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec rangetosubnet - convert address range to subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *rangetosubnet(const ip_address *start, + +
+  +const ip_address *stop, ip_subnet *dst); + +  +

DESCRIPTION

+ +Rangetosubnet + +accepts two IP addresses which define an address range, +from +start + +to +stop + +inclusive, +and converts this to a subnet if possible. +The addresses must both be IPv4 or both be IPv6, +and the address family of the resulting subnet is the same. +

+ +Rangetosubnet + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +ipsec_initsubnet(3), ipsec_ttosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +rangetosubnet + +are: +mixed address families; +unknown address family; +start + +and +stop + +do not define a subnet. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = rangetosubnet( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_rsasigkey.8.html b/doc/manpage.d/ipsec_rsasigkey.8.html new file mode 100644 index 000000000..3173a9f13 --- /dev/null +++ b/doc/manpage.d/ipsec_rsasigkey.8.html @@ -0,0 +1,401 @@ +Content-type: text/html + +Manpage of IPSEC_RSASIGKEY + +

IPSEC_RSASIGKEY

+Section: Maintenance Commands (8)
Updated: 22 July 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec rsasigkey - generate RSA signature key +  +

SYNOPSIS

+ +ipsec + +rsasigkey + +[ +--verbose + +] [ +--random + +filename +] +\ + +
+ +   [ +--rounds + +nr +] [ +--hostname + +host ] [ +--noopt + +] nbits +
+ +ipsec + +rsasigkey + +[ +--verbose + +] [ +--hostname + +host ] +\ + +
+ +    +[ +--noopt + +] +--oldkey + +file +  +

DESCRIPTION

+ +Rsasigkey + +generates an RSA public/private key pair, +suitable for digital signatures, +of (exactly) +nbits + +bits (that is, two primes each of exactly +nbits/2 + +bits, +and related numbers) +and emits it on standard output as ASCII (mostly hex) data. +nbits + +must be a multiple of 16. +

+ +The public exponent is forced to the value +3, + +which has important speed advantages for signature checking. +Beware that the resulting keys have known weaknesses as encryption keys +and should not be used for that purpose. +

+ +The +--verbose + +option makes +rsasigkey + +give a running commentary on standard error. +By default, it works in silence until it is ready to generate output. +

+ +The +--random + +option specifies a source for random bits. +The default is +/dev/random + +(see +random(4)). + +Normally, +rsasigkey + +reads exactly +nbits + +random bits from the source; +in extremely-rare circumstances it may need more. +

+ +The +--rounds + +option specifies the number of rounds to be done by the +mpz_probab_prime_p + +probabilistic primality checker. +The default, 30, is fairly rigorous and should not normally +have to be overridden. +

+ +The +--hostname + +option specifies what host name to use in +the first line of the output (see below); +the default is what +gethostname(2) + +returns. +

+ +The +--noopt + +option suppresses an optimization of the private key +(to be precise, setting of the decryption exponent to +lcm(p-1,q-1) + +rather than +(p-1)*(q-1)) + +which speeds up operations on it slightly +but can cause it to flunk a validity check in old RSA implementations +(notably, obsolete versions of +ipsec_pluto(8)). + +

+ +The +--oldkey + +option specifies that rather than generate a new key, +rsasigkey + +should read an old key from the +file + +(the name +- + +means ``standard input'') +and use that to generate its output. +Input lines which do not look like +rsasigkey + +output are silently ignored. +This permits updating old keys to the current format. +

+ +The output format looks like this (with long numbers trimmed down +for clarity): +

+ + +

+        # RSA 2048 bits   xy.example.com   Sat Apr 15 13:53:22 2000
+        # for signatures only, UNSAFE FOR ENCRYPTION
+        #pubkey=0sAQOF8tZ2NZt...Y1P+buFuFn/
+        Modulus: 0xcc2a86fcf440...cf1011abb82d1
+        PublicExponent: 0x03
+        # everything after this point is secret
+        PrivateExponent: 0x881c59fdf8...ab05c8c77d23
+        Prime1: 0xf49fd1f779...46504c7bf3
+        Prime2: 0xd5a9108453...321d43cb2b
+        Exponent1: 0xa31536a4fb...536d98adda7f7
+        Exponent2: 0x8e70b5ad8d...9142168d7dcc7
+        Coefficient: 0xafb761d001...0c13e98d98
+
+ +

+ +The first (comment) line, +indicating the nature and date of the key, +and giving a host name, +is used by +ipsec_showhostkey(8) + +when generating some forms of key output. +

+ +The commented-out +pubkey= + +line contains the public key---the public exponent and the modulus---combined +in approximately RFC 2537 format +(the one deviation is that the combined value is given with a +0s + +prefix, rather than in unadorned base-64), +suitable for use in the +ipsec.conf + +file. +

+ +The +Modulus, + +PublicExponent, + +and +PrivateExponent + +lines give the basic signing and verification data. +

+ +The +Prime1 + +and +Prime2 + +lines give the primes themselves (aka +p + +and +q), + +largest first. +The +Exponent1 + +and +Exponent2 + +lines give +the private exponent mod +p-1 + +and +q-1 + +respectively. +The +Coefficient + +line gives the Chinese Remainder Theorem coefficient, +which is the inverse of +q, + +mod +p. + +These additional numbers (which must all be kept as secret as the +private exponent) are precomputed aids to rapid signature generation. +

+ +No attempt is made to break long lines. +

+ +The US patent on the RSA algorithm expired 20 Sept 2000. +  +

EXAMPLES

+ +
+
ipsec rsasigkey --verbose 2192 >mykey + +
+generates a 2192-bit signature key and puts it in the file +mykey, + +with running commentary on standard error. +The file contents can be inserted verbatim into a suitable entry in the +ipsec.secrets + +file (see +ipsec.secrets(5)), + +and the public key can then be extracted and edited into the +ipsec.conf + +file (see +ipsec.conf(5)). + +
ipsec rsasigkey --verbose --oldkey oldie >latest + +
+takes the old signature key from file +oldie + +and puts a version in the current format into the file +latest, + +with running commentary on standard error. +
+  +

FILES

+ +/dev/random +  +

SEE ALSO

+ +random(4), ipsec_showhostkey(8) +
+ +Applied Cryptography, 2nd. ed., by Bruce Schneier, Wiley 1996. +
+ +RFCs 2537, 2313. +
+ +GNU MP, the GNU multiple precision arithmetic library, edition 2.0.2, +by Torbj Granlund. +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +There is an internal limit on +nbits, + +currently 20000. +

+ +Rsasigkey's + +run time is difficult to predict, +since +/dev/random + +output can be arbitrarily delayed if +the system's entropy pool is low on randomness, +and the time taken by the search for primes is also somewhat unpredictable. +A reasonably typical time for a 1024-bit key on a quiet 200MHz Pentium MMX +with plenty of randomness available is 20 seconds, +almost all of it in the prime searches. +Generating a 2192-bit key on the same system usually takes several minutes. +A 4096-bit key took an hour and a half of CPU time. +

+ +The +--oldkey + +option does not check its input format as rigorously as it might. +Corrupted +rsasigkey + +output may confuse it. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_sameaddr.3.html b/doc/manpage.d/ipsec_sameaddr.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_sameaddr.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_sameaddrtype.3.html b/doc/manpage.d/ipsec_sameaddrtype.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_sameaddrtype.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_samesaid.3.html b/doc/manpage.d/ipsec_samesaid.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_samesaid.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_samesubnet.3.html b/doc/manpage.d/ipsec_samesubnet.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_samesubnet.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_samesubnettype.3.html b/doc/manpage.d/ipsec_samesubnettype.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_samesubnettype.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_satoa.3.html b/doc/manpage.d/ipsec_satoa.3.html new file mode 100644 index 000000000..2b2c7425c --- /dev/null +++ b/doc/manpage.d/ipsec_satoa.3.html @@ -0,0 +1,347 @@ +Content-type: text/html + +Manpage of IPSEC_ATOSA + +

IPSEC_ATOSA

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atosa, satoa - convert IPsec Security Association IDs to and from ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atosa(const char *src, size_t srclen, + +
+  +struct sa_id *sa); + +
+ +size_t satoa(struct sa_id sa, int format, + +
+  +char *dst, size_t dstlen); + +

+struct sa_id { + +
+  +struct in_addr dst; + +
+  +ipsec_spi_t spi; + +
+  +int proto; + +
+ +}; + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttosa(3) + +for their replacements. +

+ +Atosa + +converts an ASCII Security Association (SA) specifier into an +sa_id + +structure (containing +a destination-host address +in network byte order, +an SPI number in network byte order, and +a protocol code). +Satoa + +does the reverse conversion, back to an ASCII SA specifier. +

+ +An SA is specified in ASCII with a mail-like syntax, e.g. +esp507@1.2.3.4. + +An SA specifier contains +a protocol prefix (currently +ah, + +esp, + +or +tun), + +an unsigned integer SPI number, +and an IP address. +The SPI number can be decimal or hexadecimal +(with +0x + +prefix), as accepted by +ipsec_atoul(3). + +The IP address can be any form accepted by +ipsec_atoaddr(3), + +e.g. dotted-decimal address or DNS name. +

+ +As a special case, the SA specifier +%passthrough + +signifies the special SA used to indicate that packets should be +passed through unaltered. +(At present, this is a synonym for +tun0x0@0.0.0.0, + +but that is subject to change without notice.) +This form is known to both +atosa + +and +satoa, + +so the internal form of +%passthrough + +is never visible. +

+ +The +<freeswan.h> + +header file supplies the +sa_id + +structure, as well as a data type +ipsec_spi_t + +which is an unsigned 32-bit integer. +(There is no consistency between kernel and user on what such a type +is called, hence the header hides the differences.) +

+ +The protocol code uses the same numbers that IP does. +For user convenience, given the difficulty in acquiring the exact set of +protocol names used by the kernel, +<freeswan.h> + +defines the names +SA_ESP, + +SA_AH, + +and +SA_IPIP + +to have the same values as the kernel names +IPPROTO_ESP, + +IPPROTO_AH, + +and +IPPROTO_IPIP. + +

+ +The +srclen + +parameter of +atosa + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +satoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +SATOA_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +satoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default +(currently +lowercase protocol prefix, lowercase hexadecimal SPI, dotted-decimal address). +The value +d + +causes the SPI to be generated in decimal instead. +

+ +Atosa + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Satoa + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +ipsec_atoul(3), ipsec_atoaddr(3), inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atosa + +are: +empty input; +input too small to be a legal SA specifier; +no +@ + +in input; +unknown protocol prefix; +conversion error in +atoul + +or +atoaddr. + +

+ +Fatal errors in +satoa + +are: +unknown format; unknown protocol code. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The +tun + +protocol code is a FreeS/WANism which may eventually disappear. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_satot.3.html b/doc/manpage.d/ipsec_satot.3.html new file mode 100644 index 000000000..1e457fc24 --- /dev/null +++ b/doc/manpage.d/ipsec_satot.3.html @@ -0,0 +1,453 @@ +Content-type: text/html + +Manpage of IPSEC_TTOSA + +

IPSEC_TTOSA

+Section: C Library Functions (3)
Updated: 26 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttosa, satot - convert IPsec Security Association IDs to and from text +
+ +ipsec initsaid - initialize an SA ID +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+typedef struct { + +
+  +ip_address dst; + +
+  +ipsec_spi_t spi; + +
+  +int proto; + +
+ +} ip_said; + +

+const char *ttosa(const char *src, size_t srclen, + +
+  +ip_said *sa); + +
+ +size_t satot(const ip_said *sa, int format, + +
+  +char *dst, size_t dstlen); + +
+ +void initsaid(const ip_address *addr, ipsec_spi_t spi, + +
+  +int proto, ip_said *dst); + +  +

DESCRIPTION

+ +Ttosa + +converts an ASCII Security Association (SA) specifier into an +ip_said + +structure (containing +a destination-host address +in network byte order, +an SPI number in network byte order, and +a protocol code). +Satot + +does the reverse conversion, back to a text SA specifier. +Initsaid + +initializes an +ip_said + +from separate items of information. +

+ +An SA is specified in text with a mail-like syntax, e.g. +esp.5a7@1.2.3.4. + +An SA specifier contains +a protocol prefix (currently +ah, + +esp, + +tun, + +comp, + +or +int), + +a single character indicating the address family +(. + +for IPv4, +: + +for IPv6), +an unsigned integer SPI number in hexadecimal (with no +0x + +prefix), +and an IP address. +The IP address can be any form accepted by +ipsec_ttoaddr(3), + +e.g. dotted-decimal IPv4 address, +colon-hex IPv6 address, +or DNS name. +

+ +As a special case, the SA specifier +%passthrough4 + +or +%passthrough6 + +signifies the special SA used to indicate that packets should be +passed through unaltered. +(At present, these are synonyms for +tun.0@0.0.0.0 + +and +tun:0@:: + +respectively, +but that is subject to change without notice.) +%passthrough + +is a historical synonym for +%passthrough4. + +These forms are known to both +ttosa + +and +satot, + +so the internal representation is never visible. +

+ +Similarly, the SA specifiers +%pass, + +%drop, + +%reject, + +%hold, + +%trap, + +and +%trapsubnet + +signify special ``magic'' SAs used to indicate that packets should be +passed, dropped, rejected (dropped with ICMP notification), +held, +and trapped (sent up to +ipsec_pluto(8), + +with either of two forms of +%hold + +automatically installed) +respectively. +These forms too are known to both routines, +so the internal representation of the magic SAs should never be visible. +

+ +The +<freeswan.h> + +header file supplies the +ip_said + +structure, as well as a data type +ipsec_spi_t + +which is an unsigned 32-bit integer. +(There is no consistency between kernel and user on what such a type +is called, hence the header hides the differences.) +

+ +The protocol code uses the same numbers that IP does. +For user convenience, given the difficulty in acquiring the exact set of +protocol names used by the kernel, +<freeswan.h> + +defines the names +SA_ESP, + +SA_AH, + +SA_IPIP, + +and +SA_COMP + +to have the same values as the kernel names +IPPROTO_ESP, + +IPPROTO_AH, + +IPPROTO_IPIP, + +and +IPPROTO_COMP. + +

+ +<freeswan.h> + +also defines +SA_INT + +to have the value +61 + +(reserved by IANA for ``any host internal protocol'') +and +SPI_PASS, + +SPI_DROP, + +SPI_REJECT, + +SPI_HOLD, + +and +SPI_TRAP + +to have the values 256-260 (in host byte order) respectively. +These are used in constructing the magic SAs +(which always have address +0.0.0.0). + +

+ +If +satot + +encounters an unknown protocol code, e.g. 77, +it yields output using a prefix +showing the code numerically, e.g. ``unk77''. +This form is +not + +recognized by +ttosa. + +

+ +The +srclen + +parameter of +ttosa + +specifies the length of the string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +satot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +<freeswan.h> + +header file defines a constant, +SATOT_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +satot + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default +(currently +lowercase protocol prefix, lowercase hexadecimal SPI, +dotted-decimal or colon-hex address). +The value +'f' + +is similar except that the SPI is padded with +0s + +to a fixed 32-bit width, to ease aligning displayed tables. +

+ +Ttosa + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Satot + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +

+ +There is also, temporarily, support for some obsolete +forms of SA specifier which lack the address-family indicator. +  +

SEE ALSO

+ +ipsec_ttoul(3), ipsec_ttoaddr(3), ipsec_samesaid(3), inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttosa + +are: +empty input; +input too small to be a legal SA specifier; +no +@ + +in input; +unknown protocol prefix; +conversion error in +ttoul + +or +ttoaddr. + +

+ +Fatal errors in +satot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttosa( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_send-pr.8.html b/doc/manpage.d/ipsec_send-pr.8.html new file mode 100644 index 000000000..19026543a --- /dev/null +++ b/doc/manpage.d/ipsec_send-pr.8.html @@ -0,0 +1,427 @@ +Content-type: text/html + +Manpage of SEND-PR + +

SEND-PR

+Section: User Commands (1)
Updated: xVERSIONx
Index +Return to Main Contents
+ +  +

NAME

+ +ipsec send-pr - send problem report (PR) to a central support site +  +

SYNOPSIS

+ +ipsec send-pr + +[ +site + +] +[ +-f + +problem-report + +] +[ +-t + +mail-address + +] +
+ + +[ +-P + +] +[ +-L + +] +[ +-s + +severity + +] +[ +-c + +address + +] +
+ +[ +--request-id + +] +[ +-V + +] +  +

DESCRIPTION

+ +ipsec send-pr + +is a tool used to submit +problem reports + + +(PRs) to a central support site. In most cases the correct +site + +will be the default. This argument indicates the support site which +is responsible for the category of problem involved. Some sites may +use a local address as a default. +site + +values are defined by using the +aliases(5). + +

+ +ipsec send-pr + +invokes an editor on a problem report template (after trying to fill +in some fields with reasonable default values). When you exit the +editor, +ipsec send-pr + +sends the completed form to the +Problem Report Management System + +(GNATS) at a central support site. At the support site, the PR +is assigned a unique number and is stored in the GNATS database +according to its category and submitter-id. GNATS automatically +replies with an acknowledgement, citing the category and the PR +number. +

+ +To ensure that a PR is handled promptly, it should contain your (unique) +submitter-id and one of the available categories to identify the +problem area. (Use +`ipsec send-pr -L' + +to see a list of categories.) +

+ +The +ipsec send-pr + +template at your site should already be customized with your +submitter-id (running `install-sid submitter-id' to +accomplish this is part of the installation procedures for +ipsecsend-pr). + +If this hasn't been done, see your system administrator for your +submitter-id, or request one from your support site by invoking +`ipsec send-pr --request-id'. + +If your site does not distinguish between different user sites, or if +you are not affiliated with the support site, use +`net' + +for this field. +

+ +The more precise your problem description and the more complete your +information, the faster your support team can solve your problems. +  +

OPTIONS

+ +
+
-f problem-report + +
+specify a file (problem-report) which already contains a +complete problem report. +ipsec send-pr + +sends the contents of the file without invoking the editor. If +the value for +problem-report + +is +`-', + +then +ipsec send-pr + +reads from standard input. +
-s severity + +
+Give the problem report the severity +severity. + +
-t mail-address + +
+Change mail address at the support site for problem reports. The +default +mail-address + +is the address used for the default +site. + +Use the +site + +argument rather than this option in nearly all cases. +
-c address + +
+Put +address + +in the +Cc: + +header of the message. +
-P + +
+print the form specified by the environment variable +PR_FORM + +on standard output. If +PR_FORM + +is not set, print the standard blank PR template. No mail is sent. +
-L + +
+print the list of available categories. No mail is sent. +
--request-id + +
+sends mail to the default support site, or +site + +if specified, with a request for your +submitter-id. + +If you are +not affiliated with +site, + +use a +submitter-id + +of +net'. + +
-V + +
+Display the +ipsec send-pr + +version number. +
+

+ +Note: use +ipsec send-pr + +to submit problem reports rather than mailing them directly. Using +both the template and +ipsec send-pr + +itself will help ensure all necessary information will reach the +support site. +  +

ENVIRONMENT

+ +The environment variable +EDITOR + +specifies the editor to invoke on the template. +
+ +default: +vi + +

+If the environment variable +PR_FORM + +is set, then its value is used as the file name of the template for +your problem-report editing session. You can use this to start with a +partially completed form (for example, a form with the identification +fields already completed). +  +

HOW TO FILL OUT A PROBLEM REPORT

+ +Problem reports have to be in a particular form so that a program can +easily manage them. Please remember the following guidelines: +
+
*
+describe only +one problem + +with each problem report. +
*
+For follow-up mail, use the same subject line as the one in the automatic +acknowledgent. It consists of category, PR number and the original synopsis +line. This allows the support site to relate several mail messages to a +particular PR and to record them automatically. +
*
+Please try to be as accurate as possible in the subject and/or synopsis line. +
*
+The subject and the synopsis line are not confidential. This is +because open-bugs lists are compiled from them. Avoid confidential +information there. +
+

+ +See the GNU +Info + +file +send-pr.info + +or the document Reporting Problems With send-pr for detailed +information on reporting problems +  +

HOW TO SUBMIT TEST CASES, CODE, ETC.

+ +Submit small code samples with the PR. Contact the support site for +instructions on submitting larger test cases and problematic source +code. +  +

FILES

+ + + +/tmp/p$$     copy of PR used in editing session
+
+ +/tmp/pf$$   copy of empty PR form, for testing purposes
+
+ +/tmp/pbad$$ file for rejected PRs
+
+ +@IPSEC_DIR@/send-pr.confscript to customize send-pr.
+  +

EMACS USER INTERFACE

+ +An Emacs user interface for +send-pr + +with completion of field values is part of the +send-pr + +distribution (invoked with +M-x send-pr). + +See the file +send-pr.info + +or the ASCII file +INSTALL + +in the top level directory of the distribution for configuration and +installation information. The Emacs LISP template file is +send-pr-el.in + +and is installed as +send-pr.el. + +  +

INSTALLATION AND CONFIGURATION

+ +See +send-pr.info + +or +INSTALL + +for installation instructions. +  +

SEE ALSO

+ +Reporting Problems Using send-pr + +(also installed as the GNU Info file +send-pr.info). + +

+ +gnats(l), + +query-pr(1), + +edit-pr(1), + +gnats(8), + +queue-pr(8), + +at-pr(8), + +mkcat(8), + +mkdist(8). + +  +

AUTHORS

+ +Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus +Support) +  +

COPYING

+ +Copyright (c) 1992, 1993 Free Software Foundation, Inc. +

+ +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. +

+ +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the +entire resulting derived work is distributed under the terms of a +permission notice identical to this one. +

+ +Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be included in +translations approved by the Free Software Foundation instead of in +the original English. +

+

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
OPTIONS
+
ENVIRONMENT
+
HOW TO FILL OUT A PROBLEM REPORT
+
HOW TO SUBMIT TEST CASES, CODE, ETC.
+
FILES
+
EMACS USER INTERFACE
+
INSTALLATION AND CONFIGURATION
+
SEE ALSO
+
AUTHORS
+
COPYING
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_setportof.3.html b/doc/manpage.d/ipsec_setportof.3.html new file mode 100644 index 000000000..3965ca62d --- /dev/null +++ b/doc/manpage.d/ipsec_setportof.3.html @@ -0,0 +1,143 @@ +Content-type: text/html + +Manpage of IPSEC_PORTOF + +

IPSEC_PORTOF

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec portof - get port field of an ip_address +
+ +ipsec setportof - set port field of an ip_address +
+ +ipsec sockaddrof - get pointer to internal sockaddr of an ip_address +
+ +ipsec sockaddrlenof - get length of internal sockaddr of an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int portof(const ip_address *src); + +
+ +void setportof(int port, ip_address *dst); + +
+ +struct sockaddr *sockaddrof(ip_address *src); + +
+ +size_t sockaddrlenof(const ip_address *src); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +internal type +ip_address + +contains one of the +sockaddr + +types internally. +Reliance on this feature is discouraged, +but it may occasionally be necessary. +These functions provide low-level tools for this purpose. +

+ +Portof + +and +setportof + +respectively read and write the port-number field of the internal +sockaddr. + +The values are in network byte order. +

+ +Sockaddrof + +returns a pointer to the internal +sockaddr, + +for passing to other functions. +

+ +Sockaddrlenof + +reports the size of the internal +sockaddr, + +for use in storage allocation. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

DIAGNOSTICS

+ +Portof + +returns +-1, + +sockaddrof + +returns +NULL, + +and +sockaddrlenof + +returns +0 + +if an unknown address family is found within the +ip_address. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +These functions all depend on low-level details of the +ip_address + +type, which are in principle subject to change. +Avoid using them unless really necessary. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_setup.8.html b/doc/manpage.d/ipsec_setup.8.html new file mode 100644 index 000000000..7197e2b18 --- /dev/null +++ b/doc/manpage.d/ipsec_setup.8.html @@ -0,0 +1,237 @@ +Content-type: text/html + +Manpage of IPSEC_SETUP + +

IPSEC_SETUP

+Section: Maintenance Commands (8)
Updated: 23 July 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec setup - control IPsec subsystem +  +

SYNOPSIS

+ +ipsec + +setup + +[ +--show + +| +--showonly + +] +command +  +

DESCRIPTION

+ +Setup + +controls the FreeS/WAN IPsec subsystem, +including both the Klips kernel code and the Pluto key-negotiation daemon. +(It is a synonym for the ``rc'' script for the subsystem; +the system runs the equivalent of +ipsec setup start + +at boot time, +and +ipsec setup stop + +at shutdown time, more or less.) +

+ +The action taken depends on the specific +command, + +and on the contents of the +config + +setup + +section of the +IPsec configuration file (/etc/ipsec.conf, + +see +ipsec.conf(5)). + +Current +commands + +are: +

+
start + +
+start Klips and Pluto, +including setting up Klips to do crypto operations on the +interface(s) specified in the configuration file, +and (if the configuration file so specifies) +setting up manually-keyed connections and/or +asking Pluto to negotiate automatically-keyed connections +to other security gateways +
stop + +
+shut down Klips and Pluto, +including tearing down all existing crypto connections +
restart + +
+equivalent to +stop + +followed by +start + +
status + +
+report the status of the subsystem; +normally just reports +IPsec running + +and +pluto pid nnn, + +or +IPsec stopped, + +and exits with status 0, +but will go into more detail (and exit with status 1) +if something strange is found. +(An ``illicit'' Pluto is one that does not match the process ID in +Pluto's lock file; +an ``orphaned'' Pluto is one with no lock file.) +
+

+ +The +stop + +operation tries to clean up properly even if assorted accidents +have occurred, +e.g. Pluto having died without removing its lock file. +If +stop + +discovers that the subsystem is (supposedly) not running, +it will complain, +but will do its cleanup anyway before exiting with status 1. +

+ +Although a number of configuration-file parameters influence +setup's + +operations, the key one is the +interfaces + +parameter, which must be right or chaos will ensue. +

+ +The +--show + +and +--showonly + +options cause +setup + +to display the shell commands that it would execute. +--showonly + +suppresses their execution. +Only +start, + +stop, + +and +restart + +commands recognize these flags. +  +

FILES

+ + + +/etc/rc.d/init.d/ipsec         the script itself
+
+ +/etc/init.d/ipsec             alternate location for the script
+
+ +/etc/ipsec.conf               IPsec configuration file
+
+ +/proc/sys/net/ipv4/ip_forward forwarding control
+
+ +/var/run/ipsec.info           saved information
+
+ +/var/run/pluto.pid            Pluto lock file
+
+ +/var/run/ipsec_setup.pid      IPsec lock file
+  +

SEE ALSO

+ +ipsec.conf(5), ipsec(8), ipsec_manual(8), ipsec_auto(8), route(8) +  +

DIAGNOSTICS

+ +All output from the commands +start + +and +stop + +goes both to standard +output and to +syslogd(8), + +via +logger(1). + +Selected additional information is logged only to +syslogd(8). + +  +

HISTORY

+ +Written for the FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +Old versions of +logger(1) + +inject spurious extra newlines onto standard output. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_showdefaults.8.html b/doc/manpage.d/ipsec_showdefaults.8.html new file mode 100644 index 000000000..e1786dc0a --- /dev/null +++ b/doc/manpage.d/ipsec_showdefaults.8.html @@ -0,0 +1,82 @@ +Content-type: text/html + +Manpage of IPSEC_SHOWDEFAULTS + +

IPSEC_SHOWDEFAULTS

+Section: Maintenance Commands (8)
Updated: 23 Jan 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec showdefaults - show %defaultroute defaults +  +

SYNOPSIS

+ +ipsec + +showdefaults + +  +

DESCRIPTION

+ +Showdefaults + +outputs (on standard output) a terse description of the defaults +used by the +%defaultroute + +facilities in +ipsec_auto(8) + +and +ipsec_manual(8). + +

+ +Beware that the exact output format is subject to change. +  +

DIAGNOSTICS

+ +Normal exit status is 0. +If no defaults are available, +i.e. the +interfaces + +parameter in +config setup + +is not +%defaultroute, + +produces a message on standard error and exits with status 1. +  +

FILES

+ +/var/run/ipsec.info +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
DIAGNOSTICS
+
FILES
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_showhostkey.8.html b/doc/manpage.d/ipsec_showhostkey.8.html new file mode 100644 index 000000000..90a16d5ee --- /dev/null +++ b/doc/manpage.d/ipsec_showhostkey.8.html @@ -0,0 +1,269 @@ +Content-type: text/html + +Manpage of IPSEC_SHOWHOSTKEY + +

IPSEC_SHOWHOSTKEY

+Section: Maintenance Commands (8)
Updated: 5 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec showhostkey - show host's authentication key +  +

SYNOPSIS

+ +ipsec + +showhostkey + +[ +--key + +] [ +--left + +] [ +--right + +] [ +--txt + +gateway +] [ +--dhclient + +] [ +--file + +secretfile +] [ +--id + +identity +] +  +

DESCRIPTION

+ +Showhostkey + +outputs (on standard output) a public key suitable for this host, +in the format specified, +using the host key information stored in +/etc/ipsec.secrets. + +In general only the super-user can run this command, +since only he can read +ipsec.secrets. + +

+ +The +--txt + +option causes the output to be in opportunistic-encryption DNS TXT record +format, +with the specified +gateway + +value. +If information about how the key was generated is available, +that is provided as a DNS-file comment. +For example, +--txt 10.11.12.13 + +might give (with the key data trimmed for clarity): +

+ +

+  ; RSA 2048 bits   xy.example.com   Sat Apr 15 13:53:22 2000
+      IN TXT  "X-IPsec-Server(10)=10.11.12.13 AQOF8tZ2...+buFuFn/"
+
+ +

+ +No name is supplied in the TXT record +because there are too many possibilities, +depending on how it will be used. +If the text string is longer than 255 bytes, +it is split up into multiple strings (matching the restrictions of +the DNS TXT binary format). +If any split is needed, the first split will be at the start of the key: +this increases the chances that later hand editing will work. +

+ +The +--left + +and +--right + +options cause the output to be in +ipsec.conf(5) + +format, as a +leftrsasigkey + +or +rightrsasigkey + +parameter respectively. +Again, generation information is included if available. +For example, +--left + +might give (with the key data trimmed down for clarity): +

+ +

+  # RSA 2048 bits   xy.example.com   Sat Apr 15 13:53:22 2000
+  leftrsasigkey=0sAQOF8tZ2...+buFuFn/
+
+ +

+ +The +--dhclient + +option cause the output to be suitable for inclusion in +dhclient.conf(5) + +as part of configuring WAVEsec. +See <http://www.wavesec.org>. +

+ +If +--key + +is specified, +the output format is the text form of a DNS KEY record; +the host name is the one included in the key information +(or, if that is not available, +the output of +hostname --fqdn), + +with a +. + +appended. +Again, generation information is included if available. +For example (with the key data trimmed down for clarity): +

+ +

+  ; RSA 2048 bits   xy.example.com   Sat Apr 15 13:53:22 2000
+  xy.example.com.   IN   KEY   0x4200 4 1 AQOF8tZ2...+buFuFn/
+
+ +

+ +Normally, the default key for this host +(the one with no host identities specified for it) is the one extracted. +The +--id + +option overrides this, +causing extraction of the key labeled with the specified +identity, + +if any. +The specified +identity + +must +exactly + +match the identity in the file; +in particular, the comparison is case-sensitive. +

+ +The +--file + +option overrides the default for where the key information should be +found, and takes it from the specified +secretfile. + +  +

DIAGNOSTICS

+ +A complaint about ``no pubkey line found'' indicates that the +host has a key but it was generated with an old version of FreeS/WAN +and does not contain the information that +showhostkey + +needs. +  +

FILES

+ +/etc/ipsec.secrets +  +

SEE ALSO

+ +ipsec.secrets(5), ipsec.conf(5), ipsec_rsasigkey(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Henry Spencer. +  +

BUGS

+ +Arguably, +rather than just reporting the no-IN-KEY-line-found problem, +showhostkey + +should be smart enough to run the existing key through +rsasigkey + +with the +--oldkey + +option, to generate a suitable output line. +

+ +The need to specify the gateway address (etc.) for +--txt + +is annoying, but there is no good way to determine it automatically. +

+ +There should be a way to specify the priority value for TXT records; +currently it is hardwired to +10. + +

+ +The +--id + +option assumes that the +identity + +appears on the same line as the +: RSA { + +that begins the key proper. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
DIAGNOSTICS
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_showpolicy.8.html b/doc/manpage.d/ipsec_showpolicy.8.html new file mode 100644 index 000000000..470c40879 --- /dev/null +++ b/doc/manpage.d/ipsec_showpolicy.8.html @@ -0,0 +1,88 @@ +Content-type: text/html + +Manpage of IPSEC_SHOWPOLICY + +

IPSEC_SHOWPOLICY

+Section: Maintenance Commands (8)
Updated: 7 May 2003
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec showpolicy - dump policy of socket found as stdin +  +

SYNOPSIS

+ +

+ +ipsec + +showpolicy + +

+ +  +

DESCRIPTION

+ +showpolicy + +calls the +ipsec_policy_lookup(3) + +function on the file description which is its stdin. +

+ +It then dumps the resulting query in a human readable form. +

+ +This is a test program. One might run it from inetd, via: +

+
discard stream tcp nowait nobody /usr/local/libexec/ipsec/showpolicy showpolicy
+
+  +

FILES

+ +/var/run/ipsecpolicy.ctl +  +

SEE ALSO

+ +ipsec(8), ipsec_policy_query(3), ipsec_pluto(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Michael Richardson +  +

BUGS

+ + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_sockaddrlenof.3.html b/doc/manpage.d/ipsec_sockaddrlenof.3.html new file mode 100644 index 000000000..3965ca62d --- /dev/null +++ b/doc/manpage.d/ipsec_sockaddrlenof.3.html @@ -0,0 +1,143 @@ +Content-type: text/html + +Manpage of IPSEC_PORTOF + +

IPSEC_PORTOF

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec portof - get port field of an ip_address +
+ +ipsec setportof - set port field of an ip_address +
+ +ipsec sockaddrof - get pointer to internal sockaddr of an ip_address +
+ +ipsec sockaddrlenof - get length of internal sockaddr of an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int portof(const ip_address *src); + +
+ +void setportof(int port, ip_address *dst); + +
+ +struct sockaddr *sockaddrof(ip_address *src); + +
+ +size_t sockaddrlenof(const ip_address *src); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +internal type +ip_address + +contains one of the +sockaddr + +types internally. +Reliance on this feature is discouraged, +but it may occasionally be necessary. +These functions provide low-level tools for this purpose. +

+ +Portof + +and +setportof + +respectively read and write the port-number field of the internal +sockaddr. + +The values are in network byte order. +

+ +Sockaddrof + +returns a pointer to the internal +sockaddr, + +for passing to other functions. +

+ +Sockaddrlenof + +reports the size of the internal +sockaddr, + +for use in storage allocation. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

DIAGNOSTICS

+ +Portof + +returns +-1, + +sockaddrof + +returns +NULL, + +and +sockaddrlenof + +returns +0 + +if an unknown address family is found within the +ip_address. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +These functions all depend on low-level details of the +ip_address + +type, which are in principle subject to change. +Avoid using them unless really necessary. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_sockaddrof.3.html b/doc/manpage.d/ipsec_sockaddrof.3.html new file mode 100644 index 000000000..3965ca62d --- /dev/null +++ b/doc/manpage.d/ipsec_sockaddrof.3.html @@ -0,0 +1,143 @@ +Content-type: text/html + +Manpage of IPSEC_PORTOF + +

IPSEC_PORTOF

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec portof - get port field of an ip_address +
+ +ipsec setportof - set port field of an ip_address +
+ +ipsec sockaddrof - get pointer to internal sockaddr of an ip_address +
+ +ipsec sockaddrlenof - get length of internal sockaddr of an ip_address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int portof(const ip_address *src); + +
+ +void setportof(int port, ip_address *dst); + +
+ +struct sockaddr *sockaddrof(ip_address *src); + +
+ +size_t sockaddrlenof(const ip_address *src); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +internal type +ip_address + +contains one of the +sockaddr + +types internally. +Reliance on this feature is discouraged, +but it may occasionally be necessary. +These functions provide low-level tools for this purpose. +

+ +Portof + +and +setportof + +respectively read and write the port-number field of the internal +sockaddr. + +The values are in network byte order. +

+ +Sockaddrof + +returns a pointer to the internal +sockaddr, + +for passing to other functions. +

+ +Sockaddrlenof + +reports the size of the internal +sockaddr, + +for use in storage allocation. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

DIAGNOSTICS

+ +Portof + +returns +-1, + +sockaddrof + +returns +NULL, + +and +sockaddrlenof + +returns +0 + +if an unknown address family is found within the +ip_address. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +These functions all depend on low-level details of the +ip_address + +type, which are in principle subject to change. +Avoid using them unless really necessary. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_spi.5.html b/doc/manpage.d/ipsec_spi.5.html new file mode 100644 index 000000000..b1cf89033 --- /dev/null +++ b/doc/manpage.d/ipsec_spi.5.html @@ -0,0 +1,305 @@ +Content-type: text/html + +Manpage of IPSEC_SPI + +

IPSEC_SPI

+Section: File Formats (5)
Updated: 26 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_spi - list IPSEC Security Associations +  +

SYNOPSIS

+ +ipsec + +spi + +

+ +cat + +/proc/net/ipsec_spi + +

+ +  +

DESCRIPTION

+ +/proc/net/ipsec_spi + +is a read-only file that lists the current IPSEC Security Associations. +A Security Association (SA) is a transform through which packet contents +are to be processed before being forwarded. A transform can be an +IPv4-in-IPv4 or IPv6-in-IPv6 encapsulation, an IPSEC Authentication Header (authentication +with no encryption), or an IPSEC Encapsulation Security Payload +(encryption, possibly including authentication). +

+ +When a packet is passed from a higher networking layer through an IPSEC +virtual interface, a search in the extended routing table (see +ipsec_eroute(5)) + +yields +a IP protocol number +, +a Security Parameters Index (SPI) +and +an effective destination address +When an IPSEC packet arrives from the network, +its ostensible destination, an SPI and an IP protocol +specified by its outermost IPSEC header are used. +The destination/SPI/protocol combination is used to select a relevant SA. +(See +ipsec_spigrp(5) + +for discussion of how multiple transforms are combined.) +

+ +An +spi , + +proto, + +daddr + +and +address_family + +arguments specify an SAID. +Proto + +is an ASCII string, "ah", "esp", "comp" or "tun", specifying the IP protocol. +Spi + +is a number, preceded by '.' indicating hexadecimal and IPv4 or by ':' indicating hexadecimal and IPv6, +where each hexadecimal digit represents 4 bits, +between +0x100 + +and +0xffffffff; + +values from +0x0 + +to +0xff + +are reserved. +Daddr + +is a dotted-decimal IPv4 destination address or a coloned hex IPv6 destination address. +

+ +An +SAID + +combines the three parameters above, such as: "tun.101@1.2.3.4" for IPv4 or "tun:101@3049:1::1" for IPv6 +

+ +A table entry consists of: +

+
+
+SAID + +
+
+<transform name (proto,encalg,authalg)>: +
+
+direction (dir=) +
+
+source address (src=) +
+
+source and destination addresses and masks for inner header policy check +addresses (policy=), as dotted-quads or coloned hex, separated by '->', +for IPv4-in-IPv4 or IPv6-in-IPv6 SAs only +
+
+initialisation vector length and value (iv_bits=, iv=) if non-zero +
+
+out-of-order window size, number of out-of-order errors, sequence +number, recently received packet bitmask, maximum difference between +sequence numbers (ooowin=, ooo_errs=, seq=, bit=, max_seq_diff=) if SA +is AH or ESP and if individual items are non-zero +
+
+extra flags (flags=) if any are set +
+
+authenticator length in bits (alen=) if non-zero +
+
+authentication key length in bits (aklen=) if non-zero +
+
+authentication errors (auth_errs=) if non-zero +
+
+encryption key length in bits (eklen=) if non-zero +
+
+encryption size errors (encr_size_errs=) if non-zero +
+
+encryption padding error warnings (encr_pad_errs=) if non-zero +
+
+lifetimes legend, c=Current status, s=Soft limit when exceeded will +initiate rekeying, h=Hard limit will cause termination of SA (life(c,s,h)=) +
+
+number of connections to which the SA is allocated (c), that will cause a +rekey (s), that will cause an expiry (h) (alloc=), if any value is non-zero +
+
+number of bytes processesd by this SA (c), that will cause a rekey (s), that +will cause an expiry (h) (bytes=), if any value is non-zero +
+
+time since the SA was added (c), until rekey (s), until expiry (h), in seconds (add=) +
+
+time since the SA was first used (c), until rekey (s), until expiry (h), in seconds (used=), +if any value is non-zero +
+
+number of packets processesd by this SA (c), that will cause a rekey (s), that +will cause an expiry (h) (packets=), if any value is non-zero +
+
+time since the last packet was processed, in seconds (idle=), if SA has +been used +
+average compression ratio (ratio=) +
+  +

EXAMPLES

+ +tun.12a@192.168.43.1 IPIP: dir=out src=192.168.43.2 + +
+ + life(c,s,h)=bytes(14073,0,0)add(269,0,0) + +
+ + use(149,0,0)packets(14,0,0) + +
+ + idle=23 + +

+ +is an outbound IPv4-in-IPv4 (protocol 4) tunnel-mode SA set up between machines +192.168.43.2 and 192.168.43.1 with an SPI of 12a in hexadecimal that has +passed about 14 kilobytes of traffic in 14 packets since it was created, +269 seconds ago, first used 149 seconds ago and has been idle for 23 +seconds. +

+ +esp:9a35fc02@3049:1::1 ESP_3DES_HMAC_MD5: + +
+ + dir=in src=9a35fc02@3049:1::2 + +
+ + ooowin=32 seq=7149 bit=0xffffffff + +
+ + alen=128 aklen=128 eklen=192 + +
+ + life(c,s,h)=bytes(1222304,0,0)add(4593,0,0) + +
+ + use(3858,0,0)packets(7149,0,0) + +
+ + idle=23 + +

+ +is an inbound Encapsulating Security Payload (protocol 50) SA on machine +3049:1::1 with an SPI of 9a35fc02 that uses 3DES as the encryption +cipher, HMAC MD5 as the authentication algorithm, an out-of-order +window of 32 packets, a present sequence number of 7149, every one of +the last 32 sequence numbers was received, the authenticator length and +keys is 128 bits, the encryption key is 192 bits (actually 168 for 3DES +since 1 of 8 bits is a parity bit), has passed 1.2 Mbytes of data in +7149 packets, was added 4593 seconds ago, first used +3858 seconds ago and has been idle for 23 seconds. +

+ +  +

FILES

+ +/proc/net/ipsec_spi, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_eroute(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_spi(8), ipsec_version(5), +ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. +  +

BUGS

+ +The add and use times are awkward, displayed in seconds since machine +start. It would be better to display them in seconds before now for +human readability. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_spi.8.html b/doc/manpage.d/ipsec_spi.8.html new file mode 100644 index 000000000..a40d06d9b --- /dev/null +++ b/doc/manpage.d/ipsec_spi.8.html @@ -0,0 +1,790 @@ +Content-type: text/html + +Manpage of IPSEC_SPI + +

IPSEC_SPI

+Section: Maintenance Commands (8)
Updated: 23 Oct 2001
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec spi - manage IPSEC Security Associations +  +

SYNOPSIS

+ +
+ +Note: In the following, +
+ +<SA> + +means: +--af + +(inet | inet6) +--edst + +daddr +--spi + +spi +--proto + +proto OR +--said + +said, +
+ +<life> + +means: +--life + +(soft | hard)-(allocations | bytes | addtime | usetime | packets)=value[,...] +

+ +ipsec + +spi + +

+ +ipsec + +spi + +<SA> + +--src + +src +--ah + +hmac-md5-96|hmac-sha1-96 + +[ +--replay_window + +replayw ] +[ +<life> + +] +--authkey + +akey +

+ +ipsec + +spi + +<SA> + +--src + +src +--esp + +3des + +[ +--replay_window + +replayw ] +[ +<life> + +] +--enckey + +ekey +

+ +ipsec + +spi + +<SA> + +--src + +src +--esp + +3des-md5-96|3des-sha1-96 + +[ +--replay_window + +replayw ] +[ +<life> + +] +--enckey + +ekey +--authkey + +akey +

+ +ipsec + +spi + +<SA> + +--src + +src +--comp + +deflate + +

+ +ipsec + +spi + +<SA> + +--ip4 + +--src + +encap-src +--dst + +encap-dst +

+ +ipsec + +spi + +<SA> + +--ip6 + +--src + +encap-src +--dst + +encap-dst +

+ +ipsec + +spi + +<SA> + +--del + +

+ +ipsec + +spi + +--help + +

+ +ipsec + +spi + +--version + +

+ +ipsec + +spi + +--clear + +

+ +  +

DESCRIPTION

+ +Spi + +creates and deletes IPSEC Security Associations. +A Security Association (SA) is a transform through which packet +contents are to be processed before being forwarded. +A transform can be an IPv4-in-IPv4 or an IPv6-in-IPv6 encapsulation, +an IPSEC Authentication Header (authentication with no encryption), +or an IPSEC Encapsulation Security Payload (encryption, possibly +including authentication). +

+ +When a packet is passed from a higher networking layer +through an IPSEC virtual interface, +a search in the extended routing table (see +ipsec_eroute(8)) + +yields an effective destination address, a +Security Parameters Index (SPI) and a IP protocol number. +When an IPSEC packet arrives from the network, +its ostensible destination, an SPI and an IP protocol +specified by its outermost IPSEC header are used. +The destination/SPI/protocol combination is used to select a relevant SA. +(See +ipsec_spigrp(8) + +for discussion of how multiple transforms are combined.) +

+ +The +af, + +daddr, + +spi + +and +proto + +arguments specify the SA to be created or deleted. +af + +is the address family (inet for IPv4, inet6 for IPv6). +Daddr + +is a destination address +in dotted-decimal notation for IPv4 +or in a coloned hex notation for IPv6. +Spi + +is a number, preceded by '0x' for hexadecimal, +between +0x100 + +and +0xffffffff; + +values from +0x0 + +to +0xff + +are reserved. +Proto + +is an ASCII string, "ah", "esp", "comp" or "tun", specifying the IP protocol. +The protocol must agree with the algorithm selected. +

+ +Alternatively, the +said + +argument can also specify an SA to be created or deleted. +Said + +combines the three parameters above, such as: "tun.101@1.2.3.4" or "tun:101@1:2::3:4", +where the address family is specified by "." for IPv4 and ":" for IPv6. The address +family indicators substitute the "0x" for hexadecimal. +

+ +The source address, +src, + +must also be provided for the inbound policy check to +function. The source address does not need to be included if inbound +policy checking has been disabled. +

+ +Keys vectors must be entered as hexadecimal or base64 numbers. +They should be cryptographically strong random numbers. +

+ +All hexadecimal numbers are entered as strings of hexadecimal digits +(0-9 and a-f), without spaces, preceded by '0x', where each hexadecimal +digit represents 4 bits. +All base64 numbers are entered as strings of base64 digits +
 (0-9, A-Z, a-z, '+' and '/'), without spaces, preceded by '0s', +where each hexadecimal digit represents 6 bits and '=' is used for padding. +

+ +The deletion of an SA which has been grouped will result in the entire chain +being deleted. +

+ +The form with no additional arguments lists the contents of +/proc/net/ipsec_spi. The format of /proc/net/ipsec_spi is discussed in +ipsec_spi(5). +

+ +The lifetime severity of +soft + +sets a limit when the key management daemons are asked to rekey the SA. +The lifetime severity of +hard + +sets a limit when the SA must expire. +The lifetime type +allocations + +tells the system when to expire the SA because it is being shared by too many +eroutes (not currently used). The lifetime type of +bytes + +tells the system to expire the SA after a certain number of bytes have been +processed with that SA. The lifetime type of +addtime + +tells the system to expire the SA a certain number of seconds after the SA was +installed. The lifetime type of +usetime + +tells the system to expire the SA a certain number of seconds after that SA has +processed its first packet. The lifetime type of +packets + +tells the system to expire the SA after a certain number of packets have been +processed with that SA. +  +

OPTIONS

+ +
+
--af + +
+specifies the address family (inet for IPv4, inet6 for IPv6) +
--edst + +
+specifies the effective destination +daddr + +of the Security Association +
--spi + +
+specifies the Security Parameters Index +spi + +of the Security Association +
--proto + +
+specifies the IP protocol +proto + +of the Security Association +
--said + +
+specifies the Security Association in monolithic format +
--ah + +
+add an SA for an IPSEC Authentication Header, +specified by the following transform identifier +(hmac-md5-96 + +or +hmac-sha1-96) + +(RFC2402, obsoletes RFC1826) +
hmac-md5-96 + +
+transform following the HMAC and MD5 standards, +using a 128-bit +key + +to produce a 96-bit authenticator (RFC2403) +
hmac-sha1-96 + +
+transform following the HMAC and SHA1 standards, +using a 160-bit +key + +to produce a 96-bit authenticator (RFC2404) +
--esp + +
+add an SA for an IPSEC Encapsulation Security Payload, +specified by the following +transform identifier (3des, + +or +3des-md5-96) + +(RFC2406, obsoletes RFC1827) +
3des + +
+encryption transform following the Triple-DES standard in +Cipher-Block-Chaining mode using a 64-bit +iv + +(internally generated) and a 192-bit 3DES +ekey + +(RFC2451) +
3des-md5-96 + +
+encryption transform following the Triple-DES standard in +Cipher-Block-Chaining mode with authentication provided by +HMAC and MD5 +(96-bit authenticator), +using a 64-bit +iv + +(internally generated), a 192-bit 3DES +ekey + +and a 128-bit HMAC-MD5 +akey + +(RFC2451, RFC2403) +
3des-sha1-96 + +
+encryption transform following the Triple-DES standard in +Cipher-Block-Chaining mode with authentication provided by +HMAC and SHA1 +(96-bit authenticator), +using a 64-bit +iv + +(internally generated), a 192-bit 3DES +ekey + +and a 160-bit HMAC-SHA1 +akey + +(RFC2451, RFC2404) +
--replay_window replayw + +
+sets the replay window size; valid values are decimal, 1 to 64 +
--life life_param[,life_param] + +
+sets the lifetime expiry; the format of +life_param + +consists of a comma-separated list of lifetime specifications without spaces; +a lifetime specification is comprised of a severity of +soft or hard + +followed by a '-', followed by a lifetime type of +allocations, bytes, addtime, usetime or packets + +followed by an '=' and finally by a value +
--comp + +
+add an SA for IPSEC IP Compression, +specified by the following +transform identifier (deflate) + +(RFC2393) +
deflate + +
+compression transform following the patent-free Deflate compression algorithm +(RFC2394) +
--ip4 + +
+add an SA for an IPv4-in-IPv4 +tunnel from +encap-src + +to +encap-dst + +
--ip6 + +
+add an SA for an IPv6-in-IPv6 +tunnel from +encap-src + +to +encap-dst + +
--src + +
+specify the source end of an IP-in-IP tunnel from +encap-src + +to +encap-dst + +and also specifies the source address of the Security Association to be +used in inbound policy checking and must be the same address +family as +af + +and +edst + +
--dst + +
+specify the destination end of an IP-in-IP tunnel from +encap-src + +to +encap-dst + +
--del + +
+delete the specified SA +
--clear + +
+clears the table of +SAs + +
--help + +
+display synopsis +
--version + +
+display version information +
+  +

EXAMPLES

+ +To keep line lengths down and reduce clutter, +some of the long keys in these examples have been abbreviated +by replacing part of their text with +``...''. + +Keys used when the programs are actually run must, +of course, be the full length required for the particular algorithm. +

+ +ipsec spi --af inet --edst gw2 --spi 0x125 --proto esp \ + +
+ + --src gw1 \ + +
+ + --esp 3des-md5-96 \ + +
+ +   --enckey 0x6630...97ce \ + +
+ + --authkey 0x9941...71df + +

+ +sets up an SA from +gw1 + +to +gw2 + +with an SPI of +0x125 + +and protocol +ESP + +(50) using +3DES + +encryption with integral +MD5-96 + +authentication transform, using an encryption key of +0x6630...97ce + +and an authentication key of +0x9941...71df + +(see note above about abbreviated keys). +

+ +ipsec spi --af inet6 --edst 3049:9::9000:3100 --spi 0x150 --proto ah \ + +
+ + --src 3049:9::9000:3101 \ + +
+ + --ah hmac-md5-96 \ + +
+ +   --authkey 0x1234...2eda \ + +

+ +sets up an SA from +3049:9::9000:3101 + +to +3049:9::9000:3100 + +with an SPI of +0x150 + +and protocol +AH + +(50) using +MD5-96 + +authentication transform, using an authentication key of +0x1234...2eda + +(see note above about abbreviated keys). +

+ +ipsec spi --said tun.987@192.168.100.100 --del + +

+ +deletes an SA to +192.168.100.100 + +with an SPI of +0x987 + +and protocol +IPv4-in-IPv4 + +(4). +

+ +ipsec spi --said tun:500@3049:9::1000:1 --del + +

+ +deletes an SA to +3049:9::1000:1 + +with an SPI of +0x500 + +and protocol +IPv6-in-IPv6 + +(4). +

+ +  +

FILES

+ +/proc/net/ipsec_spi, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), +ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_spi(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. +  +

BUGS

+ +The syntax is messy and the transform naming needs work. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
OPTIONS
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_spigrp.5.html b/doc/manpage.d/ipsec_spigrp.5.html new file mode 100644 index 000000000..e0efcb73e --- /dev/null +++ b/doc/manpage.d/ipsec_spigrp.5.html @@ -0,0 +1,193 @@ +Content-type: text/html + +Manpage of IPSEC_SPIGRP + +

IPSEC_SPIGRP

+Section: File Formats (5)
Updated: 27 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_spigrp - list IPSEC Security Association groupings +  +

SYNOPSIS

+ +ipsec + +spigrp + +

+ +cat + +/proc/net/ipsec_spigrp + +

+ +  +

DESCRIPTION

+ +/proc/net/ipsec_spigrp + +is a read-only file that lists groups of IPSEC Security Associations +(SAs). +

+ +An entry in the IPSEC extended routing table can only point (via an +SAID) to one SA. If more than one transform must be applied to a given +type of packet, this can be accomplished by setting up several SAs with +the same destination address but potentially different SPIs and +protocols, and grouping them with +ipsec_spigrp(8). + +

+ +The SA groups are listed, one line per connection/group, as a sequence +of SAs to be applied (or that should have been applied, in the case of +an incoming packet) from inside to outside the packet. An SA is +identified by its SAID, which consists of protocol ("ah", "esp", "comp" or +"tun"), SPI (with '.' for IPv4 or ':' for IPv6 prefixed hexadecimal number ) and destination address +(IPv4 dotted quad or IPv6 coloned hex) prefixed by '@', in the format <proto><af><spi>@<dest>. +  +

EXAMPLES

+ +
+
tun.3d0@192.168.2.110 + +
+comp.3d0@192.168.2.110 + +esp.187a101b@192.168.2.110 + +ah.187a101a@192.168.2.110 + +
+

+ +is a group of 3 SAs, destined for +192.168.2.110 + +with an IPv4-in-IPv4 tunnel SA applied first with an SPI of +3d0 + +in hexadecimal, followed by a Deflate compression header to compress +the packet with CPI of +3d0 + +in hexadecimal, followed by an Encapsulating Security Payload header to +encrypt the packet with SPI +187a101b + +in hexadecimal, followed by an Authentication Header to authenticate the +packet with SPI +187a101a + +in hexadecimal, applied from inside to outside the packet. This could +be an incoming or outgoing group, depending on the address of the local +machine. +

+ +

+
tun:3d0@3049:1::2 + +
+comp:3d0@3049:1::2 + +esp:187a101b@3049:1::2 + +ah:187a101a@3049:1::2 + +
+

+ +is a group of 3 SAs, destined for +3049:1::2 + +with an IPv6-in-IPv6 tunnel SA applied first with an SPI of +3d0 + +in hexadecimal, followed by a Deflate compression header to compress +the packet with CPI of +3d0 + +in hexadecimal, followed by an Encapsulating Security Payload header to +encrypt the packet with SPI +187a101b + +in hexadecimal, followed by an Authentication Header to authenticate the +packet with SPI +187a101a + +in hexadecimal, applied from inside to outside the packet. This could +be an incoming or outgoing group, depending on the address of the local +machine. +

+ +  +

FILES

+ +/proc/net/ipsec_spigrp, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_eroute(5), +ipsec_spi(5), ipsec_klipsdebug(5), ipsec_spigrp(8), ipsec_version(5), +ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. +  +

BUGS

+ +:-) + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_spigrp.8.html b/doc/manpage.d/ipsec_spigrp.8.html new file mode 100644 index 000000000..2e96c0574 --- /dev/null +++ b/doc/manpage.d/ipsec_spigrp.8.html @@ -0,0 +1,280 @@ +Content-type: text/html + +Manpage of IPSEC_SPIGRP + +

IPSEC_SPIGRP

+Section: Maintenance Commands (8)
Updated: 21 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec spigrp - group/ungroup IPSEC Security Associations +  +

SYNOPSIS

+ +ipsec + +spigrp + +

+ +ipsec + +spigrp + +[ +--label + +label ] +af1 dst1 spi1 proto1 [ af2 dst2 spi2 proto2 [ af3 dst3 spi3 proto3 [ af4 dst4 spi4 proto4 ] ] ] +

+ +ipsec + +spigrp + +[ +--label + +label ] +--said + +SA1 [ SA2 [ SA3 [ SA4 ] ] ] +

+ +ipsec + +spigrp + +--help + +

+ +ipsec + +spigrp + +--version + +

+ +  +

DESCRIPTION

+ +Spigrp + +groups IPSEC Security Associations (SAs) together or ungroups +previously grouped SAs. +An entry in the IPSEC extended +routing table can only point +(via a destination address, a Security Parameters Index (SPI) and +a protocol identifier) to one SA. +If more than one transform must be applied to a given type of packet, +this can be accomplished by setting up several SAs +with the same destination address but potentially different SPIs and protocols, +and grouping them with +spigrp. + +

+ +The SAs to be grouped, +specified by destination address (DNS name lookup, IPv4 dotted quad or IPv6 coloned hex), SPI +('0x'-prefixed hexadecimal number) and protocol ("ah", "esp", "comp" or "tun"), +are listed from the inside transform to the +outside; +in other words, the transforms are applied in +the order of the command line and removed in the reverse +order. +The resulting SA group is referred to by its first SA (by +af1, + +dst1, + +spi1 + +and +proto1). + +

+ +The --said option indicates that the SA IDs are to be specified as +one argument each, in the format <proto><af><spi>@<dest>. The SA IDs must +all be specified as separate parameters without the --said option or +all as monolithic parameters after the --said option. +

+ +The SAs must already exist and must not already +be part of a group. +

+ +If +spigrp + +is invoked with only one SA specification, +it ungroups the previously-grouped set of SAs containing +the SA specified. +

+ +The --label option identifies all responses from that command +invocation with a user-supplied label, provided as an argument to the +label option. This can be helpful for debugging one invocation of the +command out of a large number. +

+ +The command form with no additional arguments lists the contents of +/proc/net/ipsec_spigrp. The format of /proc/net/ipsec_spigrp is +discussed in ipsec_spigrp(5). +  +

EXAMPLES

+ +
+
ipsec spigrp inet gw2 0x113 tun inet gw2 0x115 esp inet gw2 0x116 ah + +
+groups 3 SAs together, all destined for +gw2, + +but with an IPv4-in-IPv4 tunnel SA applied first with SPI +0x113, + +then an ESP header to encrypt the packet with SPI +0x115, + +and finally an AH header to authenticate the packet with SPI +0x116. + +
+

+ +

+
ipsec spigrp --said tun.113@gw2 esp.115@gw2 ah.116@gw2 + +
+groups 3 SAs together, all destined for +gw2, + +but with an IPv4-in-IPv4 tunnel SA applied first with SPI +0x113, + +then an ESP header to encrypt the packet with SPI +0x115, + +and finally an AH header to authenticate the packet with SPI +0x116. + +
+

+ +

+
ipsec spigrp --said tun:233@3049:1::1 esp:235@3049:1::1 ah:236@3049:1::1 + +
+groups 3 SAs together, all destined for +3049:1::1, + +but with an IPv6-in-IPv6 tunnel SA applied first with SPI +0x233, + +then an ESP header to encrypt the packet with SPI +0x235, + +and finally an AH header to authenticate the packet with SPI +0x236. + +
+

+ +

+
ipsec spigrp inet6 3049:1::1 0x233 tun inet6 3049:1::1 0x235 esp inet6 3049:1::1 0x236 ah + +
+groups 3 SAs together, all destined for +3049:1::1, + +but with an IPv6-in-IPv6 tunnel SA applied first with SPI +0x233, + +then an ESP header to encrypt the packet with SPI +0x235, + +and finally an AH header to authenticate the packet with SPI +0x236. + +
+

+ +  +

FILES

+ +/proc/net/ipsec_spigrp, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), +ipsec_spi(8), ipsec_klipsdebug(8), ipsec_spigrp(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. +  +

BUGS

+ +Yes, it really is limited to a maximum of four SAs, +although admittedly it's hard to see why you would need more. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_splitkeytoid.3.html b/doc/manpage.d/ipsec_splitkeytoid.3.html new file mode 100644 index 000000000..109cfafa7 --- /dev/null +++ b/doc/manpage.d/ipsec_splitkeytoid.3.html @@ -0,0 +1,174 @@ +Content-type: text/html + +Manpage of IPSEC_KEYBLOBTOID + +

IPSEC_KEYBLOBTOID

+Section: C Library Functions (3)
Updated: 25 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec keyblobtoid, splitkeytoid - generate key IDs from RSA keys +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+size_t keyblobtoid(const unsigned char *blob, + +
+  +size_t bloblen, char *dst, size_t dstlen); + +
+ +size_t splitkeytoid(const unsigned char *e, size_t elen, + +
+  +const unsigned char *m, size_t mlen, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +Keyblobtoid + +and +splitkeytoid + +generate +key IDs +from RSA keys, +for use in messages and reporting, +writing the result to +dst. + +A +key ID + +is a short ASCII string identifying a key; +currently it is just the first nine characters of the base64 +encoding of the RFC 2537/3110 ``byte blob'' representation of the key. +(Beware that no finite key ID can be collision-proof: +there is always some small chance of two random keys having the +same ID.) +

+ +Keyblobtoid + +generates a key ID from a key which is already in the form of an +RFC 2537/3110 binary key +blob + +(encoded exponent length, exponent, modulus). +

+ +Splitkeytoid + +generates a key ID from a key given in the form of a separate +(binary) exponent +e + +and modulus +m. + +

+ +The +dstlen + +parameter of either +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant +KEYID_BUF + +which is the size of a buffer large enough for worst-case results. +

+ +Both functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. + +With keys generated by +ipsec_rsasigkey(3), + +the first two base64 digits are always the same, +and the third carries only about one bit of information. +It's worse with keys using longer fixed exponents, +e.g. the 24-bit exponent that's common in X.509 certificates. +However, being able to relate key IDs to the full +base64 text form of keys by eye is sufficiently useful that this +waste of space seems justifiable. +The choice of nine digits is a compromise between bulk and +probability of collision. +  +

SEE ALSO

+ +RFC 3110, +RSA/SHA-1 SIGs and RSA KEYs in the Domain Name System (DNS), +Eastlake, 2001 +(superseding the older but better-known RFC 2537). +  +

DIAGNOSTICS

+ +Fatal errors are: +key too short to supply enough bits to construct a complete key ID +(almost certainly indicating a garbage key); +exponent too long for its length to be representable. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnetinsubnet.3.html b/doc/manpage.d/ipsec_subnetinsubnet.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_subnetinsubnet.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnetishost.3.html b/doc/manpage.d/ipsec_subnetishost.3.html new file mode 100644 index 000000000..414a0d513 --- /dev/null +++ b/doc/manpage.d/ipsec_subnetishost.3.html @@ -0,0 +1,274 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 28 Nov 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec sameaddr - are two addresses the same? +
+ +ipsec addrcmp - ordered comparison of addresses +
+ +ipsec samesubnet - are two subnets the same? +
+ +ipsec addrinsubnet - is an address within a subnet? +
+ +ipsec subnetinsubnet - is a subnet within another subnet? +
+ +ipsec subnetishost - is a subnet a single host? +
+ +ipsec samesaid - are two SA IDs the same? +
+ +ipsec sameaddrtype - are two addresses of the same address family? +
+ +ipsec samesubnettype - are two subnets of the same address family? +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+int sameaddr(const ip_address *a, const ip_address *b); + +
+ +int addrcmp(const ip_address *a, const ip_address *b); + +
+ +int samesubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int addrinsubnet(const ip_address *a, const ip_subnet *s); + +
+ +int subnetinsubnet(const ip_subnet *a, const ip_subnet *b); + +
+ +int subnetishost(const ip_subnet *s); + +
+ +int samesaid(const ip_said *a, const ip_said *b); + +
+ +int sameaddrtype(const ip_address *a, const ip_address *b); + +
+ +int samesubnettype(const ip_subnet *a, const ip_subnet *b); + +  +

DESCRIPTION

+ +These functions do various comparisons and tests on the +ip_address + +type and +ip_subnet + +types. +

+ +Sameaddr + +returns +non-zero +if addresses +a + +and +b + +are identical, +and +0 + +otherwise. +Addresses of different families are never identical. +

+ +Addrcmp + +returns +-1, + +0, + +or +1 + +respectively +if address +a + +is less than, equal to, or greater than +b. + +If they are not of the same address family, +they are never equal; +the ordering reported in this case is arbitrary +(and probably not useful) but consistent. +

+ +Samesubnet + +returns +non-zero +if subnets +a + +and +b + +are identical, +and +0 + +otherwise. +Subnets of different address families are never identical. +

+ +Addrinsubnet + +returns +non-zero +if address +a + +is within subnet +s + +and +0 + +otherwise. +An address is never within a +subnet of a different address family. +

+ +Subnetinsubnet + +returns +non-zero +if subnet +a + +is a subset of subnet +b + +and +0 + +otherwise. +A subnet is deemed to be a subset of itself. +A subnet is never a subset of another +subnet if their address families differ. +

+ +Subnetishost + +returns +non-zero +if subnet +s + +is in fact only a single host, +and +0 + +otherwise. +

+ +Samesaid + +returns +non-zero +if SA IDs +a + +and +b + +are identical, +and +0 + +otherwise. +

+ +Sameaddrtype + +returns +non-zero +if addresses +a + +and +b + +are of the same address family, +and +0 + +otherwise. +

+ +Samesubnettype + +returns +non-zero +if subnets +a + +and +b + +are of the same address family, +and +0 + +otherwise. +  +

SEE ALSO

+ +inet(3), ipsec_initaddr(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnetof.3.html b/doc/manpage.d/ipsec_subnetof.3.html new file mode 100644 index 000000000..a185d716b --- /dev/null +++ b/doc/manpage.d/ipsec_subnetof.3.html @@ -0,0 +1,107 @@ +Content-type: text/html + +Manpage of IPSEC_SUBNETOF + +

IPSEC_SUBNETOF

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec subnetof - given Internet address and subnet mask, return subnet number +
+ +ipsec hostof - given Internet address and subnet mask, return host part +
+ +ipsec broadcastof - given Internet address and subnet mask, return broadcast address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+struct in_addr subnetof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr hostof(struct in_addr addr, + +
+  +struct in_addr mask); + +
+ +struct in_addr broadcastof(struct in_addr addr, + +
+  +struct in_addr mask); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_networkof(3) + +for their replacements. +

+ +Subnetof + +takes an Internet +address + +and a subnet +mask + +and returns the network part of the address +(all in network byte order). +Hostof + +similarly returns the host part, and +broadcastof + +returns the broadcast address (all-1s convention) for the network. +

+ +These functions are provided to hide the Internet bit-munging inside +an API, in hopes of easing the eventual transition to IPv6. +  +

SEE ALSO

+ +inet(3), ipsec_atosubnet(3) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Calling functions for this is more costly than doing it yourself. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnettoa.3.html b/doc/manpage.d/ipsec_subnettoa.3.html new file mode 100644 index 000000000..718fa935a --- /dev/null +++ b/doc/manpage.d/ipsec_subnettoa.3.html @@ -0,0 +1,448 @@ +Content-type: text/html + +Manpage of IPSEC_ATOADDR + +

IPSEC_ATOADDR

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoaddr, addrtoa - convert Internet addresses to and from ASCII +
+ +ipsec atosubnet, subnettoa - convert subnet/mask ASCII form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoaddr(const char *src, size_t srclen, + +
+  +struct in_addr *addr); + +
+ +size_t addrtoa(struct in_addr addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *atosubnet(const char *src, size_t srclen, + +
+  +struct in_addr *addr, struct in_addr *mask); + +
+ +size_t subnettoa(struct in_addr addr, struct in_addr mask, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoaddr(3) + +for their replacements. +

+ +Atoaddr + +converts an ASCII name or dotted-decimal address into a binary address +(in network byte order). +Addrtoa + +does the reverse conversion, back to an ASCII dotted-decimal address. +Atosubnet + +and +subnettoa + +do likewise for the ``address/mask'' ASCII form used to write a +specification of a subnet. +

+ +An address is specified in ASCII as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +ASCII-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of +addrtoa + +is always complete and does not contain leading zeros. +

+ +The letters in +a hexadecimal address may be uppercase or lowercase or any mixture thereof. +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +Name lookup resorts to +getnetbyname(3) + +only if +gethostbyname(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +atoaddr. + +In addition, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0. + +

+ +Atosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettoa + +generates the decimal-integer-bit-count +form of the mask, +with no leading zeros, +unless the mask is non-contiguous. +

+ +The +srclen + +parameter of +atoaddr + +and +atosubnet + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +addrtoa + +and +subnettoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOA_BUF + +and +SUBNETTOA_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtoa + +and +subnettoa + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available. +This parameter is a hedge against future needs. +

+ +The ASCII-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-ASCII functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoaddr + +are: +empty input; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal form; +dotted-decimal component too large to fit in 8 bits. +

+ +Fatal errors in +atosubnet + +are: +no +/ + +in +src; + +atoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtoa + +and +subnettoa + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +The restriction of ASCII-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The ASCII-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnettot.3.html b/doc/manpage.d/ipsec_subnettot.3.html new file mode 100644 index 000000000..199937a35 --- /dev/null +++ b/doc/manpage.d/ipsec_subnettot.3.html @@ -0,0 +1,569 @@ +Content-type: text/html + +Manpage of IPSEC_TTOADDR + +

IPSEC_TTOADDR

+Section: C Library Functions (3)
Updated: 28 Sept 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoaddr, tnatoaddr, addrtot - convert Internet addresses to and from text +
+ +ipsec ttosubnet, subnettot - convert subnet/mask text form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +const char *tnatoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +size_t addrtot(const ip_address *addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *ttosubnet(const char *src, size_t srclen, + +
+  +int af, ip_subnet *dst); + +
+ +size_t subnettot(const ip_subnet *sub, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttoaddr + +converts a text-string name or numeric address into a binary address +(in network byte order). +Tnatoaddr + +does the same conversion, +but the only text forms it accepts are +the ``official'' forms of +numeric address (dotted-decimal for IPv4, colon-hex for IPv6). +Addrtot + +does the reverse conversion, from binary address back to a text form. +Ttosubnet + +and +subnettot + +do likewise for the ``address/mask'' form used to write a +specification of a subnet. +

+ +An IPv4 address is specified in text as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +text-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of applying +addrtot + +to an IPv4 address is always complete and does not contain leading zeros. +

+ +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +An IPv6 address is specified in text with +colon-hex notation (e.g. +0:56:78ab:22:33:44:55:66), + +colon-hex with +:: + +abbreviating at most one subsequence of multiple zeros (e.g. +99:ab::54:068, + +which is synonymous with +99:ab:0:0:0:0:54:68), + +or a DNS name to be looked up via +gethostbyname(3). + +The result of applying +addrtot + +to an IPv6 address will use +:: + +abbreviation if possible, +and will not contain leading zeros. +

+ +The letters in hexadecimal +may be uppercase or lowercase or any mixture thereof. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname2(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +IPv4 name lookup resorts to +getnetbyname(3) + +only if +gethostbyname2(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +ttoaddr. + +In addition, and preferably, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +in IPv4 means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0 + +or +::/0 + +in IPv4 or IPv6 respectively. +

+ +Ttosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettot + +always generates the decimal-integer-bit-count +form of the mask, +with no leading zeros. +

+ +The +srclen + +parameter of +ttoaddr + +and +ttosubnet + +specifies the length of the text string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +af + +parameter of +ttoaddr + +and +ttosubnet + +specifies the address family of interest. +It should be either +AF_INET + +or +AF_INET6. + +

+ +The +dstlen + +parameter of +addrtot + +and +subnettot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOT_BUF + +and +SUBNETTOT_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtot + +and +subnettot + +specifies what format is to be used for the conversion. +The value +0 + +(not the character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available in +subnettot. + +Addrtot + +also accepts format values +'r' + +(signifying a text form suitable for DNS reverse lookups, +e.g. +4.3.2.1.IN-ADDR.ARPA. + +for IPv4 and +RFC 2874 format for IPv6), +and +'R' + +(signifying an alternate reverse-lookup form, +an error for IPv4 and RFC 1886 format for IPv6). +Reverse-lookup names always end with a ``.''. +

+ +The text-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-text functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoaddr + +are: +empty input; +unknown address family; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal or colon-hex form; +dotted-decimal or colon-hex component too large. +

+ +Fatal errors in +ttosubnet + +are: +no +/ + +in +src; + +ttoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtot + +and +subnettot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +Ttoaddr + +does not support the mixed colon-hex-dotted-decimal +convention used to embed an IPv4 address in an IPv6 address. +

+ +Addrtot + +always uses the +:: + +abbreviation (which can appear only once in an address) for the +first + +sequence of multiple zeros in an IPv6 address. +One can construct addresses (unlikely ones) in which this is suboptimal. +

+ +Addrtot + +'r' + +conversion of an IPv6 address uses lowercase hexadecimal, +not the uppercase used in RFC 2874's examples. +It takes careful reading of RFCs 2874, 2673, and 2234 to realize +that lowercase is technically legitimate here, +and there may be software which botches this +and hence would have trouble with lowercase hex. +

+ +Possibly +subnettot + +ought to recognize the +%default + +case and generate that string as its output. +Currently it doesn't. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +Tnatoaddr + +probably should enforce completeness of dotted-decimal addresses. +

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_subnettypeof.3.html b/doc/manpage.d/ipsec_subnettypeof.3.html new file mode 100644 index 000000000..ea0f83f82 --- /dev/null +++ b/doc/manpage.d/ipsec_subnettypeof.3.html @@ -0,0 +1,238 @@ +Content-type: text/html + +Manpage of IPSEC_INITSUBNET + +

IPSEC_INITSUBNET

+Section: C Library Functions (3)
Updated: 12 March 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec initsubnet - initialize an ip_subnet +
+ +ipsec addrtosubnet - initialize a singleton ip_subnet +
+ +ipsec subnettypeof - get address type of an ip_subnet +
+ +ipsec masktocount - convert subnet mask to bit count +
+ +ipsec networkof - get base address of an ip_subnet +
+ +ipsec maskof - get subnet mask of an ip_subnet +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *initsubnet(const ip_address *addr, + +
+  +int maskbits, int clash, ip_subnet *dst); + +
+ +const char *addrtosubnet(const ip_address *addr, + +
+  +ip_subnet *dst); + +

+int subnettypeof(const ip_subnet *src); + +
+ +int masktocount(const ip_address *src); + +
+ +void networkof(const ip_subnet *src, ip_address *dst); + +
+ +void maskof(const ip_subnet *src, ip_address *dst); + +  +

DESCRIPTION

+ +The +<freeswan.h> + +library uses an internal type +ip_subnet + +to contain a description of an IP subnet +(base address plus mask). +These functions provide basic tools for creating and examining this type. +

+ +Initsubnet + +initializes a variable +*dst + +of type +ip_subnet + +from a base address and +a count of mask bits. +The +clash + +parameter specifies what to do if the base address includes +1 + +bits outside the prefix specified by the mask +(that is, in the ``host number'' part of the address): +

+
+
'0'
+zero out host-number bits +
'x'
+non-zero host-number bits are an error +
+
+ +

+ +Initsubnet + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +

+ +Addrtosubnet + +initializes an +ip_subnet + +variable +*dst + +to a ``singleton subnet'' containing the single address +*addr. + +It returns +NULL + +for success and +a pointer to a string-literal error message for failure. +

+ +Subnettypeof + +returns the address type of a subnet, +normally +AF_INET + +or +AF_INET6. + +(The +<freeswan.h> + +header file arranges to include the necessary headers for these +names to be known.) +

+ +Masktocount + +converts a subnet mask, expressed as an address, to a bit count +suitable for use with +initsubnet. + +It returns +-1 + +for error; see DIAGNOSTICS. +

+ +Networkof + +fills in +*dst + +with the base address of subnet +src. + +

+ +Maskof + +fills in +*dst + +with the subnet mask of subnet +src, + +expressed as an address. +  +

SEE ALSO

+ +inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +initsubnet + +are: +unknown address family; +unknown +clash + +value; +impossible mask bit count; +non-zero host-number bits and +clash + +is +'x'. + +Fatal errors in +addrtosubnet + +are: +unknown address family. +Fatal errors in +masktocount + +are: +unknown address family; +mask bits not contiguous. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_tnatoaddr.3.html b/doc/manpage.d/ipsec_tnatoaddr.3.html new file mode 100644 index 000000000..199937a35 --- /dev/null +++ b/doc/manpage.d/ipsec_tnatoaddr.3.html @@ -0,0 +1,569 @@ +Content-type: text/html + +Manpage of IPSEC_TTOADDR + +

IPSEC_TTOADDR

+Section: C Library Functions (3)
Updated: 28 Sept 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoaddr, tnatoaddr, addrtot - convert Internet addresses to and from text +
+ +ipsec ttosubnet, subnettot - convert subnet/mask text form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +const char *tnatoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +size_t addrtot(const ip_address *addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *ttosubnet(const char *src, size_t srclen, + +
+  +int af, ip_subnet *dst); + +
+ +size_t subnettot(const ip_subnet *sub, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttoaddr + +converts a text-string name or numeric address into a binary address +(in network byte order). +Tnatoaddr + +does the same conversion, +but the only text forms it accepts are +the ``official'' forms of +numeric address (dotted-decimal for IPv4, colon-hex for IPv6). +Addrtot + +does the reverse conversion, from binary address back to a text form. +Ttosubnet + +and +subnettot + +do likewise for the ``address/mask'' form used to write a +specification of a subnet. +

+ +An IPv4 address is specified in text as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +text-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of applying +addrtot + +to an IPv4 address is always complete and does not contain leading zeros. +

+ +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +An IPv6 address is specified in text with +colon-hex notation (e.g. +0:56:78ab:22:33:44:55:66), + +colon-hex with +:: + +abbreviating at most one subsequence of multiple zeros (e.g. +99:ab::54:068, + +which is synonymous with +99:ab:0:0:0:0:54:68), + +or a DNS name to be looked up via +gethostbyname(3). + +The result of applying +addrtot + +to an IPv6 address will use +:: + +abbreviation if possible, +and will not contain leading zeros. +

+ +The letters in hexadecimal +may be uppercase or lowercase or any mixture thereof. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname2(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +IPv4 name lookup resorts to +getnetbyname(3) + +only if +gethostbyname2(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +ttoaddr. + +In addition, and preferably, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +in IPv4 means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0 + +or +::/0 + +in IPv4 or IPv6 respectively. +

+ +Ttosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettot + +always generates the decimal-integer-bit-count +form of the mask, +with no leading zeros. +

+ +The +srclen + +parameter of +ttoaddr + +and +ttosubnet + +specifies the length of the text string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +af + +parameter of +ttoaddr + +and +ttosubnet + +specifies the address family of interest. +It should be either +AF_INET + +or +AF_INET6. + +

+ +The +dstlen + +parameter of +addrtot + +and +subnettot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOT_BUF + +and +SUBNETTOT_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtot + +and +subnettot + +specifies what format is to be used for the conversion. +The value +0 + +(not the character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available in +subnettot. + +Addrtot + +also accepts format values +'r' + +(signifying a text form suitable for DNS reverse lookups, +e.g. +4.3.2.1.IN-ADDR.ARPA. + +for IPv4 and +RFC 2874 format for IPv6), +and +'R' + +(signifying an alternate reverse-lookup form, +an error for IPv4 and RFC 1886 format for IPv6). +Reverse-lookup names always end with a ``.''. +

+ +The text-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-text functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoaddr + +are: +empty input; +unknown address family; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal or colon-hex form; +dotted-decimal or colon-hex component too large. +

+ +Fatal errors in +ttosubnet + +are: +no +/ + +in +src; + +ttoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtot + +and +subnettot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +Ttoaddr + +does not support the mixed colon-hex-dotted-decimal +convention used to embed an IPv4 address in an IPv6 address. +

+ +Addrtot + +always uses the +:: + +abbreviation (which can appear only once in an address) for the +first + +sequence of multiple zeros in an IPv6 address. +One can construct addresses (unlikely ones) in which this is suboptimal. +

+ +Addrtot + +'r' + +conversion of an IPv6 address uses lowercase hexadecimal, +not the uppercase used in RFC 2874's examples. +It takes careful reading of RFCs 2874, 2673, and 2234 to realize +that lowercase is technically legitimate here, +and there may be software which botches this +and hence would have trouble with lowercase hex. +

+ +Possibly +subnettot + +ought to recognize the +%default + +case and generate that string as its output. +Currently it doesn't. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +Tnatoaddr + +probably should enforce completeness of dotted-decimal addresses. +

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_tncfg.5.html b/doc/manpage.d/ipsec_tncfg.5.html new file mode 100644 index 000000000..e4082a28f --- /dev/null +++ b/doc/manpage.d/ipsec_tncfg.5.html @@ -0,0 +1,175 @@ +Content-type: text/html + +Manpage of IPSEC_TNCFG + +

IPSEC_TNCFG

+Section: File Formats (5)
Updated: 27 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_tncfg - lists IPSEC virtual interfaces attached to real interfaces +  +

SYNOPSIS

+ +ipsec + +tncfg + +

+ +cat + +/proc/net/ipsec_tncfg + +  +

DESCRIPTION

+ +/proc/net/ipsec_tncfg + +is a read-only file which lists which IPSEC virtual interfaces are +attached to which real interfaces, through which packets will be +forwarded once processed by IPSEC. +

+ +Each line lists one ipsec I/F. +A table entry consists of: +

+
+
+an ipsec virtual I/F name +
+
+a visual and machine parsable separator '->', separating the virtual I/F +and the physical I/F, +
+
+a physical I/F name, to which the ipsec virtual I/F is attached or NULL +if it is not attached, +
+
+the keyword +mtu=, + +
+
+the MTU of the ipsec virtual I/F, +
+
+the automatically adjusted effective MTU for PMTU discovery, in brackets, +
+
+a visual and machine parsable separator '->', separating the virtual I/F +MTU and the physical I/F MTU, +
+
+the MTU of the attached physical I/F. +.SHEXAMPLES + +
ipsec2 -> eth3 mtu=16260(1443) -> 1500 + +
+
+

+ +shows that virtual device +ipsec2 + +with an MTU of +16260 + +is connected to physical device +eth3 + +with an MTU of +1500 + +and that the effective MTU as a result of PMTU discovery has been +automatically set to +1443. + +

+
ipsec0 -> wvlan0 mtu=1400(16260) -> 1500 + +
+
+

+ +shows that virtual device +ipsec0 + +with an MTU of +1400 + +is connected to physical device +wvlan0 + +with an MTU of +1500 + +and no PMTU packets have gotten far enough to bump down the effective MTU +from its default of 16260. +

+
ipsec3 -> NULL mtu=0(0) -> 0 + +
+
+

+ +shows that virtual device +ipsec3 + +is not connected to any physical device. +

+ +  +

FILES

+ +/proc/net/ipsec_tncfg, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_eroute(5), ipsec_spi(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_tncfg(8), ipsec_version(5), +ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_tncfg.8.html b/doc/manpage.d/ipsec_tncfg.8.html new file mode 100644 index 000000000..e5965267c --- /dev/null +++ b/doc/manpage.d/ipsec_tncfg.8.html @@ -0,0 +1,195 @@ +Content-type: text/html + +Manpage of IPSEC_TNCFG + +

IPSEC_TNCFG

+Section: Maintenance Commands (8)
Updated: 21 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec tncfg - associate IPSEC virtual interface with physical interface +  +

SYNOPSIS

+ +ipsec + +tncfg + +

+ +ipsec + +tncfg + +--attach + +--virtual + +virtual +--physical + +physical +

+ +ipsec + +tncfg + +--detach + +--virtual + +virtual +

+ +ipsec + +tncfg + +--clear + +

+ +ipsec + +tncfg + +--version + +

+ +ipsec + +tncfg + +--help + +  +

DESCRIPTION

+ +Tncfg + +attaches/detaches IPSEC virtual interfaces to/from +physical interfaces, +through which packets will be forwarded once processed by IPSEC. +

+ +The form with no additional arguments lists the contents of +/proc/net/ipsec_tncfg. The format of /proc/net/ipsec_tncfg is discussed +in ipsec_tncfg(5). +The +--attach + +form attaches the +virtual + +interface to the +physical + +one. +The +--detach + +form detaches the +virtual + +interface from whichever physical interface it is attached to. +The +--clear + +form clears all the +virtual + +interfaces from whichever physical interfaces they were attached to. +

+ +Virtual interfaces typically have names like +ipsec0, + +while physical interfaces typically have names like +eth0 + +or +ppp0. + +  +

EXAMPLES

+ +
+
ipsec tncfg --attach --virtual ipsec0 --physical eth0 + +
+attaches the +ipsec0 + +virtual device to the +eth0 + +physical device. +
+

+ +  +

FILES

+ +/proc/net/ipsec_tncfg, /usr/local/bin/ipsec +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_eroute(8), ipsec_spi(8), +ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_tncfg(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_trap_count.5.html b/doc/manpage.d/ipsec_trap_count.5.html new file mode 100644 index 000000000..8da655f77 --- /dev/null +++ b/doc/manpage.d/ipsec_trap_count.5.html @@ -0,0 +1,74 @@ +Content-type: text/html + +Manpage of IPSEC_TRAP_COUNT + +

IPSEC_TRAP_COUNT

+Section: File Formats (5)
Updated: 19 Jun 2003
Index +Return to Main Contents
+ + + + +  +

NAME

+ +trap_count - KLIPS statistic on number of ACQUIREs +  +

SYNOPSIS

+ +cat + +/proc/net/ipsec/stats/trap_count + +  +

DESCRIPTION

+ +/proc/net/ipsec/stats/trap_count + +is a read-only file. It contains a hexadecimal number which records the +number of attempts to send PF_ACQUIRE messages. Only those recorded by +trap_sendcount were actually successfully passed to userland. Note that the +userland may still have lost them on its own. +

+ +  +

FILES

+ +/proc/net/ipsec/stats/trap_sendcount +  +

SEE ALSO

+ +ipsec(8), ipsec_pf_key(5), trap_sendcount(5), pluto(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Michael C. Richardson <mcr@freeswan.org> + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_trap_sendcount.5.html b/doc/manpage.d/ipsec_trap_sendcount.5.html new file mode 100644 index 000000000..94f56b3a7 --- /dev/null +++ b/doc/manpage.d/ipsec_trap_sendcount.5.html @@ -0,0 +1,72 @@ +Content-type: text/html + +Manpage of IPSEC_TRAP_SENDCOUNT + +

IPSEC_TRAP_SENDCOUNT

+Section: File Formats (5)
Updated: 19 Jun 2003
Index +Return to Main Contents
+ + + + +  +

NAME

+ +trap_sendcount - KLIPS statistic on number of successful ACQUIREs +  +

SYNOPSIS

+ +cat + +/proc/net/ipsec/stats/trap_sendcount + +  +

DESCRIPTION

+ +/proc/net/ipsec/stats/trap_sendcount + +is a read-only file. It contains a hexadecimal number which records the +number of successful PF_ACQUIRE messages that were sent. +

+ +  +

FILES

+ +/proc/net/ipsec/stats/trap_sendcount +  +

SEE ALSO

+ +ipsec(8), ipsec_pf_key(5), trap_count(5), pluto(8) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Michael C. Richardson <mcr@freeswan.org> + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ttoaddr.3.html b/doc/manpage.d/ipsec_ttoaddr.3.html new file mode 100644 index 000000000..199937a35 --- /dev/null +++ b/doc/manpage.d/ipsec_ttoaddr.3.html @@ -0,0 +1,569 @@ +Content-type: text/html + +Manpage of IPSEC_TTOADDR + +

IPSEC_TTOADDR

+Section: C Library Functions (3)
Updated: 28 Sept 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoaddr, tnatoaddr, addrtot - convert Internet addresses to and from text +
+ +ipsec ttosubnet, subnettot - convert subnet/mask text form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +const char *tnatoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +size_t addrtot(const ip_address *addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *ttosubnet(const char *src, size_t srclen, + +
+  +int af, ip_subnet *dst); + +
+ +size_t subnettot(const ip_subnet *sub, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttoaddr + +converts a text-string name or numeric address into a binary address +(in network byte order). +Tnatoaddr + +does the same conversion, +but the only text forms it accepts are +the ``official'' forms of +numeric address (dotted-decimal for IPv4, colon-hex for IPv6). +Addrtot + +does the reverse conversion, from binary address back to a text form. +Ttosubnet + +and +subnettot + +do likewise for the ``address/mask'' form used to write a +specification of a subnet. +

+ +An IPv4 address is specified in text as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +text-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of applying +addrtot + +to an IPv4 address is always complete and does not contain leading zeros. +

+ +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +An IPv6 address is specified in text with +colon-hex notation (e.g. +0:56:78ab:22:33:44:55:66), + +colon-hex with +:: + +abbreviating at most one subsequence of multiple zeros (e.g. +99:ab::54:068, + +which is synonymous with +99:ab:0:0:0:0:54:68), + +or a DNS name to be looked up via +gethostbyname(3). + +The result of applying +addrtot + +to an IPv6 address will use +:: + +abbreviation if possible, +and will not contain leading zeros. +

+ +The letters in hexadecimal +may be uppercase or lowercase or any mixture thereof. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname2(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +IPv4 name lookup resorts to +getnetbyname(3) + +only if +gethostbyname2(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +ttoaddr. + +In addition, and preferably, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +in IPv4 means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0 + +or +::/0 + +in IPv4 or IPv6 respectively. +

+ +Ttosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettot + +always generates the decimal-integer-bit-count +form of the mask, +with no leading zeros. +

+ +The +srclen + +parameter of +ttoaddr + +and +ttosubnet + +specifies the length of the text string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +af + +parameter of +ttoaddr + +and +ttosubnet + +specifies the address family of interest. +It should be either +AF_INET + +or +AF_INET6. + +

+ +The +dstlen + +parameter of +addrtot + +and +subnettot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOT_BUF + +and +SUBNETTOT_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtot + +and +subnettot + +specifies what format is to be used for the conversion. +The value +0 + +(not the character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available in +subnettot. + +Addrtot + +also accepts format values +'r' + +(signifying a text form suitable for DNS reverse lookups, +e.g. +4.3.2.1.IN-ADDR.ARPA. + +for IPv4 and +RFC 2874 format for IPv6), +and +'R' + +(signifying an alternate reverse-lookup form, +an error for IPv4 and RFC 1886 format for IPv6). +Reverse-lookup names always end with a ``.''. +

+ +The text-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-text functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoaddr + +are: +empty input; +unknown address family; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal or colon-hex form; +dotted-decimal or colon-hex component too large. +

+ +Fatal errors in +ttosubnet + +are: +no +/ + +in +src; + +ttoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtot + +and +subnettot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +Ttoaddr + +does not support the mixed colon-hex-dotted-decimal +convention used to embed an IPv4 address in an IPv6 address. +

+ +Addrtot + +always uses the +:: + +abbreviation (which can appear only once in an address) for the +first + +sequence of multiple zeros in an IPv6 address. +One can construct addresses (unlikely ones) in which this is suboptimal. +

+ +Addrtot + +'r' + +conversion of an IPv6 address uses lowercase hexadecimal, +not the uppercase used in RFC 2874's examples. +It takes careful reading of RFCs 2874, 2673, and 2234 to realize +that lowercase is technically legitimate here, +and there may be software which botches this +and hence would have trouble with lowercase hex. +

+ +Possibly +subnettot + +ought to recognize the +%default + +case and generate that string as its output. +Currently it doesn't. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +Tnatoaddr + +probably should enforce completeness of dotted-decimal addresses. +

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ttodata.3.html b/doc/manpage.d/ipsec_ttodata.3.html new file mode 100644 index 000000000..960392fe0 --- /dev/null +++ b/doc/manpage.d/ipsec_ttodata.3.html @@ -0,0 +1,439 @@ +Content-type: text/html + +Manpage of IPSEC_TTODATA + +

IPSEC_TTODATA

+Section: C Library Functions (3)
Updated: 16 August 2003
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttodata, datatot - convert binary data bytes from and to text formats +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttodata(const char *src, size_t srclen, + +
+  +int base, char *dst, size_t dstlen, size_t *lenp); + +
+ +const char *ttodatav(const char *src, size_t srclen, + +
+  +int base, char *dst, size_t dstlen, size_t *lenp, + +
+  +char *errp, size_t errlen, int flags); + +
+ +size_t datatot(const char *src, size_t srclen, + +
+  +int format, char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttodata, + +ttodatav, + +and +datatot + +convert arbitrary binary data (e.g. encryption or authentication keys) +from and to more-or-less human-readable text formats. +

+ +Currently supported formats are hexadecimal, base64, and characters. +

+ +A hexadecimal text value begins with a +0x + +(or +0X) + +prefix and continues with two-digit groups +of hexadecimal digits (0-9, and a-f or A-F), +each group encoding the value of one binary byte, high-order digit first. +A single +_ + +(underscore) +between consecutive groups is ignored, permitting punctuation to improve +readability; doing this every eight digits seems about right. +

+ +A base64 text value begins with a +0s + +(or +0S) + +prefix +and continues with four-digit groups of base64 digits (A-Z, a-z, 0-9, +, and /), +each group encoding the value of three binary bytes as described in +section 6.8 of RFC 2045. +If +flags + +has the +TTODATAV_IGNORESPACE + +bit on, blanks are ignore (after the prefix). +Note that the last one or two digits of a base64 group can be += + +to indicate that fewer than three binary bytes are encoded. +

+ +A character text value begins with a +0t + +(or +0T) + +prefix +and continues with text characters, each being the value of one binary byte. +

+ +All these functions basically copy data from +src + +(whose size is specified by +srclen) + +to +dst + +(whose size is specified by +dstlen), + +doing the conversion en route. +If the result will not fit in +dst, + +it is truncated; +under no circumstances are more than +dstlen + +bytes of result written to +dst. + +Dstlen + +can be zero, in which case +dst + +need not be valid and no result bytes are written at all. +

+ +The +base + +parameter of +ttodata + +and +ttodatav + +specifies what format the input is in; +normally it should be +0 + +to signify that this gets figured out from the prefix. +Values of +16, + +64, + +and +256 + +respectively signify hexadecimal, base64, and character-text formats +without prefixes. +

+ +The +format + +parameter of +datatot, + +a single character used as a type code, +specifies which text format is wanted. +The value +0 + +(not ASCII +'0', + +but a zero value) specifies a reasonable default. +Other currently-supported values are: +

+
+
'x' + +
+continuous lower-case hexadecimal with a +0x + +prefix +
'h' + +
+lower-case hexadecimal with a +0x + +prefix and a +_ + +every eight digits +
':' + +
+lower-case hexadecimal with no prefix and a +: + +(colon) every two digits +
16 + +
+lower-case hexadecimal with no prefix or +_ + +
's' + +
+continuous base64 with a +0s + +prefix +
64 + +
+continuous base64 with no prefix +
+
+ +

+ +The default format is currently +'h'. + +

+ +Ttodata + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +On success, +if and only if +lenp + +is non-NULL, +*lenp + +is set to the number of bytes required to contain the full untruncated result. +It is the caller's responsibility to check this against +dstlen + +to determine whether he has obtained a complete result. +The +*lenp + +value is correct even if +dstlen + +is zero, which offers a way to determine how much space would be needed +before having to allocate any. +

+ +Ttodatav + +is just like +ttodata + +except that in certain cases, +if +errp + +is non-NULL, +the buffer pointed to by +errp + +(whose length is given by +errlen) + +is used to hold a more detailed error message. +The return value is NULL for success, +and is either +errp + +or a pointer to a string literal for failure. +If the size of the error-message buffer is +inadequate for the desired message, +ttodatav + +will fall back on returning a pointer to a literal string instead. +The +freeswan.h + +header file defines a constant +TTODATAV_BUF + +which is the size of a buffer large enough for worst-case results. +

+ +The normal return value of +datatot + +is the number of bytes required +to contain the full untruncated result. +It is the caller's responsibility to check this against +dstlen + +to determine whether he has obtained a complete result. +The return value is correct even if +dstlen + +is zero, which offers a way to determine how much space would be needed +before having to allocate any. +A return value of +0 + +signals a fatal error of some kind +(see DIAGNOSTICS). +

+ +A zero value for +srclen + +in +ttodata + +(but not +datatot!) + +is synonymous with +strlen(src). + +A non-zero +srclen + +in +ttodata + +must not include the terminating NUL. +

+ +Unless +dstlen + +is zero, +the result supplied by +datatot + +is always NUL-terminated, +and its needed-size return value includes space for the terminating NUL. +

+ +Several obsolete variants of these functions +(atodata, + +datatoa, + +atobytes, + +and +bytestoa) + +are temporarily also supported. +  +

SEE ALSO

+ +sprintf(3), ipsec_atoaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttodata + +and +ttodatav + +are: +unknown characters in the input; +unknown or missing prefix; +unknown base; +incomplete digit group; +non-zero padding in a base64 less-than-three-bytes digit group; +zero-length input. +

+ +Fatal errors in +datatot + +are: +unknown format code; +zero-length input. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Datatot + +should have a format code to produce character-text output. +

+ +The +0s + +and +0t + +prefixes are the author's inventions and are not a standard +of any kind. +They have been chosen to avoid collisions with existing practice +(some C implementations use +0b + +for binary) +and possible confusion with unprefixed hexadecimal. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ttosa.3.html b/doc/manpage.d/ipsec_ttosa.3.html new file mode 100644 index 000000000..1e457fc24 --- /dev/null +++ b/doc/manpage.d/ipsec_ttosa.3.html @@ -0,0 +1,453 @@ +Content-type: text/html + +Manpage of IPSEC_TTOSA + +

IPSEC_TTOSA

+Section: C Library Functions (3)
Updated: 26 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttosa, satot - convert IPsec Security Association IDs to and from text +
+ +ipsec initsaid - initialize an SA ID +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+typedef struct { + +
+  +ip_address dst; + +
+  +ipsec_spi_t spi; + +
+  +int proto; + +
+ +} ip_said; + +

+const char *ttosa(const char *src, size_t srclen, + +
+  +ip_said *sa); + +
+ +size_t satot(const ip_said *sa, int format, + +
+  +char *dst, size_t dstlen); + +
+ +void initsaid(const ip_address *addr, ipsec_spi_t spi, + +
+  +int proto, ip_said *dst); + +  +

DESCRIPTION

+ +Ttosa + +converts an ASCII Security Association (SA) specifier into an +ip_said + +structure (containing +a destination-host address +in network byte order, +an SPI number in network byte order, and +a protocol code). +Satot + +does the reverse conversion, back to a text SA specifier. +Initsaid + +initializes an +ip_said + +from separate items of information. +

+ +An SA is specified in text with a mail-like syntax, e.g. +esp.5a7@1.2.3.4. + +An SA specifier contains +a protocol prefix (currently +ah, + +esp, + +tun, + +comp, + +or +int), + +a single character indicating the address family +(. + +for IPv4, +: + +for IPv6), +an unsigned integer SPI number in hexadecimal (with no +0x + +prefix), +and an IP address. +The IP address can be any form accepted by +ipsec_ttoaddr(3), + +e.g. dotted-decimal IPv4 address, +colon-hex IPv6 address, +or DNS name. +

+ +As a special case, the SA specifier +%passthrough4 + +or +%passthrough6 + +signifies the special SA used to indicate that packets should be +passed through unaltered. +(At present, these are synonyms for +tun.0@0.0.0.0 + +and +tun:0@:: + +respectively, +but that is subject to change without notice.) +%passthrough + +is a historical synonym for +%passthrough4. + +These forms are known to both +ttosa + +and +satot, + +so the internal representation is never visible. +

+ +Similarly, the SA specifiers +%pass, + +%drop, + +%reject, + +%hold, + +%trap, + +and +%trapsubnet + +signify special ``magic'' SAs used to indicate that packets should be +passed, dropped, rejected (dropped with ICMP notification), +held, +and trapped (sent up to +ipsec_pluto(8), + +with either of two forms of +%hold + +automatically installed) +respectively. +These forms too are known to both routines, +so the internal representation of the magic SAs should never be visible. +

+ +The +<freeswan.h> + +header file supplies the +ip_said + +structure, as well as a data type +ipsec_spi_t + +which is an unsigned 32-bit integer. +(There is no consistency between kernel and user on what such a type +is called, hence the header hides the differences.) +

+ +The protocol code uses the same numbers that IP does. +For user convenience, given the difficulty in acquiring the exact set of +protocol names used by the kernel, +<freeswan.h> + +defines the names +SA_ESP, + +SA_AH, + +SA_IPIP, + +and +SA_COMP + +to have the same values as the kernel names +IPPROTO_ESP, + +IPPROTO_AH, + +IPPROTO_IPIP, + +and +IPPROTO_COMP. + +

+ +<freeswan.h> + +also defines +SA_INT + +to have the value +61 + +(reserved by IANA for ``any host internal protocol'') +and +SPI_PASS, + +SPI_DROP, + +SPI_REJECT, + +SPI_HOLD, + +and +SPI_TRAP + +to have the values 256-260 (in host byte order) respectively. +These are used in constructing the magic SAs +(which always have address +0.0.0.0). + +

+ +If +satot + +encounters an unknown protocol code, e.g. 77, +it yields output using a prefix +showing the code numerically, e.g. ``unk77''. +This form is +not + +recognized by +ttosa. + +

+ +The +srclen + +parameter of +ttosa + +specifies the length of the string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +dstlen + +parameter of +satot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +<freeswan.h> + +header file defines a constant, +SATOT_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +satot + +specifies what format is to be used for the conversion. +The value +0 + +(not the ASCII character +'0', + +but a zero value) +specifies a reasonable default +(currently +lowercase protocol prefix, lowercase hexadecimal SPI, +dotted-decimal or colon-hex address). +The value +'f' + +is similar except that the SPI is padded with +0s + +to a fixed 32-bit width, to ease aligning displayed tables. +

+ +Ttosa + +returns +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Satot + +returns +0 + +for a failure, and otherwise +always returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +

+ +There is also, temporarily, support for some obsolete +forms of SA specifier which lack the address-family indicator. +  +

SEE ALSO

+ +ipsec_ttoul(3), ipsec_ttoaddr(3), ipsec_samesaid(3), inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttosa + +are: +empty input; +input too small to be a legal SA specifier; +no +@ + +in input; +unknown protocol prefix; +conversion error in +ttoul + +or +ttoaddr. + +

+ +Fatal errors in +satot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttosa( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ttosubnet.3.html b/doc/manpage.d/ipsec_ttosubnet.3.html new file mode 100644 index 000000000..199937a35 --- /dev/null +++ b/doc/manpage.d/ipsec_ttosubnet.3.html @@ -0,0 +1,569 @@ +Content-type: text/html + +Manpage of IPSEC_TTOADDR + +

IPSEC_TTOADDR

+Section: C Library Functions (3)
Updated: 28 Sept 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoaddr, tnatoaddr, addrtot - convert Internet addresses to and from text +
+ +ipsec ttosubnet, subnettot - convert subnet/mask text form to and from addresses +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +const char *tnatoaddr(const char *src, size_t srclen, + +
+  +int af, ip_address *addr); + +
+ +size_t addrtot(const ip_address *addr, int format, + +
+  +char *dst, size_t dstlen); + +

+const char *ttosubnet(const char *src, size_t srclen, + +
+  +int af, ip_subnet *dst); + +
+ +size_t subnettot(const ip_subnet *sub, int format, + +
+  +char *dst, size_t dstlen); + +  +

DESCRIPTION

+ +Ttoaddr + +converts a text-string name or numeric address into a binary address +(in network byte order). +Tnatoaddr + +does the same conversion, +but the only text forms it accepts are +the ``official'' forms of +numeric address (dotted-decimal for IPv4, colon-hex for IPv6). +Addrtot + +does the reverse conversion, from binary address back to a text form. +Ttosubnet + +and +subnettot + +do likewise for the ``address/mask'' form used to write a +specification of a subnet. +

+ +An IPv4 address is specified in text as a +dotted-decimal address (e.g. +1.2.3.4), + +an eight-digit network-order hexadecimal number with the usual C prefix (e.g. +0x01020304, + +which is synonymous with +1.2.3.4), + +an eight-digit host-order hexadecimal number with a +0h + +prefix (e.g. +0h01020304, + +which is synonymous with +1.2.3.4 + +on a big-endian host and +4.3.2.1 + +on a little-endian host), +a DNS name to be looked up via +gethostbyname(3), + +or an old-style network name to be looked up via +getnetbyname(3). + +

+ +A dotted-decimal address may be incomplete, in which case +text-to-binary conversion implicitly appends +as many instances of +.0 + +as necessary to bring it up to four components. +The components of a dotted-decimal address are always taken as +decimal, and leading zeros are ignored. +For example, +10 + +is synonymous with +10.0.0.0, + +and +128.009.000.032 + +is synonymous with +128.9.0.32 + +(the latter example is verbatim from RFC 1166). +The result of applying +addrtot + +to an IPv4 address is always complete and does not contain leading zeros. +

+ +Use of hexadecimal addresses is +strongly + +discouraged; + +they are included only to save hassles when dealing with +the handful of perverted programs which already print +network addresses in hexadecimal. +

+ +An IPv6 address is specified in text with +colon-hex notation (e.g. +0:56:78ab:22:33:44:55:66), + +colon-hex with +:: + +abbreviating at most one subsequence of multiple zeros (e.g. +99:ab::54:068, + +which is synonymous with +99:ab:0:0:0:0:54:68), + +or a DNS name to be looked up via +gethostbyname(3). + +The result of applying +addrtot + +to an IPv6 address will use +:: + +abbreviation if possible, +and will not contain leading zeros. +

+ +The letters in hexadecimal +may be uppercase or lowercase or any mixture thereof. +

+ +DNS names may be complete (optionally terminated with a ``.'') +or incomplete, and are looked up as specified by local system configuration +(see +resolver(5)). + +The +h_addr + +value returned by +gethostbyname2(3) + +is used, +so with current DNS implementations, +the result when the name corresponds to more than one address is +difficult to predict. +IPv4 name lookup resorts to +getnetbyname(3) + +only if +gethostbyname2(3) + +fails. +

+ +A subnet specification is of the form network/mask. +The +network + +and +mask + +can be any form acceptable to +ttoaddr. + +In addition, and preferably, the +mask + +can be a decimal integer (leading zeros ignored) giving a bit count, +in which case +it stands for a mask with that number of high bits on and all others off +(e.g., +24 + +in IPv4 means +255.255.255.0). + +In any case, the mask must be contiguous +(a sequence of high bits on and all remaining low bits off). +As a special case, the subnet specification +%default + +is a synonym for +0.0.0.0/0 + +or +::/0 + +in IPv4 or IPv6 respectively. +

+ +Ttosubnet + +ANDs the mask with the address before returning, +so that any non-network bits in the address are turned off +(e.g., +10.1.2.3/24 + +is synonymous with +10.1.2.0/24). + +Subnettot + +always generates the decimal-integer-bit-count +form of the mask, +with no leading zeros. +

+ +The +srclen + +parameter of +ttoaddr + +and +ttosubnet + +specifies the length of the text string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +af + +parameter of +ttoaddr + +and +ttosubnet + +specifies the address family of interest. +It should be either +AF_INET + +or +AF_INET6. + +

+ +The +dstlen + +parameter of +addrtot + +and +subnettot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines constants, +ADDRTOT_BUF + +and +SUBNETTOT_BUF, + +which are the sizes of buffers just large enough for worst-case results. +

+ +The +format + +parameter of +addrtot + +and +subnettot + +specifies what format is to be used for the conversion. +The value +0 + +(not the character +'0', + +but a zero value) +specifies a reasonable default, +and is in fact the only format currently available in +subnettot. + +Addrtot + +also accepts format values +'r' + +(signifying a text form suitable for DNS reverse lookups, +e.g. +4.3.2.1.IN-ADDR.ARPA. + +for IPv4 and +RFC 2874 format for IPv6), +and +'R' + +(signifying an alternate reverse-lookup form, +an error for IPv4 and RFC 1886 format for IPv6). +Reverse-lookup names always end with a ``.''. +

+ +The text-to-binary functions return NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +The binary-to-text functions return +0 + +for a failure, and otherwise +always return the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +inet(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoaddr + +are: +empty input; +unknown address family; +attempt to allocate temporary storage for a very long name failed; +name lookup failed; +syntax error in dotted-decimal or colon-hex form; +dotted-decimal or colon-hex component too large. +

+ +Fatal errors in +ttosubnet + +are: +no +/ + +in +src; + +ttoaddr + +error in conversion of +network + +or +mask; + +bit-count mask too big; +mask non-contiguous. +

+ +Fatal errors in +addrtot + +and +subnettot + +are: +unknown format. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +The interpretation of incomplete dotted-decimal addresses +(e.g. +10/24 + +means +10.0.0.0/24) + +differs from that of some older conversion +functions, e.g. those of +inet(3). + +The behavior of the older functions has never been +particularly consistent or particularly useful. +

+ +Ignoring leading zeros in dotted-decimal components and bit counts +is arguably the most useful behavior in this application, +but it might occasionally cause confusion with the historical use of leading +zeros to denote octal numbers. +

+ +Ttoaddr + +does not support the mixed colon-hex-dotted-decimal +convention used to embed an IPv4 address in an IPv6 address. +

+ +Addrtot + +always uses the +:: + +abbreviation (which can appear only once in an address) for the +first + +sequence of multiple zeros in an IPv6 address. +One can construct addresses (unlikely ones) in which this is suboptimal. +

+ +Addrtot + +'r' + +conversion of an IPv6 address uses lowercase hexadecimal, +not the uppercase used in RFC 2874's examples. +It takes careful reading of RFCs 2874, 2673, and 2234 to realize +that lowercase is technically legitimate here, +and there may be software which botches this +and hence would have trouble with lowercase hex. +

+ +Possibly +subnettot + +ought to recognize the +%default + +case and generate that string as its output. +Currently it doesn't. +

+ +It is barely possible that somebody, somewhere, +might have a legitimate use for non-contiguous subnet masks. +

+ +Getnetbyname(3) + +is a historical dreg. +

+ +Tnatoaddr + +probably should enforce completeness of dotted-decimal addresses. +

+ +The restriction of text-to-binary error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The text-to-binary error-reporting convention lends itself +to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoaddr( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ttoul.3.html b/doc/manpage.d/ipsec_ttoul.3.html new file mode 100644 index 000000000..b722dcc13 --- /dev/null +++ b/doc/manpage.d/ipsec_ttoul.3.html @@ -0,0 +1,310 @@ +Content-type: text/html + +Manpage of IPSEC_TTOUL + +

IPSEC_TTOUL

+Section: C Library Functions (3)
Updated: 16 Aug 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoul, ultot - convert unsigned-long numbers to and from text +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoul(const char *src, size_t srclen, + +
+  +int base, unsigned long *n); + +
+ +size_t ultot(unsigned long n, int format, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +Ttoul + +converts a text-string number into a binary +unsigned long + +value. +Ultot + +does the reverse conversion, back to a text version. +

+ +Numbers are specified in text as +decimal (e.g. +123), + +octal with a leading zero (e.g. +012, + +which has value 10), +or hexadecimal with a leading +0x + +(e.g. +0x1f, + +which has value 31) +in either upper or lower case. +

+ +The +srclen + +parameter of +ttoul + +specifies the length of the string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +base + +parameter of +ttoul + +can be +8, + +10, + +or +16, + +in which case the number supplied is assumed to be of that form +(and in the case of +16, + +to lack any +0x + +prefix). +It can also be +0, + +in which case the number is examined for a leading zero +or a leading +0x + +to determine its base. +

+ +The +dstlen + +parameter of +ultot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +ULTOT_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +ultot + +must be one of: +

+
+
'o'
+octal conversion with leading +0 + +
 8
+octal conversion with no leading +0 + +
'd'
+decimal conversion +
10
+same as +d + +
'x'
+hexadecimal conversion, including leading +0x + +
16
+hexadecimal conversion with no leading +0x + +
17
+like +16 + +except padded on left with +0s + +to eight digits (full width of a 32-bit number) +
+
+ +

+ +Ttoul + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Ultot + +returns +0 + +for a failure, and otherwise +returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL +(it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred). +  +

SEE ALSO

+ +atol(3), strtoul(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoul + +are: +empty input; +unknown +base; + +non-digit character found; +number too large for an +unsigned long. + +

+ +Fatal errors in +ultot + +are: +unknown +format. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Conversion of +0 + +with format +o + +yields +00. + +

+ +Ultot + +format +17 + +is a bit of a kludge. +

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoul( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ultoa.3.html b/doc/manpage.d/ipsec_ultoa.3.html new file mode 100644 index 000000000..7669dce52 --- /dev/null +++ b/doc/manpage.d/ipsec_ultoa.3.html @@ -0,0 +1,266 @@ +Content-type: text/html + +Manpage of IPSEC_ATOUL + +

IPSEC_ATOUL

+Section: C Library Functions (3)
Updated: 11 June 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec atoul, ultoa - convert unsigned-long numbers to and from ASCII +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *atoul(const char *src, size_t srclen, + +
+  +int base, unsigned long *n); + +
+ +size_t ultoa(unsigned long n, int base, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +These functions are obsolete; see +ipsec_ttoul(3) + +for their replacements. +

+ +Atoul + +converts an ASCII number into a binary +unsigned long + +value. +Ultoa + +does the reverse conversion, back to an ASCII version. +

+ +Numbers are specified in ASCII as +decimal (e.g. +123), + +octal with a leading zero (e.g. +012, + +which has value 10), +or hexadecimal with a leading +0x + +(e.g. +0x1f, + +which has value 31) +in either upper or lower case. +

+ +The +srclen + +parameter of +atoul + +specifies the length of the ASCII string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +base + +parameter of +atoul + +can be +8, + +10, + +or +16, + +in which case the number supplied is assumed to be of that form +(and in the case of +16, + +to lack any +0x + +prefix). +It can also be +0, + +in which case the number is examined for a leading zero +or a leading +0x + +to determine its base, +or +13 + +(halfway between 10 and 16), +which has the same effect as +0 + +except that a non-hexadecimal +number is considered decimal regardless of any leading zero. +

+ +The +dstlen + +parameter of +ultoa + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +

+ +The +base + +parameter of +ultoa + +must be +8, + +10, + +or +16. + +

+ +Atoul + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Ultoa + +returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL; +it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred. +  +

SEE ALSO

+ +atol(3), strtoul(3) +  +

DIAGNOSTICS

+ +Fatal errors in +atoul + +are: +empty input; +unknown +base; + +non-digit character found; +number too large for an +unsigned long. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +There is no provision for reporting an invalid +base + +parameter given to +ultoa. + +

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = atoul( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_ultot.3.html b/doc/manpage.d/ipsec_ultot.3.html new file mode 100644 index 000000000..b722dcc13 --- /dev/null +++ b/doc/manpage.d/ipsec_ultot.3.html @@ -0,0 +1,310 @@ +Content-type: text/html + +Manpage of IPSEC_TTOUL + +

IPSEC_TTOUL

+Section: C Library Functions (3)
Updated: 16 Aug 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ttoul, ultot - convert unsigned-long numbers to and from text +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ttoul(const char *src, size_t srclen, + +
+  +int base, unsigned long *n); + +
+ +size_t ultot(unsigned long n, int format, char *dst, + +
+  +size_t dstlen); + +  +

DESCRIPTION

+ +Ttoul + +converts a text-string number into a binary +unsigned long + +value. +Ultot + +does the reverse conversion, back to a text version. +

+ +Numbers are specified in text as +decimal (e.g. +123), + +octal with a leading zero (e.g. +012, + +which has value 10), +or hexadecimal with a leading +0x + +(e.g. +0x1f, + +which has value 31) +in either upper or lower case. +

+ +The +srclen + +parameter of +ttoul + +specifies the length of the string pointed to by +src; + +it is an error for there to be anything else +(e.g., a terminating NUL) within that length. +As a convenience for cases where an entire NUL-terminated string is +to be converted, +a +srclen + +value of +0 + +is taken to mean +strlen(src). + +

+ +The +base + +parameter of +ttoul + +can be +8, + +10, + +or +16, + +in which case the number supplied is assumed to be of that form +(and in the case of +16, + +to lack any +0x + +prefix). +It can also be +0, + +in which case the number is examined for a leading zero +or a leading +0x + +to determine its base. +

+ +The +dstlen + +parameter of +ultot + +specifies the size of the +dst + +parameter; +under no circumstances are more than +dstlen + +bytes written to +dst. + +A result which will not fit is truncated. +Dstlen + +can be zero, in which case +dst + +need not be valid and no result is written, +but the return value is unaffected; +in all other cases, the (possibly truncated) result is NUL-terminated. +The +freeswan.h + +header file defines a constant, +ULTOT_BUF, + +which is the size of a buffer just large enough for worst-case results. +

+ +The +format + +parameter of +ultot + +must be one of: +

+
+
'o'
+octal conversion with leading +0 + +
 8
+octal conversion with no leading +0 + +
'd'
+decimal conversion +
10
+same as +d + +
'x'
+hexadecimal conversion, including leading +0x + +
16
+hexadecimal conversion with no leading +0x + +
17
+like +16 + +except padded on left with +0s + +to eight digits (full width of a 32-bit number) +
+
+ +

+ +Ttoul + +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +Ultot + +returns +0 + +for a failure, and otherwise +returns the size of buffer which would +be needed to +accommodate the full conversion result, including terminating NUL +(it is the caller's responsibility to check this against the size of +the provided buffer to determine whether truncation has occurred). +  +

SEE ALSO

+ +atol(3), strtoul(3) +  +

DIAGNOSTICS

+ +Fatal errors in +ttoul + +are: +empty input; +unknown +base; + +non-digit character found; +number too large for an +unsigned long. + +

+ +Fatal errors in +ultot + +are: +unknown +format. + +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +  +

BUGS

+ +Conversion of +0 + +with format +o + +yields +00. + +

+ +Ultot + +format +17 + +is a bit of a kludge. +

+ +The restriction of error reports to literal strings +(so that callers don't need to worry about freeing them or copying them) +does limit the precision of error reporting. +

+ +The error-reporting convention lends itself to slightly obscure code, +because many readers will not think of NULL as signifying success. +A good way to make it clearer is to write something like: +

+ +

+
+const char *error;
+
+error = ttoul( /* ... */ );
+if (error != NULL) {
+        /* something went wrong */
+
+ +
+ +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_unspecaddr.3.html b/doc/manpage.d/ipsec_unspecaddr.3.html new file mode 100644 index 000000000..92f69d99c --- /dev/null +++ b/doc/manpage.d/ipsec_unspecaddr.3.html @@ -0,0 +1,166 @@ +Content-type: text/html + +Manpage of IPSEC_ANYADDR + +

IPSEC_ANYADDR

+Section: C Library Functions (3)
Updated: 8 Sept 2000
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec anyaddr - get "any" address +
+ +ipsec isanyaddr - test address for equality to "any" address +
+ +ipsec unspecaddr - get "unspecified" address +
+ +ipsec isunspecaddr - test address for equality to "unspecified" address +
+ +ipsec loopbackaddr - get loopback address +
+ +ipsec isloopbackaddr - test address for equality to loopback address +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *anyaddr(int af, ip_address *dst); + +
+ +int isanyaddr(const ip_address *src); + +
+ +const char *unspecaddr(int af, ip_address *dst); + +
+ +int isunspecaddr(const ip_address *src); + +
+ +const char *loopbackaddr(int af, ip_address *dst); + +
+ +int isloopbackaddr(const ip_address *src); + +  +

DESCRIPTION

+ +These functions fill in, and test for, special values of the +ip_address + +type. +

+ +Anyaddr + +fills in the destination +*dst + +with the ``any'' address of address family +af + +(normally +AF_INET + +or +AF_INET6). + +The IPv4 ``any'' address is the one embodied in the old +INADDR_ANY + +macro. +

+ +Isanyaddr + +returns +1 + +if the +src + +address equals the ``any'' address, +and +0 + +otherwise. +

+ +Similarly, +unspecaddr + +supplies, and +isunspecaddr + +tests for, +the ``unspecified'' address, +which may be the same as the ``any'' address. +

+ +Similarly, +loopbackaddr + +supplies, and +islookbackaddr + +tests for, +the loopback address. +

+ +Anyaddr, + +unspecaddr, + +and +loopbackaddr + +return +NULL + +for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +  +

SEE ALSO

+ +inet(3), ipsec_addrtot(3), ipsec_sameaddr(3) +  +

DIAGNOSTICS

+ +Fatal errors in the address-supplying functions are: +unknown address family. +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
DIAGNOSTICS
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_verify.8.html b/doc/manpage.d/ipsec_verify.8.html new file mode 100644 index 000000000..09d04894b --- /dev/null +++ b/doc/manpage.d/ipsec_verify.8.html @@ -0,0 +1,107 @@ +Content-type: text/html + +Manpage of IPSEC_VERIFY + +

IPSEC_VERIFY

+Section: Maintenance Commands (8)
Updated: 8 June 2002
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec verify - see if FreeSWAN has been installed correctly +  +

SYNOPSIS

+ +ipsec + +verify + +[ +--host + + name ] +  +

DESCRIPTION

+ +

+ +Invoked without argument, +verify + +examines the local system for a number of common system faults: +IPsec not in path, no secrets file generated, +pluto not running, and IPsec support not present in kernel +(or IPsec module not loaded). +If two or more interfaces are found, it performs checks relevant on an +IPsec gateway: whether IP forwarding is allowed, and if so, +whether MASQ or NAT rules are in play. +

+ +In addition, +verify + +performs checks relevant to Opportunistic Encryption. +It looks in forward DNS for a TXT record for the system's hostname, and +in reverse DNS for a TXT record for the system's IP addresses. +It checks whether the system has a public IP. +

+ +The +--host + +option causes +verify + +to look for a TXT record for +name + +in forward and reverse DNS. +  +

FILES

+ +
+/proc/net/ipsec_eroute
+/etc/ipsec.secrets
+
+ +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org> +by Michael Richardson. +  +

BUGS

+ +Verify + +does not check for +ipchains + +masquerading. +

+ +Verify + +does not look for TXT records for Opportunistic clients behind the system. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
FILES
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_version.3.html b/doc/manpage.d/ipsec_version.3.html new file mode 100644 index 000000000..bcad75a46 --- /dev/null +++ b/doc/manpage.d/ipsec_version.3.html @@ -0,0 +1,94 @@ +Content-type: text/html + +Manpage of IPSEC_VERSION + +

IPSEC_VERSION

+Section: C Library Functions (3)
Updated: 21 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ipsec_version_code - get IPsec version code +
+ +ipsec ipsec_version_string - get full IPsec version string +
+ +ipsec ipsec_copyright_notice - get IPsec copyright notice +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ipsec_version_code(void); + +
+ +const char *ipsec_version_string(void); + +
+ +const char **ipsec_copyright_notice(void); + +  +

DESCRIPTION

+ +These functions provide information on version numbering and copyright +of the Linux FreeS/WAN IPsec implementation. +

+ +Ipsec_version_code + +returns a pointer to a string constant +containing the current IPsec version code, +such as ``1.92'' or ``snap2001Nov19b''. +

+ +Ipsec_version_string + +returns a pointer to a string constant giving a full version identification, +consisting of the version code preceded by a prefix identifying the software, +e.g. ``Linux FreeS/WAN 1.92''. +

+ +Ipsec_copyright_notice + +returns a pointer to a vector of pointers, +terminated by a +NULL, + +which is the text of a suitable copyright notice. +Each pointer points to a string constant (possibly empty) which is one line +of the somewhat-verbose copyright notice. +The strings are NUL-terminated and do not contain a newline; +supplying suitable line termination for the output device is +the caller's responsibility. +  +

SEE ALSO

+ +ipsec(8) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_version.5.html b/doc/manpage.d/ipsec_version.5.html new file mode 100644 index 000000000..89bee0f97 --- /dev/null +++ b/doc/manpage.d/ipsec_version.5.html @@ -0,0 +1,103 @@ +Content-type: text/html + +Manpage of IPSEC_VERSION + +

IPSEC_VERSION

+Section: File Formats (5)
Updated: 29 Jun 2000
Index +Return to Main Contents
+ + + + +  +

NAME

+ +ipsec_version - lists KLIPS version information +  +

SYNOPSIS

+ +cat + +/proc/net/ipsec_version + +  +

DESCRIPTION

+ +/proc/net/ipsec_version + +is a read-only file which lists the currently running KLIPS version +information. +

+ +  +

EXAMPLES

+ +
+
FreeS/WAN version: 1.4 + +
+
+

+ +shows that the currently loaded +KLIPS + +is from +FreeS/WAN 1.4. + +

+ +  +

FILES

+ +/proc/net/ipsec_version +  +

SEE ALSO

+ +ipsec(8), ipsec_manual(8), ipsec_eroute(5), ipsec_spi(5), +ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_tncfg(8), ipsec_pf_key(5) +  +

HISTORY

+ +Written for the Linux FreeS/WAN project +<http://www.freeswan.org/> +by Richard Guy Briggs. + + + + + + + + + + + + + + + + + + + +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
EXAMPLES
+
FILES
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_version_code.3.html b/doc/manpage.d/ipsec_version_code.3.html new file mode 100644 index 000000000..bcad75a46 --- /dev/null +++ b/doc/manpage.d/ipsec_version_code.3.html @@ -0,0 +1,94 @@ +Content-type: text/html + +Manpage of IPSEC_VERSION + +

IPSEC_VERSION

+Section: C Library Functions (3)
Updated: 21 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ipsec_version_code - get IPsec version code +
+ +ipsec ipsec_version_string - get full IPsec version string +
+ +ipsec ipsec_copyright_notice - get IPsec copyright notice +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ipsec_version_code(void); + +
+ +const char *ipsec_version_string(void); + +
+ +const char **ipsec_copyright_notice(void); + +  +

DESCRIPTION

+ +These functions provide information on version numbering and copyright +of the Linux FreeS/WAN IPsec implementation. +

+ +Ipsec_version_code + +returns a pointer to a string constant +containing the current IPsec version code, +such as ``1.92'' or ``snap2001Nov19b''. +

+ +Ipsec_version_string + +returns a pointer to a string constant giving a full version identification, +consisting of the version code preceded by a prefix identifying the software, +e.g. ``Linux FreeS/WAN 1.92''. +

+ +Ipsec_copyright_notice + +returns a pointer to a vector of pointers, +terminated by a +NULL, + +which is the text of a suitable copyright notice. +Each pointer points to a string constant (possibly empty) which is one line +of the somewhat-verbose copyright notice. +The strings are NUL-terminated and do not contain a newline; +supplying suitable line termination for the output device is +the caller's responsibility. +  +

SEE ALSO

+ +ipsec(8) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_version_string.3.html b/doc/manpage.d/ipsec_version_string.3.html new file mode 100644 index 000000000..bcad75a46 --- /dev/null +++ b/doc/manpage.d/ipsec_version_string.3.html @@ -0,0 +1,94 @@ +Content-type: text/html + +Manpage of IPSEC_VERSION + +

IPSEC_VERSION

+Section: C Library Functions (3)
Updated: 21 Nov 2001
Index +Return to Main Contents
+ + +  +

NAME

+ +ipsec ipsec_version_code - get IPsec version code +
+ +ipsec ipsec_version_string - get full IPsec version string +
+ +ipsec ipsec_copyright_notice - get IPsec copyright notice +  +

SYNOPSIS

+ +#include <freeswan.h> + +

+const char *ipsec_version_code(void); + +
+ +const char *ipsec_version_string(void); + +
+ +const char **ipsec_copyright_notice(void); + +  +

DESCRIPTION

+ +These functions provide information on version numbering and copyright +of the Linux FreeS/WAN IPsec implementation. +

+ +Ipsec_version_code + +returns a pointer to a string constant +containing the current IPsec version code, +such as ``1.92'' or ``snap2001Nov19b''. +

+ +Ipsec_version_string + +returns a pointer to a string constant giving a full version identification, +consisting of the version code preceded by a prefix identifying the software, +e.g. ``Linux FreeS/WAN 1.92''. +

+ +Ipsec_copyright_notice + +returns a pointer to a vector of pointers, +terminated by a +NULL, + +which is the text of a suitable copyright notice. +Each pointer points to a string constant (possibly empty) which is one line +of the somewhat-verbose copyright notice. +The strings are NUL-terminated and do not contain a newline; +supplying suitable line termination for the output device is +the caller's responsibility. +  +

SEE ALSO

+ +ipsec(8) +  +

HISTORY

+ +Written for the FreeS/WAN project by Henry Spencer. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
SEE ALSO
+
HISTORY
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + diff --git a/doc/manpage.d/ipsec_whack.8.html b/doc/manpage.d/ipsec_whack.8.html new file mode 100644 index 000000000..2e2ce4c2f --- /dev/null +++ b/doc/manpage.d/ipsec_whack.8.html @@ -0,0 +1,1824 @@ +Content-type: text/html + +Manpage of IPSEC_PLUTO + +

IPSEC_PLUTO

+Section: Maintenance Commands (8)
Updated: 28 March 1999
Index +Return to Main Contents
+ +  +

NAME

+ +ipsec pluto - IPsec IKE keying daemon +
+ +ipsec whack - control interface for IPSEC keying daemon +  +

SYNOPSIS

+ + + +
+
+ +
ipsec pluto +[--help] +[--version] +[--optionsfrom filename] +[--nofork] +[--stderrlog] +[--noklips] +[--uniqueids] +[--interface interfacename] +[--ikeport portnumber] +[--ctlbase path] +[--secretsfile secrets-file] +[--adns pathname] +[--lwdnsq pathname] +[--perpeerlog] +[--perpeerlogbase dirname] +[--debug-none] +[--debug-all] +[--debug-raw] +[--debug-crypt] +[--debug-parsing] +[--debug-emitting] +[--debug-control] +[--debug-lifecycle] +[--debug-klips] +[--debug-dns] +[--debug-oppo] +[--debug-private] +
+ +
ipsec whack +[--help] +[--version] +
+ +
ipsec whack +--name connection-name +
+ +[--id id] [--host ip-address] +[--ikeport port-number] +[--nexthop ip-address] +[--client subnet] +[--dnskeyondemand] +[--updown updown] +
+ +--to +
+ +[--id id] +[--host ip-address] +[--ikeport port-number] +[--nexthop ip-address] +[--client subnet] +[--dnskeyondemand] +[--updown updown] +
+ +[--psk] +[--rsasig] +[--encrypt] +[--authenticate] +[--compress] +[--tunnel] +[--pfs] +[--disablearrivalcheck] +[--ipv4] +[--ipv6] +[--tunnelipv4] +[--tunnelipv6] +[--ikelifetime seconds] +[--ipseclifetime seconds] +[--rekeymargin seconds] +[--rekeyfuzz percentage] +[--keyingtries count] +[--dontrekey] +[--delete] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--keyid id +[--addkey] +[--pubkeyrsa key] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--myid id +
+ +
ipsec whack +--listen|--unlisten +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--route|--unroute +--name connection-name +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--initiate|--terminate +--name connection-name +[--asynchronous] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +[--tunnelipv4] +[--tunnelipv6] +--oppohere ip-address +--oppothere ip-address +
+ +
ipsec whack +--delete +--name connection-name +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--deletestate state-number +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +[--name connection-name] +[--debug-none] +[--debug-all] +[--debug-raw] +[--debug-crypt] +[--debug-parsing] +[--debug-emitting] +[--debug-control] +[--debug-lifecycle] +[--debug-klips] +[--debug-dns] +[--debug-oppo] +[--debug-private] +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--status +[--ctlbase path] +[--optionsfrom filename] +[--label string] +
+ +
ipsec whack +--shutdown +[--ctlbase path] +[--optionsfrom filename] +[--label string] + + + +
+  +

DESCRIPTION

+ +pluto + +is an IKE (``IPsec Key Exchange'') daemon. +whack + +is an auxiliary program to allow requests to be made to a running +pluto. + +

+ +pluto + +is used to automatically build shared ``security associations'' on a +system that has IPsec, the secure IP protocol. +In other words, +pluto + +can eliminate much of the work of manual keying. +The actual +secure transmission of packets is the responsibility of other parts of +the system (see +KLIPS, + +the companion implementation of IPsec). +ipsec_auto(8) provides a more convenient interface to +pluto and whack. +  +

IKE's Job

+ +

+ +A Security Association (SA) is an agreement between two network nodes on +how to process certain traffic between them. This processing involves +encapsulation, authentication, encryption, or compression. +

+ +IKE can be deployed on a network node to negotiate Security +Associations for that node. These IKE implementations can only +negotiate with other IKE implementations, so IKE must be on each node +that is to be an endpoint of an IKE-negotiated Security Association. +No other nodes need to be running IKE. +

+ +An IKE instance (i.e. an IKE implementation on a particular network +node) communicates with another IKE instance using UDP IP packets, so +there must be a route between the nodes in each direction. +

+ +The negotiation of Security Associations requires a number of choices +that involve tradeoffs between security, convenience, trust, and +efficiency. These are policy issues and are normally specified to the +IKE instance by the system administrator. +

+ +IKE deals with two kinds of Security Associations. The first part of +a negotiation between IKE instances is to build an ISAKMP SA. An +ISAKMP SA is used to protect communication between the two IKEs. +IPsec SAs can then be built by the IKEs - these are used to carry +protected IP traffic between the systems. +

+ +The negotiation of the ISAKMP SA is known as Phase 1. In theory, +Phase 1 can be accomplished by a couple of different exchange types, +but we only implement one called Main Mode (we don't implement +Aggressive Mode). +

+ +Any negotiation under the protection of an ISAKMP SA, including the +negotiation of IPsec SAs, is part of Phase 2. The exchange type +that we use to negotiate an IPsec SA is called Quick Mode. +

+ +IKE instances must be able to authenticate each other as part of their +negotiation of an ISAKMP SA. This can be done by several mechanisms +described in the draft standards. +

+ +IKE negotiation can be initiated by any instance with any other. If +both can find an agreeable set of characteristics for a Security +Association, and both recognize each others authenticity, they can set +up a Security Association. The standards do not specify what causes +an IKE instance to initiate a negotiation. +

+ +In summary, an IKE instance is prepared to automate the management of +Security Associations in an IPsec environment, but a number of issues +are considered policy and are left in the system administrator's hands. +  +

Pluto

+ +

+ +pluto is an implementation of IKE. It runs as a daemon on a network +node. Currently, this network node must be a LINUX system running the +KLIPS implementation of IPsec. +

+ +pluto only implements a subset of IKE. This is enough for it to +interoperate with other instances of pluto, and many other IKE +implementations. We are working on implementing more of IKE. +

+ +The policy for acceptable characteristics for Security Associations is +mostly hardwired into the code of pluto (spdb.c). Eventually +this will be moved into a security policy database with reasonable +expressive power and more convenience. +

+ +pluto uses shared secrets or RSA signatures to authenticate +peers with whom it is negotiating. +

+ +pluto initiates negotiation of a Security Association when it is +manually prodded: the program whack is run to trigger this. +It will also initiate a negotiation when KLIPS traps an outbound packet +for Opportunistic Encryption. +

+ +pluto implements ISAKMP SAs itself. After it has negotiated the +characteristics of an IPsec SA, it directs KLIPS to implement it. +It also invokes a script to adjust any firewall and issue route(8) +commands to direct IP packets through KLIPS. +

+ +When pluto shuts down, it closes all Security Associations. +  +

Before Running Pluto

+ +

+ +pluto runs as a daemon with userid root. Before running it, a few +things must be set up. +

+ +pluto requires KLIPS, the FreeS/WAN implementation of IPsec. +All of the components of KLIPS and pluto should be installed. +

+ +pluto supports multiple public networks (that is, networks +that are considered insecure and thus need to have their traffic +encrypted or authenticated). It discovers the +public interfaces to use by looking at all interfaces that are +configured (the --interface option can be used to limit +the interfaces considered). +It does this only when whack tells it to --listen, +so the interfaces must be configured by then. Each interface with a name of the form +ipsec[0-9] is taken as a KLIPS virtual public interface. +Another network interface with the same IP address (there should be only +one) is taken as the corresponding real public +interface. ifconfig(8) with the -a flag will show +the name and status of each network interface. +

+ +pluto requires a database of preshared secrets and RSA private keys. +This is described in the +ipsec.secrets(5). + +pluto is told of RSA public keys via whack commands. +If the connection is Opportunistic, and no RSA public key is known, +pluto will attempt to fetch RSA keys using the Domain Name System. +  +

Setting up KLIPS for pluto

+ +

+ +The most basic network topology that pluto supports has two security +gateways negotiating on behalf of client subnets. The diagram of RGB's +testbed is a good example (see klips/doc/rgb_setup.txt). +

+ +The file INSTALL in the base directory of this distribution +explains how to start setting up the whole system, including KLIPS. +

+ +Make sure that the security gateways have routes to each other. This +is usually covered by the default route, but may require issuing +route(8) + +commands. The route must go through a particular IP +interface (we will assume it is eth0, but it need not be). The +interface that connects the security gateway to its client must be a +different one. +

+ +It is necessary to issue a +ipsec_tncfg(8) + +command on each gateway. The required command is: +

+   ipsec tncfg --attach --virtual ipsec0 --physical eth0 +

+A command to set up the ipsec0 virtual interface will also need to be +run. It will have the same parameters as the command used to set up +the physical interface to which it has just been connected using +ipsec_tncfg(8). + +  +

ipsec.secrets file

+ +

+ +A pluto daemon and another IKE daemon (for example, another instance +of pluto) must convince each other that they are who they are supposed +to be before any negotiation can succeed. This authentication is +accomplished by using either secrets that have been shared beforehand +(manually) or by using RSA signatures. There are other techniques, +but they have not been implemented in pluto. +

+ +The file /etc/ipsec.secrets is used to keep preshared secret keys +and RSA private keys for +authentication with other IKE daemons. For debugging, there is an +argument to the pluto command to use a different file. +This file is described in +ipsec.secrets(5). + +  +

Running Pluto

+ +

+ +To fire up the daemon, just type pluto (be sure to be running as +the superuser). +The default IKE port number is 500, the UDP port assigned by IANA for IKE Daemons. +pluto must be run by the superuser to be able to use the UDP 500 port. +

+ +pluto attempts to create a lockfile with the name +/var/run/pluto.pid. If the lockfile cannot be created, +pluto exits - this prevents multiple plutos from +competing Any ``leftover'' lockfile must be removed before +pluto will run. pluto writes its pid into this file so +that scripts can find it. This lock will not function properly if it +is on an NFS volume (but sharing locks on multiple machines doesn't +make sense anyway). +

+ +pluto then forks and the parent exits. This is the conventional +``daemon fork''. It can make debugging awkward, so there is an option +to suppress this fork. +

+ +All logging, including diagnostics, is sent to +syslog(3) + +with facility=authpriv; +it decides where to put these messages (possibly in /var/log/secure). +Since this too can make debugging awkward, there is an option to +steer logging to stderr. +

+ +If the --perpeerlog option is given, then pluto will open +a log file per connection. By default, this is in /var/log/pluto/peer, +in a subdirectory formed by turning all dot (.) [IPv4} or colon (:) +[IPv6] into slashes (/). +

+ +The base directory can be changed with the --perpeerlogbase. +

+ +Once pluto is started, it waits for requests from whack. +  +

Pluto's Internal State

+ +

+ +To understand how to use pluto, it is helpful to understand a little +about its internal state. Furthermore, the terminology is needed to decipher +some of the diagnostic messages. +

+ +The (potential) connection database describes attributes of a +connection. These include the IP addresses of the hosts and client +subnets and the security characteristics desired. pluto +requires this information (simply called a connection) before it can +respond to a request to build an SA. Each connection is given a name +when it is created, and all references are made using this name. +

+ +During the IKE exchange to build an SA, the information about the +negotiation is represented in a state object. Each state object +reflects how far the negotiation has reached. Once the negotiation is +complete and the SA established, the state object remains to represent +the SA. When the SA is terminated, the state object is discarded. +Each State object is given a serial number and this is used to refer +to the state objects in logged messages. +

+ +Each state object corresponds to a connection and can be thought of +as an instantiation of that connection. +At any particular time, there may be any number of state objects +corresponding to a particular connection. +Often there is one representing an ISAKMP SA and another representing +an IPsec SA. +

+ +KLIPS hooks into the routing code in a LINUX kernel. +Traffic to be processed by an IPsec SA must be directed through +KLIPS by routing commands. Furthermore, the processing to be +done is specified by ipsec eroute(8) commands. +pluto takes the responsibility of managing both of these special +kinds of routes. +

+ +Each connection may be routed, and must be while it has an IPsec SA. +The connection specifies the characteristics of the route: the +interface on this machine, the ``gateway'' (the nexthop), +and the peer's client subnet. Two +connections may not be simultaneously routed if they are for the same +peer's client subnet but use different interfaces or gateways +(pluto's logic does not reflect any advanced routing capabilities). +

+ +Each eroute is associated with the state object for an IPsec SA +because it has the particular characteristics of the SA. +Two eroutes conflict if they specify the identical local +and remote clients (unlike for routes, the local clients are +taken into account). +

+ +When pluto needs to install a route for a connection, +it must make sure that no conflicting route is in use. If another +connection has a conflicting route, that route will be taken down, as long +as there is no IPsec SA instantiating that connection. +If there is such an IPsec SA, the attempt to install a route will fail. +

+ +There is an exception. If pluto, as Responder, needs to install +a route to a fixed client subnet for a connection, and there is +already a conflicting route, then the SAs using the route are deleted +to make room for the new SAs. The rationale is that the new +connection is probably more current. The need for this usually is a +product of Road Warrior connections (these are explained later; they +cannot be used to initiate). +

+ +When pluto needs to install an eroute for an IPsec SA (for a +state object), first the state object's connection must be routed (if +this cannot be done, the eroute and SA will not be installed). +If a conflicting eroute is already in place for another connection, +the eroute and SA will not be installed (but note that the routing +exception mentioned above may have already deleted potentially conflicting SAs). +If another IPsec +SA for the same connection already has an eroute, all its outgoing traffic +is taken over by the new eroute. The incoming traffic will still be +processed. This characteristic is exploited during rekeying. +

+ +All of these routing characteristics are expected change when +KLIPS is modified to use the firewall hooks in the LINUX 2.4.x +kernel. +  +

Using Whack

+ +

+ +whack is used to command a running pluto. +whack uses a UNIX domain socket to speak to pluto +(by default, /var/pluto.ctl). +

+ +whack has an intricate argument syntax. +This syntax allows many different functions to be specified. +The help form shows the usage or version information. +The connection form gives pluto a description of a potential connection. +The public key form informs pluto of the RSA public key for a potential peer. +The delete form deletes a connection description and all SAs corresponding +to it. +The listen form tells pluto to start or stop listening on the public interfaces +for IKE requests from peers. +The route form tells pluto to set up routing for a connection; +the unroute form undoes this. +The initiate form tells pluto to negotiate an SA corresponding to a connection. +The terminate form tells pluto to remove all SAs corresponding to a connection, +including those being negotiated. +The status form displays the pluto's internal state. +The debug form tells pluto to change the selection of debugging output +``on the fly''. The shutdown form tells +pluto to shut down, deleting all SAs. +

+ +Most options are specific to one of the forms, and will be described +with that form. There are three options that apply to all forms. +

+
--ctlbase path
+path.ctl is used as the UNIX domain socket for talking +to pluto. +This option facilitates debugging. +
--optionsfrom filename
+adds the contents of the file to the argument list. +
--label string
+adds the string to all error messages generated by whack. +
+

+ +The help form of whack is self-explanatory. +

+
--help
+display the usage message. +
--version
+display the version of whack. +
+

+ +The connection form describes a potential connection to pluto. +pluto needs to know what connections can and should be negotiated. +When pluto is the initiator, it needs to know what to propose. +When pluto is the responder, it needs to know enough to decide whether +is is willing to set up the proposed connection. +

+ +The description of a potential connection can specify a large number +of details. Each connection has a unique name. This name will appear +in a updown shell command, so it should not contain punctuation +that would make the command ill-formed. +

+
--name connection-name
+
+

+ +The topology of +a connection is symmetric, so to save space here is half a picture: +

+   client_subnet<-->host:ikeport<-->nexthop<--- +

+A similar trick is used in the flags. The same flag names are used for +both ends. Those before the --to flag describe the left side +and those afterwards describe the right side. When pluto attempts +to use the connection, it decides whether it is the left side or the right +side of the connection, based on the IP numbers of its interfaces. +

+
--id id
+the identity of the end. Currently, this can be an IP address (specified +as dotted quad or as a Fully Qualified Domain Name, which will be resolved +immediately) or as a Fully Qualified Domain Name itself (prefixed by ``@'' +to signify that it should not be resolved), or as user@FQDN, or as the +magic value %myid. +Pluto only authenticates the identity, and does not use it for +addressing, so, for example, an IP address need not be the one to which +packets are to be sent. If the option is absent, the +identity defaults to the IP address specified by --host. +%myid allows the identity to be separately specified (by the pluto or whack option --myid +or by the ipsec.conf(5) config setup parameter myid). +Otherwise, pluto tries to guess what %myid should stand for: +the IP address of %defaultroute, if it is supported by a suitable TXT record in the reverse domain for that IP address, +or the system's hostname, if it is supported by a suitable TXT record in its forward domain. + +
--host ip-address
+
--host %any
+
--host %opportunistic
+the IP address of the end (generally the public interface). +If pluto is to act as a responder +for IKE negotiations initiated from unknown IP addresses (the +``Road Warrior'' case), the +IP address should be specified as %any (currently, +the obsolete notation 0.0.0.0 is also accepted for this). +If pluto is to opportunistically initiate the connection, +use %opportunistic +
--ikeport port-number
+the UDP port that IKE listens to on that host. The default is 500. +(pluto on this machine uses the port specified by its own command +line argument, so this only affects where pluto sends messages.) +
--nexthop ip-address
+where to route packets for the peer's client (presumably for the peer too, +but it will not be used for this). +When pluto installs an IPsec SA, it issues a route command. +It uses the nexthop as the gateway. +The default is the peer's IP address (this can be explicitly written as +%direct; the obsolete notation 0.0.0.0 is accepted). +This option is necessary if pluto's host's interface used for sending +packets to the peer is neither point-to-point nor directly connected to the +peer. +
--client subnet
+the subnet for which the IPsec traffic will be destined. If not specified, +the host will be the client. +The subnet can be specified in any of the forms supported by ipsec_atosubnet(3). +The general form is address/mask. The address can be either +a domain name or four decimal numbers (specifying octets) separated by dots. +The most convenient form of the mask is a decimal integer, specifying +the number of leading one bits in the mask. So, for example, 10.0.0.0/8 +would specify the class A network ``Net 10''. +
--dnskeyondemand]
+specifies that when an RSA public key is needed to authenticate this +host, and it isn't already known, fetch it from DNS. +
--updown updown
+specifies an external shell command to be run whenever pluto +brings up or down a connection. +The script is used to build a shell command, so it may contain positional +parameters, but ought not to have punctuation that would cause the +resulting command to be ill-formed. +The default is ipsec _updown. +
--to
+separates the specification of the left and right ends of the connection. +
+

+ +The potential connection description also specifies characteristics of +rekeying and security. +

+
--psk
+Propose and allow preshared secret authentication for IKE peers. This authentication +requires that each side use the same secret. May be combined with --rsasig; +at least one must be specified. +
--rsasig
+Propose and allow RSA signatures for authentication of IKE peers. This authentication +requires that each side have have a private key of its own and know the +public key of its peer. May be combined with --psk; +at least one must be specified. +
--encrypt
+All proposed or accepted IPsec SAs will include non-null ESP. +The actual choices of transforms are wired into pluto. +
--authenticate
+All proposed IPsec SAs will include AH. +All accepted IPsec SAs will include AH or ESP with authentication. +The actual choices of transforms are wired into pluto. +Note that this has nothing to do with IKE authentication. +
--compress
+All proposed IPsec SAs will include IPCOMP (compression). +This will be ignored if KLIPS is not configured with IPCOMP support. +
--tunnel
+the IPsec SA should use tunneling. Implicit if the SA is for clients. +Must only be used with --authenticate or --encrypt. +
--ipv4
+The host addresses will be interpreted as IPv4 addresses. This is the +default. Note that for a connection, all host addresses must be of +the same Address Family (IPv4 and IPv6 use different Address Families). +
--ipv6
+The host addresses (including nexthop) will be interpreted as IPv6 addresses. +Note that for a connection, all host addresses must be of +the same Address Family (IPv4 and IPv6 use different Address Families). +
--tunnelipv4
+The client addresses will be interpreted as IPv4 addresses. The default is +to match what the host will be. This does not imply --tunnel so the +flag can be safely used when no tunnel is actually specified. +Note that for a connection, all tunnel addresses must be of the same +Address Family. +
--tunnelipv6
+The client addresses will be interpreted as IPv6 addresses. The default is +to match what the host will be. This does not imply --tunnel so the +flag can be safely used when no tunnel is actually specified. +Note that for a connection, all tunnel addresses must be of the same +Address Family. +
--pfs
+There should be Perfect Forward Secrecy - new keying material will +be generated for each IPsec SA rather than being derived from the ISAKMP +SA keying material. +Since the group to be used cannot be negotiated (a dubious feature of the +standard), pluto will propose the same group that was used during Phase 1. +We don't implement a stronger form of PFS which would require that the +ISAKMP SA be deleted after the IPSEC SA is negotiated. +
--disablearrivalcheck
+If the connection is a tunnel, allow packets arriving through the tunnel +to have any source and destination addresses. +
+

+ +If none of the --encrypt, --authenticate, --compress, +or --pfs flags is given, the initiating the connection will +only build an ISAKMP SA. For such a connection, client subnets have +no meaning and must not be specified. +

+ +More work is needed to allow for flexible policies. Currently +policy is hardwired in the source file spdb.c. The ISAKMP SAs may use +Oakley groups MODP1024 and MODP1536; 3DES encryption; SHA1-96 +and MD5-96 authentication. The IPsec SAs may use 3DES and +MD5-96 or SHA1-96 for ESP, or just MD5-96 or SHA1-96 for AH. +IPCOMP Compression is always Deflate. +

+
--ikelifetime seconds
+how long pluto will propose that an ISAKMP SA be allowed to live. +The default is 3600 (one hour) and the maximum is 28800 (8 hours). +This option will not affect what is accepted. +pluto will reject proposals that exceed the maximum. +
--ipseclifetime seconds
+how long pluto will propose that an IPsec SA be allowed to live. +The default is 28800 (eight hours) and the maximum is 86400 (one day). +This option will not affect what is accepted. +pluto will reject proposals that exceed the maximum. +
--rekeymargin seconds
+how long before an SA's expiration should pluto try to negotiate +a replacement SA. This will only happen if pluto was the initiator. +The default is 540 (nine minutes). +
--rekeyfuzz percentage
+maximum size of random component to add to rekeymargin, expressed as +a percentage of rekeymargin. pluto will select a delay uniformly +distributed within this range. By default, the percentage will be 100. +If greater determinism is desired, specify 0. It may be appropriate +for the percentage to be much larger than 100. +
--keyingtries count
+how many times pluto should try to negotiate an SA, +either for the first time or for rekeying. +A value of 0 is interpreted as a very large number: never give up. +The default is three. +
--dontrekey
+A misnomer. +Only rekey a connection if we were the Initiator and there was recent +traffic on the existing connection. +This applies to Phase 1 and Phase 2. +This is currently the only automatic way for a connection to terminate. +It may be useful with Road Warrior or Opportunistic connections. +
+ +Since SA lifetime negotiation is take-it-or-leave it, a Responder +normally uses the shorter of the negotiated or the configured lifetime. +This only works because if the lifetime is shorter than negotiated, +the Responder will rekey in time so that everything works. +This interacts badly with --dontrekey. In this case, +the Responder will end up rekeying to rectify a shortfall in an IPsec SA +lifetime; for an ISAKMP SA, the Responder will accept the negotiated +lifetime. +
--delete
+when used in the connection form, it causes any previous connection +with this name to be deleted before this one is added. Unlike a +normal delete, no diagnostic is produced if there was no previous +connection to delete. Any routing in place for the connection is undone. +
+

+ +The delete form deletes a named connection description and any +SAs established or negotiations initiated using this connection. +Any routing in place for the connection is undone. +

+
--delete
+
--name connection-name
+
+

+ +The deletestate form deletes the state object with the specified serial number. +This is useful for selectively deleting instances of connections. +

+
--deletestate state-number
+
+

+ +The route form of the whack command tells pluto to set up +routing for a connection. +Although like a traditional route, it uses an ipsec device as a +virtual interface. +Once routing is set up, no packets will be +sent ``in the clear'' to the peer's client specified in the connection. +A TRAP shunt eroute will be installed; if outbound traffic is caught, +Pluto will initiate the connection. +An explicit whack route is not always needed: if it hasn't been +done when an IPsec SA is being installed, one will be automatically attempted. +

+ +When a routing is attempted for a connection, there must not already +be a routing for a different connection with the same subnet but different +interface or destination, or if +there is, it must not be being used by an IPsec SA. Otherwise the +attempt will fail. +

+
--route
+
--name connection-name
+
+

+ +The unroute form of the whack command tells pluto to undo +a routing. pluto will refuse if an IPsec SA is using the connection. +If another connection is sharing the same routing, it will be left in place. +Without a routing, packets will be sent without encryption or authentication. +

+
--unroute
+
--name connection-name
+
+

+ +The initiate form tells pluto to initiate a negotiation with another +pluto (or other IKE daemon) according to the named connection. +Initiation requires a route that --route would provide; +if none is in place at the time an IPsec SA is being installed, +pluto attempts to set one up. +

+
--initiate
+
--name connection-name
+
--asynchronous
+
+

+ +The initiate form of the whack command will relay back from +pluto status information via the UNIX domain socket (unless +--asynchronous is specified). The status information is meant to +look a bit like that from FTP. Currently whack simply +copies this to stderr. When the request is finished (eg. the SAs are +established or pluto gives up), pluto closes the channel, +causing whack to terminate. +

+ +The opportunistic initiate form is mainly used for debugging. +

+
--tunnelipv4
+
--tunnelipv6
+
--oppohere ip-address
+
--oppothere ip-address
+
+

+ +This will cause pluto to attempt to opportunistically initiate a +connection from here to the there, even if a previous attempt +had been made. +The whack log will show the progress of this attempt. +

+ +The terminate form tells pluto to delete any SAs that use the specified +connection and to stop any negotiations in process. +It does not prevent new negotiations from starting (the delete form +has this effect). +

+
--terminate
+
--name connection-name
+
+

+ +The public key for informs pluto of the RSA public key for a potential peer. +Private keys must be kept secret, so they are kept in +ipsec.secrets(5). + +

+
--keyid id
+specififies the identity of the peer for which a public key should be used. +Its form is identical to the identity in the connection. +If no public key is specified, pluto attempts to find KEY records +from DNS for the id (if a FQDN) or through reverse lookup (if an IP address). +Note that there several interesting ways in which this is not secure. +
--addkey
+specifies that the new key is added to the collection; otherwise the +new key replaces any old ones. +
--pubkeyrsa key
+specifies the value of the RSA public key. It is a sequence of bytes +as described in RFC 2537 ``RSA/MD5 KEYs and SIGs in the Domain Name System (DNS)''. +It is denoted in a way suitable for ipsec_ttodata(3). +For example, a base 64 numeral starts with 0s. +
+

+ +The listen form tells pluto to start listening for IKE requests +on its public interfaces. To avoid race conditions, it is normal to +load the appropriate connections into pluto before allowing it +to listen. If pluto isn't listening, it is pointless to +initiate negotiations, so it will refuse requests to do so. Whenever +the listen form is used, pluto looks for public interfaces and +will notice when new ones have been added and when old ones have been +removed. This is also the trigger for pluto to read the +ipsec.secrets file. So listen may useful more than once. +

+
--listen
+start listening for IKE traffic on public interfaces. +
--unlisten
+stop listening for IKE traffic on public interfaces. +
+

+ +The status form will display information about the internal state of +pluto: information about each potential connection, about +each state object, and about each shunt that pluto is managing +without an associated connection. +

+
--status
+
+

+ +The shutdown form is the proper way to shut down pluto. +It will tear down the SAs on this machine that pluto has negotiated. +It does not inform its peers, so the SAs on their machines remain. +

+
--shutdown
+
+  +

Examples

+ +

+ +It would be normal to start pluto in one of the system initialization +scripts. It needs to be run by the superuser. Generally, no arguments are needed. +To run in manually, the superuser can simply type +

+   ipsec pluto +

+The command will immediately return, but a pluto process will be left +running, waiting for requests from whack or a peer. +

+ +Using whack, several potential connections would be described: +

+
+ +   ipsec whack --name silly +--host 127.0.0.1 --to --host 127.0.0.2 +--ikelifetime 900 --ipseclifetime 800 --keyingtries 3 + +
+

+ +

Since this silly connection description specifies neither encryption, +authentication, nor tunneling, it could only be used to establish +an ISAKMP SA. +
+
+ +   ipsec whack --name secret --host 10.0.0.1 --client 10.0.1.0/24 +--to --host 10.0.0.2 --client 10.0.2.0/24 +--encrypt + +
+

+ +

This is something that must be done on both sides. If the other +side is pluto, the same whack command could be used on it +(the command syntax is designed to not distinguish which end is ours). +

+ +Now that the connections are specified, pluto is ready to handle +requests and replies via the public interfaces. We must tell it to discover +those interfaces and start accepting messages from peers: +

+   ipsec whack --listen +

+ +If we don't immediately wish to bring up a secure connection between +the two clients, we might wish to prevent insecure traffic. +The routing form asks pluto to cause the packets sent from +our client to the peer's client to be routed through the ipsec0 +device; if there is no SA, they will be discarded: +

+   ipsec whack --route secret +

+ +Finally, we are ready to get pluto to initiate negotiation +for an IPsec SA (and implicitly, an ISAKMP SA): +

+   ipsec whack --initiate --name secret +

+A small log of interesting events will appear on standard output +(other logging is sent to syslog). +

+ +whack can also be used to terminate pluto cleanly, tearing down +all SAs that it has negotiated. +

+   ipsec whack --shutdown +

+Notification of any IPSEC SA deletion, but not ISAKMP SA deletion +is sent to the peer. Unfortunately, such Notification is not reliable. +Furthermore, pluto itself ignores Notifications. +  +

The updown command

+ +

+ +Whenever pluto brings a connection up or down, it invokes +the updown command. This command is specified using the --updown +option. This allows for customized control over routing and firewall manipulation. +

+ +The updown is invoked for five different operations. Each of +these operations can be for our client subnet or for our host itself. +

+
prepare-host or prepare-client
+is run before bringing up a new connection if no other connection +with the same clients is up. Generally, this is useful for deleting a +route that might have been set up before pluto was run or +perhaps by some agent not known to pluto. +
route-host or route-client
+is run when bringing up a connection for a new peer client subnet +(even if prepare-host or prepare-client was run). The +command should install a suitable route. Routing decisions are based +only on the destination (peer's client) subnet address, unlike eroutes +which discriminate based on source too. +
unroute-host or unroute-client
+is run when bringing down the last connection for a particular peer +client subnet. It should undo what the route-host or route-client +did. +
up-host or up-client
+is run when bringing up a tunnel eroute with a pair of client subnets +that does not already have a tunnel eroute. +This command should install firewall rules as appropriate. +It is generally a good idea to allow IKE messages (UDP port 500) +travel between the hosts. +
down-host or down-client
+is run when bringing down the eroute for a pair of client subnets. +This command should delete firewall rules as appropriate. Note that +there may remain some inbound IPsec SAs with these client subnets. +
+

+ +The script is passed a large number of environment variables to specify +what needs to be done. +

+
PLUTO_VERSION
+indicates what version of this interface is being used. This document +describes version 1.1. This is upwardly compatible with version 1.0. +
PLUTO_VERB
+specifies the name of the operation to be performed +(prepare-host,r prepare-client, +up-host, up-client, +down-host, or down-client). If the address family for +security gateway to security gateway communications is IPv6, then +a suffix of -v6 is added to the verb. +
PLUTO_CONNECTION
+is the name of the connection for which we are routing. +
PLUTO_NEXT_HOP
+is the next hop to which packets bound for the peer must be sent. +
PLUTO_INTERFACE
+is the name of the ipsec interface to be used. +
PLUTO_ME
+is the IP address of our host. +
PLUTO_MY_CLIENT
+is the IP address / count of our client subnet. +If the client is just the host, this will be the host's own IP address / max +(where max is 32 for IPv4 and 128 for IPv6). +
PLUTO_MY_CLIENT_NET
+is the IP address of our client net. +If the client is just the host, this will be the host's own IP address. +
PLUTO_MY_CLIENT_MASK
+is the mask for our client net. +If the client is just the host, this will be 255.255.255.255. +
PLUTO_PEER
+is the IP address of our peer. +
PLUTO_PEER_CLIENT
+is the IP address / count of the peer's client subnet. +If the client is just the peer, this will be the peer's own IP address / max +(where max is 32 for IPv4 and 128 for IPv6). +
PLUTO_PEER_CLIENT_NET
+is the IP address of the peer's client net. +If the client is just the peer, this will be the peer's own IP address. +
PLUTO_PEER_CLIENT_MASK
+is the mask for the peer's client net. +If the client is just the peer, this will be 255.255.255.255. +
+

+ +All output sent by the script to stderr or stdout is logged. The +script should return an exit status of 0 if and only if it succeeds. +

+ +Pluto waits for the script to finish and will not do any other +processing while it is waiting. +The script may assume that pluto will not change anything +while the script runs. +The script should avoid doing anything that takes much time and it +should not issue any command that requires processing by pluto. +Either of these activities could be performed by a background +subprocess of the script. +  +

Rekeying

+ +

+ +When an SA that was initiated by pluto has only a bit of +lifetime left, +pluto will initiate the creation of a new SA. This applies to +ISAKMP and IPsec SAs. +The rekeying will be initiated when the SA's remaining lifetime is +less than the rekeymargin plus a random percentage, between 0 and +rekeyfuzz, of the rekeymargin. +

+ +Similarly, when an SA that was initiated by the peer has only a bit of +lifetime left, pluto will try to initiate the creation of a +replacement. +To give preference to the initiator, this rekeying will only be initiated +when the SA's remaining lifetime is half of rekeymargin. +If rekeying is done by the responder, the roles will be reversed: the +responder for the old SA will be the initiator for the replacement. +The former initiator might also initiate rekeying, so there may +be redundant SAs created. +To avoid these complications, make sure that rekeymargin is generous. +

+ +One risk of having the former responder initiate is that perhaps +none of its proposals is acceptable to the former initiator +(they have not been used in a successful negotiation). +To reduce the chances of this happening, and to prevent loss of security, +the policy settings are taken from the old SA (this is the case even if +the former initiator is initiating). +These may be stricter than those of the connection. +

+ +pluto will not rekey an SA if that SA is not the most recent of its +type (IPsec or ISAKMP) for its potential connection. +This avoids creating redundant SAs. +

+ +The random component in the rekeying time (rekeyfuzz) is intended to +make certain pathological patterns of rekeying unstable. If both +sides decide to rekey at the same time, twice as many SAs as necessary +are created. This could become a stable pattern without the +randomness. +

+ +Another more important case occurs when a security gateway has SAs +with many other security gateways. Each of these connections might +need to be rekeyed at the same time. This would cause a high peek +requirement for resources (network bandwidth, CPU time, entropy for +random numbers). The rekeyfuzz can be used to stagger the rekeying +times. +

+ +Once a new set of SAs has been negotiated, pluto will never send +traffic on a superseded one. Traffic will be accepted on an old SA +until it expires. +  +

Selecting a Connection When Responding: Road Warrior Support

+ +

+ +When pluto receives an initial Main Mode message, it needs to +decide which connection this message is for. It picks based solely on +the source and destination IP addresses of the message. There might +be several connections with suitable IP addresses, in which case one +of them is arbitrarily chosen. (The ISAKMP SA proposal contained in +the message could be taken into account, but it is not.) +

+ +The ISAKMP SA is negotiated before the parties pass further +identifying information, so all ISAKMP SA characteristics specified in +the connection description should be the same for every connection +with the same two host IP addresses. At the moment, the only +characteristic that might differ is authentication method. +

+ +Up to this point, +all configuring has presumed that the IP addresses +are known to all parties ahead of time. This will not work +when either end is mobile (or assigned a dynamic IP address for other +reasons). We call this situation ``Road Warrior''. It is fairly tricky +and has some important limitations, most of which are features of +the IKE protocol. +

+ +Only the initiator may be mobile: +the initiator may have an IP number unknown to the responder. When +the responder doesn't recognize the IP address on the first Main Mode +packet, it looks for a connection with itself as one end and %any +as the other. +If it cannot find one, it refuses to negotiate. If it +does find one, it creates a temporary connection that is a duplicate +except with the %any replaced by the source IP address from the +packet; if there was no identity specified for the peer, the new IP +address will be used. +

+ +When pluto is using one of these temporary connections and +needs to find the preshared secret or RSA private key in ipsec.secrets, +and and the connection specified no identity for the peer, %any +is used as its identity. After all, the real IP address was apparently +unknown to the configuration, so it is unreasonable to require that +it be used in this table. +

+ +Part way into the Phase 1 (Main Mode) negotiation using one of these +temporary connection descriptions, pluto will be receive an +Identity Payload. At this point, pluto checks for a more +appropriate connection, one with an identity for the peer that matches +the payload but which would use the same keys so-far used for +authentication. If it finds one, it will switch to using this better +connection (or a temporary derived from this, if it has %any +for the peer's IP address). It may even turn out that no connection +matches the newly discovered identity, including the current connection; +if so, pluto terminates negotiation. +

+ +Unfortunately, if preshared secret authentication is being used, the +Identity Payload is encrypted using this secret, so the secret must be +selected by the responder without knowing this payload. This +limits there to being at most one preshared secret for all Road Warrior +systems connecting to a host. RSA Signature authentications does not +require that the responder know how to select the initiator's public key +until after the initiator's Identity Payload is decoded (using the +responder's private key, so that must be preselected). +

+ +When pluto is responding to a Quick Mode negotiation via one of these +temporary connection descriptions, it may well find that the subnets +specified by the initiator don't match those in the temporary +connection description. If so, it will look for a connection with +matching subnets, its own host address, a peer address of %any +and matching identities. +If it finds one, a new temporary connection is derived from this one +and used for the Quick Mode negotiation of IPsec SAs. If it does not +find one, pluto terminates negotiation. +

+ +Be sure to specify an appropriate nexthop for the responder +to send a message to the initiator: pluto has no way of guessing +it (if forwarding isn't required, use an explicit %direct as the nexthop +and the IP address of the initiator will be filled in; the obsolete +notation 0.0.0.0 is still accepted). +

+ +pluto has no special provision for the initiator side. The current +(possibly dynamic) IP address and nexthop must be used in defining +connections. These must be +properly configured each time the initiator's IP address changes. +pluto has no mechanism to do this automatically. +

+ +Although we call this Road Warrior Support, it could also be used to +support encrypted connections with anonymous initiators. The +responder's organization could announce the preshared secret that would be used +with unrecognized initiators and let anyone connect. Of course the initiator's +identity would not be authenticated. +

+ +If any Road Warrior connections are supported, pluto cannot +reject an exchange initiated by an unknown host until it has +determined that the secret is not shared or the signature is invalid. +This must await the +third Main Mode message from the initiator. If no Road Warrior +connection is supported, the first message from an unknown source +would be rejected. This has implications for ease of debugging +configurations and for denial of service attacks. +

+ +Although a Road Warrior connection must be initiated by the mobile +side, the other side can and will rekey using the temporary connection +it has created. If the Road Warrior wishes to be able to disconnect, +it is probably wise to set --keyingtries to 1 in the +connection on the non-mobile side to prevent it trying to rekey the +connection. Unfortunately, there is no mechanism to unroute the +connection automatically. +  +

Debugging

+ +

+ +pluto accepts several optional arguments, useful mostly for debugging. +Except for --interface, each should appear at most once. +

+
--interface interfacename
+specifies that the named real public network interface should be considered. +The interface name specified should not be ipsecN. +If the option doesn't appear, all interfaces are considered. +To specify several interfaces, use the option once for each. +One use of this option is to specify which interface should be used +when two or more share the same IP address. +
--ikeport port-number
+changes the UDP port that pluto will use +(default, specified by IANA: 500) +
--ctlbase path
+basename for control files. +path.ctl is the socket through which whack communicates with +pluto. +path.pid is the lockfile to prevent multiple pluto instances. +The default is /var/run/pluto). +
--secretsfile file
+specifies the file for authentication secrets +(default: /etc/ipsec.secrets). +This name is subject to ``globbing'' as in sh(1), +so every file with a matching name is processed. +Quoting is generally needed to prevent the shell from doing the globbing. +
--adns pathname
+
--lwdnsq pathname
+specifies where to find pluto's helper program for asynchronous DNS lookup. +pluto can be built to use one of two helper programs: _pluto_adns +or lwdnsq. You must use the program for which it was built. +By default, pluto will look for the program in +$IPSEC_DIR (if that environment variable is defined) or, failing that, +in the same directory as pluto. +
--nofork
+disable ``daemon fork'' (default is to fork). In addition, after the +lock file and control socket are created, print the line ``Pluto +initialized'' to standard out. +
--noklips
+don't actually implement negotiated IPsec SAs +
--uniqueids
+if this option has been selected, whenever a new ISAKMP SA is +established, any connection with the same Peer ID but a different +Peer IP address is unoriented (causing all its SAs to be deleted). +This helps clean up dangling SAs when a connection is lost and +then regained at another IP address. +
--stderrlog
+log goes to standard out {default is to use syslogd(8)) +
+

+ +For example +

+
pluto --secretsfile ipsec.secrets --ctlbase pluto.base --ikeport 8500 --nofork --noklips --stderrlog
+
+

+ +lets one test pluto without using the superuser account. +

+ +pluto is willing to produce a prodigious amount of debugging +information. To do so, it must be compiled with -DDEBUG. There are +several classes of debugging output, and pluto may be directed to +produce a selection of them. All lines of +debugging output are prefixed with ``| '' to distinguish them from error +messages. +

+ +When pluto is invoked, it may be given arguments to specify +which classes to output. The current options are: +

+
--debug-raw
+show the raw bytes of messages +
--debug-crypt
+show the encryption and decryption of messages +
--debug-parsing
+show the structure of input messages +
--debug-emitting
+show the structure of output messages +
--debug-control
+show pluto's decision making +
--debug-lifecycle
+[this option is temporary] log more detail of lifecycle of SAs +
--debug-klips
+show pluto's interaction with KLIPS +
--debug-dns
+show pluto's interaction with DNS for KEY and TXT records +
--debug-oppo
+show why pluto didn't find a suitable DNS TXT record to authorize opportunistic initiation +
--debug-all
+all of the above +
--debug-private
+allow debugging output with private keys. +
--debug-none
+none of the above +
+

+ +The debug form of the +whack command will change the selection in a running +pluto. +If a connection name is specified, the flags are added whenever +pluto has identified that it is dealing with that connection. +Unfortunately, this is often part way into the operation being observed. +

+ +For example, to start a pluto with a display of the structure of input +and output: +

+
+pluto --debug-emitting --debug-parsing +
+

+ +To later change this pluto to only display raw bytes: +

+
+whack --debug-raw +
+

+ +For testing, SSH's IKE test page is quite useful: +

+
+http://isakmp-test.ssh.fi/ +
+

+ +Hint: ISAKMP SAs are often kept alive by IKEs even after the IPsec SA +is established. This allows future IPsec SA's to be negotiated +directly. If one of the IKEs is restarted, the other may try to use +the ISAKMP SA but the new IKE won't know about it. This can lead to +much confusion. pluto is not yet smart enough to get out of such a +mess. +  +

Pluto's Behaviour When Things Go Wrong

+ +

+ +When pluto doesn't understand or accept a message, it just +ignores the message. It is not yet capable of communicating the +problem to the other IKE daemon (in the future it might use +Notifications to accomplish this in many cases). It does log a diagnostic. +

+ +When pluto gets no response from a message, it resends the same +message (a message will be sent at most three times). This is +appropriate: UDP is unreliable. +

+ +When pluto gets a message that it has already seen, there are many +cases when it notices and discards it. This too is appropriate for UDP. +

+ +Combine these three rules, and you can explain many apparently +mysterious behaviours. In a pluto log, retrying isn't usually the +interesting event. The critical thing is either earlier (pluto +got a message which it didn't like and so ignored, so it was still +awaiting an acceptable message and got impatient) or on the other +system (pluto didn't send a reply because it wasn't happy with +the previous message). +  +

Notes

+ +

+ +If pluto is compiled without -DKLIPS, it negotiates Security +Associations but never ask the kernel to put them in place and never +makes routing changes. This allows pluto to be tested on systems +without KLIPS, but makes it rather useless. +

+ +Each IPsec SA is assigned an SPI, a 32-bit number used to refer to the SA. +The IKE protocol lets the destination of the SA choose the SPI. +The range 0 to 0xFF is reserved for IANA. +Pluto also avoids choosing an SPI in the range 0x100 to 0xFFF, +leaving these SPIs free for manual keying. +Remember that the peer, if not pluto, may well chose +SPIs in this range. +  +

Policies

+ +

+ +This catalogue of policies may be of use when trying to configure +Pluto and another IKE implementation to interoperate. +

+ +In Phase 1, only Main Mode is supported. We are not sure that +Aggressive Mode is secure. For one thing, it does not support +identity protection. It may allow more severe Denial Of Service +attacks. +

+ +No Informational Exchanges are supported. These are optional and +since their delivery is not assured, they must not matter. +It is the case that some IKE implementations won't interoperate +without Informational Exchanges, but we feel they are broken. +

+ +No Informational Payloads are supported. These are optional, but +useful. It is of concern that these payloads are not authenticated in +Phase 1, nor in those Phase 2 messages authenticated with HASH(3). +

+
*
+Diffie Hellman Groups MODP 1024 and MODP 1536 (2 and 5) +are supported. +Group MODP768 (1) is not supported because it is too weak. +
*
+Host authetication can be done by RSA Signatures or Pre-Shared +Secrets. +
*
+3DES CBC (Cypher Block Chaining mode) is the only encryption +supported, both for ISAKMP SAs and IPSEC SAs. +
*
+MD5 and SHA1 hashing are supported for packet authentication in both +kinds of SAs. +
*
+The ESP, AH, or AH plus ESP are supported. If, and only if, AH and +ESP are combined, the ESP need not have its own authentication +component. The selection is controlled by the --encrypt and +--authenticate flags. +
*
+Each of these may be combined with IPCOMP Deflate compression, +but only if the potential connection specifies compression and only +if KLIPS is configured with IPCOMP support. +
*
+The IPSEC SAs may be tunnel or transport mode, where appropriate. +The --tunnel flag controls this when pluto is initiating. +
*
+When responding to an ISAKMP SA proposal, the maximum acceptable +lifetime is eight hours. The default is one hour. There is no +minimum. The --ikelifetime flag controls this when pluto +is initiating. +
*
+When responding to an IPSEC SA proposal, the maximum acceptable +lifetime is one day. The default is eight hours. There is no +minimum. The --ipseclifetime flag controls this when pluto +is initiating. +
*
+PFS is acceptable, and will be proposed if the --pfs flag was +specified. The DH group proposed will be the same as negotiated for +Phase 1. +
+  +

SIGNALS

+ +

+ +Pluto responds to SIGHUP by issuing a suggestion that ``whack +--listen'' might have been intended. +

+ +Pluto exits when it recieves SIGTERM. +  +

EXIT STATUS

+ +

+ +pluto normally forks a daemon process, so the exit status is +normally a very preliminary result. +

+
0
+means that all is OK so far. +
1
+means that something was wrong. +
10
+means that the lock file already exists. +
+

+ +If whack detects a problem, it will return an exit status of 1. +If it received progress messages from pluto, it returns as status +the value of the numeric prefix from the last such message +that was not a message sent to syslog or a comment +(but the prefix for success is treated as 0). +Otherwise, the exit status is 0. +  +

FILES

+ +/var/run/pluto.pid +
+ +/var/run/pluto.ctl +
+ +/etc/ipsec.secrets +
+ +$IPSEC_LIBDIR/_pluto_adns +
+ +$IPSEC_EXECDIR/lwdnsq +
+ +/dev/urandom +  +

ENVIRONMENT

+ +IPSEC_LIBDIR +
+ +IPSEC_EXECDIR +
+ +IPSECmyid +  +

SEE ALSO

+ +

+ +The rest of the FreeS/WAN distribution, in particular ipsec(8). +

+ +ipsec_auto(8) is designed to make using pluto more pleasant. +Use it! +

+ +ipsec.secrets(5) + +describes the format of the secrets file. +

+ +ipsec_atoaddr(3), part of the FreeS/WAN distribution, describes the +forms that IP addresses may take. +ipsec_atosubnet(3), part of the FreeS/WAN distribution, describes the +forms that subnet specifications. +

+ +For more information on IPsec, the mailing list, and the relevant +documents, see: +

+
+ +http://www.ietf.cnri.reston.va.us/html.charters/ipsec-charter.html + +
+

+ +At the time of writing, the most relevant IETF RFCs are: +

+
+RFC2409 The Internet Key Exchange (IKE) +
+RFC2408 Internet Security Association and Key Management Protocol (ISAKMP) +
+RFC2407 The Internet IP Security Domain of Interpretation for ISAKMP +
+

+ +The FreeS/WAN web site <htp://www.freeswan.org> +and the mailing lists described there. +  +

HISTORY

+ +This code is released under the GPL terms. +See the accompanying file COPYING-2.0 for more details. +The GPL does NOT apply to those pieces of code written by others +which are included in this distribution, except as noted by the +individual authors. +

+ +This software was originally written +for the FreeS/WAN project +<http://www.freeswan.org> +by Angelos D. Keromytis +(angelos@dsl.cis.upenn.edu), in May/June 1997, in Athens, Greece. +Thanks go to John Ioannidis for his help. +

+ +It is currently (2000) +being developed and maintained by D. Hugh Redelmeier +(hugh@mimosa.com), in Canada. The regulations of Greece and Canada +allow us to make the code freely redistributable. +

+ +Kai Martius (admin@imib.med.tu-dresden.de) contributed the initial +version of the code supporting PFS. +

+ +Richard Guy Briggs <rgb@conscoop.ottawa.on.ca> and Peter Onion +<ponion@srd.bt.co.uk> added the PFKEY2 support. +

+ +We gratefully acknowledge that we use parts of Eric Young's libdes +package; see ../libdes/COPYRIGHT. +  +

BUGS

+ +pluto + +is a work-in-progress. It currently has many limitations. +For example, it ignores notification messages that it receives, and +it generates only Delete Notifications and those only for IPSEC SAs. +

+ +pluto does not support the Commit Flag. +The Commit Flag is a bad feature of the IKE protocol. +It isn't protected -- neither encrypted nor authenticated. +A man in the middle could turn it on, leading to DoS. +We just ignore it, with a warning. +This should let us interoperate with +implementations that insist on it, with minor damage. +

+ +pluto does not check that the SA returned by the Responder +is actually one that was proposed. It only checks that the SA is +acceptable. The difference is not large, but can show up in attributes +such as SA lifetime. +

+ +There is no good way for a connection to be automatically terminated. +This is a problem for Road Warrior and Opportunistic connections. +The --dontrekey option does prevent the SAs from +being rekeyed on expiry. +Additonally, if a Road Warrior connection has a client subnet with a fixed IP +address, a negotiation with that subnet will cause any other +connection instantiations with that same subnet to be unoriented +(deleted, in effect). +See also the --uniqueids option for an extension of this. +

+ +When pluto sends a message to a peer that has disappeared, +pluto receives incomplete information from the kernel, so it +logs the unsatisfactory message ``some IKE message we sent has been +rejected with ECONNREFUSED (kernel supplied no details)''. John +Denker suggests that this command is useful for tracking down the +source of these problems: +
+ +       tcpdump -i eth0 icmp[0] != 8 and icmp[0] != 0
+
+ +Substitute your public interface for eth0 if it is different. +

+ +The word ``authenticate'' is used for two different features. We must +authenticate each IKE peer to the other. This is an important task of +Phase 1. Each packet must be authenticated, both in IKE and in IPsec, +and the method for IPsec is negotiated as an AH SA or part of an ESP SA. +Unfortunately, the protocol has no mechanism for authenticating the Phase 2 +identities. +

+ +Bugs should be reported to the <users@lists.freeswan.org> mailing list. +Caution: we cannot accept +actual code from US residents, or even US citizens living outside the +US, because that would bring FreeS/WAN under US export law. Some +other countries cause similar problems. In general, we would prefer +that you send detailed problem reports rather than code: we want +FreeS/WAN to be unquestionably freely exportable, which means being +very careful about where the code comes from, and for a small bug fix, +that is often more time-consuming than just reinventing the fix +ourselves. +

+ +


+ 

Index

+
+
NAME
+
SYNOPSIS
+
DESCRIPTION
+
+
IKE's Job
+
Pluto
+
Before Running Pluto
+
Setting up KLIPS for pluto
+
ipsec.secrets file
+
Running Pluto
+
Pluto's Internal State
+
Using Whack
+
Examples
+
The updown command
+
Rekeying
+
Selecting a Connection When Responding: Road Warrior Support
+
Debugging
+
Pluto's Behaviour When Things Go Wrong
+
Notes
+
Policies
+
+
SIGNALS
+
EXIT STATUS
+
FILES
+
ENVIRONMENT
+
SEE ALSO
+
HISTORY
+
BUGS
+
+
+This document was created by +man2html, +using the manual pages.
+Time: 21:40:18 GMT, November 11, 2003 + + -- cgit v1.2.3