| 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 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 rtc::SocketAddress* out) = 0; | 154 rtc::SocketAddress* out) = 0; |
| 155 virtual ~TurnRedirectInterface() {} | 155 virtual ~TurnRedirectInterface() {} |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 // The core TURN server class. Give it a socket to listen on via | 158 // The core TURN server class. Give it a socket to listen on via |
| 159 // AddInternalServerSocket, and a factory to create external sockets via | 159 // AddInternalServerSocket, and a factory to create external sockets via |
| 160 // SetExternalSocketFactory, and it's ready to go. | 160 // SetExternalSocketFactory, and it's ready to go. |
| 161 // Not yet wired up: TCP support. | 161 // Not yet wired up: TCP support. |
| 162 class TurnServer : public sigslot::has_slots<> { | 162 class TurnServer : public sigslot::has_slots<> { |
| 163 public: | 163 public: |
| 164 typedef std::map<TurnServerConnection, TurnServerAllocation*> AllocationMap; | 164 typedef std::map<TurnServerConnection, std::unique_ptr<TurnServerAllocation>> |
| 165 AllocationMap; |
| 165 | 166 |
| 166 explicit TurnServer(rtc::Thread* thread); | 167 explicit TurnServer(rtc::Thread* thread); |
| 167 ~TurnServer(); | 168 ~TurnServer(); |
| 168 | 169 |
| 169 // Gets/sets the realm value to use for the server. | 170 // Gets/sets the realm value to use for the server. |
| 170 const std::string& realm() const { return realm_; } | 171 const std::string& realm() const { return realm_; } |
| 171 void set_realm(const std::string& realm) { realm_ = realm; } | 172 void set_realm(const std::string& realm) { realm_ = realm; } |
| 172 | 173 |
| 173 // Gets/sets the value for the SOFTWARE attribute for TURN messages. | 174 // Gets/sets the value for the SOFTWARE attribute for TURN messages. |
| 174 const std::string& software() const { return software_; } | 175 const std::string& software() const { return software_; } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // For testing only. If this is non-zero, the next NONCE will be generated | 286 // For testing only. If this is non-zero, the next NONCE will be generated |
| 286 // from this value, and it will be reset to 0 after generating the NONCE. | 287 // from this value, and it will be reset to 0 after generating the NONCE. |
| 287 int64_t ts_for_next_nonce_ = 0; | 288 int64_t ts_for_next_nonce_ = 0; |
| 288 | 289 |
| 289 friend class TurnServerAllocation; | 290 friend class TurnServerAllocation; |
| 290 }; | 291 }; |
| 291 | 292 |
| 292 } // namespace cricket | 293 } // namespace cricket |
| 293 | 294 |
| 294 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ | 295 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ |
| OLD | NEW |