2 * Copyright (C) 2003 Juan Lang
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 * This module implements functions shared by DLLs that need to get network-
19 * related statistics. It's meant to hide some platform-specificisms, and
20 * share code that was previously duplicated.
22 #ifndef WINE_IPSTATS_H_
23 #define WINE_IPSTATS_H_
28 //#include "winbase.h"
29 //#include "iprtrmib.h"
31 /* Fills in entry's interface stats, using name to find them.
32 * Returns ERROR_INVALID_PARAMETER if name or entry is NULL, NO_ERROR otherwise.
34 DWORD
getInterfaceStatsByName(const char *name
, PMIB_IFROW entry
);
36 /* Ditto above by index. */
37 DWORD
getInterfaceStatsByIndex(DWORD index
, PMIB_IFROW entry
);
39 /* Gets ICMP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
40 * NULL, NO_ERROR otherwise.
42 DWORD
getICMPStats(MIB_ICMP
*stats
);
44 /* Gets IP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
45 * NULL, NO_ERROR otherwise.
47 DWORD
getIPStats(PMIB_IPSTATS stats
, DWORD family
);
49 /* Gets TCP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
50 * NULL, NO_ERROR otherwise.
52 DWORD
getTCPStats(MIB_TCPSTATS
*stats
, DWORD family
);
54 /* Gets UDP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
55 * NULL, NO_ERROR otherwise.
57 DWORD
getUDPStats(MIB_UDPSTATS
*stats
, DWORD family
);
59 /* Route table functions */
61 DWORD
getNumRoutes(void);
63 /* Minimalist route entry, only has the fields I can actually fill in. How
64 * these map to the different windows route data structures is up to you.
66 typedef struct _RouteEntry
{
74 typedef struct _RouteTable
{
79 /* Allocates and returns to you the route table, or NULL if it can't allocate
80 * enough memory. free() the returned table.
82 RouteTable
*getRouteTable(void);
84 /* Returns the number of entries in the arp table. */
85 DWORD
getNumArpEntries(void);
87 /* Allocates and returns to you the arp table, or NULL if it can't allocate
88 * enough memory. free() the returned table.
90 PMIB_IPNETTABLE
getArpTable(void);
92 /* Returns the number of entries in the UDP state table. */
93 DWORD
getNumUdpEntries(void);
95 /* Allocates and returns to you the UDP state table, or NULL if it can't
96 * allocate enough memory. free() the returned table.
98 PMIB_UDPTABLE
getUdpTable(void);
100 /* Returns the number of entries in the TCP state table. */
101 DWORD
getNumTcpEntries(void);
103 /* Allocates and returns to you the TCP state table, or NULL if it can't
104 * allocate enough memory. free() the returned table.
106 PMIB_TCPTABLE
getTcpTable(void);
108 #endif /* ndef WINE_IPSTATS_H_ */