Implement the Ipv4 layer. More...
#include <ipv4-l3-protocol.h>
Public Member Functions | |
Ipv4L3Protocol () | |
virtual | ~Ipv4L3Protocol () |
void | SetNode (Ptr< Node > node) |
Ptr< Socket > | CreateRawSocket (void) |
void | DeleteRawSocket (Ptr< Socket > socket) |
void | Insert (Ptr< Ipv4L4Protocol > protocol) |
Ptr< Ipv4L4Protocol > | GetProtocol (int protocolNumber) const |
void | Remove (Ptr< Ipv4L4Protocol > protocol) |
void | SetDefaultTtl (uint8_t ttl) |
Ptr< Ipv4Interface > | FindInterfaceForDevice (Ptr< const NetDevice > device) |
void | Receive (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType) |
void | Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol) |
void | AddHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface) |
void | AddHostRouteTo (Ipv4Address dest, uint32_t interface) |
void | AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface) |
void | AddNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface) |
void | SetDefaultRoute (Ipv4Address nextHop, uint32_t interface) |
void | Lookup (Ipv4Header const &ipHeader, Ptr< Packet > packet, Ipv4RoutingProtocol::RouteReplyCallback routeReply) |
uint32_t | GetNRoutes (void) |
Ipv4Route * | GetRoute (uint32_t i) |
void | RemoveRoute (uint32_t i) |
void | AddMulticastRoute (Ipv4Address origin, Ipv4Address group, uint32_t inputInterface, std::vector< uint32_t > outputInterfaces) |
void | SetDefaultMulticastRoute (uint32_t onputInterface) |
uint32_t | GetNMulticastRoutes (void) const |
Ipv4MulticastRoute * | GetMulticastRoute (uint32_t i) const |
void | RemoveMulticastRoute (Ipv4Address origin, Ipv4Address group, uint32_t inputInterface) |
void | RemoveMulticastRoute (uint32_t i) |
uint32_t | AddInterface (Ptr< NetDevice > device) |
Ptr< Ipv4Interface > | GetInterface (uint32_t i) const |
uint32_t | GetNInterfaces (void) const |
uint32_t | FindInterfaceForAddr (Ipv4Address addr) const |
uint32_t | FindInterfaceForAddr (Ipv4Address addr, Ipv4Mask mask) const |
int32_t | FindInterfaceIndexForDevice (Ptr< NetDevice > device) const |
void | JoinMulticastGroup (Ipv4Address origin, Ipv4Address group) |
void | LeaveMulticastGroup (Ipv4Address origin, Ipv4Address group) |
void | SetAddress (uint32_t i, Ipv4Address address) |
void | SetNetworkMask (uint32_t i, Ipv4Mask mask) |
Ipv4Mask | GetNetworkMask (uint32_t t) const |
Ipv4Address | GetAddress (uint32_t i) const |
void | SetMetric (uint32_t i, uint16_t metric) |
uint16_t | GetMetric (uint32_t i) const |
bool | GetIfIndexForDestination (Ipv4Address destination, uint32_t &ifIndex) const |
uint16_t | GetMtu (uint32_t i) const |
bool | IsUp (uint32_t i) const |
void | SetUp (uint32_t i) |
void | SetDown (uint32_t i) |
void | AddRoutingProtocol (Ptr< Ipv4RoutingProtocol > routingProtocol, int priority) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Ipv4L3Protocol. | |
Static Public Attributes | |
static const uint16_t | PROT_NUMBER = 0x0800 |
Protected Member Functions | |
virtual void | DoDispose (void) |
Private Types | |
typedef std::list< Ptr < Ipv4Interface > > | Ipv4InterfaceList |
typedef std::list< std::pair < Ipv4Address, Ipv4Address > > | Ipv4MulticastGroupList |
typedef std::list< std::pair < int, Ptr < Ipv4RoutingProtocol > > > | Ipv4RoutingProtocolList |
typedef std::list< Ptr < Ipv4RawSocketImpl > > | SocketList |
typedef std::list< Ptr < Ipv4L4Protocol > > | L4List_t |
Private Member Functions | |
Ipv4L3Protocol (const Ipv4L3Protocol &) | |
Ipv4L3Protocol & | operator= (const Ipv4L3Protocol &) |
void | Lookup (uint32_t ifIndex, Ipv4Header const &ipHeader, Ptr< Packet > packet, Ipv4RoutingProtocol::RouteReplyCallback routeReply) |
void | SendRealOut (bool found, Ipv4Route const &route, Ptr< Packet > packet, Ipv4Header const &ipHeader) |
bool | Forwarding (uint32_t ifIndex, Ptr< Packet > packet, Ipv4Header &ipHeader, Ptr< NetDevice > device) |
void | ForwardUp (Ptr< Packet > p, Ipv4Header const &ip, Ptr< Ipv4Interface > incomingInterface) |
uint32_t | AddIpv4Interface (Ptr< Ipv4Interface > interface) |
void | SetupLoopback (void) |
Ptr< Icmpv4L4Protocol > | GetIcmp (void) const |
bool | IsUnicast (Ipv4Address ad, Ipv4Mask interfaceMask) const |
void | DoForward (uint32_t ifIndex, Ptr< Packet > packet, Ipv4Header ipHeader) |
Private Attributes | |
L4List_t | m_protocols |
Ipv4InterfaceList | m_interfaces |
uint32_t | m_nInterfaces |
uint8_t | m_defaultTtl |
bool | m_calcChecksum |
uint16_t | m_identification |
Ptr< Node > | m_node |
TracedCallback< Ptr< const Packet >, uint32_t > | m_txTrace |
TracedCallback< Ptr< const Packet >, uint32_t > | m_rxTrace |
TracedCallback< Ptr< const Packet > > | m_dropTrace |
Ipv4RoutingProtocolList | m_routingProtocols |
Ptr< Ipv4StaticRouting > | m_staticRouting |
Ipv4MulticastGroupList | m_multicastGroups |
SocketList | m_sockets |
Implement the Ipv4 layer.
This is the actual implementation of IP. It contains APIs to send and receive packets at the IP layer, as well as APIs for IP routing.
Definition at line 56 of file ipv4-l3-protocol.h.
typedef std::list<Ptr<Ipv4Interface> > ns3::Ipv4L3Protocol::Ipv4InterfaceList [private] |
Definition at line 236 of file ipv4-l3-protocol.h.
typedef std::list<std::pair<Ipv4Address, Ipv4Address> > ns3::Ipv4L3Protocol::Ipv4MulticastGroupList [private] |
Definition at line 237 of file ipv4-l3-protocol.h.
typedef std::list< std::pair< int, Ptr<Ipv4RoutingProtocol> > > ns3::Ipv4L3Protocol::Ipv4RoutingProtocolList [private] |
Definition at line 238 of file ipv4-l3-protocol.h.
typedef std::list<Ptr<Ipv4L4Protocol> > ns3::Ipv4L3Protocol::L4List_t [private] |
Definition at line 240 of file ipv4-l3-protocol.h.
typedef std::list<Ptr<Ipv4RawSocketImpl> > ns3::Ipv4L3Protocol::SocketList [private] |
Definition at line 239 of file ipv4-l3-protocol.h.
ns3::Ipv4L3Protocol::Ipv4L3Protocol | ( | ) |
Definition at line 81 of file ipv4-l3-protocol.cc.
References AddRoutingProtocol(), m_staticRouting, and NS_LOG_FUNCTION_NOARGS.
ns3::Ipv4L3Protocol::~Ipv4L3Protocol | ( | ) | [virtual] |
Definition at line 90 of file ipv4-l3-protocol.cc.
References NS_LOG_FUNCTION.
ns3::Ipv4L3Protocol::Ipv4L3Protocol | ( | const Ipv4L3Protocol & | ) | [private] |
void ns3::Ipv4L3Protocol::AddHostRouteTo | ( | Ipv4Address | dest, | |
uint32_t | interface | |||
) |
Definition at line 204 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::AddHostRouteTo | ( | Ipv4Address | dest, | |
Ipv4Address | nextHop, | |||
uint32_t | interface | |||
) |
Definition at line 195 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
Referenced by SetupLoopback().
Definition at line 382 of file ipv4-l3-protocol.cc.
References AddIpv4Interface(), m_node, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::PeekPointer(), ns3::ArpL3Protocol::PROT_NUMBER, PROT_NUMBER, ns3::ArpL3Protocol::Receive(), and Receive().
uint32_t ns3::Ipv4L3Protocol::AddIpv4Interface | ( | Ptr< Ipv4Interface > | interface | ) | [private] |
Definition at line 399 of file ipv4-l3-protocol.cc.
References m_interfaces, m_nInterfaces, and NS_LOG_FUNCTION.
Referenced by AddInterface(), and SetupLoopback().
void ns3::Ipv4L3Protocol::AddMulticastRoute | ( | Ipv4Address | origin, | |
Ipv4Address | group, | |||
uint32_t | inputInterface, | |||
std::vector< uint32_t > | outputInterfaces | |||
) |
Definition at line 332 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::AddNetworkRouteTo | ( | Ipv4Address | network, | |
Ipv4Mask | networkMask, | |||
uint32_t | interface | |||
) |
Definition at line 222 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::AddNetworkRouteTo | ( | Ipv4Address | network, | |
Ipv4Mask | networkMask, | |||
Ipv4Address | nextHop, | |||
uint32_t | interface | |||
) |
Definition at line 212 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
Referenced by SetUp().
void ns3::Ipv4L3Protocol::AddRoutingProtocol | ( | Ptr< Ipv4RoutingProtocol > | routingProtocol, | |
int | priority | |||
) |
Definition at line 301 of file ipv4-l3-protocol.cc.
References m_routingProtocols, and NS_LOG_FUNCTION.
Referenced by Ipv4L3Protocol().
Definition at line 126 of file ipv4-l3-protocol.cc.
References m_node, m_sockets, and NS_LOG_FUNCTION.
Definition at line 135 of file ipv4-l3-protocol.cc.
References m_sockets, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::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 150 of file ipv4-l3-protocol.cc.
References m_interfaces, m_node, m_protocols, m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::DoForward | ( | uint32_t | ifIndex, | |
Ptr< Packet > | packet, | |||
Ipv4Header | ipHeader | |||
) | [private] |
Definition at line 849 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::GetDestination(), GetIcmp(), GetInterface(), ns3::Ipv4Header::GetTtl(), IsUnicast(), Lookup(), m_dropTrace, ns3::MakeCallback(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, SendRealOut(), and ns3::Ipv4Header::SetTtl().
Referenced by Forwarding().
uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr | ( | Ipv4Address | addr, | |
Ipv4Mask | mask | |||
) | const |
Definition at line 453 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Address::CombineMask(), m_interfaces, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr | ( | Ipv4Address | addr | ) | const |
Definition at line 432 of file ipv4-l3-protocol.cc.
References m_interfaces, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Ptr< Ipv4Interface > ns3::Ipv4L3Protocol::FindInterfaceForDevice | ( | Ptr< const NetDevice > | device | ) |
device | the device to match |
Try to find an Ipv4Interface whose NetDevice is equal to the input NetDevice.
Definition at line 493 of file ipv4-l3-protocol.cc.
References m_interfaces, and NS_LOG_FUNCTION.
Definition at line 474 of file ipv4-l3-protocol.cc.
References m_interfaces, and NS_LOG_FUNCTION.
bool ns3::Ipv4L3Protocol::Forwarding | ( | uint32_t | ifIndex, | |
Ptr< Packet > | packet, | |||
Ipv4Header & | ipHeader, | |||
Ptr< NetDevice > | device | |||
) | [private] |
Definition at line 780 of file ipv4-l3-protocol.cc.
References DoForward(), ns3::Ipv4Address::GetAny(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Address::IsEqual(), m_interfaces, m_multicastGroups, m_node, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by Receive().
void ns3::Ipv4L3Protocol::ForwardUp | ( | Ptr< Packet > | p, | |
Ipv4Header const & | ip, | |||
Ptr< Ipv4Interface > | incomingInterface | |||
) | [private] |
Definition at line 874 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::GetDestination(), GetIcmp(), ns3::Ipv4Header::GetProtocol(), GetProtocol(), ns3::Ipv4Header::GetSource(), IsUnicast(), NS_LOG_FUNCTION, ns3::Ipv4L4Protocol::RX_CSUM_FAILED, ns3::Ipv4L4Protocol::RX_ENDPOINT_UNREACH, and ns3::Ipv4L4Protocol::RX_OK.
Referenced by Receive().
Ipv4Address ns3::Ipv4L3Protocol::GetAddress | ( | uint32_t | i | ) | const |
Definition at line 952 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
Ptr< Icmpv4L4Protocol > ns3::Ipv4L3Protocol::GetIcmp | ( | void | ) | const [private] |
Definition at line 567 of file ipv4-l3-protocol.cc.
References GetProtocol(), and ns3::Icmpv4L4Protocol::GetStaticProtocolNumber().
Referenced by DoForward(), ForwardUp(), Send(), and SendRealOut().
bool ns3::Ipv4L3Protocol::GetIfIndexForDestination | ( | Ipv4Address | destination, | |
uint32_t & | ifIndex | |||
) | const |
Definition at line 976 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Route::GetInterface(), GetNInterfaces(), m_routingProtocols, m_staticRouting, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Ptr< Ipv4Interface > ns3::Ipv4L3Protocol::GetInterface | ( | uint32_t | i | ) | const |
Definition at line 409 of file ipv4-l3-protocol.cc.
References m_interfaces, and NS_LOG_FUNCTION.
Referenced by DoForward(), GetAddress(), GetMetric(), GetMtu(), GetNetworkMask(), IsUp(), SendRealOut(), SetAddress(), SetDown(), SetMetric(), SetNetworkMask(), and SetUp().
uint16_t ns3::Ipv4L3Protocol::GetMetric | ( | uint32_t | i | ) | const |
Definition at line 968 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
uint16_t ns3::Ipv4L3Protocol::GetMtu | ( | uint32_t | i | ) | const |
Definition at line 1046 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
Ipv4MulticastRoute * ns3::Ipv4L3Protocol::GetMulticastRoute | ( | uint32_t | i | ) | const |
Definition at line 359 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
Ipv4Mask ns3::Ipv4L3Protocol::GetNetworkMask | ( | uint32_t | t | ) | const |
Definition at line 944 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
uint32_t ns3::Ipv4L3Protocol::GetNInterfaces | ( | void | ) | const |
Definition at line 425 of file ipv4-l3-protocol.cc.
References m_nInterfaces, and NS_LOG_FUNCTION_NOARGS.
Referenced by GetIfIndexForDestination().
uint32_t ns3::Ipv4L3Protocol::GetNMulticastRoutes | ( | void | ) | const |
Definition at line 352 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION_NOARGS.
uint32_t ns3::Ipv4L3Protocol::GetNRoutes | ( | void | ) |
Definition at line 311 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION_NOARGS.
Referenced by SetDown().
Ptr< Ipv4L4Protocol > ns3::Ipv4L3Protocol::GetProtocol | ( | int | protocolNumber | ) | const |
protocolNumber | number of protocol to lookup in this L4 Demux |
This method is typically called by lower layers to forward packets up the stack to the right protocol. It is also called from NodeImpl::GetUdp for example.
Definition at line 101 of file ipv4-l3-protocol.cc.
References m_protocols.
Referenced by ForwardUp(), and GetIcmp().
Ipv4Route * ns3::Ipv4L3Protocol::GetRoute | ( | uint32_t | i | ) |
Definition at line 318 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION_NOARGS.
Referenced by SetDown().
TypeId ns3::Ipv4L3Protocol::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::Ipv4L3Protocol.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::Object.
Definition at line 53 of file ipv4-l3-protocol.cc.
References ns3::TypeId::AddAttribute(), ns3::TypeId::AddTraceSource(), m_calcChecksum, m_defaultTtl, m_dropTrace, m_interfaces, m_rxTrace, m_txTrace, ns3::MakeObjectVectorAccessor(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
void ns3::Ipv4L3Protocol::Insert | ( | Ptr< Ipv4L4Protocol > | protocol | ) |
protocol | a template for the protocol to add to this L4 Demux. |
Invoke Copy on the input template to get a copy of the input protocol which can be used on the Node on which this L4 Demux is running. The new L4Protocol is registered internally as a working L4 Protocol and returned from this method. The caller does not get ownership of the returned pointer.
Definition at line 96 of file ipv4-l3-protocol.cc.
References m_protocols.
bool ns3::Ipv4L3Protocol::IsUnicast | ( | Ipv4Address | ad, | |
Ipv4Mask | interfaceMask | |||
) | const [private] |
Definition at line 581 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Address::IsMulticast(), and ns3::Ipv4Address::IsSubnetDirectedBroadcast().
Referenced by DoForward(), ForwardUp(), Send(), and SendRealOut().
bool ns3::Ipv4L3Protocol::IsUp | ( | uint32_t | i | ) | const |
Definition at line 1054 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::JoinMulticastGroup | ( | Ipv4Address | origin, | |
Ipv4Address | group | |||
) |
Definition at line 903 of file ipv4-l3-protocol.cc.
References m_multicastGroups, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::LeaveMulticastGroup | ( | Ipv4Address | origin, | |
Ipv4Address | group | |||
) |
Definition at line 911 of file ipv4-l3-protocol.cc.
References m_multicastGroups, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::Lookup | ( | uint32_t | ifIndex, | |
Ipv4Header const & | ipHeader, | |||
Ptr< Packet > | packet, | |||
Ipv4RoutingProtocol::RouteReplyCallback | routeReply | |||
) | [private] |
Definition at line 250 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::GetDestination(), ns3::Ipv4RoutingProtocol::IF_INDEX_ANY, ns3::Ipv4Address::IsMulticast(), m_routingProtocols, m_staticRouting, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
void ns3::Ipv4L3Protocol::Lookup | ( | Ipv4Header const & | ipHeader, | |
Ptr< Packet > | packet, | |||
Ipv4RoutingProtocol::RouteReplyCallback | routeReply | |||
) |
Definition at line 239 of file ipv4-l3-protocol.cc.
References ns3::Ipv4RoutingProtocol::IF_INDEX_ANY, and NS_LOG_FUNCTION.
Referenced by DoForward(), and Send().
Ipv4L3Protocol& ns3::Ipv4L3Protocol::operator= | ( | const Ipv4L3Protocol & | ) | [private] |
void ns3::Ipv4L3Protocol::Receive | ( | Ptr< NetDevice > | device, | |
Ptr< const Packet > | p, | |||
uint16_t | protocol, | |||
const Address & | from, | |||
const Address & | to, | |||
NetDevice::PacketType | packetType | |||
) |
Lower layer calls this method after calling L3Demux::Lookup The ARP subclass needs to know from which NetDevice this packet is coming to:
Definition at line 507 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::EnableChecksum(), Forwarding(), ForwardUp(), ns3::Ipv4Header::IsChecksumOk(), m_calcChecksum, m_dropTrace, m_interfaces, m_node, m_rxTrace, m_sockets, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by AddInterface().
void ns3::Ipv4L3Protocol::Remove | ( | Ptr< Ipv4L4Protocol > | protocol | ) |
protocol | protocol to remove from this demux. |
The input value to this method should be the value returned from the Ipv4L4Protocol::Insert method.
Definition at line 113 of file ipv4-l3-protocol.cc.
References m_protocols.
void ns3::Ipv4L3Protocol::RemoveMulticastRoute | ( | uint32_t | i | ) |
Definition at line 375 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::RemoveMulticastRoute | ( | Ipv4Address | origin, | |
Ipv4Address | group, | |||
uint32_t | inputInterface | |||
) |
Definition at line 366 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::RemoveRoute | ( | uint32_t | i | ) |
Definition at line 325 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
Referenced by SetDown().
void ns3::Ipv4L3Protocol::Send | ( | Ptr< Packet > | packet, | |
Ipv4Address | source, | |||
Ipv4Address | destination, | |||
uint8_t | protocol | |||
) |
packet | packet to send | |
source | source address of packet | |
destination | address of packet | |
protocol | number of packet |
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.
Definition at line 587 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::EnableChecksum(), ns3::Ipv4Header::GetDestination(), GetIcmp(), ns3::SocketIpTtlTag::GetTtl(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Header::IsDontFragment(), ns3::SocketSetDontFragmentTag::IsEnabled(), ns3::Ipv4Address::IsSubnetDirectedBroadcast(), IsUnicast(), Lookup(), m_calcChecksum, m_defaultTtl, m_dropTrace, m_identification, m_interfaces, m_txTrace, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, SendRealOut(), ns3::Ipv4Header::SetDestination(), ns3::Ipv4Header::SetDontFragment(), ns3::Ipv4Header::SetIdentification(), ns3::Ipv4Header::SetMayFragment(), ns3::Ipv4Header::SetPayloadSize(), ns3::Ipv4Header::SetProtocol(), ns3::Ipv4Header::SetSource(), and ns3::Ipv4Header::SetTtl().
void ns3::Ipv4L3Protocol::SendRealOut | ( | bool | found, | |
Ipv4Route const & | route, | |||
Ptr< Packet > | packet, | |||
Ipv4Header const & | ipHeader | |||
) | [private] |
Definition at line 709 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Header::GetDestination(), ns3::Ipv4Route::GetGateway(), GetIcmp(), GetInterface(), ns3::Ipv4Route::GetInterface(), ns3::Ipv4Header::IsDontFragment(), ns3::Ipv4Route::IsGateway(), IsUnicast(), m_dropTrace, m_txTrace, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
Referenced by DoForward(), and Send().
void ns3::Ipv4L3Protocol::SetAddress | ( | uint32_t | i, | |
Ipv4Address | address | |||
) |
Definition at line 928 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::SetDefaultMulticastRoute | ( | uint32_t | onputInterface | ) |
Definition at line 344 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::SetDefaultRoute | ( | Ipv4Address | nextHop, | |
uint32_t | interface | |||
) |
Definition at line 231 of file ipv4-l3-protocol.cc.
References m_staticRouting, and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::SetDefaultTtl | ( | uint8_t | ttl | ) |
ttl | default ttl to use |
When we need to send an ipv4 packet, we use this default ttl value.
Definition at line 187 of file ipv4-l3-protocol.cc.
References m_defaultTtl, and NS_LOG_FUNCTION_NOARGS.
void ns3::Ipv4L3Protocol::SetDown | ( | uint32_t | i | ) |
Definition at line 1080 of file ipv4-l3-protocol.cc.
References ns3::Ipv4Route::GetInterface(), GetInterface(), GetNRoutes(), GetRoute(), NS_LOG_FUNCTION, and RemoveRoute().
void ns3::Ipv4L3Protocol::SetMetric | ( | uint32_t | i, | |
uint16_t | metric | |||
) |
Definition at line 960 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::SetNetworkMask | ( | uint32_t | i, | |
Ipv4Mask | mask | |||
) |
Definition at line 936 of file ipv4-l3-protocol.cc.
References GetInterface(), and NS_LOG_FUNCTION.
Definition at line 119 of file ipv4-l3-protocol.cc.
References m_node, and SetupLoopback().
void ns3::Ipv4L3Protocol::SetUp | ( | uint32_t | i | ) |
Definition at line 1062 of file ipv4-l3-protocol.cc.
References AddNetworkRouteTo(), GetInterface(), and NS_LOG_FUNCTION.
void ns3::Ipv4L3Protocol::SetupLoopback | ( | void | ) | [private] |
Definition at line 173 of file ipv4-l3-protocol.cc.
References AddHostRouteTo(), AddIpv4Interface(), ns3::Ipv4Mask::GetLoopback(), ns3::Ipv4Address::GetLoopback(), m_node, and NS_LOG_FUNCTION_NOARGS.
Referenced by SetNode().
bool ns3::Ipv4L3Protocol::m_calcChecksum [private] |
Definition at line 246 of file ipv4-l3-protocol.h.
Referenced by GetTypeId(), Receive(), and Send().
uint8_t ns3::Ipv4L3Protocol::m_defaultTtl [private] |
Definition at line 245 of file ipv4-l3-protocol.h.
Referenced by GetTypeId(), Send(), and SetDefaultTtl().
TracedCallback<Ptr<const Packet> > ns3::Ipv4L3Protocol::m_dropTrace [private] |
Definition at line 251 of file ipv4-l3-protocol.h.
Referenced by DoForward(), GetTypeId(), Receive(), Send(), and SendRealOut().
uint16_t ns3::Ipv4L3Protocol::m_identification [private] |
Definition at line 247 of file ipv4-l3-protocol.h.
Referenced by Send().
Definition at line 243 of file ipv4-l3-protocol.h.
Referenced by AddIpv4Interface(), DoDispose(), FindInterfaceForAddr(), FindInterfaceForDevice(), FindInterfaceIndexForDevice(), Forwarding(), GetInterface(), GetTypeId(), Receive(), and Send().
Definition at line 256 of file ipv4-l3-protocol.h.
Referenced by Forwarding(), JoinMulticastGroup(), and LeaveMulticastGroup().
uint32_t ns3::Ipv4L3Protocol::m_nInterfaces [private] |
Definition at line 244 of file ipv4-l3-protocol.h.
Referenced by AddIpv4Interface(), and GetNInterfaces().
Ptr<Node> ns3::Ipv4L3Protocol::m_node [private] |
Definition at line 248 of file ipv4-l3-protocol.h.
Referenced by AddInterface(), CreateRawSocket(), DoDispose(), Forwarding(), Receive(), SetNode(), and SetupLoopback().
L4List_t ns3::Ipv4L3Protocol::m_protocols [private] |
Definition at line 242 of file ipv4-l3-protocol.h.
Referenced by DoDispose(), GetProtocol(), Insert(), and Remove().
Definition at line 253 of file ipv4-l3-protocol.h.
Referenced by AddRoutingProtocol(), GetIfIndexForDestination(), and Lookup().
TracedCallback<Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_rxTrace [private] |
Definition at line 250 of file ipv4-l3-protocol.h.
Referenced by GetTypeId(), and Receive().
SocketList ns3::Ipv4L3Protocol::m_sockets [private] |
Definition at line 258 of file ipv4-l3-protocol.h.
Referenced by CreateRawSocket(), DeleteRawSocket(), and Receive().
Definition at line 255 of file ipv4-l3-protocol.h.
Referenced by AddHostRouteTo(), AddMulticastRoute(), AddNetworkRouteTo(), DoDispose(), GetIfIndexForDestination(), GetMulticastRoute(), GetNMulticastRoutes(), GetNRoutes(), GetRoute(), Ipv4L3Protocol(), Lookup(), RemoveMulticastRoute(), RemoveRoute(), SetDefaultMulticastRoute(), and SetDefaultRoute().
TracedCallback<Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_txTrace [private] |
Definition at line 249 of file ipv4-l3-protocol.h.
Referenced by GetTypeId(), Send(), and SendRealOut().
const uint16_t ns3::Ipv4L3Protocol::PROT_NUMBER = 0x0800 [static] |
Definition at line 60 of file ipv4-l3-protocol.h.
Referenced by AddInterface(), ns3::Ipv4LoopbackInterface::SendTo(), and ns3::ArpIpv4Interface::SendTo().