|
ns-3
|
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. | |
| uint16_t | GetPrefixLength (void) const |
Static Public Member Functions | |
| static Ipv4Mask | GetLoopback (void) |
| static Ipv4Mask | GetZero (void) |
| static Ipv4Mask | GetOnes (void) |
a class to represent an Ipv4 address mask
The constructor takes arguments according to a few formats. Ipv4Mask ("255.255.255.255"), Ipv4Mask ("/32"), and Ipv4Mask (0xffffffff) are all equivalent.
Will initialize to a garbage value (0x66666666)
Referenced by GetLoopback(), GetOnes(), and GetZero().
| ns3::Ipv4Mask::Ipv4Mask | ( | uint32_t | mask | ) |
| mask | bitwise integer representation of the mask |
For example, the integer input 0xffffff00 yields a 24-bit mask
| ns3::Ipv4Mask::Ipv4Mask | ( | char const * | mask | ) |
| mask | String constant either in "255.255.255.0" or "/24" format |
References NS_ASSERT.
| uint32_t ns3::Ipv4Mask::Get | ( | void | ) | const |
Get the host-order 32-bit IP mask
Referenced by ns3::Ipv4Address::CombineMask(), and ns3::Ipv4AddressHelper::SetBase().
| Ipv4Mask ns3::Ipv4Mask::GetLoopback | ( | void | ) | [static] |
References Ipv4Mask().
| Ipv4Mask ns3::Ipv4Mask::GetOnes | ( | void | ) | [static] |
References Ipv4Mask().
Referenced by ns3::Ipv4StaticRouting::AddHostRouteTo(), ns3::Ipv4Address::GetSubnetDirectedBroadcast(), ns3::Ipv4RoutingTableEntry::IsHost(), ns3::Ipv4Address::IsSubnetDirectedBroadcast(), and ns3::Ipv4StaticRouting::NotifyInterfaceUp().
| uint16_t ns3::Ipv4Mask::GetPrefixLength | ( | void | ) | const |
Referenced by ns3::Ipv4StaticRouting::GetDefaultRoute().
| Ipv4Mask ns3::Ipv4Mask::GetZero | ( | void | ) | [static] |
References Ipv4Mask().
Referenced by ns3::Ipv4StaticRouting::SetDefaultRoute().
| bool ns3::Ipv4Mask::IsEqual | ( | Ipv4Mask | other | ) | const |
| other | a mask to compare |
Referenced by ns3::Ipv4RoutingTableEntry::IsHost().
| bool ns3::Ipv4Mask::IsMatch | ( | Ipv4Address | a, |
| Ipv4Address | b | ||
| ) | const |
| a | first address to compare |
| b | second address to compare |
References ns3::Ipv4Address::Get().
| 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 |
| void ns3::Ipv4Mask::Set | ( | uint32_t | mask | ) |
input mask is in host order.
| mask | The host order 32-bit mask |