21 #ifndef IPV4_ADDRESS_H
22 #define IPV4_ADDRESS_H
26 #include "ns3/address.h"
27 #include "ns3/attribute-helper.h"
28 #include "ns3/deprecated.h"
63 uint32_t
Get (
void)
const;
99 void Print (std::ostream &os)
const;
108 bool IsAny (
void)
const;
283 uint32_t
Get (
void)
const;
288 void Set (uint32_t mask);
300 void Print (std::ostream &os)
const;
a polymophic address class
Class providing an hash for IPv4 addresses.
size_t operator()(Ipv4Address const &x) const
Returns the hash of an IPv4 address.
Ipv4 addresses are stored in host order in this class.
void Print(std::ostream &os) const
Print this address to the given output stream.
uint32_t Get(void) const
Get the host-order 32-bit IP address.
static uint8_t GetType(void)
Get the underlying address type (automatically assigned).
bool IsMulticast(void) const
bool IsInitialized(void) const
static Ipv4Address GetBroadcast(void)
static Ipv4Address GetLoopback(void)
static Ipv4Address ConvertFrom(const Address &address)
friend bool operator<(Ipv4Address const &a, Ipv4Address const &b)
Less than to operator.
static bool IsMatchingType(const Address &address)
void Set(uint32_t address)
input address is in host order.
bool IsBroadcast(void) const
static Ipv4Address GetAny(void)
bool IsSubnetDirectedBroadcast(Ipv4Mask const &mask) const
Generate subnet-directed broadcast address corresponding to mask.
void Serialize(uint8_t buf[4]) const
Serialize this address to a 4-byte buffer.
bool IsLocalMulticast(void) const
bool IsLocalhost(void) const
static Ipv4Address Deserialize(const uint8_t buf[4])
friend bool operator!=(Ipv4Address const &a, Ipv4Address const &b)
Not equal to operator.
bool m_initialized
IPv4 address has been explicitly initialized to a valid value.
Ipv4Address GetSubnetDirectedBroadcast(Ipv4Mask const &mask) const
Generate subnet-directed broadcast address corresponding to mask.
uint32_t m_address
IPv4 address.
Ipv4Address CombineMask(Ipv4Mask const &mask) const
Combine this address with a network mask.
friend bool operator==(Ipv4Address const &a, Ipv4Address const &b)
Equal to operator.
Address ConvertTo(void) const
Convert to an Address type.
static Ipv4Address GetZero(void)
a class to represent an Ipv4 address mask
friend bool operator==(Ipv4Mask const &a, Ipv4Mask const &b)
Equal to operator.
void Set(uint32_t mask)
input mask is in host order.
uint32_t GetInverse(void) const
Return the inverse mask in host order.
Ipv4Mask()
Will initialize to a garbage value (0x66666666)
uint16_t GetPrefixLength(void) const
static Ipv4Mask GetLoopback(void)
friend bool operator!=(Ipv4Mask const &a, Ipv4Mask const &b)
Not equal to operator.
void Print(std::ostream &os) const
Print this mask to the given output stream.
static Ipv4Mask GetZero(void)
bool IsMatch(Ipv4Address a, Ipv4Address b) const
uint32_t Get(void) const
Get the host-order 32-bit IP mask.
static Ipv4Mask GetOnes(void)
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator==(const EventId &a, const EventId &b)
bool operator<(const EventId &a, const EventId &b)
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
std::istream & operator>>(std::istream &is, Angles &a)
std::ostream & operator<<(std::ostream &os, const Angles &a)
list x
Random number samples.