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

(-)a/src/applications/helper/udp-client-server-helper.cc (+13 lines)
 Lines 75-80   UdpClientHelper::UdpClientHelper (Address address, uint16_t port) Link Here 
75
  SetAttribute ("RemotePort", UintegerValue (port));
75
  SetAttribute ("RemotePort", UintegerValue (port));
76
}
76
}
77
77
78
UdpClientHelper::UdpClientHelper (Address address)
79
{
80
  m_factory.SetTypeId (UdpClient::GetTypeId ());
81
  SetAttribute ("RemoteAddress", AddressValue (address));
82
}
83
78
UdpClientHelper::UdpClientHelper (Ipv4Address address, uint16_t port)
84
UdpClientHelper::UdpClientHelper (Ipv4Address address, uint16_t port)
79
{
85
{
80
  m_factory.SetTypeId (UdpClient::GetTypeId ());
86
  m_factory.SetTypeId (UdpClient::GetTypeId ());
 Lines 121-126   UdpTraceClientHelper::UdpTraceClientHelper (Address address, uint16_t port, std: Link Here 
121
  SetAttribute ("TraceFilename", StringValue (filename));
127
  SetAttribute ("TraceFilename", StringValue (filename));
122
}
128
}
123
129
130
UdpTraceClientHelper::UdpTraceClientHelper (Address address, std::string filename)
131
{
132
  m_factory.SetTypeId (UdpTraceClient::GetTypeId ());
133
  SetAttribute ("RemoteAddress", AddressValue (address));
134
  SetAttribute ("TraceFilename", StringValue (filename));
135
}
136
124
UdpTraceClientHelper::UdpTraceClientHelper (Ipv4Address address, uint16_t port, std::string filename)
137
UdpTraceClientHelper::UdpTraceClientHelper (Ipv4Address address, uint16_t port, std::string filename)
125
{
138
{
126
  m_factory.SetTypeId (UdpTraceClient::GetTypeId ());
139
  m_factory.SetTypeId (UdpTraceClient::GetTypeId ());
(-)a/src/applications/helper/udp-client-server-helper.h (-2 / +26 lines)
 Lines 125-133   public: Link Here 
125
   *
125
   *
126
   * \param ip The IP address of the remote UDP server
126
   * \param ip The IP address of the remote UDP server
127
   * \param port The port number of the remote UDP server
127
   * \param port The port number of the remote UDP server
128
   * \deprecated This constructor is deprecated and will be removed
129
   * in a future release because, if the provided address is of
130
   * type InetSocketAddress or Inet6SocketAddress, the port argument
131
   * is not needed since it can be specified within the address.
128
   */
132
   */
129
133
130
  UdpClientHelper (Address ip, uint16_t port);
134
  UdpClientHelper (Address ip, uint16_t port) NS_DEPRECATED;
135
  /**
136
   *  Create UdpClientHelper which will make life easier for people trying
137
   * to set up simulations with udp-client-server.
138
   *
139
   * \param addr The address of the remote UDP server
140
   */
141
142
  UdpClientHelper (Address addr);
131
143
132
  /**
144
  /**
133
   * Record an attribute to be set in each Application after it is is created.
145
   * Record an attribute to be set in each Application after it is is created.
 Lines 178-185   public: Link Here 
178
   * \param ip The IP address of the remote UDP server
190
   * \param ip The IP address of the remote UDP server
179
   * \param port The port number of the remote UDP server
191
   * \param port The port number of the remote UDP server
180
   * \param filename the file from which packet traces will be loaded
192
   * \param filename the file from which packet traces will be loaded
193
   * \deprecated This constructor is deprecated and will be removed
194
   * in a future release because, if the provided address is of
195
   * type InetSocketAddress or Inet6SocketAddress, the port argument
196
   * is not needed since it can be specified within the address.
197
   */
198
  UdpTraceClientHelper (Address ip, uint16_t port, std::string filename) NS_DEPRECATED;
199
  /**
200
   * Create UdpTraceClientHelper which will make life easier for people trying
201
   * to set up simulations with udp-client-server.
202
   *
203
   * \param addr The address of the remote UDP server
204
   * \param filename the file from which packet traces will be loaded
181
   */
205
   */
182
  UdpTraceClientHelper (Address ip, uint16_t port, std::string filename);
206
  UdpTraceClientHelper (Address addr, std::string filename);
183
  /**
207
  /**
184
   * Create UdpTraceClientHelper which will make life easier for people trying
208
   * Create UdpTraceClientHelper which will make life easier for people trying
185
   * to set up simulations with udp-client-server.
209
   * to set up simulations with udp-client-server.
(-)a/src/applications/helper/udp-echo-helper.cc (+6 lines)
 Lines 80-85   UdpEchoClientHelper::UdpEchoClientHelper (Address address, uint16_t port) Link Here 
80
  SetAttribute ("RemotePort", UintegerValue (port));
80
  SetAttribute ("RemotePort", UintegerValue (port));
81
}
81
}
82
82
83
UdpEchoClientHelper::UdpEchoClientHelper (Address address)
84
{
85
  m_factory.SetTypeId (UdpEchoClient::GetTypeId ());
86
  SetAttribute ("RemoteAddress", AddressValue (address));
87
}
88
83
UdpEchoClientHelper::UdpEchoClientHelper (Ipv4Address address, uint16_t port)
89
UdpEchoClientHelper::UdpEchoClientHelper (Ipv4Address address, uint16_t port)
84
{
90
{
85
  m_factory.SetTypeId (UdpEchoClient::GetTypeId ());
91
  m_factory.SetTypeId (UdpEchoClient::GetTypeId ());
(-)a/src/applications/helper/udp-echo-helper.h (-1 / +12 lines)
 Lines 112-119   public: Link Here 
112
   *
112
   *
113
   * \param ip The IP address of the remote udp echo server
113
   * \param ip The IP address of the remote udp echo server
114
   * \param port The port number of the remote udp echo server
114
   * \param port The port number of the remote udp echo server
115
   * \deprecated This constructor is deprecated and will be removed
116
   * in a future release because, if the provided address is of
117
   * type InetSocketAddress or Inet6SocketAddress, the port argument
118
   * is not needed since it can be specified within the address.
115
   */
119
   */
116
  UdpEchoClientHelper (Address ip, uint16_t port);
120
  UdpEchoClientHelper (Address ip, uint16_t port) NS_DEPRECATED;
121
  /**
122
   * Create UdpEchoClientHelper which will make life easier for people trying
123
   * to set up simulations with echos.
124
   *
125
   * \param addr The address of the remote udp echo server
126
   */
127
  UdpEchoClientHelper (Address addr);
117
  /**
128
  /**
118
   * Create UdpEchoClientHelper which will make life easier for people trying
129
   * Create UdpEchoClientHelper which will make life easier for people trying
119
   * to set up simulations with echos.
130
   * to set up simulations with echos.
(-)a/src/applications/model/udp-client.cc (+17 lines)
 Lines 111-116   UdpClient::SetRemote (Address ip, uint16_t port) Link Here 
111
}
111
}
112
112
113
void
113
void
114
UdpClient::SetRemote (Address addr)
115
{
116
  NS_LOG_FUNCTION (this << addr);
117
  m_peerAddress = addr;
118
}
119
120
void
114
UdpClient::DoDispose (void)
121
UdpClient::DoDispose (void)
115
{
122
{
116
  NS_LOG_FUNCTION (this);
123
  NS_LOG_FUNCTION (this);
 Lines 136-141   UdpClient::StartApplication (void) Link Here 
136
          m_socket->Bind6 ();
143
          m_socket->Bind6 ();
137
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom(m_peerAddress), m_peerPort));
144
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom(m_peerAddress), m_peerPort));
138
        }
145
        }
146
      else if (InetSocketAddress::IsMatchingType (m_peerAddress) == true)
147
        {
148
          m_socket->Bind ();
149
          m_socket->Connect (m_peerAddress);
150
        }
151
      else if (Inet6SocketAddress::IsMatchingType (m_peerAddress) == true)
152
        {
153
          m_socket->Bind6 ();
154
          m_socket->Connect (m_peerAddress);
155
        }
139
    }
156
    }
140
157
141
  m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
158
  m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
(-)a/src/applications/model/udp-client.h (-1 / +10 lines)
 Lines 69-76   public: Link Here 
69
   * \brief set the remote address and port
69
   * \brief set the remote address and port
70
   * \param ip remote IP address
70
   * \param ip remote IP address
71
   * \param port remote port
71
   * \param port remote port
72
   * \deprecated This method is deprecated and will be removed
73
   * in a future release because, if the provided address is of
74
   * type InetSocketAddress or Inet6SocketAddress, the port argument
75
   * is not needed since it can be specified within the address.
72
   */
76
   */
73
  void SetRemote (Address ip, uint16_t port);
77
  void SetRemote (Address ip, uint16_t port) NS_DEPRECATED;
78
  /**
79
   * \brief set the remote address
80
   * \param addr remote address
81
   */
82
  void SetRemote (Address addr);
74
83
75
protected:
84
protected:
76
  virtual void DoDispose (void);
85
  virtual void DoDispose (void);
(-)a/src/applications/model/udp-echo-client.cc (+17 lines)
 Lines 103-108   UdpEchoClient::SetRemote (Address ip, uint16_t port) Link Here 
103
}
103
}
104
104
105
void 
105
void 
106
UdpEchoClient::SetRemote (Address addr)
107
{
108
  NS_LOG_FUNCTION (this << addr);
109
  m_peerAddress = addr;
110
}
111
112
void 
106
UdpEchoClient::SetRemote (Ipv4Address ip, uint16_t port)
113
UdpEchoClient::SetRemote (Ipv4Address ip, uint16_t port)
107
{
114
{
108
  NS_LOG_FUNCTION (this << ip << port);
115
  NS_LOG_FUNCTION (this << ip << port);
 Lines 144-149   UdpEchoClient::StartApplication (void) Link Here 
144
          m_socket->Bind6();
151
          m_socket->Bind6();
145
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom(m_peerAddress), m_peerPort));
152
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom(m_peerAddress), m_peerPort));
146
        }
