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
68498fc3
Commit
68498fc3
authored
Aug 11, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Aug 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsiproxy: Implement IPv6 ipstats get_all_parameters on linux.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2f3fc13c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
1 deletion
+85
-1
nsi.c
dlls/nsi/tests/nsi.c
+0
-1
ip.c
dlls/nsiproxy.sys/ip.c
+85
-0
No files found.
dlls/nsi/tests/nsi.c
View file @
68498fc3
...
...
@@ -424,7 +424,6 @@ static void test_ip_ipstats( int family )
/* The table appears to consist of a single object without a key. The rw data does exist but
isn't part of GetIpStatisticsEx() and isn't yet tested */
err
=
NsiGetAllParameters
(
1
,
mod
,
NSI_IP_IPSTATS_TABLE
,
NULL
,
0
,
NULL
,
0
,
&
dyn
,
sizeof
(
dyn
),
&
stat
,
sizeof
(
stat
)
);
todo_wine_if
(
family
==
AF_INET6
)
ok
(
!
err
,
"got %x
\n
"
,
err
);
if
(
err
)
goto
err
;
...
...
dlls/nsiproxy.sys/ip.c
View file @
68498fc3
...
...
@@ -226,6 +226,82 @@ static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, DWORD key_size
#endif
}
static
NTSTATUS
ipv6_ipstats_get_all_parameters
(
const
void
*
key
,
DWORD
key_size
,
void
*
rw_data
,
DWORD
rw_size
,
void
*
dynamic_data
,
DWORD
dynamic_size
,
void
*
static_data
,
DWORD
static_size
)
{
struct
nsi_ip_ipstats_dynamic
dyn
;
struct
nsi_ip_ipstats_static
stat
;
memset
(
&
dyn
,
0
,
sizeof
(
dyn
)
);
memset
(
&
stat
,
0
,
sizeof
(
stat
)
);
#ifdef __linux__
{
struct
{
const
char
*
name
;
void
*
elem
;
int
size
;
}
ipstatlist
[]
=
{
#define X(x) &x, sizeof(x)
{
"Ip6InReceives"
,
X
(
dyn
.
in_recv
)
},
{
"Ip6InHdrErrors"
,
X
(
dyn
.
in_hdr_errs
)
},
{
"Ip6InAddrErrors"
,
X
(
dyn
.
in_addr_errs
)
},
{
"Ip6OutForwDatagrams"
,
X
(
dyn
.
fwd_dgrams
)
},
{
"Ip6InUnknownProtos"
,
X
(
dyn
.
in_unk_protos
)
},
{
"Ip6InDiscards"
,
X
(
dyn
.
in_discards
)
},
{
"Ip6InDelivers"
,
X
(
dyn
.
in_delivers
)
},
{
"Ip6OutRequests"
,
X
(
dyn
.
out_reqs
)
},
{
"Ip6OutDiscards"
,
X
(
dyn
.
out_discards
)
},
{
"Ip6OutNoRoutes"
,
X
(
dyn
.
out_no_routes
)
},
{
"Ip6ReasmTimeout"
,
X
(
stat
.
reasm_timeout
)
},
{
"Ip6ReasmReqds"
,
X
(
dyn
.
reasm_reqds
)
},
{
"Ip6ReasmOKs"
,
X
(
dyn
.
reasm_oks
)
},
{
"Ip6ReasmFails"
,
X
(
dyn
.
reasm_fails
)
},
{
"Ip6FragOKs"
,
X
(
dyn
.
frag_oks
)
},
{
"Ip6FragFails"
,
X
(
dyn
.
frag_fails
)
},
{
"Ip6FragCreates"
,
X
(
dyn
.
frag_creates
)
},
/* no routingDiscards */
#undef X
};
NTSTATUS
status
=
STATUS_NOT_SUPPORTED
;
char
buf
[
512
],
*
ptr
,
*
value
;
DWORD
i
;
FILE
*
fp
;
if
(
!
(
fp
=
fopen
(
"/proc/net/snmp6"
,
"r"
)))
return
STATUS_NOT_SUPPORTED
;
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
!
(
value
=
strchr
(
buf
,
' '
)))
continue
;
/* terminate the valuename */
*
value
++
=
'\0'
;
/* and strip leading spaces from value */
while
(
*
value
==
' '
)
value
++
;
if
((
ptr
=
strchr
(
value
,
'\n'
)))
*
ptr
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipstatlist
);
i
++
)
if
(
!
_strnicmp
(
buf
,
ipstatlist
[
i
].
name
,
-
1
))
{
if
(
ipstatlist
[
i
].
size
==
sizeof
(
long
))
*
(
long
*
)
ipstatlist
[
i
].
elem
=
strtoul
(
value
,
NULL
,
10
);
else
*
(
long
long
*
)
ipstatlist
[
i
].
elem
=
strtoull
(
value
,
NULL
,
10
);
status
=
STATUS_SUCCESS
;
}
}
fclose
(
fp
);
if
(
dynamic_data
)
*
(
struct
nsi_ip_ipstats_dynamic
*
)
dynamic_data
=
dyn
;
if
(
static_data
)
*
(
struct
nsi_ip_ipstats_static
*
)
static_data
=
stat
;
return
status
;
}
#else
FIXME
(
"not implemented
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
#endif
}
static
void
unicast_fill_entry
(
struct
ifaddrs
*
entry
,
void
*
key
,
struct
nsi_ip_unicast_rw
*
rw
,
struct
nsi_ip_unicast_dynamic
*
dyn
,
struct
nsi_ip_unicast_static
*
stat
)
{
...
...
@@ -841,6 +917,15 @@ const struct module ipv4_module =
static
struct
module_table
ipv6_tables
[]
=
{
{
NSI_IP_IPSTATS_TABLE
,
{
0
,
0
,
sizeof
(
struct
nsi_ip_ipstats_dynamic
),
sizeof
(
struct
nsi_ip_ipstats_static
)
},
NULL
,
ipv6_ipstats_get_all_parameters
,
},
{
NSI_IP_UNICAST_TABLE
,
{
sizeof
(
struct
nsi_ipv6_unicast_key
),
sizeof
(
struct
nsi_ip_unicast_rw
),
...
...
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