ipsec_subnetof(3)

ipsec_subnetof3

Given internet address and subnet mask return subnet number, host part, broadcast address

Usage

#include <freeswan.h>

struct in_addr subnetof(struct in_addr addr, struct in_addr mask);
struct in_addr hostof(struct in_addr addr, struct in_addr mask);
struct in_addr broadcastof(struct in_addr addr, struct in_addr mask);

Overview

These functions are obsolete; see ipsec_networkof(3) for their replacements.

Subnetof takes an Internet address and a subnet mask and returns the network part of the address (all in network byte order). Hostof similarly returns the host part, and broadcastof returns the broadcast address (all-1s convention) for the network.

These functions are provided to hide the Internet bit-munging inside an API, in hopes of easing the eventual transition to IPv6.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 3 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 7

History

Written for the FreeS/WAN project by Henry Spencer.

Bugs

Calling functions for this is more costly than doing it yourself.

From openswan 1:2.6.37-3+deb7u1 in Debian 7 (Wheezy). Parsed by carta from the page's man source.