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_PROTOCOL_TRANSPORT_CONFIG_H_ | 5 #ifndef REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ |
6 #define REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ | 6 #define REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 namespace protocol { | 11 namespace protocol { |
12 | 12 |
13 struct TransportConfig { | 13 struct TransportConfig { |
14 TransportConfig(); | 14 TransportConfig(); |
15 ~TransportConfig(); | 15 ~TransportConfig(); |
16 | 16 |
17 bool nat_traversal; | 17 enum NatTraversalMode { |
| 18 // Don't use STUN or relay servers. Accept incoming P2P connection |
| 19 // attempts, but don't initiate any. This ensures that the peer is |
| 20 // on the same network. Note that connection will always fail if |
| 21 // both ends use this mode. |
| 22 NAT_TRAVERSAL_DISABLED, |
| 23 |
| 24 // Don't use STUN or relay servers but make outgoing connections. |
| 25 NAT_TRAVERSAL_OUTGOING, |
| 26 |
| 27 // Active NAT traversal using STUN and relay servers. |
| 28 NAT_TRAVERSAL_ENABLED, |
| 29 }; |
| 30 |
| 31 NatTraversalMode nat_traversal_mode; |
18 std::string stun_server; | 32 std::string stun_server; |
19 std::string relay_server; | 33 std::string relay_server; |
20 std::string relay_token; | 34 std::string relay_token; |
21 | 35 |
22 // |min_port| and |max_port| specify range (inclusive) of ports used by | 36 // |min_port| and |max_port| specify range (inclusive) of ports used by |
23 // P2P sessions. Any port can be used when both values are set to 0. | 37 // P2P sessions. Any port can be used when both values are set to 0. |
24 int min_port; | 38 int min_port; |
25 int max_port; | 39 int max_port; |
26 }; | 40 }; |
27 | 41 |
28 } // namespace protocol | 42 } // namespace protocol |
29 } // namespace remoting | 43 } // namespace remoting |
30 | 44 |
31 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ | 45 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ |
OLD | NEW |