20 #ifndef ARP_L3_PROTOCOL_H
21 #define ARP_L3_PROTOCOL_H
24 #include "ns3/ipv4-address.h"
25 #include "ns3/net-device.h"
26 #include "ns3/address.h"
28 #include "ns3/traced-callback.h"
29 #include "ns3/random-variable-stream.h"
void Receive(Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Receive a packet.
void SendArpReply(Ptr< const ArpCache > cache, Ipv4Address myIp, Ipv4Address toIp, Address toMac)
Send an ARP reply to an host.
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
std::list< Ptr< ArpCache > > CacheList
container of the ARP caches
ArpL3Protocol & operator=(const ArpL3Protocol &o)
Copy constructor.
Ptr< ArpCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv4Interface > interface)
Create an ARP cache for the device/interface.
TracedCallback< Ptr< const Packet > > m_dropTrace
trace for packets dropped by ARP
void SendArpRequest(Ptr< const ArpCache >cache, Ipv4Address to)
Send an ARP request to an host.
a polymophic address class
virtual void NotifyNewAggregate()
This method is invoked whenever two sets of objects are aggregated together.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
static const uint16_t PROT_NUMBER
ARP protocol number (0x0806)
Ptr< Node > m_node
node the ARP L3 protocol is associated with
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Ipv4 addresses are stored in host order in this class.
bool Lookup(Ptr< Packet > p, Ipv4Address destination, Ptr< NetDevice > device, Ptr< ArpCache > cache, Address *hardwareDestination)
Perform an ARP lookup.
void SetNode(Ptr< Node > node)
Set the node the ARP L3 protocol is associated with.
Ptr< RandomVariableStream > m_requestJitter
jitter to de-sync ARP requests
An implementation of the ARP protocol.
a base class which provides memory management and object aggregation
PacketType
Packet types are used as they are in Linux.
CacheList m_cacheList
ARP cache container.
a unique identifier for an interface.
Ptr< ArpCache > FindCache(Ptr< NetDevice > device)
Finds the cache associated with a NetDevice.
static TypeId GetTypeId(void)
Get the type ID.