#include <ipv4-impl.h>
Public Member Functions | |
Ipv4Impl () | |
virtual | ~Ipv4Impl () |
void | SetIpv4 (Ptr< Ipv4L3Protocol > ipv4) |
virtual void | AddRoutingProtocol (Ptr< Ipv4RoutingProtocol > routingProtocol, int16_t priority) |
Register a new routing protocol to be used in this IPv4 stack. | |
virtual void | AddHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface) |
virtual void | AddHostRouteTo (Ipv4Address dest, uint32_t interface) |
virtual void | AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface) |
virtual void | AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface) |
virtual void | SetDefaultRoute (Ipv4Address nextHop, uint32_t interface) |
virtual uint32_t | GetNRoutes (void) |
virtual Ipv4Route | GetRoute (uint32_t i) |
virtual void | RemoveRoute (uint32_t i) |
virtual void | AddMulticastRoute (Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces) |
Add a static multicast route for a given multicast source and group. | |
virtual void | SetDefaultMulticastRoute (uint32_t outputInterface) |
Set the default static multicast route. | |
virtual uint32_t | GetNMulticastRoutes (void) const |
virtual Ipv4MulticastRoute | GetMulticastRoute (uint32_t i) const |
virtual void | RemoveMulticastRoute (Ipv4Address origin, Ipv4Address group, uint32_t inputInterface) |
Remove a static multicast route for a given multicast source and group. | |
virtual void | RemoveMulticastRoute (uint32_t i) |
virtual uint32_t | AddInterface (Ptr< NetDevice > device) |
virtual uint32_t | GetNInterfaces (void) |
virtual uint32_t | FindInterfaceForAddr (Ipv4Address addr) const |
Find and return the interface ID of the interface that has been assigned the specified IP address. | |
virtual uint32_t | FindInterfaceForAddr (Ipv4Address addr, Ipv4Mask mask) const |
Find and return the interface ID of the interface that has been assigned the specified (masked) IP address. | |
virtual int32_t | FindInterfaceForDevice (Ptr< NetDevice > device) const |
Find and return the interface ID of the interface that has been associated with the specified (masked) NetDevice. | |
virtual Ptr< NetDevice > | GetNetDevice (uint32_t i) |
virtual void | JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) |
Join a multicast group for a given multicast source and group. | |
virtual void | LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) |
Leave a multicast group for a given multicast source and group. | |
virtual void | SetAddress (uint32_t i, Ipv4Address address) |
virtual void | SetNetworkMask (uint32_t i, Ipv4Mask mask) |
virtual Ipv4Mask | GetNetworkMask (uint32_t t) const |
virtual Ipv4Address | GetAddress (uint32_t i) const |
virtual void | SetMetric (uint32_t i, uint16_t metric) |
virtual uint16_t | GetMetric (uint32_t i) const |
virtual Ipv4Address | GetSourceAddress (Ipv4Address destination) const |
virtual bool | GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const |
virtual uint16_t | GetMtu (uint32_t i) const |
virtual bool | IsUp (uint32_t i) const |
virtual void | SetUp (uint32_t i) |
virtual void | SetDown (uint32_t i) |
Protected Member Functions | |
virtual void | DoDispose (void) |
Private Attributes | |
Ptr< Ipv4L3Protocol > | m_ipv4 |
Definition at line 30 of file ipv4-impl.h.
ns3::Ipv4Impl::Ipv4Impl | ( | ) |
Definition at line 28 of file ipv4-impl.cc.
ns3::Ipv4Impl::~Ipv4Impl | ( | ) | [virtual] |
Definition at line 31 of file ipv4-impl.cc.
void ns3::Ipv4Impl::AddHostRouteTo | ( | Ipv4Address | dest, | |
uint32_t | interface | |||
) | [virtual] |
dest | destination address | |
interface | of next hop |
add route to host dest on interface.
Implements ns3::Ipv4.
Definition at line 61 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::AddHostRouteTo | ( | Ipv4Address | dest, | |
Ipv4Address | nextHop, | |||
uint32_t | interface | |||
) | [virtual] |
dest | destination address | |
nextHop | address of next hop. | |
interface | interface of next hop. |
Add route to host dest through host nextHop on interface.
Implements ns3::Ipv4.
Definition at line 54 of file ipv4-impl.cc.
References m_ipv4.
device | device to add to the list of ipv4 interfaces which can be used as output interfaces during packet forwarding. |
Once a device has been added, it can never be removed: if you want to disable it, you can invoke Ipv4::SetDown which will make sure that it is never used during packet forwarding.
Implements ns3::Ipv4.
Definition at line 145 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::AddMulticastRoute | ( | Ipv4Address | origin, | |
Ipv4Address | group, | |||
uint32_t | inputInterface, | |||
std::vector< uint32_t > | outputInterfaces | |||
) | [virtual] |
Add a static multicast route for a given multicast source and group.
origin | The Ipv4 address of the multicast source. | |
group | The multicast group address. | |
inputInterface | The interface index over which the packet arrived. | |
outputInterfaces | The list of output interface indices over which the packet should be sent (excluding the inputInterface). |
Implements ns3::Ipv4.
Definition at line 104 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::AddNetworkRouteTo | ( | Ipv4Address | network, | |
Ipv4Mask | networkMask, | |||
uint32_t | interface | |||
) | [virtual] |
network | destination network | |
networkMask | netmask of destination network | |
interface | interface of next hop |
add route to network dest with netmask on interface
Implements ns3::Ipv4.
Definition at line 75 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::AddNetworkRouteTo | ( | Ipv4Address | network, | |
Ipv4Mask | networkMask, | |||
Ipv4Address | nextHop, | |||
uint32_t | interface | |||
) | [virtual] |
network | destination network | |
networkMask | netmask of destination network | |
nextHop | address of next hop | |
interface | interface of next hop |
add route to network dest with netmask through host nextHop on interface
Implements ns3::Ipv4.
Definition at line 67 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::AddRoutingProtocol | ( | Ptr< Ipv4RoutingProtocol > | routingProtocol, | |
int16_t | priority | |||
) | [virtual] |
Register a new routing protocol to be used in this IPv4 stack.
routingProtocol | new routing protocol implementation object | |
priority | priority to give to this routing protocol. Values may range between -32768 and +32767. The priority 0 corresponds to static routing table lookups, higher values have more priority. The order by which routing protocols with the same priority value are consulted is undefined. |
Implements ns3::Ipv4.
Definition at line 47 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::DoDispose | ( | void | ) | [protected, virtual] |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
Reimplemented from ns3::Object.
Definition at line 41 of file ipv4-impl.cc.
References m_ipv4.
uint32_t ns3::Ipv4Impl::FindInterfaceForAddr | ( | Ipv4Address | addr, | |
Ipv4Mask | mask | |||
) | const [virtual] |
Find and return the interface ID of the interface that has been assigned the specified (masked) IP address.
addr | The IP address assigned to the interface of interest. | |
mask | The address mask to be used in address matching. |
Each IP interface has an IP address associated with it. It is often useful to search the list of interfaces for one that corresponds to a known IP Address. This call takes an IP address and an IP address mask as parameters and returns the interface index of the first interface that matches the masked IP address.
Implements ns3::Ipv4.
Definition at line 163 of file ipv4-impl.cc.
References m_ipv4.
uint32_t ns3::Ipv4Impl::FindInterfaceForAddr | ( | Ipv4Address | addr | ) | const [virtual] |
Find and return the interface ID of the interface that has been assigned the specified IP address.
addr | The IP address assigned to the interface of interest. |
Each IP interface has an IP address associated with it. It is often useful to search the list of interfaces for one that corresponds to a known IP Address. This call takes an IP address as a parameter and returns the interface index of the first interface that has been assigned that address. If the address is not found, this function asserts.
Implements ns3::Ipv4.
Definition at line 157 of file ipv4-impl.cc.
References m_ipv4.
Find and return the interface ID of the interface that has been associated with the specified (masked) NetDevice.
nd | The net device of the interface of interest. |
Each IP interface is associated with a net device. It is often useful to search the list of interfaces for one that corresponds to a known net device. This call takes an smart pointer to a net device and returns the interface index of the first interface that matches the net device.
Implements ns3::Ipv4.
Definition at line 169 of file ipv4-impl.cc.
References m_ipv4.
Ipv4Address ns3::Ipv4Impl::GetAddress | ( | uint32_t | i | ) | const [virtual] |
i | index of ipv4 interface |
Note that the broadcast address for this interface may be fetched from the Ipv4Address object returned here using Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for the interface may be retrived using Ipv4::GetNetworkMask(i).
Implements ns3::Ipv4.
Definition at line 209 of file ipv4-impl.cc.
References m_ipv4.
bool ns3::Ipv4Impl::GetIfIndexForDestination | ( | Ipv4Address | dest, | |
uint32_t & | ifIndex | |||
) | const [virtual] |
dest | The IP address of a hypothetical destination. | |
ifIndex | filled in with the interface index that will be used to send a packet to the hypothetical destination. |
Implements ns3::Ipv4.
Definition at line 227 of file ipv4-impl.cc.
References m_ipv4.
uint16_t ns3::Ipv4Impl::GetMetric | ( | uint32_t | i | ) | const [virtual] |
i | index of ipv4 interface |
Implements ns3::Ipv4.
Definition at line 221 of file ipv4-impl.cc.
References m_ipv4.
uint16_t ns3::Ipv4Impl::GetMtu | ( | uint32_t | i | ) | const [virtual] |
i | index of ipv4 interface |
Implements ns3::Ipv4.
Definition at line 253 of file ipv4-impl.cc.
References m_ipv4.
Ipv4MulticastRoute ns3::Ipv4Impl::GetMulticastRoute | ( | uint32_t | i | ) | const [virtual] |
i | index of route to return |
Implements ns3::Ipv4.
Definition at line 125 of file ipv4-impl.cc.
References m_ipv4.
i | index of ipv4 interface |
Implements ns3::Ipv4.
Definition at line 175 of file ipv4-impl.cc.
References m_ipv4.
Ipv4Mask ns3::Ipv4Impl::GetNetworkMask | ( | uint32_t | i | ) | const [virtual] |
i | index of ipv4 interface |
Implements ns3::Ipv4.
Definition at line 203 of file ipv4-impl.cc.
References m_ipv4.
uint32_t ns3::Ipv4Impl::GetNInterfaces | ( | void | ) | [virtual] |
Implements ns3::Ipv4.
Definition at line 151 of file ipv4-impl.cc.
References m_ipv4.
uint32_t ns3::Ipv4Impl::GetNMulticastRoutes | ( | void | ) | const [virtual] |
Implements ns3::Ipv4.
Definition at line 119 of file ipv4-impl.cc.
References m_ipv4.
uint32_t ns3::Ipv4Impl::GetNRoutes | ( | void | ) | [virtual] |
Implements ns3::Ipv4.
Definition at line 88 of file ipv4-impl.cc.
References m_ipv4.
Ipv4Route ns3::Ipv4Impl::GetRoute | ( | uint32_t | i | ) | [virtual] |
i | index of route to return |
Implements ns3::Ipv4.
Definition at line 93 of file ipv4-impl.cc.
References m_ipv4.
Ipv4Address ns3::Ipv4Impl::GetSourceAddress | ( | Ipv4Address | destination | ) | const [virtual] |
destination | The IP address of a hypothetical destination. |
Note that the broadcast address for this interface may be fetched from the Ipv4Address object returned here using Ipv4Address::GetSubnetDirectedBroadcast(mask), where the mask for the interface may be retrived using Ipv4::GetNetworkMask(i).
Implements ns3::Ipv4.
Definition at line 233 of file ipv4-impl.cc.
References ns3::Ipv4Address::GetAny(), and m_ipv4.
bool ns3::Ipv4Impl::IsUp | ( | uint32_t | i | ) | const [virtual] |
i | index of ipv4 interface |
Implements ns3::Ipv4.
Definition at line 258 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::JoinMulticastGroup | ( | Ipv4Address | origin, | |
Ipv4Address | group | |||
) | [virtual] |
Join a multicast group for a given multicast source and group.
origin | The Ipv4 address of the multicast source. | |
group | The multicast group address. |
Implements ns3::Ipv4.
Definition at line 181 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::LeaveMulticastGroup | ( | Ipv4Address | origin, | |
Ipv4Address | group | |||
) | [virtual] |
Leave a multicast group for a given multicast source and group.
origin | The Ipv4 address of the multicast source. | |
group | The multicast group address. |
Implements ns3::Ipv4.
Definition at line 187 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::RemoveMulticastRoute | ( | uint32_t | i | ) | [virtual] |
i | index of route to remove from routing table. |
Implements ns3::Ipv4.
Definition at line 139 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::RemoveMulticastRoute | ( | Ipv4Address | origin, | |
Ipv4Address | group, | |||
uint32_t | inputInterface | |||
) | [virtual] |
Remove a static multicast route for a given multicast source and group.
origin | The Ipv4 address of the multicast source. | |
group | The multicast group address. | |
inputInterface | The interface index over which the packet arrived. |
Implements ns3::Ipv4.
Definition at line 131 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::RemoveRoute | ( | uint32_t | i | ) | [virtual] |
i | index of route to remove from routing table. |
Implements ns3::Ipv4.
Definition at line 98 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetAddress | ( | uint32_t | i, | |
Ipv4Address | address | |||
) | [virtual] |
i | index of ipv4 interface | |
address | address to associate to the underlying ipv4 interface |
Implements ns3::Ipv4.
Definition at line 193 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetDefaultMulticastRoute | ( | uint32_t | outputInterface | ) | [virtual] |
Set the default static multicast route.
outputInterface | The network output interface index over which packets without specific routes should be sent. |
Implements ns3::Ipv4.
Definition at line 113 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetDefaultRoute | ( | Ipv4Address | nextHop, | |
uint32_t | interface | |||
) | [virtual] |
nextHop | address of default next hop | |
interface | interface of default next hop. |
set the default route to host nextHop on interface.
Implements ns3::Ipv4.
Definition at line 82 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetDown | ( | uint32_t | i | ) | [virtual] |
i | index of ipv4 interface |
Set the interface into the "down" state. In this state, it is ignored during ipv4 forwarding.
Implements ns3::Ipv4.
Definition at line 268 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetIpv4 | ( | Ptr< Ipv4L3Protocol > | ipv4 | ) |
Definition at line 36 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetMetric | ( | uint32_t | i, | |
uint16_t | metric | |||
) | [virtual] |
i | index of ipv4 interface | |
metric | routing metric (cost) associated to the underlying ipv4 interface |
Implements ns3::Ipv4.
Definition at line 215 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetNetworkMask | ( | uint32_t | i, | |
Ipv4Mask | mask | |||
) | [virtual] |
i | index of ipv4 interface | |
mask | mask to associate to the underlying ipv4 interface |
Implements ns3::Ipv4.
Definition at line 198 of file ipv4-impl.cc.
References m_ipv4.
void ns3::Ipv4Impl::SetUp | ( | uint32_t | i | ) | [virtual] |
i | index of ipv4 interface |
Set the interface into the "up" state. In this state, it is considered valid during ipv4 forwarding.
Implements ns3::Ipv4.
Definition at line 263 of file ipv4-impl.cc.
References m_ipv4.
Ptr<Ipv4L3Protocol> ns3::Ipv4Impl::m_ipv4 [private] |
Definition at line 107 of file ipv4-impl.h.
Referenced by AddHostRouteTo(), AddInterface(), AddMulticastRoute(), AddNetworkRouteTo(), AddRoutingProtocol(), DoDispose(), FindInterfaceForAddr(), FindInterfaceForDevice(), GetAddress(), GetIfIndexForDestination(), GetMetric(), GetMtu(), GetMulticastRoute(), GetNetDevice(), GetNetworkMask(), GetNInterfaces(), GetNMulticastRoutes(), GetNRoutes(), GetRoute(), GetSourceAddress(), IsUp(), JoinMulticastGroup(), LeaveMulticastGroup(), RemoveMulticastRoute(), RemoveRoute(), SetAddress(), SetDefaultMulticastRoute(), SetDefaultRoute(), SetDown(), SetIpv4(), SetMetric(), SetNetworkMask(), SetUp(), and ~Ipv4Impl().