View | Details | Raw Unified | Return to bug 213
Collapse All | Expand All

(-)a/src/node/socket.cc (+15 lines)
 Lines 364-367   SocketIpTtlTag::Print (std::ostream &os) Link Here 
364
  os << "Ttl=" << (uint32_t) m_ttl;
364
  os << "Ttl=" << (uint32_t) m_ttl;
365
}
365
}
366
366
367
Ptr<Packet>
368
Socket::RecvFrom (Address &outSenderAddress)
369
{
370
  Ptr<Packet> packet = Recv ();
371
  if (packet != 0)
372
    {
373
      SocketRxAddressTag tag;
374
      bool found;
375
      found = packet->FindFirstMatchingTag (tag);
376
      NS_ASSERT (found);
377
      outSenderAddress = tag.GetAddress ();
378
    }
379
  return packet;
380
}
381
367
}//namespace ns3
382
}//namespace ns3
(-)a/src/node/socket.h (+15 lines)
 Lines 354-359   public: Link Here 
354
   * to that of real network or BSD sockets.  
354
   * to that of real network or BSD sockets.  
355
   */
355
   */
356
  int Recv (uint8_t* buf, uint32_t size, uint32_t flags);
356
  int Recv (uint8_t* buf, uint32_t size, uint32_t flags);
357
358
  /**
359
   * \brief Read a single packet from the socket and retrieve the sender address
360
   *
361
   *      Calls Recv(maxSize, flags) with maxSize
362
   *      implicitly set to maximum sized integer, and flags set to zero.
363
   *
364
   * \param outSenderAddress output parameter that will return the
365
   * address of the sender of the received packet, if any.  Remains
366
   * untouched if no packet is received.
367
   * \returns Ptr<Packet> of the next in-sequence packet.  Returns
368
   * 0 if the socket cannot return a next in-sequence packet.
369
   */
370
   Ptr<Packet> RecvFrom (Address &outSenderAddress);
371
357
  /**
372
  /**
358
   * Return number of bytes which can be returned from one or 
373
   * Return number of bytes which can be returned from one or 
359
   * multiple calls to Recv.
374
   * multiple calls to Recv.

Return to bug 213