File: portof.3.xml

package info (click to toggle)
libreswan 5.2-2.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,656 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 (116 lines) | stat: -rw-r--r-- 3,739 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
<?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">
<refentry id='portof3'>
<refmeta>
<refentrytitle>IPSEC-PORTOF</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo class='date'>8 Sept 2000</refmiscinfo>
<refmiscinfo class="source">libreswan</refmiscinfo>
<refmiscinfo class="manual">Executable programs</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>ipsec-portof</refname>
<refname>ipsec-setportof</refname>
<refname>ipsec-sockaddrof</refname>
<refname>ipsec-sockaddrlenof</refname>
<refpurpose>get port field of an ip_address, set port field of an ip_address, get pointer to internal sockaddr of an ip_address, get length of internal sockaddr of an ip_address</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;libreswan.h&gt;

</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>portof</function></funcdef>
    <paramdef>const ip_address * <parameter>src</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>void <function>setportof</function></funcdef>
    <paramdef>int <parameter>port</parameter></paramdef>
    <paramdef>ip_address * <parameter>dst</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>struct <function>sockaddr</function> *sockaddrof</funcdef>
    <paramdef>ip_address * <parameter>src</parameter></paramdef>
</funcprototype>

<funcprototype>
<funcdef>size_t <function>sockaddrlenof</function></funcdef>
    <paramdef>const ip_address * <parameter>src</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis>&lt;libreswan.h&gt;</emphasis>
internal type
<emphasis>ip_address</emphasis>
contains one of the
<function>sockaddr</function>
types internally.
<emphasis>Reliance on this feature is discouraged</emphasis>,
but it may occasionally be necessary.
These functions provide low-level tools for this purpose.</para>

<para><emphasis>Portof</emphasis>
and
<function>setportof</function>
respectively read and write the port-number field of the internal
<function>sockaddr</function>.
The values are in network byte order.</para>

<para><emphasis>Sockaddrof</emphasis>
returns a pointer to the internal
<function>sockaddr</function>,
for passing to other functions.</para>

<para><emphasis>Sockaddrlenof</emphasis>
reports the size of the internal
<function>sockaddr</function>,
for use in storage allocation.</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='diagnostics'><title>DIAGNOSTICS</title>
<para><emphasis>Portof</emphasis>
returns
<option>-1</option>,
<emphasis>sockaddrof</emphasis>
returns
<emphasis>NULL</emphasis>,
and
<function>sockaddrlenof</function>
returns
<literal>0</literal>
if an unknown address family is found within the
<emphasis>ip_address</emphasis>.</para>
</refsect1>

<refsect1 id='history'><title>HISTORY</title>
<para>Written for the FreeS/WAN project by Henry Spencer.</para>
</refsect1>

<refsect1 id='bugs'><title>BUGS</title>
<para>These functions all depend on low-level details of the
<emphasis>ip_address</emphasis>
type, which are in principle subject to change.
Avoid using them unless really necessary.</para>
</refsect1>
  <refsect1 id='author'>
    <title>AUTHOR</title>
    <para>
      <emphasis role='strong'>Paul Wouters</emphasis>
    </para>
  </refsect1>
</refentry>