Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
cea728ee
Commit
cea728ee
authored
May 17, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address: add nice_address_equal_no_port() to compare addresses ignoring ports
parent
ee493a3e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
0 deletions
+40
-0
agent/address.c
agent/address.c
+20
-0
agent/address.h
agent/address.h
+17
-0
docs/reference/libnice/libnice-sections.txt
docs/reference/libnice/libnice-sections.txt
+1
-0
nice/libnice.sym
nice/libnice.sym
+1
-0
win32/vs9/libnice.def
win32/vs9/libnice.def
+1
-0
No files found.
agent/address.c
View file @
cea728ee
...
...
@@ -391,3 +391,23 @@ nice_address_ip_version (const NiceAddress *addr)
return
0
;
}
}
NICEAPI_EXPORT
gboolean
nice_address_equal_no_port
(
const
NiceAddress
*
a
,
const
NiceAddress
*
b
)
{
if
(
a
->
s
.
addr
.
sa_family
!=
b
->
s
.
addr
.
sa_family
)
return
FALSE
;
switch
(
a
->
s
.
addr
.
sa_family
)
{
case
AF_INET
:
return
(
a
->
s
.
ip4
.
sin_addr
.
s_addr
==
b
->
s
.
ip4
.
sin_addr
.
s_addr
);
case
AF_INET6
:
return
IN6_ARE_ADDR_EQUAL
(
&
a
->
s
.
ip6
.
sin6_addr
,
&
b
->
s
.
ip6
.
sin6_addr
)
&&
(
a
->
s
.
ip6
.
sin6_scope_id
==
b
->
s
.
ip6
.
sin6_scope_id
);
default:
g_return_val_if_reached
(
FALSE
);
}
}
agent/address.h
View file @
cea728ee
...
...
@@ -235,12 +235,29 @@ nice_address_copy_to_sockaddr (const NiceAddress *addr, struct sockaddr *sin);
* @b: Second #NiceAddress to compare
*
* Compares two #NiceAddress structures to see if they contain the same address
* and the same port.
*
* Returns: %TRUE if @a and @b are the same address, %FALSE if they are different
*/
gboolean
nice_address_equal
(
const
NiceAddress
*
a
,
const
NiceAddress
*
b
);
/**
* nice_address_equal_no_port:
* @a: First #NiceAddress to compare
* @b: Second #NiceAddress to compare
*
* Compares two #NiceAddress structures to see if they contain the same address,
* ignoring the port.
*
* Returns: %TRUE if @a and @b are the same address, %FALSE if they
* are different
*
* Since: UNRELEASED
*/
gboolean
nice_address_equal_no_port
(
const
NiceAddress
*
a
,
const
NiceAddress
*
b
);
/**
* nice_address_to_string:
* @addr: The #NiceAddress to query
...
...
docs/reference/libnice/libnice-sections.txt
View file @
cea728ee
...
...
@@ -112,6 +112,7 @@ nice_address_set_from_string
nice_address_set_from_sockaddr
nice_address_copy_to_sockaddr
nice_address_equal
nice_address_equal_no_port
nice_address_to_string
nice_address_is_private
nice_address_is_valid
...
...
nice/libnice.sym
View file @
cea728ee
nice_address_copy_to_sockaddr
nice_address_dup
nice_address_equal
nice_address_equal_no_port
nice_address_free
nice_address_get_port
nice_address_init
...
...
win32/vs9/libnice.def
View file @
cea728ee
...
...
@@ -5,6 +5,7 @@ EXPORTS
nice_address_copy_to_sockaddr
nice_address_dup
nice_address_equal
nice_address_equal_no_port
nice_address_free
nice_address_get_port
nice_address_init
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment