OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // CF = CANDIDATE FILTER | 89 // CF = CANDIDATE FILTER |
90 enum { | 90 enum { |
91 CF_NONE = 0x0, | 91 CF_NONE = 0x0, |
92 CF_HOST = 0x1, | 92 CF_HOST = 0x1, |
93 CF_REFLEXIVE = 0x2, | 93 CF_REFLEXIVE = 0x2, |
94 CF_RELAY = 0x4, | 94 CF_RELAY = 0x4, |
95 CF_ALL = 0x7, | 95 CF_ALL = 0x7, |
96 }; | 96 }; |
97 | 97 |
| 98 // TLS certificate policy. |
| 99 enum class TlsCertPolicy { |
| 100 // For TLS based protocols, ensure the connection is secure by not |
| 101 // circumventing certificate validation. |
| 102 TLS_CERT_POLICY_SECURE, |
| 103 // For TLS based protocols, disregard security completely by skipping |
| 104 // certificate validation. This is insecure and should never be used unless |
| 105 // security is irrelevant in that particular context. |
| 106 TLS_CERT_POLICY_INSECURE_NO_CHECK, |
| 107 }; |
| 108 |
98 // TODO(deadbeef): Rename to TurnCredentials (and username to ufrag). | 109 // TODO(deadbeef): Rename to TurnCredentials (and username to ufrag). |
99 struct RelayCredentials { | 110 struct RelayCredentials { |
100 RelayCredentials() {} | 111 RelayCredentials() {} |
101 RelayCredentials(const std::string& username, const std::string& password) | 112 RelayCredentials(const std::string& username, const std::string& password) |
102 : username(username), password(password) {} | 113 : username(username), password(password) {} |
103 | 114 |
104 bool operator==(const RelayCredentials& o) const { | 115 bool operator==(const RelayCredentials& o) const { |
105 return username == o.username && password == o.password; | 116 return username == o.username && password == o.password; |
106 } | 117 } |
107 bool operator!=(const RelayCredentials& o) const { return !(*this == o); } | 118 bool operator!=(const RelayCredentials& o) const { return !(*this == o); } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 bool operator==(const RelayServerConfig& o) const { | 151 bool operator==(const RelayServerConfig& o) const { |
141 return type == o.type && ports == o.ports && credentials == o.credentials && | 152 return type == o.type && ports == o.ports && credentials == o.credentials && |
142 priority == o.priority; | 153 priority == o.priority; |
143 } | 154 } |
144 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); } | 155 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); } |
145 | 156 |
146 RelayType type; | 157 RelayType type; |
147 PortList ports; | 158 PortList ports; |
148 RelayCredentials credentials; | 159 RelayCredentials credentials; |
149 int priority = 0; | 160 int priority = 0; |
| 161 TlsCertPolicy tls_cert_policy = TlsCertPolicy::TLS_CERT_POLICY_SECURE; |
150 }; | 162 }; |
151 | 163 |
152 class PortAllocatorSession : public sigslot::has_slots<> { | 164 class PortAllocatorSession : public sigslot::has_slots<> { |
153 public: | 165 public: |
154 // Content name passed in mostly for logging and debugging. | 166 // Content name passed in mostly for logging and debugging. |
155 PortAllocatorSession(const std::string& content_name, | 167 PortAllocatorSession(const std::string& content_name, |
156 int component, | 168 int component, |
157 const std::string& ice_ufrag, | 169 const std::string& ice_ufrag, |
158 const std::string& ice_pwd, | 170 const std::string& ice_pwd, |
159 uint32_t flags); | 171 uint32_t flags); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 int candidate_pool_size_ = 0; // Last value passed into SetConfiguration. | 440 int candidate_pool_size_ = 0; // Last value passed into SetConfiguration. |
429 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 441 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
430 bool prune_turn_ports_ = false; | 442 bool prune_turn_ports_ = false; |
431 | 443 |
432 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; | 444 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; |
433 }; | 445 }; |
434 | 446 |
435 } // namespace cricket | 447 } // namespace cricket |
436 | 448 |
437 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 449 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
OLD | NEW |