OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool prepare_address); | 175 bool prepare_address); |
176 void OnCandidateReady(Port* port, const Candidate& c); | 176 void OnCandidateReady(Port* port, const Candidate& c); |
177 void OnPortComplete(Port* port); | 177 void OnPortComplete(Port* port); |
178 void OnPortError(Port* port); | 178 void OnPortError(Port* port); |
179 void OnProtocolEnabled(AllocationSequence* seq, ProtocolType proto); | 179 void OnProtocolEnabled(AllocationSequence* seq, ProtocolType proto); |
180 void OnPortDestroyed(PortInterface* port); | 180 void OnPortDestroyed(PortInterface* port); |
181 void OnShake(); | 181 void OnShake(); |
182 void MaybeSignalCandidatesAllocationDone(); | 182 void MaybeSignalCandidatesAllocationDone(); |
183 void OnPortAllocationComplete(AllocationSequence* seq); | 183 void OnPortAllocationComplete(AllocationSequence* seq); |
184 PortData* FindPort(Port* port); | 184 PortData* FindPort(Port* port); |
| 185 void GetNetworks(std::vector<rtc::Network*>* networks); |
185 | 186 |
186 bool CheckCandidateFilter(const Candidate& c); | 187 bool CheckCandidateFilter(const Candidate& c); |
187 | 188 |
188 BasicPortAllocator* allocator_; | 189 BasicPortAllocator* allocator_; |
189 rtc::Thread* network_thread_; | 190 rtc::Thread* network_thread_; |
190 rtc::scoped_ptr<rtc::PacketSocketFactory> owned_socket_factory_; | 191 rtc::scoped_ptr<rtc::PacketSocketFactory> owned_socket_factory_; |
191 rtc::PacketSocketFactory* socket_factory_; | 192 rtc::PacketSocketFactory* socket_factory_; |
192 bool allocation_started_; | 193 bool allocation_started_; |
193 bool network_manager_started_; | 194 bool network_manager_started_; |
194 bool running_; // set when StartGetAllPorts is called | 195 bool running_; // set when StartGetAllPorts is called |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 254 |
254 // kInit --> kRunning --> {kCompleted|kStopped} | 255 // kInit --> kRunning --> {kCompleted|kStopped} |
255 }; | 256 }; |
256 AllocationSequence(BasicPortAllocatorSession* session, | 257 AllocationSequence(BasicPortAllocatorSession* session, |
257 rtc::Network* network, | 258 rtc::Network* network, |
258 PortConfiguration* config, | 259 PortConfiguration* config, |
259 uint32 flags); | 260 uint32 flags); |
260 ~AllocationSequence(); | 261 ~AllocationSequence(); |
261 bool Init(); | 262 bool Init(); |
262 void Clear(); | 263 void Clear(); |
| 264 void OnNetworkRemoved(); |
263 | 265 |
264 State state() const { return state_; } | 266 State state() const { return state_; } |
| 267 const rtc::Network* network() const { return network_; } |
| 268 bool network_removed() const { return network_removed_; } |
265 | 269 |
266 // Disables the phases for a new sequence that this one already covers for an | 270 // Disables the phases for a new sequence that this one already covers for an |
267 // equivalent network setup. | 271 // equivalent network setup. |
268 void DisableEquivalentPhases(rtc::Network* network, | 272 void DisableEquivalentPhases(rtc::Network* network, |
269 PortConfiguration* config, | 273 PortConfiguration* config, |
270 uint32* flags); | 274 uint32* flags); |
271 | 275 |
272 // Starts and stops the sequence. When started, it will continue allocating | 276 // Starts and stops the sequence. When started, it will continue allocating |
273 // new ports on its own timed schedule. | 277 // new ports on its own timed schedule. |
274 void Start(); | 278 void Start(); |
(...skipping 29 matching lines...) Expand all Loading... |
304 | 308 |
305 void OnReadPacket(rtc::AsyncPacketSocket* socket, | 309 void OnReadPacket(rtc::AsyncPacketSocket* socket, |
306 const char* data, | 310 const char* data, |
307 size_t size, | 311 size_t size, |
308 const rtc::SocketAddress& remote_addr, | 312 const rtc::SocketAddress& remote_addr, |
309 const rtc::PacketTime& packet_time); | 313 const rtc::PacketTime& packet_time); |
310 | 314 |
311 void OnPortDestroyed(PortInterface* port); | 315 void OnPortDestroyed(PortInterface* port); |
312 | 316 |
313 BasicPortAllocatorSession* session_; | 317 BasicPortAllocatorSession* session_; |
| 318 bool network_removed_ = false; |
314 rtc::Network* network_; | 319 rtc::Network* network_; |
315 rtc::IPAddress ip_; | 320 rtc::IPAddress ip_; |
316 PortConfiguration* config_; | 321 PortConfiguration* config_; |
317 State state_; | 322 State state_; |
318 uint32 flags_; | 323 uint32 flags_; |
319 ProtocolList protocols_; | 324 ProtocolList protocols_; |
320 rtc::scoped_ptr<rtc::AsyncPacketSocket> udp_socket_; | 325 rtc::scoped_ptr<rtc::AsyncPacketSocket> udp_socket_; |
321 // There will be only one udp port per AllocationSequence. | 326 // There will be only one udp port per AllocationSequence. |
322 UDPPort* udp_port_; | 327 UDPPort* udp_port_; |
323 std::vector<TurnPort*> turn_ports_; | 328 std::vector<TurnPort*> turn_ports_; |
324 int phase_; | 329 int phase_; |
325 }; | 330 }; |
326 | 331 |
327 } // namespace cricket | 332 } // namespace cricket |
328 | 333 |
329 #endif // WEBRTC_P2P_CLIENT_BASICPORTALLOCATOR_H_ | 334 #endif // WEBRTC_P2P_CLIENT_BASICPORTALLOCATOR_H_ |
OLD | NEW |