Fixed some problems found while compiling and linking Wine under
[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 <stdarg.h>
26
27 #include "windef.h"
28 #include "winbase.h"
29 #include "iprtrmib.h"
30
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.
33  */
34 DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry);
35
36 /* Gets ICMP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
37  * NULL, NO_ERROR otherwise.
38  */
39 DWORD getICMPStats(MIB_ICMP *stats);
40
41 /* Gets IP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
42  * NULL, NO_ERROR otherwise.
43  */
44 DWORD getIPStats(PMIB_IPSTATS stats);
45
46 /* Gets TCP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
47  * NULL, NO_ERROR otherwise.
48  */
49 DWORD getTCPStats(MIB_TCPSTATS *stats);
50
51 /* Gets UDP statistics into stats.  Returns ERROR_INVALID_PARAMETER if stats is
52  * NULL, NO_ERROR otherwise.
53  */
54 DWORD getUDPStats(MIB_UDPSTATS *stats);
55
56 /* Route table functions */
57
58 DWORD getNumRoutes(void);
59
60 /* Minimalist route entry, only has the fields I can actually fill in.  How
61  * these map to the different windows route data structures is up to you.
62  */
63 typedef struct _RouteEntry {
64   DWORD dest;
65   DWORD mask;
66   DWORD gateway;
67   DWORD ifIndex;
68   DWORD metric;
69 } RouteEntry;
70
71 typedef struct _RouteTable {
72   DWORD numRoutes;
73   RouteEntry routes[1];
74 } RouteTable;
75
76 /* Allocates and returns to you the route table, or NULL if it can't allocate
77  * enough memory.  free() the returned table.
78  */
79 RouteTable *getRouteTable(void);
80
81 /* Returns the number of entries in the arp table. */
82 DWORD getNumArpEntries(void);
83
84 /* Allocates and returns to you the arp table, or NULL if it can't allocate
85  * enough memory.  free() the returned table.
86  */
87 PMIB_IPNETTABLE getArpTable(void);
88
89 /* Returns the number of entries in the UDP state table. */
90 DWORD getNumUdpEntries(void);
91
92 /* Allocates and returns to you the UDP state table, or NULL if it can't
93  * allocate enough memory.  free() the returned table.
94  */
95 PMIB_UDPTABLE getUdpTable(void);
96
97 /* Returns the number of entries in the TCP state table. */
98 DWORD getNumTcpEntries(void);
99
100 /* Allocates and returns to you the TCP state table, or NULL if it can't
101  * allocate enough memory.  free() the returned table.
102  */
103 PMIB_TCPTABLE getTcpTable(void);
104
105 #endif /* ndef WINE_IPSTATS_H_ */