#include <wvaddr.h>
Inheritance diagram for WvIPNet:
Public Methods | |
WvIPNet (const WvIPNet &_net) | |
WvIPNet (const char string[]) | |
WvIPNet (const WvString &string) | |
void | string_init (const char string[]) |
WvIPNet (const WvIPAddr &base, const WvIPAddr &_mask) | |
WvIPNet (const WvIPAddr &base, int bits=32) | |
WvIPNet () | |
virtual | ~WvIPNet () |
virtual unsigned | WvHash () const |
virtual bool | comparator (const WvAddr *a2) const |
WvIPAddr | base () const |
const WvIPAddr & | netmask () const |
WvIPAddr | network () const |
WvIPAddr | broadcast () const |
void | include (const WvIPNet &addr) |
bool | includes (const WvIPNet &addr) const |
int | bits () const |
void | normalize () |
bool | is_default () const |
bool | is_host () const |
WvIPNet (const WvIPNet &_net) | |
WvIPNet (const char string[]) | |
WvIPNet (const WvString &string) | |
void | string_init (const char string[]) |
WvIPNet (const WvIPAddr &base, const WvIPAddr &_mask) | |
WvIPNet (const WvIPAddr &base, int bits=32) | |
WvIPNet () | |
virtual | ~WvIPNet () |
virtual unsigned | WvHash () const |
virtual bool | comparator (const WvAddr *a2) const |
WvIPAddr | base () const |
const WvIPAddr & | netmask () const |
WvIPAddr | network () const |
WvIPAddr | broadcast () const |
void | include (const WvIPNet &addr) |
bool | includes (const WvIPNet &addr) const |
int | bits () const |
void | normalize () |
bool | is_default () const |
bool | is_host () const |
Protected Methods | |
virtual WvString | printable () const |
virtual WvString | printable () const |
Protected Attributes | |
WvIPAddr | mask |
WvIPNet internally stores a base IP address (the inherited WvIPAddr) and the netmask (a member variable).
Note that the rawdata() function is inherited from WvIPAddr, so it does not include the netmask in the raw data.
Definition at line 272 of file include/wvaddr.h.
|
Definition at line 506 of file wvaddr.cc. References WvAddr::addrtype, and wvipnet. |
|
Definition at line 280 of file include/wvaddr.h. References string_init(). |
|
Definition at line 282 of file include/wvaddr.h. References string_init(). |
|
Definition at line 545 of file wvaddr.cc. References WvAddr::addrtype, and wvipnet. |
|
construct an IPNet from a base address and a number of bits in the netmask. The default of 32 gives a one-host network, (netmask 255.255.255.255). Definition at line 552 of file wvaddr.cc. References WvAddr::addrtype, bits(), mask, WvIPAddr::WvIPAddr(), and wvipnet. |
|
construct an empty IPNet for later copying (probably by operator=) Definition at line 500 of file wvaddr.cc. References WvAddr::addrtype, and wvipnet. |
|
|
|
|
|
Definition at line 280 of file ipstreams/wvaddr.h. References string_init(). |
|
Definition at line 282 of file ipstreams/wvaddr.h. References string_init(). |
|
|
|
construct an IPNet from a base address and a number of bits in the netmask. The default of 32 gives a one-host network, (netmask 255.255.255.255). |
|
construct an empty IPNet for later copying (probably by operator=) |
|
|
|
Get the 'base IP address' component, netmask, network, and broadcast Definition at line 310 of file ipstreams/wvaddr.h. References WvIPAddr::binaddr, and WvIPAddr::WvIPAddr(). |
|
Get the 'base IP address' component, netmask, network, and broadcast Definition at line 310 of file include/wvaddr.h. References WvIPAddr::binaddr, and WvIPAddr::WvIPAddr(). Referenced by includes(), WvInterfaceDict::islocal(), and WvInterface::setipaddr(). |
|
weird netmasks such as 255.0.255.0 (easy example) are almost never used -- they have '0' bits in the middle. However, using the include() function will result in odd netmasks like this, since it will not eliminate a '1' bit unless absolutely necessary. normalize() would convert the above netmask into 255.0.0.0, which is probably the netmask _really_ in use. bits() calculates the number of leading '1' bits in the normalized netmask, without actually doing the normalization. |
|
weird netmasks such as 255.0.255.0 (easy example) are almost never used -- they have '0' bits in the middle. However, using the include() function will result in odd netmasks like this, since it will not eliminate a '1' bit unless absolutely necessary. normalize() would convert the above netmask into 255.0.0.0, which is probably the netmask _really_ in use. bits() calculates the number of leading '1' bits in the normalized netmask, without actually doing the normalization. Definition at line 604 of file wvaddr.cc. References bits(), mask, and WvIPAddr::s_addr(). Referenced by bits(), normalize(), printable(), WvInterface::setipaddr(), string_init(), and WvIPNet(). |
|
Definition at line 316 of file ipstreams/wvaddr.h. |
|
Definition at line 316 of file include/wvaddr.h. Referenced by WvInterfaceDict::islocal(), and WvInterface::setipaddr(). |
|
Reimplemented from WvAddr. |
|
Reimplemented from WvAddr. Definition at line 585 of file wvaddr.cc. References WvAddr::comparator(), and mask. |
|
adjust the netmask so that 'addr' would be included in this network |
|
adjust the netmask so that 'addr' would be included in this network Definition at line 591 of file wvaddr.cc. References mask. |
|
determine whether the given address is already included in this net |
|
determine whether the given address is already included in this net Definition at line 597 of file wvaddr.cc. References base(), mask, and network(). Referenced by WvInterfaceDict::on_local_net(). |
|
is this net the default gateway? (0.0.0.0/0) Definition at line 345 of file ipstreams/wvaddr.h. References WvIPAddr::binaddr. |
|
is this net the default gateway? (0.0.0.0/0) Definition at line 345 of file include/wvaddr.h. References WvIPAddr::binaddr. Referenced by WvInterface::addroute(), and WvInterface::delroute(). |
|
is it a plain host? (x.x.x.x/32) Definition at line 351 of file ipstreams/wvaddr.h. References WvIPAddr::binaddr. |
|
is it a plain host? (x.x.x.x/32) Definition at line 351 of file include/wvaddr.h. References WvIPAddr::binaddr. Referenced by WvInterface::addarp(). |
|
Definition at line 312 of file ipstreams/wvaddr.h. |
|
Definition at line 312 of file include/wvaddr.h. Referenced by WvInterface::addarp(), WvIPRoute::operator==(), and WvInterface::setipaddr(). |
|
Definition at line 314 of file ipstreams/wvaddr.h. |
|
Definition at line 314 of file include/wvaddr.h. Referenced by WvInterface::addarp(), includes(), WvIPRoute::operator==(), and printable(). |
|
|
|
Definition at line 618 of file wvaddr.cc. References bits(), mask, and WvIPAddr::WvIPAddr(). |
|
Reimplemented from WvIPAddr. |
|
Reimplemented from WvIPAddr. Definition at line 570 of file wvaddr.cc. References bits(), network(), and WvIPAddr::printable(). |
|
Reimplemented from WvIPAddr. |
|
Reimplemented from WvIPAddr. Definition at line 514 of file wvaddr.cc. References WvAddr::addrtype, bits(), mask, WvIPAddr::WvIPAddr(), and wvipnet. Referenced by WvIPNet(). |
|
Override the hash and comparison functions Reimplemented from WvAddr. |
|
Override the hash and comparison functions Reimplemented from WvAddr. Definition at line 579 of file wvaddr.cc. References mask, and WvAddr::WvHash(). |
|
Definition at line 275 of file ipstreams/wvaddr.h. Referenced by bits(), comparator(), include(), includes(), normalize(), string_init(), WvHash(), and WvIPNet(). |