| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 // Sets the authentication callback; does not take ownership. | 177 // Sets the authentication callback; does not take ownership. |
| 178 void set_auth_hook(TurnAuthInterface* auth_hook) { auth_hook_ = auth_hook; } | 178 void set_auth_hook(TurnAuthInterface* auth_hook) { auth_hook_ = auth_hook; } |
| 179 | 179 |
| 180 void set_redirect_hook(TurnRedirectInterface* redirect_hook) { | 180 void set_redirect_hook(TurnRedirectInterface* redirect_hook) { |
| 181 redirect_hook_ = redirect_hook; | 181 redirect_hook_ = redirect_hook; |
| 182 } | 182 } |
| 183 | 183 |
| 184 void set_enable_otu_nonce(bool enable) { enable_otu_nonce_ = enable; } | 184 void set_enable_otu_nonce(bool enable) { enable_otu_nonce_ = enable; } |
| 185 | 185 |
| 186 // If set to true, reject CreatePermission requests to RFC1918 addresses. |
| 187 void set_reject_private_addresses(bool filter) { |
| 188 reject_private_addresses_ = filter; |
| 189 } |
| 190 |
| 186 // Starts listening for packets from internal clients. | 191 // Starts listening for packets from internal clients. |
| 187 void AddInternalSocket(rtc::AsyncPacketSocket* socket, | 192 void AddInternalSocket(rtc::AsyncPacketSocket* socket, |
| 188 ProtocolType proto); | 193 ProtocolType proto); |
| 189 // Starts listening for the connections on this socket. When someone tries | 194 // Starts listening for the connections on this socket. When someone tries |
| 190 // to connect, the connection will be accepted and a new internal socket | 195 // to connect, the connection will be accepted and a new internal socket |
| 191 // will be added. | 196 // will be added. |
| 192 void AddInternalServerSocket(rtc::AsyncSocket* socket, | 197 void AddInternalServerSocket(rtc::AsyncSocket* socket, |
| 193 ProtocolType proto); | 198 ProtocolType proto); |
| 194 // Specifies the factory to use for creating external sockets. | 199 // Specifies the factory to use for creating external sockets. |
| 195 void SetExternalSocketFactory(rtc::PacketSocketFactory* factory, | 200 void SetExternalSocketFactory(rtc::PacketSocketFactory* factory, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 253 |
| 249 rtc::Thread* thread_; | 254 rtc::Thread* thread_; |
| 250 std::string nonce_key_; | 255 std::string nonce_key_; |
| 251 std::string realm_; | 256 std::string realm_; |
| 252 std::string software_; | 257 std::string software_; |
| 253 TurnAuthInterface* auth_hook_; | 258 TurnAuthInterface* auth_hook_; |
| 254 TurnRedirectInterface* redirect_hook_; | 259 TurnRedirectInterface* redirect_hook_; |
| 255 // otu - one-time-use. Server will respond with 438 if it's | 260 // otu - one-time-use. Server will respond with 438 if it's |
| 256 // sees the same nonce in next transaction. | 261 // sees the same nonce in next transaction. |
| 257 bool enable_otu_nonce_; | 262 bool enable_otu_nonce_; |
| 263 bool reject_private_addresses_; |
| 258 | 264 |
| 259 InternalSocketMap server_sockets_; | 265 InternalSocketMap server_sockets_; |
| 260 ServerSocketMap server_listen_sockets_; | 266 ServerSocketMap server_listen_sockets_; |
| 261 rtc::scoped_ptr<rtc::PacketSocketFactory> | 267 rtc::scoped_ptr<rtc::PacketSocketFactory> |
| 262 external_socket_factory_; | 268 external_socket_factory_; |
| 263 rtc::SocketAddress external_addr_; | 269 rtc::SocketAddress external_addr_; |
| 264 | 270 |
| 265 AllocationMap allocations_; | 271 AllocationMap allocations_; |
| 266 | 272 |
| 267 friend class TurnServerAllocation; | 273 friend class TurnServerAllocation; |
| 268 }; | 274 }; |
| 269 | 275 |
| 270 } // namespace cricket | 276 } // namespace cricket |
| 271 | 277 |
| 272 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ | 278 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ |
| OLD | NEW |