ns3::Ipv4Impl Class Reference

#include <ipv4-impl.h>

Inheritance diagram for ns3::Ipv4Impl:
Inheritance graph
[legend]
Collaboration diagram for ns3::Ipv4Impl:
Collaboration graph
[legend]

List of all members.

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< NetDeviceGetNetDevice (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< Ipv4L3Protocolm_ipv4

Detailed Description

Definition at line 30 of file ipv4-impl.h.


Constructor & Destructor Documentation

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.

References m_ipv4, and NS_ASSERT.


Member Function Documentation

void ns3::Ipv4Impl::AddHostRouteTo ( Ipv4Address  dest,
uint32_t  interface 
) [virtual]
Parameters:
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]
Parameters:
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.

uint32_t ns3::Ipv4Impl::AddInterface ( Ptr< NetDevice device  )  [virtual]
Parameters:
device device to add to the list of ipv4 interfaces which can be used as output interfaces during packet forwarding.
Returns:
the index of the ipv4 interface added.

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.

Parameters:
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]
Parameters:
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]
Parameters:
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.

Parameters:
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.

Parameters:
addr The IP address assigned to the interface of interest.
mask The address mask to be used in address matching.
Returns:
The index of the ipv4 interface with the given address.

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.

Parameters:
addr The IP address assigned to the interface of interest.
Returns:
The index of the ipv4 interface with the given address.

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.

int32_t ns3::Ipv4Impl::FindInterfaceForDevice ( Ptr< NetDevice nd  )  const [virtual]

Find and return the interface ID of the interface that has been associated with the specified (masked) NetDevice.

Parameters:
nd The net device of the interface of interest.
Returns:
The index of the ipv4 interface associated with the given net device or -1 if not found.

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]
Parameters:
i index of ipv4 interface
Returns:
the address associated to the underlying 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]
Parameters:
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.
Returns:
true if a single interface can be identified, false otherwise.

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]
Parameters:
i index of ipv4 interface
Returns:
routing metric (cost) associated to the underlying 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]
Parameters:
i index of ipv4 interface
Returns:
the Maximum Transmission Unit (in bytes) associated to the underlying 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]
Parameters:
i index of route to return
Returns:
the route whose index is i

Implements ns3::Ipv4.

Definition at line 125 of file ipv4-impl.cc.

References m_ipv4.

Ptr< NetDevice > ns3::Ipv4Impl::GetNetDevice ( uint32_t  i  )  [virtual]
Parameters:
i index of ipv4 interface
Returns:
the NetDevice associated with the ipv4 interface index

Implements ns3::Ipv4.

Definition at line 175 of file ipv4-impl.cc.

References m_ipv4.

Ipv4Mask ns3::Ipv4Impl::GetNetworkMask ( uint32_t  i  )  const [virtual]
Parameters:
i index of ipv4 interface
Returns:
the mask associated to the underlying ipv4 interface

Implements ns3::Ipv4.

Definition at line 203 of file ipv4-impl.cc.

References m_ipv4.

uint32_t ns3::Ipv4Impl::GetNInterfaces ( void   )  [virtual]
Returns:
the number of interfaces added by the user.

Implements ns3::Ipv4.

Definition at line 151 of file ipv4-impl.cc.

References m_ipv4.

uint32_t ns3::Ipv4Impl::GetNMulticastRoutes ( void   )  const [virtual]
Returns:
the number of entries in the multicast routing table.

Implements ns3::Ipv4.

Definition at line 119 of file ipv4-impl.cc.

References m_ipv4.

uint32_t ns3::Ipv4Impl::GetNRoutes ( void   )  [virtual]
Returns:
the number of entries in the routing table.

Implements ns3::Ipv4.

Definition at line 88 of file ipv4-impl.cc.

References m_ipv4.

Ipv4Route ns3::Ipv4Impl::GetRoute ( uint32_t  i  )  [virtual]
Parameters:
i index of route to return
Returns:
the route whose index is i

Implements ns3::Ipv4.

Definition at line 93 of file ipv4-impl.cc.

References m_ipv4.

Ipv4Address ns3::Ipv4Impl::GetSourceAddress ( Ipv4Address  destination  )  const [virtual]
Parameters:
destination The IP address of a hypothetical destination.
Returns:
The IP address assigned to the interface that will be used if we were to send a packet to 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]
Parameters:
i index of ipv4 interface
Returns:
true if the underlying interface is in the "up" state, false otherwise.

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.

Parameters:
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.

Parameters:
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]
Parameters:
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.

Parameters:
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]
Parameters:
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]
Parameters:
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.

Parameters:
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]
Parameters:
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]
Parameters:
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]
Parameters:
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]
Parameters:
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]
Parameters:
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.


Member Data Documentation


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:40 2009 for NS-3 by  doxygen 1.6.3