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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 /* 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.
31 DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry);
33 /* Gets ICMP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
34 * NULL, NO_ERROR otherwise.
36 DWORD getICMPStats(MIB_ICMP *stats);
38 /* Gets IP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
39 * NULL, NO_ERROR otherwise.
41 DWORD getIPStats(PMIB_IPSTATS stats);
43 /* Gets TCP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
44 * NULL, NO_ERROR otherwise.
46 DWORD getTCPStats(MIB_TCPSTATS *stats);
48 /* Gets UDP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
49 * NULL, NO_ERROR otherwise.
51 DWORD getUDPStats(MIB_UDPSTATS *stats);
53 /* Route table functions */
55 DWORD getNumRoutes(void);
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.
60 typedef struct _RouteEntry {
68 typedef struct _RouteTable {
73 /* Allocates and returns to you the route table, or NULL if it can't allocate
74 * enough memory. free() the returned table.
76 RouteTable *getRouteTable(void);
78 /* Returns the number of entries in the arp table. */
79 DWORD getNumArpEntries(void);
81 /* Allocates and returns to you the arp table, or NULL if it can't allocate
82 * enough memory. free() the returned table.
84 PMIB_IPNETTABLE getArpTable(void);
86 /* Returns the number of entries in the UDP state table. */
87 DWORD getNumUdpEntries(void);
89 /* Allocates and returns to you the UDP state table, or NULL if it can't
90 * allocate enough memory. free() the returned table.
92 PMIB_UDPTABLE getUdpTable(void);
94 /* Returns the number of entries in the TCP state table. */
95 DWORD getNumTcpEntries(void);
97 /* Allocates and returns to you the TCP state table, or NULL if it can't
98 * allocate enough memory. free() the returned table.
100 PMIB_TCPTABLE getTcpTable(void);
102 #endif /* ndef WINE_IPSTATS_H_ */