153
        }
154
      else if (InetSocketAddress::IsMatchingType (m_peerAddress) == true)
155
        {
156
          m_socket->Bind ();
157
          m_socket->Connect (m_peerAddress);
158
        }
159
      else if (Inet6SocketAddress::IsMatchingType (m_peerAddress) == true)
160
        {
161
          m_socket->Bind6 ();
162
          m_socket->Connect (m_peerAddress);
163
        }
147
    }
164
    }
148
165
149
  m_socket->SetRecvCallback (MakeCallback (&UdpEchoClient::HandleRead, this));
166
  m_socket->SetRecvCallback (MakeCallback (&UdpEchoClient::HandleRead, this));
(-)a/src/applications/model/udp-echo-client.h (-1 / +10 lines)
 Lines 65-72   public: Link Here 
65
   * \brief set the remote address and port
65
   * \brief set the remote address and port
66
   * \param ip remote IP address
66
   * \param ip remote IP address
67
   * \param port remote port
67
   * \param port remote port
68
   * \deprecated This method is deprecated and will be removed
69
   * in a future release because, if the provided address is of
70
   * type InetSocketAddress or Inet6SocketAddress, the port argument
71
   * is not needed since it can be specified within the address.
68
   */
72
   */
69
  void SetRemote (Address ip, uint16_t port);
