Unix and Linux Discussions Tagged with subnet |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
4 |
11,074 |
UNIX for Advanced & Expert Users |
|
|
|
9 |
12,777 |
IP Networking |
|
|
|
0 |
1,887 |
IP Networking |
|
|
|
1 |
3,404 |
IP Networking |
|
|
|
7 |
5,316 |
IP Networking |
|
|
|
0 |
3,216 |
IP Networking |
|
|
|
2 |
2,916 |
IP Networking |
|
|
|
0 |
4,750 |
IP Networking |
|
|
|
5 |
15,564 |
IP Networking |
|
|
|
1 |
2,701 |
IP Networking |
|
|
|
2 |
6,950 |
IP Networking |
|
|
|
1 |
5,569 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
4,700 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
11,642 |
Cybersecurity |
|
|
|
7 |
15,876 |
IP Networking |
|
|
|
4 |
3,541 |
IP Networking |
|
|
|
2 |
5,644 |
IP Networking |
|
|
|
2 |
2,908 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,797 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
9,834 |
IP Networking |
IPSEC_GOODMASK(3) Library Functions Manual IPSEC_GOODMASK(3)
NAME
ipsec_goodmask, ipsec_masktobits, ipsec_bitstomask - check if Internet subnet mask is valid, convert Internet subnet mask to bit count,
convert bit count to Internet subnet mask
SYNOPSIS
#include <freeswan.h>
int goodmask(struct in_addr mask);
int masktobits(struct in_addr mask);
struct in_addr bitstomask(int n);
DESCRIPTION
These functions are obsolete; see ipsec_masktocount(3) for a partial replacement.
Goodmask reports whether the subnet mask is a valid one, i.e. consists of a (possibly empty) sequence of 1s followed by a (possibly empty)
sequence of 0s. Masktobits takes a (valid) subnet mask and returns the number of 1 bits in it. Bitstomask reverses this, returning the
subnet mask corresponding to bit count n.
All masks are in network byte order.
SEE ALSO
inet(3), ipsec_atosubnet(3)
DIAGNOSTICS
Masktobits returns -1 for an invalid mask. Bitstomask returns an all-zeros mask for a negative or out-of-range n.
HISTORY
Written for the FreeS/WAN project by Henry Spencer.
BUGS
The error-reporting convention of bitstomask is less than ideal; zero is sometimes a legitimate mask.
11 June 2001 IPSEC_GOODMASK(3)