diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2006-05-22 05:12:18 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2006-05-22 05:12:18 +0000 |
commit | aa0f5b38aec14428b4b80e06f90ff781f8bca5f1 (patch) | |
tree | 95f3d0c8cb0d59d88900dbbd72110d7ab6e15b2a /linux/lib/libfreeswan/rangetosubnet.3 | |
parent | 7c383bc22113b23718be89fe18eeb251942d7356 (diff) | |
download | vyos-strongswan-aa0f5b38aec14428b4b80e06f90ff781f8bca5f1.tar.gz vyos-strongswan-aa0f5b38aec14428b4b80e06f90ff781f8bca5f1.zip |
Import initial strongswan 2.7.0 version into SVN.
Diffstat (limited to 'linux/lib/libfreeswan/rangetosubnet.3')
-rw-r--r-- | linux/lib/libfreeswan/rangetosubnet.3 | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/linux/lib/libfreeswan/rangetosubnet.3 b/linux/lib/libfreeswan/rangetosubnet.3 new file mode 100644 index 000000000..7d707545e --- /dev/null +++ b/linux/lib/libfreeswan/rangetosubnet.3 @@ -0,0 +1,59 @@ +.TH IPSEC_RANGETOSUBNET 3 "8 Sept 2000" +.\" RCSID $Id: rangetosubnet.3,v 1.1 2004/03/15 20:35:26 as Exp $ +.SH NAME +ipsec rangetosubnet \- convert address range to subnet +.SH SYNOPSIS +.B "#include <freeswan.h>" +.sp +.B "const char *rangetosubnet(const ip_address *start," +.ti +1c +.B "const ip_address *stop, ip_subnet *dst);" +.SH DESCRIPTION +.I Rangetosubnet +accepts two IP addresses which define an address range, +from +.I start +to +.I 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. +.PP +.I Rangetosubnet +returns NULL for success and +a pointer to a string-literal error message for failure; +see DIAGNOSTICS. +.SH SEE ALSO +ipsec_initsubnet(3), ipsec_ttosubnet(3) +.SH DIAGNOSTICS +Fatal errors in +.I rangetosubnet +are: +mixed address families; +unknown address family; +.I start +and +.I stop +do not define a subnet. +.SH HISTORY +Written for the FreeS/WAN project by Henry Spencer. +.SH 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. +.PP +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: +.PP +.RS +.nf +.B "const char *error;" +.sp +.B "error = rangetosubnet( /* ... */ );" +.B "if (error != NULL) {" +.B " /* something went wrong */" +.fi +.RE |