#include <ipv4-interface.h>
Public Member Functions | |
Ptr< NetDevice > | GetDevice (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) |
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.
bool ns3::Ipv4Interface::AddAddress | ( | Ipv4InterfaceAddress | address | ) |
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 |
index | Index of Ipv4InterfaceAddress to return |
uint16_t ns3::Ipv4Interface::GetMetric | ( | void | ) | const |
uint32_t ns3::Ipv4Interface::GetNAddresses | ( | void | ) | const |
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:
Reimplemented from ns3::Object.
bool ns3::Ipv4Interface::IsDown | ( | void | ) | const |
bool ns3::Ipv4Interface::IsForwarding | ( | void | ) | const |
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).
Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress | ( | uint32_t | index | ) |
index | Index of Ipv4InterfaceAddress to remove |
void ns3::Ipv4Interface::Send | ( | Ptr< Packet > | p, | |
Ipv4Address | dest | |||
) |
p | packet to send | |
dest | next hop address of packet. |
void ns3::Ipv4Interface::SetDown | ( | void | ) |
Disable this interface
void ns3::Ipv4Interface::SetForwarding | ( | bool | val | ) |
val | Whether to enable or disable IP forwarding for input datagrams |
void ns3::Ipv4Interface::SetMetric | ( | uint16_t | metric | ) |
metric | configured routing metric (cost) of this interface |
void ns3::Ipv4Interface::SetUp | ( | void | ) |
Enable this interface