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
|
<?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='subnetof3'>
<refmeta>
<refentrytitle>IPSEC-SUBNETOF</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo class='date'>11 June 2001</refmiscinfo>
<refmiscinfo class="source">libreswan</refmiscinfo>
<refmiscinfo class="manual">Executable programs</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>ipsec-subnetof</refname>
<refname>ipsec-hostof</refname>
<refname>ipsec-broadcastof</refname>
<refpurpose>given Internet address and subnet mask return subnet number, host part, broadcast address</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<funcsynopsis>
<funcsynopsisinfo>
#include <libreswan.h>
</funcsynopsisinfo>
<funcprototype>
<funcdef>struct in_addr <function>subnetof</function></funcdef>
<paramdef>struct in_addr <parameter>addr</parameter></paramdef>
<paramdef>struct in_addr <parameter>mask</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>struct in_addr <function>hostof</function></funcdef>
<paramdef>struct in_addr <parameter>addr</parameter></paramdef>
<paramdef>struct in_addr <parameter>mask</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>struct in_addr <function>broadcastof</function></funcdef>
<paramdef>struct in_addr <parameter>addr</parameter></paramdef>
<paramdef>struct in_addr <parameter>mask</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id='description'><title>DESCRIPTION</title>
<para>These functions are obsolete; see
<citerefentry><refentrytitle>ipsec-networkof</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for their replacements.</para>
<para><emphasis>Subnetof</emphasis>
takes an Internet
<emphasis>address</emphasis>
and a subnet
<varname role='parameter'>mask</varname>
and returns the network part of the address
(all in network byte order).
<emphasis>Hostof</emphasis>
similarly returns the host part, and
<function>broadcastof</function>
returns the broadcast address (all-1s convention) for the network.</para>
<para>These functions are provided to hide the Internet bit-munging inside
an API, in hopes of easing the eventual transition to IPv6.</para>
</refsect1>
<refsect1 id='see_also'><title>SEE ALSO</title>
<para><citerefentry><refentrytitle>inet</refentrytitle><manvolnum>3</manvolnum></citerefentry>, <citerefentry><refentrytitle>ipsec-atosubnet</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='bugs'><title>BUGS</title>
<para>Calling functions for this is more costly than doing it yourself.</para>
</refsect1>
<refsect1 id='author'>
<title>AUTHOR</title>
<para>
<emphasis role='strong'>Paul Wouters</emphasis>
</para>
</refsect1>
</refentry>
|