network: Add IsLocalhost and IsAny to Ipv4Address
This commit is contained in:
@@ -1848,6 +1848,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
|
||||
'ns3::Ipv4Address',
|
||||
[],
|
||||
is_static=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function]
|
||||
cls.add_method('IsAny',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function]
|
||||
cls.add_method('IsBroadcast',
|
||||
'bool',
|
||||
@@ -1863,6 +1868,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function]
|
||||
cls.add_method('IsLocalhost',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function]
|
||||
cls.add_method('IsMatchingType',
|
||||
'bool',
|
||||
|
||||
@@ -1848,6 +1848,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
|
||||
'ns3::Ipv4Address',
|
||||
[],
|
||||
is_static=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function]
|
||||
cls.add_method('IsAny',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function]
|
||||
cls.add_method('IsBroadcast',
|
||||
'bool',
|
||||
@@ -1863,6 +1868,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls):
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function]
|
||||
cls.add_method('IsLocalhost',
|
||||
'bool',
|
||||
[],
|
||||
is_const=True)
|
||||
## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function]
|
||||
cls.add_method('IsMatchingType',
|
||||
'bool',
|
||||
|
||||
@@ -264,6 +264,20 @@ Ipv4Address::IsSubnetDirectedBroadcast (Ipv4Mask const &mask) const
|
||||
return ( (Get () | mask.GetInverse ()) == Get () );
|
||||
}
|
||||
|
||||
bool
|
||||
Ipv4Address::IsAny (void) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return (m_address == 0x00000000U);
|
||||
}
|
||||
|
||||
bool
|
||||
Ipv4Address::IsLocalhost (void) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
return (m_address == 0x7f000001U);
|
||||
}
|
||||
|
||||
bool
|
||||
Ipv4Address::IsBroadcast (void) const
|
||||
{
|
||||
|
||||
@@ -105,6 +105,14 @@ public:
|
||||
* \param os The output stream to which this Ipv4Address is printed
|
||||
*/
|
||||
void Print (std::ostream &os) const;
|
||||
/**
|
||||
* \return true if address is 0.0.0.0; false otherwise
|
||||
*/
|
||||
bool IsAny (void) const;
|
||||
/**
|
||||
* \return true if address is 127.0.0.1; false otherwise
|
||||
*/
|
||||
bool IsLocalhost (void) const;
|
||||
/**
|
||||
* \return true if address is 255.255.255.255; false otherwise
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user