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
6ea3796c
Commit
6ea3796c
authored
Jun 24, 2008
by
Eric Durbin
Committed by
Alexandre Julliard
Jun 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement getNumArpEntries on FreeBSD.
parent
beea4d30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
0 deletions
+52
-0
configure
configure
+2
-0
configure.ac
configure.ac
+1
-0
ipstats.c
dlls/iphlpapi/ipstats.c
+46
-0
config.h.in
include/config.h.in
+3
-0
No files found.
configure
View file @
6ea3796c
...
...
@@ -7088,6 +7088,7 @@ done
for
ac_header
in
\
AudioUnit/AudioUnit.h
\
Carbon/Carbon.h
\
...
...
@@ -7136,6 +7137,7 @@ for ac_header in \
mntent.h
\
ncurses.h
\
netdb.h
\
netinet/if_ether.h
\
netinet/in.h
\
netinet/in_systm.h
\
netinet/ip_icmp.h
\
...
...
configure.ac
View file @
6ea3796c
...
...
@@ -273,6 +273,7 @@ AC_CHECK_HEADERS(\
mntent.h \
ncurses.h \
netdb.h \
netinet/if_ether.h \
netinet/in.h \
netinet/in_systm.h \
netinet/ip_icmp.h \
...
...
dlls/iphlpapi/ipstats.c
View file @
6ea3796c
...
...
@@ -46,6 +46,9 @@
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#ifdef HAVE_NET_IF_DL_H
#include <net/if_dl.h>
#endif
#ifdef HAVE_NET_IF_TYPES_H
#include <net/if_types.h>
#endif
...
...
@@ -55,6 +58,9 @@
#ifdef HAVE_NET_IF_ARP_H
#include <net/if_arp.h>
#endif
#ifdef HAVE_NETINET_IF_ETHER_H
#include <netinet/if_ether.h>
#endif
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
...
...
@@ -1234,6 +1240,46 @@ DWORD getRouteTable(PMIB_IPFORWARDTABLE *ppIpForwardTable, HANDLE heap,
DWORD
getNumArpEntries
(
void
)
{
#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
int
mib
[]
=
{
CTL_NET
,
PF_ROUTE
,
0
,
AF_INET
,
NET_RT_FLAGS
,
RTF_LLINFO
};
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
DWORD
arpEntries
=
0
;
size_t
needed
;
char
*
buf
,
*
lim
,
*
next
;
struct
rt_msghdr
*
rtm
;
struct
sockaddr_inarp
*
sinarp
;
struct
sockaddr_dl
*
sdl
;
if
(
sysctl
(
mib
,
MIB_LEN
,
NULL
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get size of arp table
\n
"
);
return
0
;
}
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
if
(
!
buf
)
return
0
;
if
(
sysctl
(
mib
,
MIB_LEN
,
buf
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get arp table
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
0
;
}
lim
=
buf
+
needed
;
next
=
buf
;
while
(
next
<
lim
)
{
rtm
=
(
struct
rt_msghdr
*
)
next
;
sinarp
=
(
struct
sockaddr_inarp
*
)(
rtm
+
1
);
sdl
=
(
struct
sockaddr_dl
*
)((
char
*
)
sinarp
+
ROUNDUP
(
sinarp
->
sin_len
));
if
(
sdl
->
sdl_alen
)
/* arp entry */
arpEntries
++
;
next
+=
rtm
->
rtm_msglen
;
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
arpEntries
;
#endif
return
getNumWithOneHeader
(
"/proc/net/arp"
);
}
...
...
include/config.h.in
View file @
6ea3796c
...
...
@@ -441,6 +441,9 @@
/* Define to 1 if you have the <netinet/icmp_var.h> header file. */
#undef HAVE_NETINET_ICMP_VAR_H
/* Define to 1 if you have the <netinet/if_ether.h> header file. */
#undef HAVE_NETINET_IF_ETHER_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
...
...
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