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 { |
Wez
2012/03/01 19:36:35
nit: Is a single enum the best way to express this
Sergey Ulanov
2012/03/01 20:48:29
Yes, I considered two separate flags, but incoming
| |
18 // Don't use STUN or relay servers and don't make any outgoing | |
19 // connections. Note that connection will always fail if both ends | |
Wez
2012/03/01 19:36:35
nit: "outgoing" is a little confusing in a p2p con
Sergey Ulanov
2012/03/01 20:48:29
Done.
| |
20 // use this mode. | |
21 NAT_TRAVERSAL_DISABLED, | |
22 | |
23 // Don't use STUN or relay servers but make outgoing connections. | |
24 NAT_TRAVERSAL_PASSIVE, | |
Wez
2012/03/01 19:36:35
nit: It's not really "passive" if you make an outg
Wez
2012/03/01 19:36:35
We don't actually use PASSIVE right now, so perhap
Sergey Ulanov
2012/03/01 20:48:29
It's not used anywhere right now, but it might be
Sergey Ulanov
2012/03/01 20:48:29
It is passive in terms of not actively trying to t
| |
25 | |
26 // Active NAT traversal using STUN and relay servers. | |
27 NAT_TRAVERSAL_ENABLED, | |
28 }; | |
29 | |
30 NatTraversalMode nat_traversal_mode; | |
18 std::string stun_server; | 31 std::string stun_server; |
19 std::string relay_server; | 32 std::string relay_server; |
20 std::string relay_token; | 33 std::string relay_token; |
21 | 34 |
22 // |min_port| and |max_port| specify range (inclusive) of ports used by | 35 // |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. | 36 // P2P sessions. Any port can be used when both values are set to 0. |
24 int min_port; | 37 int min_port; |
25 int max_port; | 38 int max_port; |
26 }; | 39 }; |
27 | 40 |
28 } // namespace protocol | 41 } // namespace protocol |
29 } // namespace remoting | 42 } // namespace remoting |
30 | 43 |
31 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ | 44 #endif // REMOTING_PROTOCOL_TRANSPORT_CONFIG_H_ |
OLD | NEW |