summaryrefslogtreecommitdiff
path: root/src/libfreeswan/subnetof.3
blob: aacc76d2c4876df4363672429aece80f26371551 (plain)
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
.TH IPSEC_SUBNETOF 3 "11 June 2001"
.SH NAME
ipsec subnetof \- given Internet address and subnet mask, return subnet number
.br
ipsec hostof \- given Internet address and subnet mask, return host part
.br
ipsec broadcastof \- given Internet address and subnet mask, return broadcast address
.SH SYNOPSIS
.B "#include <freeswan.h>
.sp
.B "struct in_addr subnetof(struct in_addr addr,"
.ti +1c
.B "struct in_addr mask);"
.br
.B "struct in_addr hostof(struct in_addr addr,"
.ti +1c
.B "struct in_addr mask);"
.br
.B "struct in_addr broadcastof(struct in_addr addr,"
.ti +1c
.B "struct in_addr mask);"
.SH DESCRIPTION
These functions are obsolete; see
.IR ipsec_networkof (3)
for their replacements.
.PP
.I Subnetof
takes an Internet
.I address
and a subnet
.I mask
and returns the network part of the address
(all in network byte order).
.I Hostof
similarly returns the host part, and
.I broadcastof
returns the broadcast address (all-1s convention) for the network.
.PP
These functions are provided to hide the Internet bit-munging inside
an API, in hopes of easing the eventual transition to IPv6.
.SH SEE ALSO
inet(3), ipsec_atosubnet(3)
.SH HISTORY
Written for the FreeS/WAN project by Henry Spencer.
.SH BUGS
Calling functions for this is more costly than doing it yourself.