22 #ifndef FD_NET_DEVICE_H
23 #define FD_NET_DEVICE_H
25 #include "ns3/address.h"
26 #include "ns3/callback.h"
27 #include "ns3/data-rate.h"
28 #include "ns3/event-id.h"
29 #include "ns3/mac48-address.h"
30 #include "ns3/net-device.h"
32 #include "ns3/packet.h"
34 #include "ns3/system-condition.h"
35 #include "ns3/traced-callback.h"
36 #include "ns3/unix-fd-reader.h"
37 #include "ns3/system-mutex.h"
148 virtual void SetIfIndex (
const uint32_t index);
153 virtual bool SetMtu (
const uint16_t mtu);
154 virtual uint16_t
GetMtu (
void)
const;
210 void ForwardUp (uint8_t *buf, ssize_t len);
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
keep track of time values and allow control of global simulation resolution
A structure representing data read.
smart pointer class similar to boost::intrusive_ptr
DIX II / Ethernet II packet.
void ForwardUp(uint8_t *buf, ssize_t len)
void SetFileDescriptor(int fd)
Set the associated file descriptor.
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual bool SupportsSendFrom() const
EncapsulationMode m_encapMode
When using TAP devices, if flag IFF_NO_PI is not set on the device, IP packets will have an extra hea...
virtual bool NeedsArp(void) const
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
NetDevice::ReceiveCallback m_rxCallback
The callback used to notify higher layers that a packet has been received.
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets coming into the "top" of the device at the L3/L2 transition are d...
virtual bool IsMulticast(void) const
Ptr< FdNetDeviceFdReader > m_fdReader
void Stop(Time tStop)
Set a stop time for the device.
virtual void SetIsBroadcast(bool broadcast)
virtual uint32_t GetIfIndex(void) const
virtual void SetIfIndex(const uint32_t index)
a polymophic address class
A class that asynchronously reads from a file descriptor.
virtual Ptr< Node > GetNode(void) const
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition...
virtual Ptr< Channel > GetChannel(void) const
bool TransmitStart(Ptr< Packet > p)
Start Sending a Packet Down the Wire.
virtual void SetIsMulticast(bool multicast)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
uint32_t m_maxPendingReads
virtual Address GetBroadcast(void) const
FdNetDeviceFdReader()
Constructor for the FdNetDevice.
void ReceiveCallback(uint8_t *buf, ssize_t len)
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired for packets successfully received by the device but which are dropped before b...
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual bool IsLinkUp(void) const
void SetEncapsulationMode(FdNetDevice::EncapsulationMode mode)
Set the link layer encapsulation mode of this device.
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
TracedCallback m_linkChangeCallbacks
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
A trace source that emulates a promiscuous mode protocol sniffer connected to the device...
virtual bool IsBroadcast(void) const
virtual void SetNode(Ptr< Node > node)
A class which provides a relatively platform-independent Mutual Exclusion thread synchronization prim...
TracedCallback< Ptr< const Packet > > m_snifferTrace
A trace source that emulates a non-promiscuous protocol sniffer connected to the device.
FdReader::Data DoRead(void)
The read implementation.
FdNetDevice::EncapsulationMode GetEncapsulationMode(void) const
Get the link layer encapsulation mode of this device.
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
uint32_t m_pendingReadCount
virtual bool SetMtu(const uint16_t mtu)
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
static TypeId GetTypeId(void)
an identifier for simulation events.
virtual Address GetAddress(void) const
Network layer to device interface.
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the phy layer drops a packet as it tries to transmit it.
virtual void SetAddress(Address address)
Set the address of this interface.
void Start(Time tStart)
Set a start time for the device.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
NetDevice::PromiscReceiveCallback m_promiscRxCallback
The callback used to notify higher layers that a packet has been received in promiscuous mode...
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
EncapsulationMode
Enumeration of the types of frames supported in the class.
void SetBufferSize(uint32_t bufferSize)
Set size of the read buffer.
a NetDevice to read/write network traffic from/into a file descriptor.
virtual uint16_t GetMtu(void) const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
a unique identifier for an interface.
FdNetDevice()
Constructor for the FdNetDevice.
virtual ~FdNetDevice()
Destructor for the FdNetDevice.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
SystemMutex m_pendingReadMutex