OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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_TURNSERVER_H_ | 11 #ifndef WEBRTC_P2P_BASE_TURNSERVER_H_ |
12 #define WEBRTC_P2P_BASE_TURNSERVER_H_ | 12 #define WEBRTC_P2P_BASE_TURNSERVER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <set> | 16 #include <set> |
17 #include <string> | 17 #include <string> |
18 | 18 |
19 #include "webrtc/p2p/base/portinterface.h" | 19 #include "webrtc/p2p/base/portinterface.h" |
20 #include "webrtc/base/asyncpacketsocket.h" | 20 #include "webrtc/base/asyncpacketsocket.h" |
21 #include "webrtc/base/messagequeue.h" | 21 #include "webrtc/base/messagequeue.h" |
22 #include "webrtc/base/sigslot.h" | 22 #include "webrtc/base/sigslot.h" |
23 #include "webrtc/base/socketaddress.h" | 23 #include "webrtc/base/socketaddress.h" |
24 | 24 |
25 namespace rtc { | 25 namespace rtc { |
26 class ByteBuffer; | 26 class ByteBufferWriter; |
27 class PacketSocketFactory; | 27 class PacketSocketFactory; |
28 class Thread; | 28 class Thread; |
29 } | 29 } |
30 | 30 |
31 namespace cricket { | 31 namespace cricket { |
32 | 32 |
33 class StunMessage; | 33 class StunMessage; |
34 class TurnMessage; | 34 class TurnMessage; |
35 class TurnServer; | 35 class TurnServer; |
36 | 36 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void SendErrorResponseWithRealmAndNonce(TurnServerConnection* conn, | 239 void SendErrorResponseWithRealmAndNonce(TurnServerConnection* conn, |
240 const StunMessage* req, | 240 const StunMessage* req, |
241 int code, | 241 int code, |
242 const std::string& reason); | 242 const std::string& reason); |
243 | 243 |
244 void SendErrorResponseWithAlternateServer(TurnServerConnection* conn, | 244 void SendErrorResponseWithAlternateServer(TurnServerConnection* conn, |
245 const StunMessage* req, | 245 const StunMessage* req, |
246 const rtc::SocketAddress& addr); | 246 const rtc::SocketAddress& addr); |
247 | 247 |
248 void SendStun(TurnServerConnection* conn, StunMessage* msg); | 248 void SendStun(TurnServerConnection* conn, StunMessage* msg); |
249 void Send(TurnServerConnection* conn, const rtc::ByteBuffer& buf); | 249 void Send(TurnServerConnection* conn, const rtc::ByteBufferWriter& buf); |
250 | 250 |
251 void OnAllocationDestroyed(TurnServerAllocation* allocation); | 251 void OnAllocationDestroyed(TurnServerAllocation* allocation); |
252 void DestroyInternalSocket(rtc::AsyncPacketSocket* socket); | 252 void DestroyInternalSocket(rtc::AsyncPacketSocket* socket); |
253 | 253 |
254 typedef std::map<rtc::AsyncPacketSocket*, | 254 typedef std::map<rtc::AsyncPacketSocket*, |
255 ProtocolType> InternalSocketMap; | 255 ProtocolType> InternalSocketMap; |
256 typedef std::map<rtc::AsyncSocket*, | 256 typedef std::map<rtc::AsyncSocket*, |
257 ProtocolType> ServerSocketMap; | 257 ProtocolType> ServerSocketMap; |
258 | 258 |
259 rtc::Thread* thread_; | 259 rtc::Thread* thread_; |
(...skipping 18 matching lines...) Expand all Loading... |
278 // For testing only. If this is non-zero, the next NONCE will be generated | 278 // For testing only. If this is non-zero, the next NONCE will be generated |
279 // from this value, and it will be reset to 0 after generating the NONCE. | 279 // from this value, and it will be reset to 0 after generating the NONCE. |
280 int64_t ts_for_next_nonce_ = 0; | 280 int64_t ts_for_next_nonce_ = 0; |
281 | 281 |
282 friend class TurnServerAllocation; | 282 friend class TurnServerAllocation; |
283 }; | 283 }; |
284 | 284 |
285 } // namespace cricket | 285 } // namespace cricket |
286 | 286 |
287 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ | 287 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ |
OLD | NEW |