Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0cae7c50
Commit
0cae7c50
authored
Oct 07, 2011
by
Charles Davis
Committed by
Alexandre Julliard
Oct 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement GetUdpTable() on Mac OS and the BSDs.
parent
ec37157b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
ipstats.c
dlls/iphlpapi/ipstats.c
+70
-0
No files found.
dlls/iphlpapi/ipstats.c
View file @
0cae7c50
...
...
@@ -1531,6 +1531,76 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOr
}
else
ret
=
ERROR_NOT_SUPPORTED
;
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_STRUCT_XINPGEN)
{
size_t
Len
=
0
;
char
*
Buf
=
NULL
;
struct
xinpgen
*
pXIG
,
*
pOrigXIG
;
if
(
sysctlbyname
(
"net.inet.udp.pcblist"
,
NULL
,
&
Len
,
NULL
,
0
)
<
0
)
{
ERR
(
"Failure to read net.inet.udp.pcblist via sysctlbyname!
\n
"
);
ret
=
ERROR_NOT_SUPPORTED
;
goto
done
;
}
Buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
Len
);
if
(
!
Buf
)
{
ret
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
if
(
sysctlbyname
(
"net.inet.udp.pcblist"
,
Buf
,
&
Len
,
NULL
,
0
)
<
0
)
{
ERR
(
"Failure to read net.inet.udp.pcblist via sysctlbyname!
\n
"
);
ret
=
ERROR_NOT_SUPPORTED
;
goto
done
;
}
/* Might be nothing here; first entry is just a header it seems */
if
(
Len
<=
sizeof
(
struct
xinpgen
))
goto
done
;
pOrigXIG
=
(
struct
xinpgen
*
)
Buf
;
pXIG
=
pOrigXIG
;
for
(
pXIG
=
(
struct
xinpgen
*
)((
char
*
)
pXIG
+
pXIG
->
xig_len
);
pXIG
->
xig_len
>
sizeof
(
struct
xinpgen
);
pXIG
=
(
struct
xinpgen
*
)((
char
*
)
pXIG
+
pXIG
->
xig_len
))
{
struct
inpcb
*
pINData
;
struct
xsocket
*
pSockData
;
pINData
=
&
((
struct
xinpcb
*
)
pXIG
)
->
xi_inp
;
pSockData
=
&
((
struct
xinpcb
*
)
pXIG
)
->
xi_socket
;
/* Ignore sockets for other protocols */
if
(
pSockData
->
xso_protocol
!=
IPPROTO_UDP
)
continue
;
/* Ignore PCBs that were freed while generating the data */
if
(
pINData
->
inp_gencnt
>
pOrigXIG
->
xig_gen
)
continue
;
/* we're only interested in IPv4 addresses */
if
(
!
(
pINData
->
inp_vflag
&
INP_IPV4
)
||
(
pINData
->
inp_vflag
&
INP_IPV6
))
continue
;
/* If all 0's, skip it */
if
(
!
pINData
->
inp_laddr
.
s_addr
&&
!
pINData
->
inp_lport
)
continue
;
/* Fill in structure details */
row
.
dwLocalAddr
=
pINData
->
inp_laddr
.
s_addr
;
row
.
dwLocalPort
=
pINData
->
inp_lport
;
if
(
!
(
table
=
append_udp_row
(
heap
,
flags
,
table
,
&
count
,
&
row
)))
break
;
}
done:
HeapFree
(
GetProcessHeap
(),
0
,
Buf
);
}
#else
FIXME
(
"not implemented
\n
"
);
ret
=
ERROR_NOT_SUPPORTED
;
...
...
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