A Device for an Emu Network Link. More...
#include <emu-net-device.h>
Public Types | |
enum | EncapsulationMode { ILLEGAL, DIX, LLC } |
![]() | |
enum | PacketType { PACKET_HOST = 1, NS3_PACKET_HOST = PACKET_HOST, PACKET_BROADCAST, NS3_PACKET_BROADCAST = PACKET_BROADCAST, PACKET_MULTICAST, NS3_PACKET_MULTICAST = PACKET_MULTICAST, PACKET_OTHERHOST, NS3_PACKET_OTHERHOST = PACKET_OTHERHOST } |
typedef Callback< bool, Ptr < NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, enum PacketType > | PromiscReceiveCallback |
typedef Callback< bool, Ptr < NetDevice >, Ptr< const Packet >, uint16_t, const Address & > | ReceiveCallback |
Public Member Functions | |
EmuNetDevice () | |
virtual | ~EmuNetDevice () |
virtual void | AddLinkChangeCallback (Callback< void > callback) |
virtual Address | GetAddress (void) const |
virtual Address | GetBroadcast (void) const |
virtual Ptr< Channel > | GetChannel (void) const |
EmuNetDevice::EncapsulationMode | GetEncapsulationMode (void) const |
virtual uint32_t | GetIfIndex (void) const |
virtual uint16_t | GetMtu (void) const |
virtual Address | GetMulticast (Ipv4Address multicastGroup) const |
Make and return a MAC multicast address using the provided multicast group. | |
virtual Address | GetMulticast (Ipv6Address addr) const |
Get the MAC multicast address corresponding to the IPv6 address provided. | |
virtual Ptr< Node > | GetNode (void) const |
Ptr< Queue > | GetQueue (void) const |
virtual bool | IsBridge (void) const |
virtual bool | IsBroadcast (void) const |
virtual bool | IsLinkUp (void) const |
virtual bool | IsMulticast (void) const |
virtual bool | IsPointToPoint (void) const |
virtual bool | NeedsArp (void) const |
virtual bool | Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) |
virtual bool | SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
virtual void | SetAddress (Address address) |
void | SetDataRate (DataRate bps) |
void | SetEncapsulationMode (EmuNetDevice::EncapsulationMode mode) |
virtual void | SetIfIndex (const uint32_t index) |
virtual bool | SetMtu (const uint16_t mtu) |
virtual void | SetNode (Ptr< Node > node) |
virtual void | SetPromiscReceiveCallback (PromiscReceiveCallback cb) |
void | SetQueue (Ptr< Queue > queue) |
virtual void | SetReceiveCallback (NetDevice::ReceiveCallback cb) |
void | Start (Time tStart) |
void | Stop (Time tStop) |
virtual bool | SupportsSendFrom (void) const |
![]() | |
virtual | ~NetDevice () |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::EmuNetDevice. |
Private Member Functions | |
EmuNetDevice (const EmuNetDevice &) | |
void | AddHeader (Ptr< Packet > p, uint16_t protocolNumber) |
void | CreateSocket (void) |
virtual void | DoDispose (void) |
std::string | FindCreator (std::string creatorName) |
void | ForwardUp (uint8_t *buf, uint32_t len) |
void | NotifyLinkUp (void) |
EmuNetDevice & | operator= (const EmuNetDevice &) |
bool | ProcessHeader (Ptr< Packet > p, uint16_t ¶m) |
void | ReadThread (void) |
void | StartDevice (void) |
void | StopDevice (void) |
bool | TransmitStart (Ptr< Packet > p) |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
A Device for an Emu Network Link.
Definition at line 51 of file emu-net-device.h.
Enumeration of the types of packets supported in the class.
ILLEGAL |
Encapsulation mode not set |
DIX |
DIX II / Ethernet II packet |
LLC |
802.2 LLC/SNAP Packet |
Definition at line 59 of file emu-net-device.h.
ns3::EmuNetDevice::EmuNetDevice | ( | ) |
Construct a EmuNetDevice
This is the constructor for the EmuNetDevice. It takes as a
Definition at line 188 of file emu-net-device.cc.
References m_packetBuffer, m_tStart, NS_LOG_FUNCTION, and ns3::Object::Start().
|
virtual |
Destroy a EmuNetDevice
This is the destructor for the EmuNetDevice.
Definition at line 205 of file emu-net-device.cc.
References m_packetBuffer.
|
private |
Adds the necessary headers and trailers to a packet of data in order to respect the protocol implemented by the agent.
p | packet |
protocolNumber | protocol number |
|
virtual |
callback | the callback to invoke |
Add a callback invoked whenever the link status changes to UP. This callback is typically used by the IP/ARP layer to flush the ARP cache and by IPv6 stack to flush NDISC cache whenever the link goes up.
Implements ns3::NetDevice.
Definition at line 1015 of file emu-net-device.cc.
References ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::ConnectWithoutContext(), and m_linkChangeCallbacks.
|
private |
Call out to a separate process running as suid root in order to get a raw socket. We do this to avoid having the entire simulation running as root. If this method returns, we'll have a raw socket waiting for us in m_sock.
Definition at line 380 of file emu-net-device.cc.
References EMU_MAGIC, ns3::EmuBufferToString(), m_sock, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION_NOARGS, and NS_LOG_INFO.
Referenced by StartDevice().
|
privatevirtual |
Definition at line 212 of file emu-net-device.cc.
References m_node, m_readThread, NS_LOG_FUNCTION_NOARGS, and StopDevice().
|
private |
Figure out where the raw socket creation process lives on the system.
|
private |
Method to handle received packets. Synchronized with simulator via ScheduleNow from ReadThread.
Definition at line 613 of file emu-net-device.cc.
References ns3::Packet::Copy(), DIX, ns3::EthernetHeader::GetDestination(), ns3::EthernetHeader::GetLengthType(), ns3::LlcSnapHeader::GetSerializedSize(), ns3::EthernetHeader::GetSerializedSize(), ns3::Packet::GetSize(), ns3::EthernetHeader::GetSource(), ns3::LlcSnapHeader::GetType(), ns3::Mac48Address::IsBroadcast(), ns3::Mac48Address::IsGroup(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), LLC, m_address, m_encapMode, m_macPromiscRxTrace, m_macRxTrace, m_pendingReadCount, m_pendingReadMutex, m_phyRxDropTrace, m_promiscRxCallback, m_promiscSnifferTrace, m_rxCallback, m_snifferTrace, ns3::NetDevice::NS3_PACKET_BROADCAST, ns3::NetDevice::NS3_PACKET_HOST, ns3::NetDevice::NS3_PACKET_MULTICAST, ns3::NetDevice::NS3_PACKET_OTHERHOST, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Packet::RemoveHeader().
Referenced by ReadThread().
|
virtual |
Implements ns3::NetDevice.
Definition at line 974 of file emu-net-device.cc.
References m_address, and NS_LOG_FUNCTION_NOARGS.
|
virtual |
Calling this method is invalid if IsBroadcast returns not true.
Implements ns3::NetDevice.
Definition at line 1027 of file emu-net-device.cc.
Implements ns3::NetDevice.
Definition at line 960 of file emu-net-device.cc.
References NS_FATAL_ERROR.
EmuNetDevice::EncapsulationMode ns3::EmuNetDevice::GetEncapsulationMode | ( | void | ) | const |
Get the encapsulation mode of this device.
Definition at line 232 of file emu-net-device.cc.
References m_encapMode, and NS_LOG_FUNCTION_NOARGS.
|
virtual |
Implements ns3::NetDevice.
Definition at line 954 of file emu-net-device.cc.
References m_ifIndex.
|
virtual |
This value is typically used by the IP layer to perform IP fragmentation when needed.
Implements ns3::NetDevice.
Definition at line 988 of file emu-net-device.cc.
References m_deviceName, and NS_FATAL_ERROR.
Referenced by GetTypeId().
|
virtual |
Make and return a MAC multicast address using the provided multicast group.
RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet multicast address by placing the low-order 23-bits of the IP address into the low-order 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex).
This method performs the multicast address creation function appropriate to an EUI-48-based CSMA device. This MAC address is encapsulated in an abstract Address to avoid dependencies on the exact address format.
multicastGroup | The IP address for the multicast group destination of the packet. |
Implements ns3::NetDevice.
Definition at line 1039 of file emu-net-device.cc.
References NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by GetMulticast().
|
virtual |
Get the MAC multicast address corresponding to the IPv6 address provided.
addr | IPv6 address |
Implements ns3::NetDevice.
Definition at line 1056 of file emu-net-device.cc.
References GetMulticast(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
When a subclass needs to get access to the underlying node base class to print the nodeid for example, it can invoke this method.
Implements ns3::NetDevice.
Definition at line 1093 of file emu-net-device.cc.
References m_node.
Referenced by StartDevice().
Get a copy of the attached Queue.
Definition at line 934 of file emu-net-device.cc.
References m_queue, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::EmuHelper::EnableAsciiInternal().
|
static |
This method returns the TypeId associated to ns3::EmuNetDevice.
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::NetDevice.
Definition at line 63 of file emu-net-device.cc.
References DIX, GetMtu(), LLC, m_address, m_deviceName, m_macPromiscRxTrace, m_macRxDropTrace, m_macRxTrace, m_macTxDropTrace, m_macTxTrace, m_maxPendingReads, m_phyRxBeginTrace, m_phyRxDropTrace, m_phyRxEndTrace, m_phyTxBeginTrace, m_phyTxDropTrace, m_phyTxEndTrace, m_promiscSnifferTrace, m_queue, m_snifferTrace, m_tStart, m_tStop, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeTraceSourceAccessor(), ns3::Seconds(), SetEncapsulationMode(), and ns3::TypeId::SetParent().
|
virtual |
Is this a bridge?
Implements ns3::NetDevice.
Definition at line 1073 of file emu-net-device.cc.
|
virtual |
Implements ns3::NetDevice.
Definition at line 1021 of file emu-net-device.cc.
References m_isBroadcast.
|
virtual |
Implements ns3::NetDevice.
Definition at line 1009 of file emu-net-device.cc.
References m_linkUp.
Referenced by SendFrom().
|
virtual |
Implements ns3::NetDevice.
Definition at line 1033 of file emu-net-device.cc.
References m_isMulticast.
|
virtual |
Is this a point to point link?
Implements ns3::NetDevice.
Definition at line 1067 of file emu-net-device.cc.
|
virtual |
Called by higher-layers to check if this NetDevice requires ARP to be used.
Implements ns3::NetDevice.
Definition at line 1105 of file emu-net-device.cc.
|
private |
Definition at line 941 of file emu-net-device.cc.
References m_linkChangeCallbacks, and m_linkUp.
Referenced by StartDevice().
|
private |
Removes, from a packet of data, all headers and trailers that relate to the protocol implemented by the agent
p | Packet whose headers need to be processed |
param | An integer parameter that can be set by the function |
|
private |
Loop to read and process packets
Definition at line 743 of file emu-net-device.cc.
References ForwardUp(), m_maxPendingReads, m_nodeId, m_pendingReadCount, m_pendingReadMutex, m_sock, ns3::MakeEvent(), NS_FATAL_ERROR, NS_LOG_FUNCTION_NOARGS, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().
Referenced by StartDevice().
|
virtual |
packet | packet sent from above down to Network Device |
dest | mac address of the destination (already resolved) |
protocolNumber | identifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received. |
Called from higher layer to send packet into Network Device to the specified destination Address
Implements ns3::NetDevice.
Definition at line 813 of file emu-net-device.cc.
References m_address, NS_LOG_FUNCTION, and SendFrom().
|
virtual |
packet | packet sent from above down to Network Device |
source | source mac address (so called "MAC spoofing") |
dest | mac address of the destination (already resolved) |
protocolNumber | identifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received. |
Called from higher layer to send packet into Network Device with the specified source and destination Addresses.
Implements ns3::NetDevice.
Definition at line 839 of file emu-net-device.cc.
References ns3::Packet::AddHeader(), ns3::Mac48Address::ConvertFrom(), ns3::Packet::CopyData(), ns3::Queue::Dequeue(), DIX, ns3::Queue::Enqueue(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), IsLinkUp(), LLC, m_encapMode, m_macTxDropTrace, m_macTxTrace, m_packetBuffer, m_promiscSnifferTrace, m_queue, m_sll_ifindex, m_snifferTrace, m_sock, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::EthernetHeader::SetDestination(), ns3::EthernetHeader::SetLengthType(), ns3::EthernetHeader::SetSource(), and ns3::LlcSnapHeader::SetType().
Referenced by Send().
|
virtual |
Set the address of this interface
address | address to set |
Implements ns3::NetDevice.
Definition at line 967 of file emu-net-device.cc.
References ns3::Mac48Address::ConvertFrom(), m_address, and NS_LOG_FUNCTION.
void ns3::EmuNetDevice::SetDataRate | ( | DataRate | bps | ) |
Set the Data Rate used for transmission of packets.
bps | the data rate at which this object operates |
Definition at line 920 of file emu-net-device.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
void ns3::EmuNetDevice::SetEncapsulationMode | ( | EmuNetDevice::EncapsulationMode | mode | ) |
Set the encapsulation mode of this device.
mode | The encapsulation mode of this device. |
Definition at line 224 of file emu-net-device.cc.
References m_encapMode, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by GetTypeId().
|
virtual |
index | ifIndex of the device |
Implements ns3::NetDevice.
Definition at line 948 of file emu-net-device.cc.
References m_ifIndex.
|
virtual |
mtu | MTU value, in bytes, to set for the device |
Override for default MTU defined on a per-type basis.
Implements ns3::NetDevice.
Definition at line 981 of file emu-net-device.cc.
References NS_FATAL_ERROR.
node | the node associated to this netdevice. |
This method is called from ns3::Node::AddDevice.
Implements ns3::NetDevice.
Definition at line 1099 of file emu-net-device.cc.
References m_node.
|
virtual |
cb | callback to invoke whenever a packet has been received in promiscuous mode and must be forwarded to the higher layers. |
Enables netdevice promiscuous mode and sets the callback that will handle promiscuous mode packets. Note, promiscuous mode packets means all packets, including those packets that can be sensed by the netdevice but which are intended to be received by other hosts.
Implements ns3::NetDevice.
Definition at line 1079 of file emu-net-device.cc.
References m_promiscRxCallback.
Attach a queue to the EmuNetDevice.
The EmuNetDevice "owns" a queue that implements a queueing method such as DropTail or RED.
queue | Ptr to the new queue. |
Definition at line 927 of file emu-net-device.cc.
References m_queue, and NS_LOG_FUNCTION.
Referenced by main().
|
virtual |
cb | callback to invoke whenever a packet has been received and must be forwarded to the higher layers. |
Implements ns3::NetDevice.
Definition at line 1111 of file emu-net-device.cc.
References m_rxCallback.
void ns3::EmuNetDevice::Start | ( | Time | tStart | ) |
Set a start time for the device.
tStart | the start time |
Definition at line 239 of file emu-net-device.cc.
References ns3::Simulator::Cancel(), m_startEvent, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StartDevice().
|
private |
Spin up the device
Definition at line 262 of file emu-net-device.cc.
References CreateSocket(), ns3::Node::GetId(), GetNode(), m_deviceName, m_isBroadcast, m_isMulticast, m_nodeId, m_readThread, m_sll_ifindex, m_sock, ns3::MakeCallback(), NotifyLinkUp(), NS_FATAL_ERROR, NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, ReadThread(), and ns3::SystemThread::Start().
Referenced by Start().
void ns3::EmuNetDevice::Stop | ( | Time | tStop | ) |
Set a stop time for the device.
tStop | the stop time |
Definition at line 251 of file emu-net-device.cc.
References ns3::Simulator::Cancel(), m_startEvent, m_stopEvent, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StopDevice().
|
private |
Tear down the device
Definition at line 598 of file emu-net-device.cc.
References ns3::SystemThread::Join(), m_readThread, m_sock, NS_ASSERT_MSG, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.
Referenced by DoDispose(), and Stop().
|
virtual |
Implements ns3::NetDevice.
Definition at line 1085 of file emu-net-device.cc.
References NS_LOG_FUNCTION_NOARGS.
Start Sending a Packet Down the Wire.
p | packet to send |
|
private |
The MAC address which has been assigned to this device.
Definition at line 456 of file emu-net-device.h.
Referenced by ForwardUp(), GetAddress(), GetTypeId(), Send(), and SetAddress().
|
private |
The unix/linux name of the underlying device (e.g., eth0)
Definition at line 512 of file emu-net-device.h.
Referenced by GetMtu(), GetTypeId(), and StartDevice().
|
private |
The type of packet that should be created by the AddHeader function and that should be processed by the ProcessHeader function.
Definition at line 484 of file emu-net-device.h.
Referenced by ForwardUp(), GetEncapsulationMode(), SendFrom(), and SetEncapsulationMode().
|
private |
The ns-3 interface index (in the sense of net device index) that has been assigned to this network device.
Definition at line 471 of file emu-net-device.h.
Referenced by GetIfIndex(), and SetIfIndex().
|
private |
Flag indicating whether or not the underlying net device supports broadcast.
Definition at line 496 of file emu-net-device.h.
Referenced by IsBroadcast(), and StartDevice().
|
private |
Flag indicating whether or not the underlying net device supports multicast.
Definition at line 502 of file emu-net-device.h.
Referenced by IsMulticast(), and StartDevice().
|
private |
Callbacks to fire if the link changes state (up or down).
Definition at line 507 of file emu-net-device.h.
Referenced by AddLinkChangeCallback(), and NotifyLinkUp().
|
private |
Flag indicating whether or not the link is up. In this case, whether or not the device is connected to a channel.
Definition at line 490 of file emu-net-device.h.
Referenced by IsLinkUp(), and NotifyLinkUp().
|
private |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). This is a promiscuous trace.
Definition at line 316 of file emu-net-device.h.
Referenced by ForwardUp(), and GetTypeId().
|
private |
The trace source fired for packets successfully received by the device but which are dropped before being forwarded up to higher layers (at the L2/L3 transition).
Definition at line 334 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). This is a non-promiscuous trace.
Definition at line 325 of file emu-net-device.h.
Referenced by ForwardUp(), and GetTypeId().
|
private |
The trace source fired when packets coming into the "top" of the device at the L3/L2 transition are dropped before being queued for transmission.
Definition at line 307 of file emu-net-device.h.
Referenced by GetTypeId(), and SendFrom().
|
private |
The trace source fired when packets come into the "top" of the device at the L3/L2 transition, before being queued for transmission.
Definition at line 299 of file emu-net-device.h.
Referenced by GetTypeId(), and SendFrom().
|
private |
Definition at line 526 of file emu-net-device.h.
Referenced by GetTypeId(), and ReadThread().
The Node to which this device is attached.
Definition at line 451 of file emu-net-device.h.
Referenced by DoDispose(), GetNode(), and SetNode().
|
private |
Definition at line 524 of file emu-net-device.h.
Referenced by ReadThread(), and StartDevice().
|
private |
A 64K buffer to hold packet data while it is being sent.
Definition at line 517 of file emu-net-device.h.
Referenced by EmuNetDevice(), SendFrom(), and ~EmuNetDevice().
|
private |
Definition at line 527 of file emu-net-device.h.
Referenced by ForwardUp(), and ReadThread().
|
private |
Definition at line 528 of file emu-net-device.h.
Referenced by ForwardUp(), and ReadThread().
|
private |
The trace source fired when a packet begins the reception process from the medium.
Definition at line 374 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The trace source fired when the phy layer drops a packet it has received.
Definition at line 389 of file emu-net-device.h.
Referenced by ForwardUp(), and GetTypeId().
|
private |
The trace source fired when a packet begins the reception process from the medium.
Definition at line 382 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The trace source fired when a packet ends the reception process from the medium.
Definition at line 366 of file emu-net-device.h.
|
private |
The trace source fired when a packet begins the transmission process on the medium.
Definition at line 342 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The trace source fired when the phy layer drops a packet as it tries to transmit it.
Definition at line 358 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The trace source fired when a packet ends the transmission process on the medium.
Definition at line 350 of file emu-net-device.h.
Referenced by GetTypeId().
|
private |
The callback used to notify higher layers that a packet has been received in promiscuous mode.
Definition at line 466 of file emu-net-device.h.
Referenced by ForwardUp(), and SetPromiscReceiveCallback().
|
private |
A trace source that emulates a promiscuous mode protocol sniffer connected to the device. This trace source fire on packets destined for any host just like your average everyday packet sniffer.
On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.
On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.
Definition at line 429 of file emu-net-device.h.
Referenced by ForwardUp(), GetTypeId(), and SendFrom().
The Queue which this EmuNetDevice uses as a packet source. Management of this Queue has been delegated to the EmuNetDevice and it has the responsibility for deletion.
Definition at line 291 of file emu-net-device.h.
Referenced by GetQueue(), GetTypeId(), SendFrom(), and SetQueue().
|
private |
Definition at line 446 of file emu-net-device.h.
Referenced by DoDispose(), StartDevice(), and StopDevice().
|
private |
The callback used to notify higher layers that a packet has been received.
Definition at line 461 of file emu-net-device.h.
Referenced by ForwardUp(), and SetReceiveCallback().
|
private |
The Unix interface index that we got from the system and which corresponds to the interface (e.g., "eth1") we are using to talk to the network. Valid when m_sock is valid.
Definition at line 477 of file emu-net-device.h.
Referenced by SendFrom(), and StartDevice().
|
private |
A trace source that emulates a non-promiscuous protocol sniffer connected to the device. Unlike your average everyday sniffer, this trace source will not fire on PACKET_OTHERHOST events.
On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.
On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.
Definition at line 409 of file emu-net-device.h.
Referenced by ForwardUp(), GetTypeId(), and SendFrom().
|
private |
Definition at line 444 of file emu-net-device.h.
Referenced by CreateSocket(), ReadThread(), SendFrom(), StartDevice(), and StopDevice().
|
private |
Definition at line 441 of file emu-net-device.h.
|
private |
Definition at line 442 of file emu-net-device.h.
Referenced by Stop().
|
private |
Time to start spinning up the device
Definition at line 434 of file emu-net-device.h.
Referenced by EmuNetDevice(), and GetTypeId().
|
private |
Time to start tearing down the device
Definition at line 439 of file emu-net-device.h.
Referenced by GetTypeId().