8#ifndef ARP_L3_PROTOCOL_H
9#define ARP_L3_PROTOCOL_H
13#include "ns3/address.h"
14#include "ns3/net-device.h"
16#include "ns3/random-variable-stream.h"
17#include "ns3/traced-callback.h"
29class TrafficControlLayer;
a polymophic address class
An implementation of the ARP protocol.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< RandomVariableStream > m_requestJitter
jitter to de-sync ARP requests
bool Lookup(Ptr< Packet > p, const Ipv4Header &ipHeader, Ipv4Address destination, Ptr< NetDevice > device, Ptr< ArpCache > cache, Address *hardwareDestination)
Perform an ARP lookup.
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.
Ptr< TrafficControlLayer > m_tc
The associated TrafficControlLayer.
CacheList m_cacheList
ARP cache container.
Ptr< ArpCache > FindCache(Ptr< NetDevice > device)
Finds the cache associated with a NetDevice.
void SendArpRequest(Ptr< const ArpCache > cache, Ipv4Address to)
Send an ARP request to an host.
void SetNode(Ptr< Node > node)
Set the node the ARP L3 protocol is associated with.
void DoDispose() override
Destructor implementation.
static const uint16_t PROT_NUMBER
ARP protocol number (0x0806)
void SetTrafficControl(Ptr< TrafficControlLayer > tc)
Set the TrafficControlLayer.
Ptr< ArpCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv4Interface > interface)
Create an ARP cache for the device/interface.
Ptr< Node > m_node
node the ARP L3 protocol is associated with
std::list< Ptr< ArpCache > > CacheList
container of the ARP caches
void NotifyNewAggregate() override
Notify all Objects aggregated to this one of a new Object being aggregated.
TracedCallback< Ptr< const Packet > > m_dropTrace
trace for packets dropped by ARP
~ArpL3Protocol() override
static TypeId GetTypeId()
Get the type ID.
ArpL3Protocol & operator=(const ArpL3Protocol &)=delete
ArpL3Protocol(const ArpL3Protocol &)=delete
Ipv4 addresses are stored in host order in this class.
PacketType
Packet types are used as they are in Linux.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.