Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3bcabad2
Commit
3bcabad2
authored
May 17, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/SocketAddress: add method IsV6Any()
parent
c629ac71
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
SocketAddress.cxx
src/net/SocketAddress.cxx
+8
-0
SocketAddress.hxx
src/net/SocketAddress.hxx
+6
-0
No files found.
src/net/SocketAddress.cxx
View file @
3bcabad2
...
...
@@ -48,6 +48,14 @@ SocketAddress::operator==(SocketAddress other) const noexcept
#ifdef HAVE_TCP
bool
SocketAddress
::
IsV6Any
()
const
noexcept
{
return
GetFamily
()
==
AF_INET6
&&
memcmp
(
&
((
const
struct
sockaddr_in6
*
)(
const
void
*
)
GetAddress
())
->
sin6_addr
,
&
in6addr_any
,
sizeof
(
in6addr_any
))
==
0
;
}
unsigned
SocketAddress
::
GetPort
()
const
noexcept
{
...
...
src/net/SocketAddress.hxx
View file @
3bcabad2
...
...
@@ -96,6 +96,12 @@ public:
#ifdef HAVE_TCP
/**
* Is this the IPv6 wildcard address (in6addr_any)?
*/
gcc_pure
bool
IsV6Any
()
const
noexcept
;
/**
* Extract the port number. Returns 0 if not applicable.
*/
gcc_pure
...
...
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