| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_NETWORK_SETTINGS_H_ | 5 #ifndef REMOTING_HOST_NETWORK_SETTINGS_H_ |
| 6 #define REMOTING_HOST_NETWORK_SETTINGS_H_ | 6 #define REMOTING_HOST_NETWORK_SETTINGS_H_ |
| 7 | 7 |
| 8 namespace remoting { | 8 namespace remoting { |
| 9 | 9 |
| 10 struct NetworkSettings { | 10 struct NetworkSettings { |
| 11 |
| 12 // When hosts are configured with NAT traversal disabled they will |
| 13 // typically also limit their P2P ports to this range, so that |
| 14 // sessions may be blocked or un-blocked via firewall rules. |
| 15 static const int kDefaultMinPort = 12400; |
| 16 static const int kDefaultMaxPort = 12409; |
| 17 |
| 11 enum NatTraversalMode { | 18 enum NatTraversalMode { |
| 12 // Active NAT traversal using STUN and relay servers. | 19 // Active NAT traversal using STUN and relay servers. |
| 13 NAT_TRAVERSAL_ENABLED, | 20 NAT_TRAVERSAL_ENABLED, |
| 14 | 21 |
| 15 // Don't use STUN or relay servers. Accept incoming P2P connection | 22 // Don't use STUN or relay servers. Accept incoming P2P connection |
| 16 // attempts, but don't initiate any. This ensures that the peer is | 23 // attempts, but don't initiate any. This ensures that the peer is |
| 17 // on the same network. Note that connection will always fail if | 24 // on the same network. Note that connection will always fail if |
| 18 // both ends use this mode. | 25 // both ends use this mode. |
| 19 NAT_TRAVERSAL_DISABLED, | 26 NAT_TRAVERSAL_DISABLED, |
| 20 | 27 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 | 45 |
| 39 // |min_port| and |max_port| specify range (inclusive) of ports used by | 46 // |min_port| and |max_port| specify range (inclusive) of ports used by |
| 40 // P2P sessions. Any port can be used when both values are set to 0. | 47 // P2P sessions. Any port can be used when both values are set to 0. |
| 41 int min_port; | 48 int min_port; |
| 42 int max_port; | 49 int max_port; |
| 43 }; | 50 }; |
| 44 | 51 |
| 45 } // namespace remoting | 52 } // namespace remoting |
| 46 | 53 |
| 47 #endif // REMOTING_HOST_NETWORK_SETTINGS_H_ | 54 #endif // REMOTING_HOST_NETWORK_SETTINGS_H_ |
| OLD | NEW |