1IPSEC_ANYADDR(3)           Library Functions Manual           IPSEC_ANYADDR(3)
2
3
4

NAME

6       ipsec sameaddr - are two addresses the same?
7       ipsec addrcmp - ordered comparison of addresses
8       ipsec samesubnet - are two subnets the same?
9       ipsec addrinsubnet - is an address within a subnet?
10       ipsec subnetinsubnet - is a subnet within another subnet?
11       ipsec subnetishost - is a subnet a single host?
12       ipsec samesaid - are two SA IDs the same?
13       ipsec sameaddrtype - are two addresses of the same address family?
14       ipsec samesubnettype - are two subnets of the same address family?
15

SYNOPSIS

17       #include <freeswan.h>
18
19       int sameaddr(const ip_address *a, const ip_address *b);
20       int addrcmp(const ip_address *a, const ip_address *b);
21       int samesubnet(const ip_subnet *a, const ip_subnet *b);
22       int addrinsubnet(const ip_address *a, const ip_subnet *s);
23       int subnetinsubnet(const ip_subnet *a, const ip_subnet *b);
24       int subnetishost(const ip_subnet *s);
25       int samesaid(const ip_said *a, const ip_said *b);
26       int sameaddrtype(const ip_address *a, const ip_address *b);
27       int samesubnettype(const ip_subnet *a, const ip_subnet *b);
28

DESCRIPTION

30       These functions do various comparisons and tests on the ip_address type
31       and ip_subnet types.
32
33       Sameaddr returns non-zero if addresses a and b  are  identical,  and  0
34       otherwise.  Addresses of different families are never identical.
35
36       Addrcmp  returns  -1,  0,  or 1 respectively if address a is less than,
37       equal to, or greater than b.  If they are not of the same address  fam‐
38       ily,  they are never equal; the ordering reported in this case is arbi‐
39       trary (and probably not useful) but consistent.
40
41       Samesubnet returns non-zero if subnets a and b  are  identical,  and  0
42       otherwise.  Subnets of different address families are never identical.
43
44       Addrinsubnet  returns  non-zero  if  address a is within subnet s and 0
45       otherwise.  An address is never within a subnet of a different  address
46       family.
47
48       Subnetinsubnet returns non-zero if subnet a is a subset of subnet b and
49       0 otherwise.  A subnet is deemed to be a subset of itself.  A subnet is
50       never a subset of another subnet if their address families differ.
51
52       Subnetishost  returns  non-zero  if  subnet  s is in fact only a single
53       host, and 0 otherwise.
54
55       Samesaid returns non-zero if SA IDs a and b are identical, and 0 other‐
56       wise.
57
58       Sameaddrtype  returns  non-zero  if  addresses  a and b are of the same
59       address family, and 0 otherwise.
60
61       Samesubnettype returns non-zero if subnets a and  b  are  of  the  same
62       address family, and 0 otherwise.
63

SEE ALSO

65       inet(3), ipsec_initaddr(3)
66

HISTORY

68       Written for the FreeS/WAN project by Henry Spencer.
69
70
71
72                                  28 Nov 2000                 IPSEC_ANYADDR(3)
Impressum