OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 renomination == other.renomination; | 80 renomination == other.renomination; |
81 } | 81 } |
82 bool operator!=(const IceParameters& other) { return !(*this == other); } | 82 bool operator!=(const IceParameters& other) { return !(*this == other); } |
83 }; | 83 }; |
84 | 84 |
85 extern const char CONNECTIONROLE_ACTIVE_STR[]; | 85 extern const char CONNECTIONROLE_ACTIVE_STR[]; |
86 extern const char CONNECTIONROLE_PASSIVE_STR[]; | 86 extern const char CONNECTIONROLE_PASSIVE_STR[]; |
87 extern const char CONNECTIONROLE_ACTPASS_STR[]; | 87 extern const char CONNECTIONROLE_ACTPASS_STR[]; |
88 extern const char CONNECTIONROLE_HOLDCONN_STR[]; | 88 extern const char CONNECTIONROLE_HOLDCONN_STR[]; |
89 | 89 |
90 constexpr auto ICE_RENOMINATION_STR = "renomination"; | 90 constexpr auto ICE_OPTION_TRICKLE = "trickle"; |
91 constexpr auto ICE_OPTION_RENOMINATION = "renomination"; | |
91 | 92 |
92 bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role); | 93 bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role); |
93 bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str); | 94 bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str); |
94 | 95 |
95 struct TransportDescription { | 96 struct TransportDescription { |
96 TransportDescription() | 97 TransportDescription() |
97 : ice_mode(ICEMODE_FULL), | 98 : ice_mode(ICEMODE_FULL), |
98 connection_role(CONNECTIONROLE_NONE) {} | 99 connection_role(CONNECTIONROLE_NONE) {} |
99 | 100 |
100 TransportDescription(const std::vector<std::string>& transport_options, | 101 TransportDescription(const std::vector<std::string>& transport_options, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 bool HasOption(const std::string& option) const { | 144 bool HasOption(const std::string& option) const { |
144 return (std::find(transport_options.begin(), transport_options.end(), | 145 return (std::find(transport_options.begin(), transport_options.end(), |
145 option) != transport_options.end()); | 146 option) != transport_options.end()); |
146 } | 147 } |
147 void AddOption(const std::string& option) { | 148 void AddOption(const std::string& option) { |
148 transport_options.push_back(option); | 149 transport_options.push_back(option); |
149 } | 150 } |
150 bool secure() const { return identity_fingerprint != nullptr; } | 151 bool secure() const { return identity_fingerprint != nullptr; } |
151 | 152 |
152 IceParameters GetIceParameters() { | 153 IceParameters GetIceParameters() { |
153 return IceParameters(ice_ufrag, ice_pwd, HasOption(ICE_RENOMINATION_STR)); | 154 return IceParameters(ice_ufrag, ice_pwd, |
155 HasOption(ICE_OPTION_RENOMINATION)); | |
154 } | 156 } |
155 | 157 |
156 static rtc::SSLFingerprint* CopyFingerprint( | 158 static rtc::SSLFingerprint* CopyFingerprint( |
157 const rtc::SSLFingerprint* from) { | 159 const rtc::SSLFingerprint* from) { |
158 if (!from) | 160 if (!from) |
159 return NULL; | 161 return NULL; |
160 | 162 |
161 return new rtc::SSLFingerprint(*from); | 163 return new rtc::SSLFingerprint(*from); |
162 } | 164 } |
163 | 165 |
166 // These are actually ICE options (appearing in the ice-options attribute in | |
167 // SDP). | |
168 // TODO(deadbeef): Rename to ice_options? | |
pthatcher1
2017/04/21 01:09:54
I'd say yes, rename to ice_options.
| |
164 std::vector<std::string> transport_options; | 169 std::vector<std::string> transport_options; |
165 std::string ice_ufrag; | 170 std::string ice_ufrag; |
166 std::string ice_pwd; | 171 std::string ice_pwd; |
167 IceMode ice_mode; | 172 IceMode ice_mode; |
168 ConnectionRole connection_role; | 173 ConnectionRole connection_role; |
169 | 174 |
170 std::unique_ptr<rtc::SSLFingerprint> identity_fingerprint; | 175 std::unique_ptr<rtc::SSLFingerprint> identity_fingerprint; |
171 }; | 176 }; |
172 | 177 |
173 } // namespace cricket | 178 } // namespace cricket |
174 | 179 |
175 #endif // WEBRTC_P2P_BASE_TRANSPORTDESCRIPTION_H_ | 180 #endif // WEBRTC_P2P_BASE_TRANSPORTDESCRIPTION_H_ |
OLD | NEW |