ns3::Ipv4Interface Class Reference

The IPv4 representation of a network interface. More...

#include <ipv4-interface.h>

Inheritance diagram for ns3::Ipv4Interface:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

Ptr< NetDeviceGetDevice (void) const
void SetMetric (uint16_t metric)
uint16_t GetMetric (void) const
bool IsUp (void) const
bool IsDown (void) const
void SetUp (void)
void SetDown (void)
bool IsForwarding (void) const
void SetForwarding (bool val)
void Send (Ptr< Packet > p, Ipv4Address dest)
bool AddAddress (Ipv4InterfaceAddress address)
Ipv4InterfaceAddress GetAddress (uint32_t index) const
uint32_t GetNAddresses (void) const
Ipv4InterfaceAddress RemoveAddress (uint32_t index)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Ipv4Interface.

Protected Member Functions

virtual void DoDispose (void)


Detailed Description

The IPv4 representation of a network interface.

This class roughly corresponds to the struct in_device of Linux; the main purpose is to provide address-family specific information (addresses) about an interface.

By default, Ipv4 interface are created in the "down" state no IP addresses. Before becoming useable, the user must add an address of some type and invoke Setup on them.


Member Function Documentation

bool ns3::Ipv4Interface::AddAddress ( Ipv4InterfaceAddress  address  ) 

Parameters:
address The Ipv4InterfaceAddress to add to the interface
Returns:
true if succeeded

virtual void ns3::Ipv4Interface::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.

Ipv4InterfaceAddress ns3::Ipv4Interface::GetAddress ( uint32_t  index  )  const

Parameters:
index Index of Ipv4InterfaceAddress to return
Returns:
The Ipv4InterfaceAddress address whose index is i

Ptr<NetDevice> ns3::Ipv4Interface::GetDevice ( void   )  const

Returns:
the underlying NetDevice. This method cannot return zero.

uint16_t ns3::Ipv4Interface::GetMetric ( void   )  const

Returns:
configured routing metric (cost) of this interface
Note: This is synonymous to the Metric value that ifconfig prints out. It is used by ns-3 global routing, but other routing daemons may choose to ignore it.

uint32_t ns3::Ipv4Interface::GetNAddresses ( void   )  const

Returns:
the number of Ipv4InterfaceAddresss stored on this interface

static TypeId ns3::Ipv4Interface::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Ipv4Interface.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::Ipv4L3Protocol/InterfaceList/[i]
Attributes defined for this type:
No TraceSources defined for this type.

Reimplemented from ns3::Object.

bool ns3::Ipv4Interface::IsDown ( void   )  const

Returns:
true if this interface is disabled, false otherwise.

bool ns3::Ipv4Interface::IsForwarding ( void   )  const

Returns:
true if this interface is enabled for IP forwarding of input datagrams

bool ns3::Ipv4Interface::IsUp ( void   )  const

These are IP interface states and may be distinct from NetDevice states, such as found in real implementations (where the device may be down but IP interface state is still up).

Returns:
true if this interface is enabled, false otherwise.

Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress ( uint32_t  index  ) 

Parameters:
index Index of Ipv4InterfaceAddress to remove
Returns:
The Ipv4InterfaceAddress address whose index is index

void ns3::Ipv4Interface::Send ( Ptr< Packet p,
Ipv4Address  dest 
)

Parameters:
p packet to send
dest next hop address of packet.
This method will eventually call the private SendTo method which must be implemented by subclasses.

void ns3::Ipv4Interface::SetDown ( void   ) 

Disable this interface

void ns3::Ipv4Interface::SetForwarding ( bool  val  ) 

Parameters:
val Whether to enable or disable IP forwarding for input datagrams

void ns3::Ipv4Interface::SetMetric ( uint16_t  metric  ) 

Parameters:
metric configured routing metric (cost) of this interface
Note: This is synonymous to the Metric value that ifconfig prints out. It is used by ns-3 global routing, but other routing daemons choose to ignore it.

void ns3::Ipv4Interface::SetUp ( void   ) 

Enable this interface


The documentation for this class was generated from the following files:

Generated on Fri Apr 9 15:01:10 2010 for NS-3 by  doxygen 1.5.8