| 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 |
| 11 #ifndef WEBRTC_P2P_BASE_PORT_H_ | 11 #ifndef WEBRTC_P2P_BASE_PORT_H_ |
| 12 #define WEBRTC_P2P_BASE_PORT_H_ | 12 #define WEBRTC_P2P_BASE_PORT_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <set> | 16 #include <set> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "webrtc/p2p/base/candidate.h" | 20 #include "webrtc/p2p/base/candidate.h" |
| 21 #include "webrtc/p2p/base/candidatepairinterface.h" | 21 #include "webrtc/p2p/base/candidatepairinterface.h" |
| 22 #include "webrtc/p2p/base/jseptransport.h" | 22 #include "webrtc/p2p/base/jseptransport.h" |
| 23 #include "webrtc/p2p/base/packetsocketfactory.h" | 23 #include "webrtc/p2p/base/packetsocketfactory.h" |
| 24 #include "webrtc/p2p/base/portinterface.h" | 24 #include "webrtc/p2p/base/portinterface.h" |
| 25 #include "webrtc/p2p/base/stun.h" | 25 #include "webrtc/p2p/base/stun.h" |
| 26 #include "webrtc/p2p/base/stunrequest.h" | 26 #include "webrtc/p2p/base/stunrequest.h" |
| 27 #include "webrtc/base/asyncpacketsocket.h" | 27 #include "webrtc/base/asyncpacketsocket.h" |
| 28 #include "webrtc/base/checks.h" |
| 28 #include "webrtc/base/network.h" | 29 #include "webrtc/base/network.h" |
| 29 #include "webrtc/base/proxyinfo.h" | 30 #include "webrtc/base/proxyinfo.h" |
| 30 #include "webrtc/base/ratetracker.h" | 31 #include "webrtc/base/ratetracker.h" |
| 31 #include "webrtc/base/sigslot.h" | 32 #include "webrtc/base/sigslot.h" |
| 32 #include "webrtc/base/socketaddress.h" | 33 #include "webrtc/base/socketaddress.h" |
| 33 #include "webrtc/base/thread.h" | 34 #include "webrtc/base/thread.h" |
| 34 | 35 |
| 35 namespace cricket { | 36 namespace cricket { |
| 36 | 37 |
| 37 class Connection; | 38 class Connection; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 sigslot::signal2<Port*, Connection*> SignalConnectionCreated; | 241 sigslot::signal2<Port*, Connection*> SignalConnectionCreated; |
| 241 | 242 |
| 242 // In a shared socket mode each port which shares the socket will decide | 243 // In a shared socket mode each port which shares the socket will decide |
| 243 // to accept the packet based on the |remote_addr|. Currently only UDP | 244 // to accept the packet based on the |remote_addr|. Currently only UDP |
| 244 // port implemented this method. | 245 // port implemented this method. |
| 245 // TODO(mallinath) - Make it pure virtual. | 246 // TODO(mallinath) - Make it pure virtual. |
| 246 virtual bool HandleIncomingPacket( | 247 virtual bool HandleIncomingPacket( |
| 247 rtc::AsyncPacketSocket* socket, const char* data, size_t size, | 248 rtc::AsyncPacketSocket* socket, const char* data, size_t size, |
| 248 const rtc::SocketAddress& remote_addr, | 249 const rtc::SocketAddress& remote_addr, |
| 249 const rtc::PacketTime& packet_time) { | 250 const rtc::PacketTime& packet_time) { |
| 250 ASSERT(false); | 251 RTC_NOTREACHED(); |
| 251 return false; | 252 return false; |
| 252 } | 253 } |
| 253 | 254 |
| 254 // Sends a response message (normal or error) to the given request. One of | 255 // Sends a response message (normal or error) to the given request. One of |
| 255 // these methods should be called as a response to SignalUnknownAddress. | 256 // these methods should be called as a response to SignalUnknownAddress. |
| 256 // NOTE: You MUST call CreateConnection BEFORE SendBindingResponse. | 257 // NOTE: You MUST call CreateConnection BEFORE SendBindingResponse. |
| 257 virtual void SendBindingResponse(StunMessage* request, | 258 virtual void SendBindingResponse(StunMessage* request, |
| 258 const rtc::SocketAddress& addr); | 259 const rtc::SocketAddress& addr); |
| 259 virtual void SendBindingErrorResponse( | 260 virtual void SendBindingErrorResponse( |
| 260 StunMessage* request, const rtc::SocketAddress& addr, | 261 StunMessage* request, const rtc::SocketAddress& addr, |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 const rtc::PacketOptions& options) override; | 711 const rtc::PacketOptions& options) override; |
| 711 int GetError() override { return error_; } | 712 int GetError() override { return error_; } |
| 712 | 713 |
| 713 private: | 714 private: |
| 714 int error_ = 0; | 715 int error_ = 0; |
| 715 }; | 716 }; |
| 716 | 717 |
| 717 } // namespace cricket | 718 } // namespace cricket |
| 718 | 719 |
| 719 #endif // WEBRTC_P2P_BASE_PORT_H_ | 720 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |