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

(-)a/src/internet-stack/udp-l4-protocol.cc (+12 lines)
 Lines 23-28    Link Here 
23
#include "ns3/packet.h"
23
#include "ns3/packet.h"
24
#include "ns3/node.h"
24
#include "ns3/node.h"
25
#include "ns3/boolean.h"
25
#include "ns3/boolean.h"
26
#include "ns3/object-vector.h"
26
#include "ns3/ipv4-route.h"
27
#include "ns3/ipv4-route.h"
27
28
28
#include "udp-l4-protocol.h"
29
#include "udp-l4-protocol.h"
 Lines 48-53    Link Here 
48
  static TypeId tid = TypeId ("ns3::UdpL4Protocol")
49
  static TypeId tid = TypeId ("ns3::UdpL4Protocol")
49
    .SetParent<Ipv4L4Protocol> ()
50
    .SetParent<Ipv4L4Protocol> ()
50
    .AddConstructor<UdpL4Protocol> ()
51
    .AddConstructor<UdpL4Protocol> ()
52
    .AddAttribute ("SocketList", "The list of sockets associated to this protocol.",
53
                   ObjectVectorValue (),
54
                   MakeObjectVectorAccessor (&UdpL4Protocol::m_sockets),
55
                   MakeObjectVectorChecker<UdpSocketImpl> ())
51
    ;
56
    ;
52
  return tid;
57
  return tid;
53
}
58
}
 Lines 107-112    Link Here 
107
UdpL4Protocol::DoDispose (void)
112
UdpL4Protocol::DoDispose (void)
108
{
113
{
109
  NS_LOG_FUNCTION_NOARGS ();
114
  NS_LOG_FUNCTION_NOARGS ();
115
  for (std::vector<Ptr<UdpSocketImpl> >::iterator i = m_sockets.begin (); i != m_sockets.end (); i++)
116
    {
117
      *i = 0;
118
    }
119
  m_sockets.clear ();
120
110
  if (m_endPoints != 0)
121
  if (m_endPoints != 0)
111
    {
122
    {
112
      delete m_endPoints;
123
      delete m_endPoints;
 Lines 123-128    Link Here 
123
  Ptr<UdpSocketImpl> socket = CreateObject<UdpSocketImpl> ();
134
  Ptr<UdpSocketImpl> socket = CreateObject<UdpSocketImpl> ();
124
  socket->SetNode (m_node);
135
  socket->SetNode (m_node);
125
  socket->SetUdp (this);
136
  socket->SetUdp (this);
137
  m_sockets.push_back (socket);
126
  return socket;
138
  return socket;
127
}
139
}
128
140
(-)a/src/internet-stack/udp-l4-protocol.h (+2 lines)
 Lines 34-39    Link Here 
34
class Socket;
34
class Socket;
35
class Ipv4Route;
35
class Ipv4Route;
36
class Ipv4EndPointDemux;
36
class Ipv4EndPointDemux;
37
class UdpSocketImpl;
37
class Ipv4EndPoint;
38
class Ipv4EndPoint;
38
/**
39
/**
39
 * \ingroup udp
40
 * \ingroup udp
 Lines 117-122    Link Here 
117
private:
118
private:
118
  Ptr<Node> m_node;
119
  Ptr<Node> m_node;
119
  Ipv4EndPointDemux *m_endPoints;
120
  Ipv4EndPointDemux *m_endPoints;
121
  std::vector<Ptr<UdpSocketImpl> > m_sockets;
120
};
122
};
121
123
122
}; // namespace ns3
124
}; // namespace ns3

Return to bug 969