|
| Ipv4 () |
|
virtual | ~Ipv4 () |
|
virtual bool | AddAddress (uint32_t interface, Ipv4InterfaceAddress address)=0 |
|
virtual uint32_t | AddInterface (Ptr< NetDevice > device)=0 |
|
virtual Ptr< Socket > | CreateRawSocket (void)=0 |
| Creates a raw socket. More...
|
|
virtual void | DeleteRawSocket (Ptr< Socket > socket)=0 |
| Deletes a particular raw socket. More...
|
|
virtual Ipv4InterfaceAddress | GetAddress (uint32_t interface, uint32_t addressIndex) const =0 |
|
virtual int32_t | GetInterfaceForAddress (Ipv4Address address) const =0 |
| Return the interface number of the interface that has been assigned the specified IP address. More...
|
|
virtual int32_t | GetInterfaceForDevice (Ptr< const NetDevice > device) const =0 |
|
virtual int32_t | GetInterfaceForPrefix (Ipv4Address address, Ipv4Mask mask) const =0 |
| Return the interface number of first interface found that has an Ipv4 address within the prefix specified by the input address and mask parameters. More...
|
|
virtual uint16_t | GetMetric (uint32_t interface) const =0 |
|
virtual uint16_t | GetMtu (uint32_t interface) const =0 |
|
virtual uint32_t | GetNAddresses (uint32_t interface) const =0 |
|
virtual Ptr< NetDevice > | GetNetDevice (uint32_t interface)=0 |
|
virtual uint32_t | GetNInterfaces (void) const =0 |
|
virtual Ptr< IpL4Protocol > | GetProtocol (int protocolNumber) const =0 |
|
virtual Ptr< Ipv4RoutingProtocol > | GetRoutingProtocol (void) const =0 |
| Get the routing protocol to be used by this Ipv4 stack. More...
|
|
virtual void | Insert (Ptr< IpL4Protocol > protocol)=0 |
|
virtual bool | IsDestinationAddress (Ipv4Address address, uint32_t iif) const =0 |
| Determine whether address and interface corresponding to received packet can be accepted for local delivery. More...
|
|
virtual bool | IsForwarding (uint32_t interface) const =0 |
|
virtual bool | IsUp (uint32_t interface) const =0 |
|
virtual bool | RemoveAddress (uint32_t interface, uint32_t addressIndex)=0 |
|
virtual bool | RemoveAddress (uint32_t interface, Ipv4Address address)=0 |
| Remove the given address on named Ipv4 interface. More...
|
|
virtual Ipv4Address | SelectSourceAddress (Ptr< const NetDevice > device, Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope)=0 |
| Return the first primary source address with scope less than or equal to the requested scope, to use in sending a packet to destination dst out of the specified device. More...
|
|
virtual void | Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route)=0 |
|
virtual void | SendWithHeader (Ptr< Packet > packet, Ipv4Header ipHeader, Ptr< Ipv4Route > route)=0 |
|
virtual void | SetDown (uint32_t interface)=0 |
|
virtual void | SetForwarding (uint32_t interface, bool val)=0 |
|
virtual void | SetMetric (uint32_t interface, uint16_t metric)=0 |
|
virtual void | SetRoutingProtocol (Ptr< Ipv4RoutingProtocol > routingProtocol)=0 |
| Register a new routing protocol to be used by this Ipv4 stack. More...
|
|
virtual void | SetUp (uint32_t interface)=0 |
|
| Object () |
|
virtual | ~Object () |
|
void | AggregateObject (Ptr< Object > other) |
|
void | Dispose (void) |
|
AggregateIterator | GetAggregateIterator (void) const |
|
virtual TypeId | GetInstanceTypeId (void) const |
|
template<typename T > |
Ptr< T > | GetObject (void) const |
|
template<typename T > |
Ptr< T > | GetObject (TypeId tid) const |
|
void | Initialize (void) |
|
| SimpleRefCount () |
|
| SimpleRefCount (const SimpleRefCount &o) |
|
uint32_t | GetReferenceCount (void) const |
|
SimpleRefCount & | operator= (const SimpleRefCount &o) |
|
void | Ref (void) const |
|
void | Unref (void) const |
|
virtual | ~ObjectBase () |
|
void | GetAttribute (std::string name, AttributeValue &value) const |
|
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
|
void | SetAttribute (std::string name, const AttributeValue &value) |
|
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
|
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
|
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
|
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
|
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
|
Access to the Ipv4 forwarding table, interfaces, and configuration.
This class defines the API to manipulate the following aspects of the Ipv4 implementation:
- set/get an Ipv4RoutingProtocol
- register a NetDevice for use by the Ipv4 layer (basically, to create Ipv4-related state such as addressing and neighbor cache that is associated with a NetDevice)
- manipulate the status of the NetDevice from the Ipv4 perspective, such as marking it as Up or Down,
- adding, deleting, and getting addresses associated to the Ipv4 interfaces.
- exporting Ipv4 configuration attributes
Each NetDevice has conceptually a single Ipv4 interface associated with it (the corresponding structure in the Linux Ipv4 implementation is struct in_device). Each interface may have one or more Ipv4 addresses associated with it. Each Ipv4 address may have different subnet mask, scope, etc., so all of this per-address information is stored in an Ipv4InterfaceAddress class (the corresponding structure in Linux is struct in_ifaddr)
Ipv4 attributes such as whether IP forwarding is enabled and disabled are also stored in this class
TO DO: Add API to allow access to the Ipv4 neighbor table
- See Also
- Ipv4RoutingProtocol
-
Ipv4InterfaceAddress
Doxygen introspection did not find any typical Config paths.
Attributes
-
IpForward: Globally enable or disable IP forwarding for all current and future Ipv4 devices.
-
Set with class: BooleanValue
-
Underlying type: bool
-
Initial value: true
-
Flags: construct write read
-
WeakEsModel: RFC1122 term for whether host accepts datagram with a dest. address on another interface
-
Set with class: BooleanValue
-
Underlying type: bool
-
Initial value: true
-
Flags: construct write read
No TraceSources are defined for this type.
Definition at line 75 of file ipv4.h.
virtual bool ns3::Ipv4::IsDestinationAddress |
( |
Ipv4Address |
address, |
|
|
uint32_t |
iif |
|
) |
| const |
|
pure virtual |
Determine whether address and interface corresponding to received packet can be accepted for local delivery.
- Parameters
-
address | The IP address being considered |
iif | The incoming Ipv4 interface index |
This method can be used to determine whether a received packet has an acceptable address for local delivery on the host. The address may be a unicast, multicast, or broadcast address. This method will return true if address is an exact match of a unicast address on one of the host's interfaces (see below), if address corresponds to a multicast group that the host has joined (and the incoming device is acceptable), or if address corresponds to a broadcast address.
If the Ipv4 attribute WeakEsModel is true, the unicast address may match any of the Ipv4 addresses on any interface. If the attribute is false, the address must match one assigned to the incoming device.
Implemented in ns3::Ipv4L3Protocol.
Return the first primary source address with scope less than or equal to the requested scope, to use in sending a packet to destination dst out of the specified device.
This method mirrors the behavior of Linux inet_select_addr() and is provided because interfaces may have multiple IP addresses configured on them with different scopes, and with a primary and secondary status. Secondary addresses are never returned.
- See Also
- Ipv4InterfaceAddress
If a non-zero device pointer is provided, the method first tries to return a primary address that is configured on that device, and whose subnet matches that of dst and whose scope is less than or equal to the requested scope. If a primary address does not match the subnet of dst but otherwise matches the scope, it is returned. If no such address on the device is found, the other devices are searched in order of their interface index, but not considering dst as a factor in the search. Because a loopback interface is typically the first one configured on a node, it will be the first alternate device to be tried. Addresses scoped at LINK scope are not returned in this phase.
If no device pointer is provided, the same logic as above applies, only that there is no preferred device that is consulted first. This means that if the device pointer is null, input parameter dst will be ignored.
If there are no possible addresses to return, a warning log message is issued and the all-zeroes address is returned.
- Parameters
-
device | output NetDevice (optionally provided, only to constrain the search) |
dst | Destination address to match, if device is provided |
scope | Scope of returned address must be less than or equal to this |
- Returns
- the first primary Ipv4Address that meets the search criteria
Implemented in ns3::Ipv4L3Protocol.