73
  void SetRemote (Address ip, uint16_t port) NS_DEPRECATED;
74
  /**
75
   * \brief set the remote address
76
   * \param addr remote address
77
   */
78
  void SetRemote (Address addr);
70
79
71
  /**
80
  /**
72
   * Set the data size of the packet (the number of bytes that are sent as data
81
   * Set the data size of the packet (the number of bytes that are sent as data
(-)a/src/applications/model/udp-trace-client.cc (+18 lines)
 Lines 131-136   UdpTraceClient::SetRemote (Address ip, uint16_t port) Link Here 
131
}
131
}
132
132
133
void
133
void
134
UdpTraceClient::SetRemote (Address addr)
135
{
136
  NS_LOG_FUNCTION (this << addr);
137
  m_entries.clear ();
138
  m_peerAddress = addr;
139
}
140
141
void
134
UdpTraceClient::SetRemote (Ipv4Address ip, uint16_t port)
142
UdpTraceClient::SetRemote (Ipv4Address ip, uint16_t port)
135
{
143
{
136
  NS_LOG_FUNCTION (this << ip << port);
144
  NS_LOG_FUNCTION (this << ip << port);
 Lines 260-265   UdpTraceClient::StartApplication (void) Link Here 
260
          m_socket->Bind6 ();
268
          m_socket->Bind6 ();
261
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom (m_peerAddress), m_peerPort));
269
          m_socket->Connect (Inet6SocketAddress (Ipv6Address::ConvertFrom (m_peerAddress), m_peerPort));
262
        }
270
        }
271
      else if (InetSocketAddress::IsMatchingType (m_peerAddress) == true)
272
        {
273
          m_socket->Bind ();
274
          m_socket->Connect (m_peerAddress);
275
        }
276
      else if (Inet6SocketAddress::IsMatchingType (m_peerAddress) == true)
277
        {
278
          m_socket->Bind6 ();
279
          m_socket->Connect (m_peerAddress);
280
        }
263
    }
281
    }
264
  m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
282
  m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
265
  m_socket->SetAllowBroadcast (true);
283
  m_socket->SetAllowBroadcast (true);
(-)a/src/applications/model/udp-trace-client.h (-1 / +10 lines)
 Lines 92-99   public: Link Here 
92
   * \brief set the remote address and port
92
   * \brief set the remote address and port
93
   * \param ip remote IP address
93
   * \param ip remote IP address
94
   * \param port remote port
94
   * \param port remote port
95
   * \deprecated This method is deprecated and will be removed
96
   * in a future release because, if the provided address is of
97
   * type InetSocketAddress or Inet6SocketAddress, the port argument
98
   * is not needed since it can be specified within the address.
95
   */
99
   */
96
  void SetRemote (Address ip, uint16_t port);
100
  void SetRemote (Address ip, uint16_t port) NS_DEPRECATED;
101
  /**
102
   * \brief set the remote address
103
   * \param addr remote address
104
   */
105
  void SetRemote (Address addr);
97
106
98
  /**
107
  /**
99
   * \brief Set the trace file to be used by the application
108
   * \brief Set the trace file to be used by the application

Return to bug 2474