a class to store IPv4 address information on an interface More...
#include <ipv4-interface-address.h>
Public Types | |
enum | InterfaceAddressScope_e { HOST, LINK, GLOBAL } |
Public Member Functions | |
Ipv4InterfaceAddress () | |
Ipv4InterfaceAddress (Ipv4Address local, Ipv4Mask mask) | |
Ipv4InterfaceAddress (const Ipv4InterfaceAddress &o) | |
Ipv4Address | GetBroadcast (void) const |
Ipv4Address | GetLocal (void) const |
Ipv4Mask | GetMask (void) const |
Ipv4InterfaceAddress::InterfaceAddressScope_e | GetScope (void) const |
bool | IsSecondary (void) const |
void | SetBroadcast (Ipv4Address broadcast) |
void | SetLocal (Ipv4Address local) |
void | SetMask (Ipv4Mask mask) |
void | SetPrimary (void) |
void | SetScope (Ipv4InterfaceAddress::InterfaceAddressScope_e scope) |
void | SetSecondary (void) |
Private Attributes | |
Ipv4Address | m_broadcast |
Ipv4Address | m_local |
Ipv4Mask | m_mask |
InterfaceAddressScope_e | m_scope |
bool | m_secondary |
Friends | |
bool | operator!= (Ipv4InterfaceAddress const &a, Ipv4InterfaceAddress const &b) |
bool | operator== (Ipv4InterfaceAddress const &a, Ipv4InterfaceAddress const &b) |
a class to store IPv4 address information on an interface
Corresponds to Linux struct in_ifaddr. A list of these addresses is stored in Ipv4Interface. This class is modelled after how current Linux handles IP aliasing for IPv4. Notably, aliasing of IPv4 interfaces (e.g., "eth0:1") is not used, and instead an interface is assigned possibly multiple addresses, with each address being classified as being primary and secondary. See the iproute2 documentation for this distinction.
Definition at line 42 of file ipv4-interface-address.h.
Definition at line 45 of file ipv4-interface-address.h.
ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress | ( | ) |
Definition at line 29 of file ipv4-interface-address.cc.
References NS_LOG_FUNCTION.
ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress | ( | Ipv4Address | local, |
Ipv4Mask | mask | ||
) |
Definition at line 36 of file ipv4-interface-address.cc.
References ns3::Ipv4Address::Get(), ns3::Ipv4Mask::Get(), m_broadcast, m_local, m_mask, and NS_LOG_FUNCTION.
ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress | ( | const Ipv4InterfaceAddress & | o | ) |
Definition at line 46 of file ipv4-interface-address.cc.
References NS_LOG_FUNCTION.
Ipv4Address ns3::Ipv4InterfaceAddress::GetBroadcast | ( | void | ) | const |
Definition at line 92 of file ipv4-interface-address.cc.
References m_broadcast, and NS_LOG_FUNCTION.
Referenced by ns3::DsdvTableTestCase::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4L3Protocol::IsDestinationAddress(), ns3::aodv::RoutingProtocol::NotifyAddAddress(), ns3::dsdv::RoutingProtocol::NotifyAddAddress(), ns3::aodv::RoutingProtocol::NotifyInterfaceUp(), ns3::aodv::RoutingProtocol::NotifyRemoveAddress(), ns3::operator<<(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::aodv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteInput(), ns3::Ipv4StaticRouting::RouteInput(), ns3::Ipv4GlobalRouting::RouteInput(), ns3::aodv::RoutingProtocol::SendHello(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), and ns3::dsr::DsrRouting::Start().
Ipv4Address ns3::Ipv4InterfaceAddress::GetLocal | ( | void | ) | const |
Definition at line 64 of file ipv4-interface-address.cc.
References m_local, and NS_LOG_FUNCTION.
Referenced by ns3::EpcHelper::ActivateEpsBearer(), ns3::olsr::RoutingProtocol::AddEntry(), ns3::NscTcpL4Protocol::AddInterface(), ns3::GlobalRouter::BuildNetworkLSAs(), ns3::Ipv4NixVectorRouting::BuildNixVectorLocal(), ns3::TapBridge::CreateTap(), ns3::olsr::RoutingProtocol::DoInitialize(), StaticRoutingSlash32TestCase::DoRun(), ns3::DsdvTableTestCase::DoRun(), GlobalRoutingSlash32TestCase::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4NixVectorRouting::FindNetDeviceForNixIndex(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::dsr::DsrOptions::GetIDfromIP(), ns3::dsr::DsrRouting::GetIDfromIP(), ns3::dsr::DsrRouting::GetIPfromID(), ns3::dsr::DsrRouting::GetIPfromMAC(), ns3::AnimationInterface::GetIpv4Address(), ns3::Ipv4L3Protocol::IsDestinationAddress(), ns3::aodv::RoutingProtocol::IsMyOwnAddress(), ns3::olsr::RoutingProtocol::IsMyOwnAddress(), ns3::Ipv4L3Protocol::LocalDeliver(), ns3::Ipv4EndPointDemux::Lookup(), main(), ns3::aodv::RoutingProtocol::NotifyAddAddress(), ns3::dsdv::RoutingProtocol::NotifyAddAddress(), ns3::Ipv4StaticRouting::NotifyAddAddress(), ns3::dsr::DsrRouting::NotifyDataReceipt(), ns3::aodv::RoutingProtocol::NotifyInterfaceDown(), ns3::aodv::RoutingProtocol::NotifyInterfaceUp(), ns3::dsdv::RoutingProtocol::NotifyInterfaceUp(), ns3::Ipv4StaticRouting::NotifyInterfaceUp(), ns3::aodv::RoutingProtocol::NotifyRemoveAddress(), ns3::Ipv4StaticRouting::NotifyRemoveAddress(), ns3::operator<<(), ns3::aodv::RoutingTableEntry::Print(), ns3::dsdv::RoutingTableEntry::Print(), PrintPosition(), ns3::GlobalRouter::ProcessBridgedBroadcastLink(), ns3::GlobalRouter::ProcessPointToPointLink(), ns3::GlobalRouter::ProcessSingleBroadcastLink(), ns3::aodv::RoutingProtocol::RouteInput(), ns3::dsdv::RoutingProtocol::RouteInput(), ns3::Ipv4StaticRouting::RouteInput(), ns3::Ipv4GlobalRouting::RouteInput(), ns3::Ipv4NixVectorRouting::RouteInput(), ns3::olsr::RoutingProtocol::RouteInput(), ns3::Ipv4NixVectorRouting::RouteOutput(), ns3::olsr::RoutingProtocol::RouteOutput(), ns3::dsdv::RoutingTableEntry::RoutingTableEntry(), ns3::aodv::RoutingTableEntry::RoutingTableEntry(), ns3::Ipv4L3Protocol::SelectSourceAddress(), ns3::Ipv4L3Protocol::Send(), ns3::aodv::RoutingProtocol::SendHello(), ns3::olsr::RoutingProtocol::SendMid(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SendRerrMessage(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), ns3::aodv::RoutingProtocol::SetIpv4(), ns3::dsdv::RoutingProtocol::SetIpv4(), ns3::olsr::RoutingProtocol::SetMainInterface(), ns3::Ipv4StaticRouting::SourceAddressSelection(), and ns3::dsr::DsrRouting::Start().
Ipv4Mask ns3::Ipv4InterfaceAddress::GetMask | ( | void | ) | const |
Definition at line 78 of file ipv4-interface-address.cc.
References m_mask, and NS_LOG_FUNCTION.
Referenced by ns3::NscTcpL4Protocol::AddInterface(), ns3::GlobalRouter::BuildNetworkLSAs(), ns3::TapBridge::CreateTap(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4L3Protocol::LocalDeliver(), ns3::Ipv4EndPointDemux::Lookup(), ns3::Ipv4StaticRouting::NotifyAddAddress(), ns3::Ipv4StaticRouting::NotifyInterfaceUp(), ns3::Ipv4StaticRouting::NotifyRemoveAddress(), ns3::operator<<(), ns3::GlobalRouter::ProcessBridgedBroadcastLink(), ns3::GlobalRouter::ProcessPointToPointLink(), ns3::GlobalRouter::ProcessSingleBroadcastLink(), ns3::aodv::RoutingProtocol::RecvRequest(), ns3::Ipv4L3Protocol::SelectSourceAddress(), ns3::Ipv4L3Protocol::Send(), ns3::aodv::RoutingProtocol::SendHello(), ns3::dsdv::RoutingProtocol::SendPeriodicUpdate(), ns3::aodv::RoutingProtocol::SendRequest(), ns3::aodv::RoutingProtocol::SendRerrWhenNoRouteToForward(), ns3::dsdv::RoutingProtocol::SendTriggeredUpdate(), and ns3::Ipv4StaticRouting::SourceAddressSelection().
Ipv4InterfaceAddress::InterfaceAddressScope_e ns3::Ipv4InterfaceAddress::GetScope | ( | void | ) | const |
Definition at line 106 of file ipv4-interface-address.cc.
References m_scope, and NS_LOG_FUNCTION.
Referenced by ns3::operator<<(), and ns3::Ipv4L3Protocol::SelectSourceAddress().
bool ns3::Ipv4InterfaceAddress::IsSecondary | ( | void | ) | const |
Definition at line 113 of file ipv4-interface-address.cc.
References m_secondary, and NS_LOG_FUNCTION.
Referenced by ns3::operator<<(), ns3::Ipv4L3Protocol::SelectSourceAddress(), and ns3::Ipv4StaticRouting::SourceAddressSelection().
void ns3::Ipv4InterfaceAddress::SetBroadcast | ( | Ipv4Address | broadcast | ) |
Definition at line 85 of file ipv4-interface-address.cc.
References m_broadcast, and NS_LOG_FUNCTION.
void ns3::Ipv4InterfaceAddress::SetLocal | ( | Ipv4Address | local | ) |
Definition at line 57 of file ipv4-interface-address.cc.
References m_local, and NS_LOG_FUNCTION.
void ns3::Ipv4InterfaceAddress::SetMask | ( | Ipv4Mask | mask | ) |
Definition at line 71 of file ipv4-interface-address.cc.
References m_mask, and NS_LOG_FUNCTION.
void ns3::Ipv4InterfaceAddress::SetPrimary | ( | void | ) |
Definition at line 127 of file ipv4-interface-address.cc.
References m_secondary, and NS_LOG_FUNCTION.
void ns3::Ipv4InterfaceAddress::SetScope | ( | Ipv4InterfaceAddress::InterfaceAddressScope_e | scope | ) |
Definition at line 99 of file ipv4-interface-address.cc.
References m_scope, and NS_LOG_FUNCTION.
void ns3::Ipv4InterfaceAddress::SetSecondary | ( | void | ) |
Definition at line 120 of file ipv4-interface-address.cc.
References m_secondary, and NS_LOG_FUNCTION.
|
friend |
Definition at line 92 of file ipv4-interface-address.h.
|
friend |
Definition at line 87 of file ipv4-interface-address.h.
|
private |
Definition at line 76 of file ipv4-interface-address.h.
Referenced by GetBroadcast(), Ipv4InterfaceAddress(), ns3::operator!=(), ns3::operator==(), and SetBroadcast().
|
private |
Definition at line 72 of file ipv4-interface-address.h.
Referenced by GetLocal(), Ipv4InterfaceAddress(), ns3::operator!=(), ns3::operator==(), and SetLocal().
|
private |
Definition at line 75 of file ipv4-interface-address.h.
Referenced by GetMask(), Ipv4InterfaceAddress(), ns3::operator!=(), ns3::operator==(), and SetMask().
|
private |
Definition at line 78 of file ipv4-interface-address.h.
Referenced by GetScope(), ns3::operator!=(), ns3::operator==(), and SetScope().
|
private |
Definition at line 79 of file ipv4-interface-address.h.
Referenced by IsSecondary(), ns3::operator!=(), ns3::operator==(), SetPrimary(), and SetSecondary().