OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / lib / subnetof.3
1 .TH IPSEC_SUBNETOF 3 "11 June 2001"
2 .\" RCSID $Id: subnetof.3,v 1.5 2001/06/11 23:08:00 henry Exp $
3 .SH NAME
4 ipsec subnetof \- given Internet address and subnet mask, return subnet number
5 .br
6 ipsec hostof \- given Internet address and subnet mask, return host part
7 .br
8 ipsec broadcastof \- given Internet address and subnet mask, return broadcast address
9 .SH SYNOPSIS
10 .B "#include <freeswan.h>
11 .sp
12 .B "struct in_addr subnetof(struct in_addr addr,"
13 .ti +1c
14 .B "struct in_addr mask);"
15 .br
16 .B "struct in_addr hostof(struct in_addr addr,"
17 .ti +1c
18 .B "struct in_addr mask);"
19 .br
20 .B "struct in_addr broadcastof(struct in_addr addr,"
21 .ti +1c
22 .B "struct in_addr mask);"
23 .SH DESCRIPTION
24 These functions are obsolete; see
25 .IR ipsec_networkof (3)
26 for their replacements.
27 .PP
28 .I Subnetof
29 takes an Internet
30 .I address
31 and a subnet
32 .I mask
33 and returns the network part of the address
34 (all in network byte order).
35 .I Hostof
36 similarly returns the host part, and
37 .I broadcastof
38 returns the broadcast address (all-1s convention) for the network.
39 .PP
40 These functions are provided to hide the Internet bit-munging inside
41 an API, in hopes of easing the eventual transition to IPv6.
42 .SH SEE ALSO
43 inet(3), ipsec_atosubnet(3)
44 .SH HISTORY
45 Written for the FreeS/WAN project by Henry Spencer.
46 .SH BUGS
47 Calling functions for this is more costly than doing it yourself.