Small resources fixes.
[wine] / dlls / iphlpapi / ipstats.h
1 /* ipstats.h
2  * Copyright (C) 2003 Juan Lang
3  *
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.
8  *
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.
13  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
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.
21  */
22 #ifndef WINE_IPSTATS_H_
23 #define WINE_IPSTATS_H_
24
25 #include "windef.h"
26 #include "iprtrmib.h"
27
28 /* Fills in entry's interface stats, using name to find them.
29  * Returns ERROR_INVALID_PARAMETER if name or entry is NULL, NO_ERROR otherwise.
30  */
31 DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry);
32
33 /* Gets ICMP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
34  * NULL, NO_ERROR otherwise.
35  */
36 DWORD getICMPStats(MIB_ICMP *stats);
37
38 /* Gets IP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
39  * NULL, NO_ERROR otherwise.
40  */
41 DWORD getIPStats(PMIB_IPSTATS stats);
42
43 /* Gets TCP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
44  * NULL, NO_ERROR otherwise.
45  */
46 DWORD getTCPStats(MIB_TCPSTATS *stats);
47
48 /* Gets UDP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
49  * NULL, NO_ERROR otherwise.
50  */
51 DWORD getUDPStats(MIB_UDPSTATS *stats);
52
53 /* Route table functions */
54
55 DWORD getNumRoutes(void);
56
57 /* Minimalist route entry, only has the fields I can actually fill in.  How
58  * these map to the different windows route data structures is up to you.
59  */
60 typedef struct _RouteEntry {
61   DWORD dest;
62   DWORD mask;
63   DWORD gateway;
64   DWORD ifIndex;
65   DWORD metric;
66 } RouteEntry;
67
68 typedef struct _RouteTable {
69   DWORD numRoutes;
70   RouteEntry routes[1];
71 } RouteTable;
72
73 /* Allocates and returns to you the route table, or NULL if it can't allocate
74  * enough memory.  free() the returned table.
75  */
76 RouteTable *getRouteTable(void);
77
78 /* Returns the number of entries in the arp table. */
79 DWORD getNumArpEntries(void);
80
81 /* Allocates and returns to you the arp table, or NULL if it can't allocate
82  * enough memory.  free() the returned table.
83  */
84 PMIB_IPNETTABLE getArpTable(void);
85
86 /* Returns the number of entries in the UDP state table. */
87 DWORD getNumUdpEntries(void);
88
89 /* Allocates and returns to you the UDP state table, or NULL if it can't
90  * allocate enough memory.  free() the returned table.
91  */
92 PMIB_UDPTABLE getUdpTable(void);
93
94 /* Returns the number of entries in the TCP state table. */
95 DWORD getNumTcpEntries(void);
96
97 /* Allocates and returns to you the TCP state table, or NULL if it can't
98  * allocate enough memory.  free() the returned table.
99  */
100 PMIB_TCPTABLE getTcpTable(void);
101
102 #endif /* ndef WINE_IPSTATS_H_ */