Index: webrtc/p2p/base/transportdescription.h |
diff --git a/webrtc/p2p/base/transportdescription.h b/webrtc/p2p/base/transportdescription.h |
index 42e45a670f9f415331466e76d1742b67f54d64b9..df8ee92003ef88af0b0d1f76de0a7256517e0781 100644 |
--- a/webrtc/p2p/base/transportdescription.h |
+++ b/webrtc/p2p/base/transportdescription.h |
@@ -60,11 +60,33 @@ enum ConnectionRole { |
CONNECTIONROLE_HOLDCONN, |
}; |
+struct IceParameters { |
+ // TODO(honghaiz): Include ICE mode in this structure to match the ORTC |
+ // struct: |
+ // http://ortc.org/wp-content/uploads/2016/03/ortc.html#idl-def-RTCIceParameters |
+ std::string ufrag; |
+ std::string pwd; |
+ bool renomination = false; |
+ IceParameters() = default; |
+ IceParameters(const std::string& ice_ufrag, |
+ const std::string& ice_pwd, |
+ bool ice_renomination) |
+ : ufrag(ice_ufrag), pwd(ice_pwd), renomination(ice_renomination) {} |
+ |
+ bool operator==(const IceParameters& other) { |
+ return ufrag == other.ufrag && pwd == other.pwd && |
+ renomination == other.renomination; |
+ } |
+ bool operator!=(const IceParameters& other) { return !(*this == other); } |
+}; |
+ |
extern const char CONNECTIONROLE_ACTIVE_STR[]; |
extern const char CONNECTIONROLE_PASSIVE_STR[]; |
extern const char CONNECTIONROLE_ACTPASS_STR[]; |
extern const char CONNECTIONROLE_HOLDCONN_STR[]; |
+constexpr auto ICE_RENOMINATION_STR = "renomination"; |
+ |
bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role); |
bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str); |
@@ -125,6 +147,10 @@ struct TransportDescription { |
} |
bool secure() const { return identity_fingerprint != NULL; } |
+ IceParameters GetIceParameters() { |
+ return IceParameters(ice_ufrag, ice_pwd, HasOption(ICE_RENOMINATION_STR)); |
+ } |
+ |
static rtc::SSLFingerprint* CopyFingerprint( |
const rtc::SSLFingerprint* from) { |
if (!from) |