a class to represent an Ipv4 address mask More...
#include <ipv4-address.h>
Public Member Functions | |
Ipv4Mask () | |
Ipv4Mask (uint32_t mask) | |
Ipv4Mask (char const *mask) | |
bool | IsMatch (Ipv4Address a, Ipv4Address b) const |
bool | IsEqual (Ipv4Mask other) const |
uint32_t | Get (void) const |
void | Set (uint32_t mask) |
uint32_t | GetInverse (void) const |
Return the inverse mask in host order. | |
void | Print (std::ostream &os) const |
Print this mask to the given output stream. | |
Static Public Member Functions | |
static Ipv4Mask | GetLoopback (void) |
static Ipv4Mask | GetZero (void) |
static Ipv4Mask | GetOnes (void) |
Private Attributes | |
uint32_t | m_mask |
a class to represent an Ipv4 address mask
Definition at line 202 of file ipv4-address.h.
ns3::Ipv4Mask::Ipv4Mask | ( | ) |
Definition at line 58 of file ipv4-address.cc.
Referenced by GetLoopback(), GetOnes(), and GetZero().
ns3::Ipv4Mask::Ipv4Mask | ( | uint32_t | mask | ) |
Definition at line 62 of file ipv4-address.cc.
ns3::Ipv4Mask::Ipv4Mask | ( | char const * | mask | ) |
Definition at line 65 of file ipv4-address.cc.
References ns3::AsciiToIpv4Host(), and m_mask.
uint32_t ns3::Ipv4Mask::Get | ( | void | ) | const |
Get the host-order 32-bit IP mask
Definition at line 91 of file ipv4-address.cc.
References m_mask.
Referenced by ns3::Ipv4Address::CombineMask(), ns3::Ipv4Interface::GetBroadcast(), ns3::Ipv4AddressGeneratorImpl::Init(), ns3::Ipv4AddressGeneratorImpl::MaskToIndex(), ns3::GlobalRouter::ProcessBridgedBroadcastLink(), ns3::GlobalRouter::ProcessPointToPointLink(), ns3::GlobalRouter::ProcessSingleBroadcastLink(), and ns3::Ipv4AddressHelper::SetBase().
uint32_t ns3::Ipv4Mask::GetInverse | ( | void | ) | const |
Return the inverse mask in host order.
Definition at line 101 of file ipv4-address.cc.
References m_mask.
Referenced by ns3::Ipv4Address::GetSubnetDirectedBroadcast(), and ns3::Ipv4Address::IsSubnetDirectedBroadcast().
Ipv4Mask ns3::Ipv4Mask::GetLoopback | ( | void | ) | [static] |
Definition at line 117 of file ipv4-address.cc.
References Ipv4Mask().
Referenced by ns3::Ipv4L3Protocol::SetupLoopback().
Ipv4Mask ns3::Ipv4Mask::GetOnes | ( | void | ) | [static] |
Definition at line 129 of file ipv4-address.cc.
References Ipv4Mask().
Referenced by ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4Address::GetSubnetDirectedBroadcast(), and ns3::Ipv4Address::IsSubnetDirectedBroadcast().
Ipv4Mask ns3::Ipv4Mask::GetZero | ( | void | ) | [static] |
Definition at line 123 of file ipv4-address.cc.
References Ipv4Mask().
Referenced by ns3::Ipv4Route::IsHost().
bool ns3::Ipv4Mask::IsEqual | ( | Ipv4Mask | other | ) | const |
other | a mask to compare |
Definition at line 71 of file ipv4-address.cc.
References m_mask.
Referenced by ns3::Ipv4Route::IsHost().
bool ns3::Ipv4Mask::IsMatch | ( | Ipv4Address | a, | |
Ipv4Address | b | |||
) | const |
a | first address to compare | |
b | second address to compare |
Definition at line 81 of file ipv4-address.cc.
References ns3::Ipv4Address::Get(), and m_mask.
void ns3::Ipv4Mask::Print | ( | std::ostream & | os | ) | const |
Print this mask to the given output stream.
The print format is in the typical "255.255.255.0"
os | The output stream to which this Ipv4Address is printed |
Definition at line 107 of file ipv4-address.cc.
References m_mask.
Referenced by ns3::NscTcpL4Protocol::AddInterface().
void ns3::Ipv4Mask::Set | ( | uint32_t | mask | ) |
input mask is in host order.
mask | The host order 32-bit mask |
Definition at line 96 of file ipv4-address.cc.
References m_mask.
uint32_t ns3::Ipv4Mask::m_mask [private] |
Definition at line 254 of file ipv4-address.h.
Referenced by Get(), GetInverse(), Ipv4Mask(), IsEqual(), IsMatch(), Print(), and Set().