diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /third_party/libwebrtc/api/candidate.cc | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/candidate.cc')
-rw-r--r-- | third_party/libwebrtc/api/candidate.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/third_party/libwebrtc/api/candidate.cc b/third_party/libwebrtc/api/candidate.cc index 90cb326823..865f8e5787 100644 --- a/third_party/libwebrtc/api/candidate.cc +++ b/third_party/libwebrtc/api/candidate.cc @@ -17,6 +17,11 @@ namespace cricket { +const char LOCAL_PORT_TYPE[] = "local"; +const char STUN_PORT_TYPE[] = "stun"; +const char PRFLX_PORT_TYPE[] = "prflx"; +const char RELAY_PORT_TYPE[] = "relay"; + Candidate::Candidate() : id_(rtc::CreateRandomString(8)), component_(0), @@ -57,6 +62,19 @@ Candidate::Candidate(const Candidate&) = default; Candidate::~Candidate() = default; +bool Candidate::is_local() const { + return type_ == LOCAL_PORT_TYPE; +} +bool Candidate::is_stun() const { + return type_ == STUN_PORT_TYPE; +} +bool Candidate::is_prflx() const { + return type_ == PRFLX_PORT_TYPE; +} +bool Candidate::is_relay() const { + return type_ == RELAY_PORT_TYPE; +} + bool Candidate::IsEquivalent(const Candidate& c) const { // We ignore the network name, since that is just debug information, and // the priority and the network cost, since they should be the same if the |