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

(-)a/src/internet-node/udp-header.cc (-4 / +4 lines)
 Lines 51-72   UdpHeader::EnableChecksums (void) Link Here 
51
}
51
}
52
52
53
void 
53
void 
54
UdpHeader::SetDestination (uint16_t port)
54
UdpHeader::SetDestinationPort (uint16_t port)
55
{
55
{
56
  m_destinationPort = port;
56
  m_destinationPort = port;
57
}
57
}
58
void 
58
void 
59
UdpHeader::SetSource (uint16_t port)
59
UdpHeader::SetSourcePort (uint16_t port)
60
{
60
{
61
  m_sourcePort = port;
61
  m_sourcePort = port;
62
}
62
}
63
uint16_t 
63
uint16_t 
64
UdpHeader::GetSource (void) const
64
UdpHeader::GetSourcePort (void) const
65
{
65
{
66
  return m_sourcePort;
66
  return m_sourcePort;
67
}
67
}
68
uint16_t 
68
uint16_t 
69
UdpHeader::GetDestination (void) const
69
UdpHeader::GetDestinationPort (void) const
70
{
70
{
71
  return m_destinationPort;
71
  return m_destinationPort;
72
}
72
}
(-)a/src/internet-node/udp-header.h (-4 / +4 lines)
 Lines 49-67   public: Link Here 
49
  /**
49
  /**
50
   * \param port the destination port for this UdpHeader
50
   * \param port the destination port for this UdpHeader
51
   */
51
   */
52
  void SetDestination (uint16_t port);
52
  void SetDestinationPort (uint16_t port);
53
  /**
53
  /**
54
   * \param port The source port for this UdpHeader
54
   * \param port The source port for this UdpHeader
55
   */
55
   */
56
  void SetSource (uint16_t port);
56
  void SetSourcePort (uint16_t port);
57
  /**
57
  /**
58
   * \return The source port for this UdpHeader
58
   * \return The source port for this UdpHeader
59
   */
59
   */
60
  uint16_t GetSource (void) const;
60
  uint16_t GetSourcePort (void) const;
61
  /**
61
  /**
62
   * \return the destination port for this UdpHeader
62
   * \return the destination port for this UdpHeader
63
   */
63
   */
64
  uint16_t GetDestination (void) const;
64
  uint16_t GetDestinationPort (void) const;
65
  /**
65
  /**
66
   * \param size The payload size in bytes
66
   * \param size The payload size in bytes
67
   */
67
   */
(-)a/src/internet-node/udp-l4-protocol.cc (-5 / +5 lines)
 Lines 155-166   UdpL4Protocol::Receive(Ptr<Packet> packe Link Here 
155
  UdpHeader udpHeader;
155
  UdpHeader udpHeader;
156
  packet->RemoveHeader (udpHeader);
156
  packet->RemoveHeader (udpHeader);
157
  Ipv4EndPointDemux::EndPoints endPoints =
157
  Ipv4EndPointDemux::EndPoints endPoints =
158
    m_endPoints->Lookup (destination, udpHeader.GetDestination (),
158
    m_endPoints->Lookup (destination, udpHeader.GetDestinationPort (),
159
                         source, udpHeader.GetSource (), interface);
159
                         source, udpHeader.GetSourcePort (), interface);
160
  for (Ipv4EndPointDemux::EndPointsI endPoint = endPoints.begin ();
160
  for (Ipv4EndPointDemux::EndPointsI endPoint = endPoints.begin ();
161
       endPoint != endPoints.end (); endPoint++)
161
       endPoint != endPoints.end (); endPoint++)
162
    {
162
    {
163
      (*endPoint)->ForwardUp (packet->Copy (), source, udpHeader.GetSource ());
163
      (*endPoint)->ForwardUp (packet->Copy (), source, udpHeader.GetSourcePort ());
164
    }
164
    }
165
}
165
}
166
166
 Lines 172-179   UdpL4Protocol::Send (Ptr<Packet> packet, Link Here 
172
  NS_LOG_FUNCTION (this << packet << saddr << daddr << sport << dport);
172
  NS_LOG_FUNCTION (this << packet << saddr << daddr << sport << dport);
173
173
174
  UdpHeader udpHeader;
174
  UdpHeader udpHeader;
175
  udpHeader.SetDestination (dport);
175
  udpHeader.SetDestinationPort (dport);
176
  udpHeader.SetSource (sport);
176
  udpHeader.SetSourcePort (sport);
177
  udpHeader.SetPayloadSize (packet->GetSize ());
177
  udpHeader.SetPayloadSize (packet->GetSize ());
178
  udpHeader.InitializeChecksum (saddr,
178
  udpHeader.InitializeChecksum (saddr,
179
                                daddr,
179
                                daddr,

Return to bug 195