Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool
- PointToPointNetDevice::Send (
- Ptr<Packet> packet,
- const Address &dest,
- uint16_t protocolNumber)
- {
- NS_LOG_FUNCTION (this << packet << dest << protocolNumber);
- NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest);
- NS_LOG_LOGIC ("UID is " << packet->GetUid ());
- //
- // If IsLinkUp() is false it means there is no channel to send any packet
- // over so we just hit the drop trace on the packet and return an error.
- //
- if (IsLinkUp () == false)
- {
- m_macTxDropTrace (packet);
- return false;
- }
- //
- // Stick a point to point protocol header on the packet in preparation for
- // shoving it out the door.
- //
- AddHeader (packet, protocolNumber);
- m_macTxTrace (packet);
- //
- // We should enqueue and dequeue the packet to hit the tracing hooks.
- //
- if (m_queue->Enqueue (packet))
- {
- //
- // If the channel is ready for transition we send the packet right now
- //
- if (m_txMachineState == READY)
- {
- packet = m_queue->Dequeue ();
- m_snifferTrace (packet);
- m_promiscSnifferTrace (packet);
- return TransmitStart (packet);
- }
- return true;
- }
- // Enqueue may fail (overflow)
- m_macTxDropTrace (packet);
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment