Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: webrtc/p2p/base/portallocator.h

Issue 1311153003: Add check to prevent TURN usage if the protocol is not allowed. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 21
22 namespace cricket { 22 namespace cricket {
23 23
24 // PortAllocator is responsible for allocating Port types for a given 24 // PortAllocator is responsible for allocating Port types for a given
25 // P2PSocket. It also handles port freeing. 25 // P2PSocket. It also handles port freeing.
26 // 26 //
27 // Clients can override this class to control port allocation, including 27 // Clients can override this class to control port allocation, including
28 // what kinds of ports are allocated. 28 // what kinds of ports are allocated.
29 29
30 enum { 30 enum {
31 PORTALLOCATOR_DISABLE_UDP = 0x01, 31 PORTALLOCATOR_DISABLE_UDP = 0x01,
pthatcher1 2015/08/25 23:12:00 Can you add a comment here that this *doesn't* dis
32 PORTALLOCATOR_DISABLE_STUN = 0x02, 32 PORTALLOCATOR_DISABLE_STUN = 0x02,
33 PORTALLOCATOR_DISABLE_RELAY = 0x04, 33 PORTALLOCATOR_DISABLE_RELAY = 0x04,
34 PORTALLOCATOR_DISABLE_TCP = 0x08, 34 PORTALLOCATOR_DISABLE_TCP = 0x08,
35 PORTALLOCATOR_ENABLE_SHAKER = 0x10, 35 PORTALLOCATOR_ENABLE_SHAKER = 0x10,
36 PORTALLOCATOR_ENABLE_IPV6 = 0x40, 36 PORTALLOCATOR_ENABLE_IPV6 = 0x40,
37 // TODO(pthatcher): Remove this once it's no longer used in: 37 // TODO(pthatcher): Remove this once it's no longer used in:
38 // remoting/client/plugin/pepper_port_allocator.cc 38 // remoting/client/plugin/pepper_port_allocator.cc
39 // remoting/protocol/chromium_port_allocator.cc 39 // remoting/protocol/chromium_port_allocator.cc
40 // remoting/test/fake_port_allocator.cc 40 // remoting/test/fake_port_allocator.cc
41 // It's a no-op and is no longer needed. 41 // It's a no-op and is no longer needed.
42 PORTALLOCATOR_ENABLE_SHARED_UFRAG = 0x80, 42 PORTALLOCATOR_ENABLE_SHARED_UFRAG = 0x80,
43 PORTALLOCATOR_ENABLE_SHARED_SOCKET = 0x100, 43 PORTALLOCATOR_ENABLE_SHARED_SOCKET = 0x100,
44 PORTALLOCATOR_ENABLE_STUN_RETRANSMIT_ATTRIBUTE = 0x200, 44 PORTALLOCATOR_ENABLE_STUN_RETRANSMIT_ATTRIBUTE = 0x200,
45 PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION = 0x400, 45 PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION = 0x400,
46 // When specified, a loopback candidate will be generated if 46 // When specified, a loopback candidate will be generated if
47 // PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION is specified. 47 // PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION is specified.
48 PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE = 0x800, 48 PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE = 0x800,
49 // Disallow to use UDP when connecting to relay server. Using UDP could leak
50 // IP address.
pthatcher1 2015/08/25 22:59:30 Disallow to use => Disallow use of to relay serve
51 PORTALLOCATOR_DISABLE_TURN_OVER_UDP = 0x1000,
pthatcher1 2015/08/25 22:59:30 Would PORTALLOCATOR_DISABLE_UDP_TURN be equally cl
49 }; 52 };
50 53
51 const uint32 kDefaultPortAllocatorFlags = 0; 54 const uint32 kDefaultPortAllocatorFlags = 0;
52 55
53 const uint32 kDefaultStepDelay = 1000; // 1 sec step delay. 56 const uint32 kDefaultStepDelay = 1000; // 1 sec step delay.
54 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain 57 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain
55 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. 58 // internal. Less than 20ms is not acceptable. We choose 50ms as our default.
56 const uint32 kMinimumStepDelay = 50; 59 const uint32 kMinimumStepDelay = 50;
57 60
58 // CF = CANDIDATE FILTER 61 // CF = CANDIDATE FILTER
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 int max_port_; 191 int max_port_;
189 uint32 step_delay_; 192 uint32 step_delay_;
190 bool allow_tcp_listen_; 193 bool allow_tcp_listen_;
191 uint32 candidate_filter_; 194 uint32 candidate_filter_;
192 std::string origin_; 195 std::string origin_;
193 }; 196 };
194 197
195 } // namespace cricket 198 } // namespace cricket
196 199
197 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 200 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/client/basicportallocator.cc » ('j') | webrtc/p2p/client/basicportallocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698