File: sameaddr.3.xml

package info (click to toggle)
libreswan 5.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,644 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (225 lines) | stat: -rw-r--r-- 6,244 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='sameaddr3'>
<refmeta>
<refentrytitle>IPSEC-SAMEADDR</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo class='date'>28 Nov 2000</refmiscinfo>
<refmiscinfo class="source">libreswan</refmiscinfo>
<refmiscinfo class="manual">Executable programs</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>ipsec-sameaddr</refname>
<refname>ipsec-addrcmp</refname>
<refname>ipsec-samesubnet</refname>
<refname>ipsec-addrinsubnet</refname>
<refname>ipsec-subnetinsubnet</refname>
<refname>ipsec-subnetishost</refname>
<refname>ipsec-samesaid</refname>
<refname>ipsec-sameaddrtype</refname>
<refname>ipsec-samesubnettype</refname>
<refpurpose>do comparisons for addresses, subnets, SA IDs and address families</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;libreswan.h&gt;

</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>sameaddr</function></funcdef>
    <paramdef>const ip_address * <parameter>a</parameter></paramdef>
    <paramdef>const ip_address * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>addrcmp</function></funcdef>
    <paramdef>const ip_address * <parameter>a</parameter></paramdef>
    <paramdef>const ip_address * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>samesubnet</function></funcdef>
    <paramdef>const ip_subnet * <parameter>a</parameter></paramdef>
    <paramdef>const ip_subnet * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>addrinsubnet</function></funcdef>
    <paramdef>const ip_address * <parameter>a</parameter></paramdef>
    <paramdef>const ip_subnet * <parameter>s</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>subnetinsubnet</function></funcdef>
    <paramdef>const ip_subnet * <parameter>a</parameter></paramdef>
    <paramdef>const ip_subnet * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>subnetishost</function></funcdef>
    <paramdef>const ip_subnet * <parameter>s</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>samesaid</function></funcdef>
    <paramdef>const ip_said * <parameter>a</parameter></paramdef>
    <paramdef>const ip_said * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>sameaddrtype</function></funcdef>
    <paramdef>const ip_address * <parameter>a</parameter></paramdef>
    <paramdef>const ip_address * <parameter>b</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>int <function>samesubnettype</function></funcdef>
    <paramdef>const ip_subnet * <parameter>a</parameter></paramdef>
    <paramdef>const ip_subnet * <parameter>b</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para>These functions do various comparisons and tests on the
<emphasis>ip_address</emphasis>
type and
<emphasis>ip_subnet</emphasis>
types.</para>

<para><emphasis>Sameaddr</emphasis>
returns
non-zero
if addresses
<varname role='parameter'>a</varname>
and
<varname role='parameter'>b</varname>
are identical,
and
<literal>0</literal>
otherwise.
Addresses of different families are never identical.</para>

<para><emphasis>Addrcmp</emphasis>
returns
<option>-1</option>,
<literal>0</literal>,
or
<literal>1</literal>
respectively
if address
<varname role='parameter'>a</varname>
is less than, equal to, or greater than
<varname role='parameter'>b</varname>.
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.</para>

<para><emphasis>Samesubnet</emphasis>
returns
non-zero
if subnets
<varname role='parameter'>a</varname>
and
<varname role='parameter'>b</varname>
are identical,
and
<literal>0</literal>
otherwise.
Subnets of different address families are never identical.</para>

<para><emphasis>Addrinsubnet</emphasis>
returns
non-zero
if address
<varname role='parameter'>a</varname>
is within subnet
<varname role='parameter'>s</varname>
and
<literal>0</literal>
otherwise.
An address is never within a
subnet of a different address family.</para>

<para><emphasis>Subnetinsubnet</emphasis>
returns
non-zero
if subnet
<varname role='parameter'>a</varname>
is a subset of subnet
<varname role='parameter'>b</varname>
and
<literal>0</literal>
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.</para>

<para><emphasis>Subnetishost</emphasis>
returns
non-zero
if subnet
<varname role='parameter'>s</varname>
is in fact only a single host,
and
<literal>0</literal>
otherwise.</para>

<para><emphasis>Samesaid</emphasis>
returns
non-zero
if SA IDs
<varname role='parameter'>a</varname>
and
<varname role='parameter'>b</varname>
are identical,
and
<literal>0</literal>
otherwise.</para>

<para><emphasis>Sameaddrtype</emphasis>
returns
non-zero
if addresses
<varname role='parameter'>a</varname>
and
<varname role='parameter'>b</varname>
are of the same address family,
and
<literal>0</literal>
otherwise.</para>

<para><emphasis>Samesubnettype</emphasis>
returns
non-zero
if subnets
<varname role='parameter'>a</varname>
and
<varname role='parameter'>b</varname>
are of the same address family,
and
<literal>0</literal>
otherwise.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>inet</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>ipsec-initaddr</refentrytitle><manvolnum>3</manvolnum></citerefentry></para>
</refsect1>

<refsect1 id='history'><title>HISTORY</title>
<para>Written for the FreeS/WAN project by Henry Spencer.</para>
</refsect1>
  <refsect1 id='author'>
    <title>AUTHOR</title>
    <para>
      <emphasis role='strong'>Paul Wouters</emphasis>
    </para>
  </refsect1>
</refentry>