Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
5674f166
Commit
5674f166
authored
Oct 08, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Add support for GAA_FLAG_INCLUDE_PREFIX in GetAdaptersAddresses.
parent
d66f7cdb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
27 deletions
+160
-27
ifenum.c
dlls/iphlpapi/ifenum.c
+24
-3
ifenum.h
dlls/iphlpapi/ifenum.h
+2
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+134
-23
No files found.
dlls/iphlpapi/ifenum.c
View file @
5674f166
...
...
@@ -886,7 +886,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
return
ret
;
}
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
)
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
,
SOCKET_ADDRESS
**
masks
)
{
struct
ifaddrs
*
ifa
;
ULONG
ret
;
...
...
@@ -906,10 +906,14 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
{
*
addrs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
(
sizeof
(
SOCKET_ADDRESS
)
+
sizeof
(
struct
WS_sockaddr_in6
)));
if
(
*
addrs
)
*
masks
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
(
sizeof
(
SOCKET_ADDRESS
)
+
sizeof
(
struct
WS_sockaddr_in6
)));
if
(
*
addrs
&&
*
masks
)
{
struct
WS_sockaddr_in6
*
next_addr
=
(
struct
WS_sockaddr_in6
*
)(
(
BYTE
*
)
*
addrs
+
n
*
sizeof
(
SOCKET_ADDRESS
));
struct
WS_sockaddr_in6
*
mask_addr
=
(
struct
WS_sockaddr_in6
*
)(
(
BYTE
*
)
*
masks
+
n
*
sizeof
(
SOCKET_ADDRESS
));
for
(
p
=
ifa
,
n
=
0
;
p
;
p
=
p
->
ifa_next
)
{
...
...
@@ -917,6 +921,7 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
!
strcmp
(
name
,
p
->
ifa_name
))
{
struct
sockaddr_in6
*
addr
=
(
struct
sockaddr_in6
*
)
p
->
ifa_addr
;
struct
sockaddr_in6
*
mask
=
(
struct
sockaddr_in6
*
)
p
->
ifa_netmask
;
next_addr
->
sin6_family
=
WS_AF_INET6
;
next_addr
->
sin6_port
=
addr
->
sin6_port
;
...
...
@@ -927,6 +932,16 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
(
*
addrs
)[
n
].
lpSockaddr
=
(
LPSOCKADDR
)
next_addr
;
(
*
addrs
)[
n
].
iSockaddrLength
=
sizeof
(
struct
WS_sockaddr_in6
);
next_addr
++
;
mask_addr
->
sin6_family
=
WS_AF_INET6
;
mask_addr
->
sin6_port
=
mask
->
sin6_port
;
mask_addr
->
sin6_flowinfo
=
mask
->
sin6_flowinfo
;
memcpy
(
&
mask_addr
->
sin6_addr
,
&
mask
->
sin6_addr
,
sizeof
(
mask_addr
->
sin6_addr
));
mask_addr
->
sin6_scope_id
=
mask
->
sin6_scope_id
;
(
*
masks
)[
n
].
lpSockaddr
=
(
LPSOCKADDR
)
mask_addr
;
(
*
masks
)[
n
].
iSockaddrLength
=
sizeof
(
struct
WS_sockaddr_in6
);
mask_addr
++
;
n
++
;
}
}
...
...
@@ -934,12 +949,17 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
ret
=
ERROR_SUCCESS
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
*
addrs
);
HeapFree
(
GetProcessHeap
(),
0
,
*
masks
);
ret
=
ERROR_OUTOFMEMORY
;
}
}
else
{
*
addrs
=
NULL
;
*
num_addrs
=
0
;
*
masks
=
NULL
;
ret
=
ERROR_SUCCESS
;
}
freeifaddrs
(
ifa
);
...
...
@@ -1073,10 +1093,11 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
return
ret
;
}
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
)
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
,
SOCKET_ADDRESS
**
masks
)
{
*
addrs
=
NULL
;
*
num_addrs
=
0
;
*
masks
=
NULL
;
return
ERROR_SUCCESS
;
}
...
...
dlls/iphlpapi/ifenum.h
View file @
5674f166
...
...
@@ -106,7 +106,8 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
/* Returns the IPv6 addresses for a particular interface index.
* Returns NO_ERROR on success, something else on failure.
*/
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
)
DECLSPEC_HIDDEN
;
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
,
SOCKET_ADDRESS
**
masks
)
DECLSPEC_HIDDEN
;
/* Converts the network-order bytes in addr to a printable string. Returns
* string.
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
5674f166
This diff is collapsed.
Click to expand it.
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