ns3::ArpL3Protocol Class Reference
[Arp]

An implementation of the ARP protocol. More...

#include <arp-l3-protocol.h>

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

List of all members.

Public Member Functions

 ArpL3Protocol ()
virtual ~ArpL3Protocol ()
void SetNode (Ptr< Node > node)
Ptr< ArpCacheCreateCache (Ptr< NetDevice > device, Ptr< Ipv4Interface > interface)
void Receive (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
 Receive a packet.
bool Lookup (Ptr< Packet > p, Ipv4Address destination, Ptr< NetDevice > device, Ptr< ArpCache > cache, Address *hardwareDestination)
 Perform an ARP lookup.

Static Public Member Functions

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

Static Public Attributes

static const uint16_t PROT_NUMBER = 0x0806

Protected Member Functions

virtual void DoDispose (void)

Private Types

typedef std::list< Ptr
< ArpCache > > 
CacheList

Private Member Functions

Ptr< ArpCacheFindCache (Ptr< NetDevice > device)
void SendArpRequest (Ptr< const ArpCache >cache, Ipv4Address to)
void SendArpReply (Ptr< const ArpCache > cache, Ipv4Address toIp, Address toMac)

Private Attributes

CacheList m_cacheList
Ptr< Nodem_node
TracedCallback< Ptr< const
Packet > > 
m_dropTrace

Detailed Description

An implementation of the ARP protocol.

Definition at line 48 of file arp-l3-protocol.h.


Member Typedef Documentation

typedef std::list<Ptr<ArpCache> > ns3::ArpL3Protocol::CacheList [private]

Definition at line 82 of file arp-l3-protocol.h.


Constructor & Destructor Documentation

ns3::ArpL3Protocol::ArpL3Protocol (  ) 

Definition at line 58 of file arp-l3-protocol.cc.

References NS_LOG_FUNCTION.

ns3::ArpL3Protocol::~ArpL3Protocol (  )  [virtual]

Definition at line 63 of file arp-l3-protocol.cc.

References NS_LOG_FUNCTION.


Member Function Documentation

Ptr< ArpCache > ns3::ArpL3Protocol::CreateCache ( Ptr< NetDevice device,
Ptr< Ipv4Interface interface 
)
void ns3::ArpL3Protocol::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 76 of file arp-l3-protocol.cc.

References m_cacheList, m_node, and NS_LOG_FUNCTION.

Ptr< ArpCache > ns3::ArpL3Protocol::FindCache ( Ptr< NetDevice device  )  [private]

Definition at line 104 of file arp-l3-protocol.cc.

References m_cacheList, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Receive().

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

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

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

  • /NodeList/[i]/$ns3ArpL3Protocol

Attributes defined for this type:

TraceSources defined for this type:

  • Drop: Packet dropped because not enough room in pending queue for a specific cache entry.

Reimplemented from ns3::Object.

Definition at line 42 of file arp-l3-protocol.cc.

References ns3::TypeId::AddTraceSource(), m_cacheList, m_dropTrace, ns3::MakeObjectVectorAccessor(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

bool ns3::ArpL3Protocol::Lookup ( Ptr< Packet p,
Ipv4Address  destination,
Ptr< NetDevice device,
Ptr< ArpCache cache,
Address hardwareDestination 
)
void ns3::ArpL3Protocol::Receive ( Ptr< NetDevice device,
Ptr< const Packet p,
uint16_t  protocol,
const Address from,
const Address to,
NetDevice::PacketType  packetType 
)
void ns3::ArpL3Protocol::SendArpReply ( Ptr< const ArpCache cache,
Ipv4Address  toIp,
Address  toMac 
) [private]

Definition at line 285 of file arp-l3-protocol.cc.

References m_node, NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, and ns3::ArpHeader::SetReply().

Referenced by Receive().

void ns3::ArpL3Protocol::SendArpRequest ( Ptr< const ArpCache cache,
Ipv4Address  to 
) [private]

Definition at line 266 of file arp-l3-protocol.cc.

References m_node, NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, and ns3::ArpHeader::SetRequest().

Referenced by CreateCache(), and Lookup().

void ns3::ArpL3Protocol::SetNode ( Ptr< Node node  ) 

Definition at line 69 of file arp-l3-protocol.cc.

References m_node, and NS_LOG_FUNCTION.


Member Data Documentation

Definition at line 86 of file arp-l3-protocol.h.

Referenced by CreateCache(), DoDispose(), FindCache(), and GetTypeId().

Definition at line 88 of file arp-l3-protocol.h.

Referenced by GetTypeId(), Lookup(), and Receive().

const uint16_t ns3::ArpL3Protocol::PROT_NUMBER = 0x0806 [static]

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