diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2017-04-04 14:41:51 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2017-04-11 17:50:40 -0400 |
commit | 1e9e28dbc98b4f6a7cf4bda0ca73b5abc2735ddc (patch) | |
tree | 2327d6b3d07268bfeb3052849201c636bcbf1955 /agent/candidate.c | |
parent | 10c557f23f8337f1304fff27bd85d2eb713cb249 (diff) | |
download | libnice-1e9e28dbc98b4f6a7cf4bda0ca73b5abc2735ddc.tar.gz |
candidate: Add equality check function
Add a function that can check if two candidates point to the same place.
https://phabricator.freedesktop.org/T104
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D1715
Diffstat (limited to 'agent/candidate.c')
-rw-r--r-- | agent/candidate.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/agent/candidate.c b/agent/candidate.c index 27966ef..85f8f65 100644 --- a/agent/candidate.c +++ b/agent/candidate.c @@ -360,3 +360,14 @@ nice_candidate_copy (const NiceCandidate *candidate) return copy; } + +NICEAPI_EXPORT gboolean +nice_candidate_equal_target (const NiceCandidate *candidate1, + const NiceCandidate *candidate2) +{ + g_return_val_if_fail (candidate1 != NULL, FALSE); + g_return_val_if_fail (candidate2 != NULL, FALSE); + + return (candidate1->transport == candidate2->transport && + nice_address_equal (&candidate1->addr, &candidate2->addr)); +} |