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 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; | |
32 std::string stun_server; | 17 std::string stun_server; |
33 std::string relay_server; | 18 std::string relay_server; |
34 std::string relay_token; | 19 std::string relay_token; |
35 | |
36 // |min_port| and |max_port| specify range (inclusive) of ports used by | |
37 // P2P sessions. Any port can be used when both values are set to 0. | |
38 int min_port; | |
39 int max_port; | |
40 }; | 20 }; |
41 | 21 |
42 } // namespace protocol | 22 } // namespace protocol |
43 } // namespace remoting | 23 } // namespace remoting |
44 | 24 |
45 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ | 25 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ |
OLD | NEW |