OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTOCOL_NETWORK_SETTINGS_H_ | 5 #ifndef REMOTING_PROTOCOL_NETWORK_SETTINGS_H_ |
6 #define REMOTING_PROTOCOL_NETWORK_SETTINGS_H_ | 6 #define REMOTING_PROTOCOL_NETWORK_SETTINGS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/time/time.h" |
13 #include "remoting/protocol/port_range.h" | 14 #include "remoting/protocol/port_range.h" |
14 | 15 |
15 namespace remoting { | 16 namespace remoting { |
16 namespace protocol { | 17 namespace protocol { |
17 | 18 |
18 struct NetworkSettings { | 19 struct NetworkSettings { |
19 | 20 |
20 // When hosts are configured with NAT traversal disabled they will | 21 // When hosts are configured with NAT traversal disabled they will |
21 // typically also limit their P2P ports to this range, so that | 22 // typically also limit their P2P ports to this range, so that |
22 // sessions may be blocked or un-blocked via firewall rules. | 23 // sessions may be blocked or un-blocked via firewall rules. |
(...skipping 14 matching lines...) Expand all Loading... |
37 NAT_TRAVERSAL_STUN = 0x2, | 38 NAT_TRAVERSAL_STUN = 0x2, |
38 | 39 |
39 // Allow the use of relay servers when a direct connection is not available. | 40 // Allow the use of relay servers when a direct connection is not available. |
40 NAT_TRAVERSAL_RELAY = 0x4, | 41 NAT_TRAVERSAL_RELAY = 0x4, |
41 | 42 |
42 // Active NAT traversal using STUN and relay servers. | 43 // Active NAT traversal using STUN and relay servers. |
43 NAT_TRAVERSAL_FULL = NAT_TRAVERSAL_STUN | NAT_TRAVERSAL_RELAY | | 44 NAT_TRAVERSAL_FULL = NAT_TRAVERSAL_STUN | NAT_TRAVERSAL_RELAY | |
44 NAT_TRAVERSAL_OUTGOING | 45 NAT_TRAVERSAL_OUTGOING |
45 }; | 46 }; |
46 | 47 |
47 NetworkSettings() : flags(NAT_TRAVERSAL_DISABLED) { | 48 NetworkSettings() {} |
48 DCHECK(!(flags & (NAT_TRAVERSAL_STUN | NAT_TRAVERSAL_RELAY)) || | |
49 (flags & NAT_TRAVERSAL_OUTGOING)); | |
50 } | |
51 | 49 |
52 explicit NetworkSettings(uint32_t flags) : flags(flags) {} | 50 explicit NetworkSettings(uint32_t flags) : flags(flags) {} |
53 | 51 |
54 uint32_t flags; | 52 uint32_t flags = NAT_TRAVERSAL_DISABLED; |
55 | 53 |
56 // Range of ports used by P2P sessions. | 54 // Range of ports used by P2P sessions. |
57 PortRange port_range; | 55 PortRange port_range; |
| 56 |
| 57 // ICE Timeout. |
| 58 base::TimeDelta ice_timeout = base::TimeDelta::FromSeconds(15); |
| 59 |
| 60 // ICE reconnect attempts. |
| 61 int ice_reconnect_attempts = 2; |
58 }; | 62 }; |
59 | 63 |
60 } // namespace protocol | 64 } // namespace protocol |
61 } // namespace remoting | 65 } // namespace remoting |
62 | 66 |
63 #endif // REMOTING_HOST_NETWORK_SETTINGS_H_ | 67 #endif // REMOTING_HOST_NETWORK_SETTINGS_H_ |
OLD | NEW |