ipsec goodmask - is this Internet subnet mask a valid one?
ipsec masktobits - convert Internet subnet mask to bit count
ipsec bitstomask - convert bit count to Internet subnet mask
int goodmask(struct in_addr mask);
int masktobits(struct in_addr mask);
struct in_addr bitstomask(int n);
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.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |