Commit 3fe2d6e5 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

include: Update the nldef.h and *mib.h headers.

parent 129f48a6
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "snmp.h" #include "snmp.h"
...@@ -669,7 +672,7 @@ static void mib2IpStatsInit(void) ...@@ -669,7 +672,7 @@ static void mib2IpStatsInit(void)
} }
static struct structToAsnValue mib2IpMap[] = { static struct structToAsnValue mib2IpMap[] = {
{ FIELD_OFFSET(MIB_IPSTATS, dwForwarding), copyInt }, /* 1 */ { FIELD_OFFSET(MIB_IPSTATS, u.dwForwarding), copyInt }, /* 1 */
{ FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt }, /* 2 */ { FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt }, /* 2 */
{ FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt }, /* 3 */ { FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt }, /* 3 */
{ FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */ { FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */
...@@ -826,8 +829,8 @@ static struct structToAsnValue mib2IpRouteMap[] = { ...@@ -826,8 +829,8 @@ static struct structToAsnValue mib2IpRouteMap[] = {
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardType), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, u1.dwForwardType), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardProto), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, u2.dwForwardProto), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt },
...@@ -924,7 +927,7 @@ static struct structToAsnValue mib2IpNetMap[] = { ...@@ -924,7 +927,7 @@ static struct structToAsnValue mib2IpNetMap[] = {
{ FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt }, { FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt },
{ FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr },
{ FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr },
{ FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt }, { FIELD_OFFSET(MIB_IPNETROW, u.dwType), copyInt },
}; };
static void mib2IpNetInit(void) static void mib2IpNetInit(void)
...@@ -1079,7 +1082,7 @@ static void mib2TcpInit(void) ...@@ -1079,7 +1082,7 @@ static void mib2TcpInit(void)
} }
static struct structToAsnValue mib2TcpMap[] = { static struct structToAsnValue mib2TcpMap[] = {
{ FIELD_OFFSET(MIB_TCPSTATS, dwRtoAlgorithm), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, u.dwRtoAlgorithm), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwRtoMin), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMin), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwRtoMax), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMax), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt },
......
...@@ -122,12 +122,12 @@ static int isLoopbackInterface(int fd, const char *name) ...@@ -122,12 +122,12 @@ static int isLoopbackInterface(int fd, const char *name)
/* The comments say MAX_ADAPTER_NAME is required, but really only IF_NAMESIZE /* The comments say MAX_ADAPTER_NAME is required, but really only IF_NAMESIZE
* bytes are necessary. * bytes are necessary.
*/ */
char *getInterfaceNameByIndex(DWORD index, char *name) char *getInterfaceNameByIndex(IF_INDEX index, char *name)
{ {
return if_indextoname(index, name); return if_indextoname(index, name);
} }
DWORD getInterfaceIndexByName(const char *name, PDWORD index) DWORD getInterfaceIndexByName(const char *name, IF_INDEX *index)
{ {
DWORD ret; DWORD ret;
unsigned int idx; unsigned int idx;
...@@ -542,7 +542,7 @@ static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr ...@@ -542,7 +542,7 @@ static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr
} }
#endif #endif
DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, DWORD getInterfacePhysicalByIndex(IF_INDEX index, PDWORD len, PBYTE addr,
PDWORD type) PDWORD type)
{ {
char nameBuf[IF_NAMESIZE]; char nameBuf[IF_NAMESIZE];
...@@ -752,7 +752,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags) ...@@ -752,7 +752,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
return ret; return ret;
} }
ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs) ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_addrs)
{ {
struct ifaddrs *ifa; struct ifaddrs *ifa;
ULONG ret; ULONG ret;
...@@ -937,7 +937,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags) ...@@ -937,7 +937,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
return ret; return ret;
} }
ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs) ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_addrs)
{ {
*addrs = NULL; *addrs = NULL;
*num_addrs = 0; *num_addrs = 0;
......
...@@ -51,7 +51,7 @@ BOOL isIfIndexLoopback(ULONG idx) DECLSPEC_HIDDEN; ...@@ -51,7 +51,7 @@ BOOL isIfIndexLoopback(ULONG idx) DECLSPEC_HIDDEN;
/* A table of interface indexes, see get*InterfaceTable(). */ /* A table of interface indexes, see get*InterfaceTable(). */
typedef struct _InterfaceIndexTable { typedef struct _InterfaceIndexTable {
DWORD numIndexes; DWORD numIndexes;
DWORD indexes[1]; IF_INDEX indexes[1];
} InterfaceIndexTable; } InterfaceIndexTable;
/* Returns a table with all known interface indexes, or NULL if one could not /* Returns a table with all known interface indexes, or NULL if one could not
...@@ -68,13 +68,13 @@ InterfaceIndexTable *getNonLoopbackInterfaceIndexTable(void) DECLSPEC_HIDDEN; ...@@ -68,13 +68,13 @@ InterfaceIndexTable *getNonLoopbackInterfaceIndexTable(void) DECLSPEC_HIDDEN;
* if not. Overwrites your buffer, which should be at least of size * if not. Overwrites your buffer, which should be at least of size
* MAX_ADAPTER_NAME. * MAX_ADAPTER_NAME.
*/ */
char *getInterfaceNameByIndex(DWORD index, char *name) DECLSPEC_HIDDEN; char *getInterfaceNameByIndex(IF_INDEX index, char *name) DECLSPEC_HIDDEN;
/* Fills index with the index of name, if found. Returns /* Fills index with the index of name, if found. Returns
* ERROR_INVALID_PARAMETER if name or index is NULL, ERROR_INVALID_DATA if name * ERROR_INVALID_PARAMETER if name or index is NULL, ERROR_INVALID_DATA if name
* is not found, and NO_ERROR on success. * is not found, and NO_ERROR on success.
*/ */
DWORD getInterfaceIndexByName(const char *name, PDWORD index) DECLSPEC_HIDDEN; DWORD getInterfaceIndexByName(const char *name, IF_INDEX *index) DECLSPEC_HIDDEN;
/* Gets a few physical characteristics of a device: MAC addr len, MAC addr, /* Gets a few physical characteristics of a device: MAC addr len, MAC addr,
* and type as one of the MIB_IF_TYPEs. * and type as one of the MIB_IF_TYPEs.
...@@ -89,7 +89,7 @@ DWORD getInterfaceIndexByName(const char *name, PDWORD index) DECLSPEC_HIDDEN; ...@@ -89,7 +89,7 @@ DWORD getInterfaceIndexByName(const char *name, PDWORD index) DECLSPEC_HIDDEN;
* if internal errors occur. * if internal errors occur.
* Returns NO_ERROR on success. * Returns NO_ERROR on success.
*/ */
DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, DWORD getInterfacePhysicalByIndex(IF_INDEX index, PDWORD len, PBYTE addr,
PDWORD type) DECLSPEC_HIDDEN; PDWORD type) DECLSPEC_HIDDEN;
/* Fills in the MIB_IFROW by name. Doesn't fill in interface statistics, /* Fills in the MIB_IFROW by name. Doesn't fill in interface statistics,
...@@ -111,7 +111,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags) ...@@ -111,7 +111,7 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
/* Returns the IPv6 addresses for a particular interface index. /* Returns the IPv6 addresses for a particular interface index.
* Returns NO_ERROR on success, something else on failure. * Returns NO_ERROR on success, something else on failure.
*/ */
ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs) DECLSPEC_HIDDEN; ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_addrs) DECLSPEC_HIDDEN;
/* Converts the network-order bytes in addr to a printable string. Returns /* Converts the network-order bytes in addr to a printable string. Returns
* string. * string.
......
...@@ -583,7 +583,7 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) ...@@ -583,7 +583,7 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
* is the default gateway for this adapter */ * is the default gateway for this adapter */
for (i = 0; i < routeTable->dwNumEntries; i++) for (i = 0; i < routeTable->dwNumEntries; i++)
if (routeTable->table[i].dwForwardIfIndex == ptr->Index if (routeTable->table[i].dwForwardIfIndex == ptr->Index
&& routeTable->table[i].dwForwardType == && routeTable->table[i].u1.ForwardType ==
MIB_IPROUTE_TYPE_INDIRECT) MIB_IPROUTE_TYPE_INDIRECT)
toIPAddressString(routeTable->table[i].dwForwardNextHop, toIPAddressString(routeTable->table[i].dwForwardNextHop,
ptr->GatewayList.IpAddress.String); ptr->GatewayList.IpAddress.String);
...@@ -628,7 +628,7 @@ static DWORD typeFromMibType(DWORD mib_type) ...@@ -628,7 +628,7 @@ static DWORD typeFromMibType(DWORD mib_type)
} }
} }
static DWORD connectionTypeFromMibType(DWORD mib_type) static NET_IF_CONNECTION_TYPE connectionTypeFromMibType(DWORD mib_type)
{ {
switch (mib_type) switch (mib_type)
{ {
...@@ -638,7 +638,7 @@ static DWORD connectionTypeFromMibType(DWORD mib_type) ...@@ -638,7 +638,7 @@ static DWORD connectionTypeFromMibType(DWORD mib_type)
} }
} }
static ULONG v4addressesFromIndex(DWORD index, DWORD **addrs, ULONG *num_addrs) static ULONG v4addressesFromIndex(IF_INDEX index, DWORD **addrs, ULONG *num_addrs)
{ {
ULONG ret, i, j; ULONG ret, i, j;
MIB_IPADDRTABLE *at; MIB_IPADDRTABLE *at;
...@@ -715,7 +715,7 @@ static ULONG count_v4_gateways(DWORD index, PMIB_IPFORWARDTABLE routeTable) ...@@ -715,7 +715,7 @@ static ULONG count_v4_gateways(DWORD index, PMIB_IPFORWARDTABLE routeTable)
for (i = 0; i < routeTable->dwNumEntries; i++) for (i = 0; i < routeTable->dwNumEntries; i++)
{ {
if (routeTable->table[i].dwForwardIfIndex == index && if (routeTable->table[i].dwForwardIfIndex == index &&
routeTable->table[i].dwForwardType == MIB_IPROUTE_TYPE_INDIRECT) routeTable->table[i].u1.ForwardType == MIB_IPROUTE_TYPE_INDIRECT)
num_gateways++; num_gateways++;
} }
return num_gateways; return num_gateways;
...@@ -730,13 +730,13 @@ static PMIB_IPFORWARDROW findIPv4Gateway(DWORD index, ...@@ -730,13 +730,13 @@ static PMIB_IPFORWARDROW findIPv4Gateway(DWORD index,
for (i = 0; !row && i < routeTable->dwNumEntries; i++) for (i = 0; !row && i < routeTable->dwNumEntries; i++)
{ {
if (routeTable->table[i].dwForwardIfIndex == index && if (routeTable->table[i].dwForwardIfIndex == index &&
routeTable->table[i].dwForwardType == MIB_IPROUTE_TYPE_INDIRECT) routeTable->table[i].u1.ForwardType == MIB_IPROUTE_TYPE_INDIRECT)
row = &routeTable->table[i]; row = &routeTable->table[i];
} }
return row; return row;
} }
static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, DWORD index, static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index,
IP_ADAPTER_ADDRESSES *aa, ULONG *size) IP_ADAPTER_ADDRESSES *aa, ULONG *size)
{ {
ULONG ret = ERROR_SUCCESS, i, num_v4addrs = 0, num_v4_gateways = 0, num_v6addrs = 0, total_size; ULONG ret = ERROR_SUCCESS, i, num_v4addrs = 0, num_v4_gateways = 0, num_v6addrs = 0, total_size;
...@@ -1212,7 +1212,7 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO ...@@ -1212,7 +1212,7 @@ DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDRO
DWORD ndx, matchedBits, matchedNdx = table->dwNumEntries; DWORD ndx, matchedBits, matchedNdx = table->dwNumEntries;
for (ndx = 0, matchedBits = 0; ndx < table->dwNumEntries; ndx++) { for (ndx = 0, matchedBits = 0; ndx < table->dwNumEntries; ndx++) {
if (table->table[ndx].dwForwardType != MIB_IPROUTE_TYPE_INVALID && if (table->table[ndx].u1.ForwardType != MIB_IPROUTE_TYPE_INVALID &&
(dwDestAddr & table->table[ndx].dwForwardMask) == (dwDestAddr & table->table[ndx].dwForwardMask) ==
(table->table[ndx].dwForwardDest & table->table[ndx].dwForwardMask)) { (table->table[ndx].dwForwardDest & table->table[ndx].dwForwardMask)) {
DWORD numShifts, mask; DWORD numShifts, mask;
......
...@@ -354,7 +354,7 @@ static void testGetIpForwardTable(void) ...@@ -354,7 +354,7 @@ static void testGetIpForwardTable(void)
sprintf( buffer + strlen(buffer), " mask %s", ntoa( buf->table[i].dwForwardMask )); sprintf( buffer + strlen(buffer), " mask %s", ntoa( buf->table[i].dwForwardMask ));
trace( "%u: %s gw %s if %u type %u\n", i, buffer, trace( "%u: %s gw %s if %u type %u\n", i, buffer,
ntoa( buf->table[i].dwForwardNextHop ), ntoa( buf->table[i].dwForwardNextHop ),
buf->table[i].dwForwardIfIndex, buf->table[i].dwForwardType ); buf->table[i].dwForwardIfIndex, U1(buf->table[i]).dwForwardType );
} }
} }
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
...@@ -474,7 +474,7 @@ static void testGetIpStatistics(void) ...@@ -474,7 +474,7 @@ static void testGetIpStatistics(void)
if (apiReturn == NO_ERROR && winetest_debug > 1) if (apiReturn == NO_ERROR && winetest_debug > 1)
{ {
trace( "IP stats:\n" ); trace( "IP stats:\n" );
trace( " dwForwarding: %u\n", stats.dwForwarding ); trace( " dwForwarding: %u\n", U(stats).dwForwarding );
trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL );
trace( " dwInReceives: %u\n", stats.dwInReceives ); trace( " dwInReceives: %u\n", stats.dwInReceives );
trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors );
...@@ -521,7 +521,7 @@ static void testGetTcpStatistics(void) ...@@ -521,7 +521,7 @@ static void testGetTcpStatistics(void)
if (apiReturn == NO_ERROR && winetest_debug > 1) if (apiReturn == NO_ERROR && winetest_debug > 1)
{ {
trace( "TCP stats:\n" ); trace( "TCP stats:\n" );
trace( " dwRtoAlgorithm: %u\n", stats.dwRtoAlgorithm ); trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm );
trace( " dwRtoMin: %u\n", stats.dwRtoMin ); trace( " dwRtoMin: %u\n", stats.dwRtoMin );
trace( " dwRtoMax: %u\n", stats.dwRtoMax ); trace( " dwRtoMax: %u\n", stats.dwRtoMax );
trace( " dwMaxConn: %u\n", stats.dwMaxConn ); trace( " dwMaxConn: %u\n", stats.dwMaxConn );
...@@ -603,7 +603,7 @@ static void testGetTcpTable(void) ...@@ -603,7 +603,7 @@ static void testGetTcpTable(void)
ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort) ); ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort) );
trace( "%u: %s remote %s:%u state %u\n", trace( "%u: %s remote %s:%u state %u\n",
i, buffer, ntoa( buf->table[i].dwRemoteAddr ), i, buffer, ntoa( buf->table[i].dwRemoteAddr ),
ntohs(buf->table[i].dwRemotePort), buf->table[i].dwState ); ntohs(buf->table[i].dwRemotePort), U(buf->table[i]).dwState );
} }
} }
HeapFree(GetProcessHeap(), 0, buf); HeapFree(GetProcessHeap(), 0, buf);
......
...@@ -321,7 +321,7 @@ struct per_thread_data ...@@ -321,7 +321,7 @@ struct per_thread_data
/* internal: routing description information */ /* internal: routing description information */
struct route { struct route {
struct in_addr addr; struct in_addr addr;
DWORD interface; IF_INDEX interface;
DWORD metric; DWORD metric;
}; };
...@@ -4487,9 +4487,10 @@ static struct WS_hostent* WS_get_local_ips( char *hostname ) ...@@ -4487,9 +4487,10 @@ static struct WS_hostent* WS_get_local_ips( char *hostname )
/* Store the interface associated with each route */ /* Store the interface associated with each route */
for (i = 0; i < routes->dwNumEntries; i++) for (i = 0; i < routes->dwNumEntries; i++)
{ {
DWORD ifindex, ifmetric, exists = FALSE; IF_INDEX ifindex;
DWORD ifmetric, exists = FALSE;
if (routes->table[i].dwForwardType != MIB_IPROUTE_TYPE_DIRECT) if (routes->table[i].u1.ForwardType != MIB_IPROUTE_TYPE_DIRECT)
continue; continue;
ifindex = routes->table[i].dwForwardIfIndex; ifindex = routes->table[i].dwForwardIfIndex;
ifmetric = routes->table[i].dwForwardMetric1; ifmetric = routes->table[i].dwForwardMetric1;
......
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
#include <ifdef.h> #include <ifdef.h>
typedef struct _MIB_IFNUMBER
{
DWORD dwValue;
} MIB_IFNUMBER, *PMIB_IFNUMBER;
/* Interface table */ /* Interface table */
...@@ -35,9 +40,9 @@ typedef struct _MIB_IFROW ...@@ -35,9 +40,9 @@ typedef struct _MIB_IFROW
DWORD dwMtu; DWORD dwMtu;
DWORD dwSpeed; DWORD dwSpeed;
DWORD dwPhysAddrLen; DWORD dwPhysAddrLen;
BYTE bPhysAddr[MAXLEN_PHYSADDR]; UCHAR bPhysAddr[MAXLEN_PHYSADDR];
DWORD dwAdminStatus; DWORD dwAdminStatus;
DWORD dwOperStatus; INTERNAL_IF_OPER_STATUS dwOperStatus;
DWORD dwLastChange; DWORD dwLastChange;
DWORD dwInOctets; DWORD dwInOctets;
DWORD dwInUcastPkts; DWORD dwInUcastPkts;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
typedef struct _MIB_IPADDRROW typedef struct _MIB_IPADDRROW
{ {
DWORD dwAddr; DWORD dwAddr;
DWORD dwIndex; IF_INDEX dwIndex;
DWORD dwMask; DWORD dwMask;
DWORD dwBCastAddr; DWORD dwBCastAddr;
DWORD dwReasmSize; DWORD dwReasmSize;
...@@ -49,10 +49,15 @@ typedef struct _MIB_IPFORWARDNUMBER ...@@ -49,10 +49,15 @@ typedef struct _MIB_IPFORWARDNUMBER
DWORD dwValue; DWORD dwValue;
} MIB_IPFORWARDNUMBER, *PMIB_IPFORWARDNUMBER; } MIB_IPFORWARDNUMBER, *PMIB_IPFORWARDNUMBER;
#define MIB_IPROUTE_TYPE_OTHER 1 typedef enum
#define MIB_IPROUTE_TYPE_INVALID 2 {
#define MIB_IPROUTE_TYPE_DIRECT 3 MIB_IPROUTE_TYPE_OTHER = 1,
#define MIB_IPROUTE_TYPE_INDIRECT 4 MIB_IPROUTE_TYPE_INVALID = 2,
MIB_IPROUTE_TYPE_DIRECT = 3,
MIB_IPROUTE_TYPE_INDIRECT = 4,
} MIB_IPFORWARD_TYPE;
typedef NL_ROUTE_PROTOCOL MIB_IPFORWARD_PROTO;
typedef struct _MIB_IPFORWARDROW typedef struct _MIB_IPFORWARDROW
{ {
...@@ -60,9 +65,17 @@ typedef struct _MIB_IPFORWARDROW ...@@ -60,9 +65,17 @@ typedef struct _MIB_IPFORWARDROW
DWORD dwForwardMask; DWORD dwForwardMask;
DWORD dwForwardPolicy; DWORD dwForwardPolicy;
DWORD dwForwardNextHop; DWORD dwForwardNextHop;
DWORD dwForwardIfIndex; IF_INDEX dwForwardIfIndex;
DWORD dwForwardType; union
DWORD dwForwardProto; {
DWORD dwForwardType;
MIB_IPFORWARD_TYPE ForwardType;
} DUMMYUNIONNAME1;
union
{
DWORD dwForwardProto;
MIB_IPFORWARD_PROTO ForwardProto;
} DUMMYUNIONNAME2;
DWORD dwForwardAge; DWORD dwForwardAge;
DWORD dwForwardNextHopAS; DWORD dwForwardNextHopAS;
DWORD dwForwardMetric1; DWORD dwForwardMetric1;
...@@ -81,10 +94,13 @@ typedef struct _MIB_IPFORWARDTABLE ...@@ -81,10 +94,13 @@ typedef struct _MIB_IPFORWARDTABLE
/* IPNET table */ /* IPNET table */
#define MIB_IPNET_TYPE_OTHER 1 typedef enum
#define MIB_IPNET_TYPE_INVALID 2 {
#define MIB_IPNET_TYPE_DYNAMIC 3 MIB_IPNET_TYPE_OTHER = 1,
#define MIB_IPNET_TYPE_STATIC 4 MIB_IPNET_TYPE_INVALID = 2,
MIB_IPNET_TYPE_DYNAMIC = 3,
MIB_IPNET_TYPE_STATIC = 4,
} MIB_IPNET_TYPE;
typedef struct _MIB_IPNETROW typedef struct _MIB_IPNETROW
{ {
...@@ -92,7 +108,11 @@ typedef struct _MIB_IPNETROW ...@@ -92,7 +108,11 @@ typedef struct _MIB_IPNETROW
DWORD dwPhysAddrLen; DWORD dwPhysAddrLen;
BYTE bPhysAddr[MAXLEN_PHYSADDR]; BYTE bPhysAddr[MAXLEN_PHYSADDR];
DWORD dwAddr; DWORD dwAddr;
DWORD dwType; union
{
DWORD dwType;
MIB_IPNET_TYPE Type;
} DUMMYUNIONNAME;
} MIB_IPNETROW, *PMIB_IPNETROW; } MIB_IPNETROW, *PMIB_IPNETROW;
typedef struct _MIB_IPNETTABLE typedef struct _MIB_IPNETTABLE
...@@ -104,9 +124,19 @@ typedef struct _MIB_IPNETTABLE ...@@ -104,9 +124,19 @@ typedef struct _MIB_IPNETTABLE
/* IP statistics */ /* IP statistics */
typedef enum
{
MIB_IP_FORWARDING = 1,
MIB_IP_NOT_FORWARDING = 2,
} MIB_IPSTATS_FORWARDING, *PMIB_IPSTATS_FORWARDING;
typedef struct _MIB_IPSTATS typedef struct _MIB_IPSTATS
{ {
DWORD dwForwarding; union
{
DWORD dwForwarding;
MIB_IPSTATS_FORWARDING Forwarding;
} DUMMYUNIONNAME;
DWORD dwDefaultTTL; DWORD dwDefaultTTL;
DWORD dwInReceives; DWORD dwInReceives;
DWORD dwInHdrErrors; DWORD dwInHdrErrors;
...@@ -149,7 +179,7 @@ typedef struct _MIBICMPSTATS ...@@ -149,7 +179,7 @@ typedef struct _MIBICMPSTATS
DWORD dwTimestampReps; DWORD dwTimestampReps;
DWORD dwAddrMasks; DWORD dwAddrMasks;
DWORD dwAddrMaskReps; DWORD dwAddrMaskReps;
} MIBICMPSTATS; } MIBICMPSTATS, *PMIBICMPSTATS;
typedef struct _MIBICMPINFO typedef struct _MIBICMPINFO
{ {
......
...@@ -48,23 +48,32 @@ typedef enum ...@@ -48,23 +48,32 @@ typedef enum
IpDadStatePreferred, IpDadStatePreferred,
} NL_DAD_STATE; } NL_DAD_STATE;
#define MIB_IPPROTO_OTHER 1
#define MIB_IPPROTO_LOCAL 2
#define MIB_IPPROTO_NETMGMT 3
#define MIB_IPPROTO_ICMP 4
#define MIB_IPPROTO_EGP 5
#define MIB_IPPROTO_GGP 6
#define MIB_IPPROTO_HELLO 7
#define MIB_IPPROTO_RIP 8
#define MIB_IPPROTO_IS_IS 9
#define MIB_IPPROTO_ES_IS 10
#define MIB_IPPROTO_CISCO 11
#define MIB_IPPROTO_BBN 12
#define MIB_IPPROTO_OSPF 13
#define MIB_IPPROTO_BGP 14
#define MIB_IPPROTO_NT_AUTOSTATIC 10002 typedef enum
#define MIB_IPPROTO_NT_STATIC 10006 {
#define MIB_IPPROTO_NT_STATIC_NON_DOD 10007 #define MAKE_ROUTE_PROTOCOL(name, value) \
MIB_IPPROTO_ ## name = value, \
PROTO_IP_ ## name = value
MAKE_ROUTE_PROTOCOL(OTHER, 1),
MAKE_ROUTE_PROTOCOL(LOCAL, 2),
MAKE_ROUTE_PROTOCOL(NETMGMT, 3),
MAKE_ROUTE_PROTOCOL(ICMP, 4),
MAKE_ROUTE_PROTOCOL(EGP, 5),
MAKE_ROUTE_PROTOCOL(GGP, 6),
MAKE_ROUTE_PROTOCOL(HELLO, 7),
MAKE_ROUTE_PROTOCOL(RIP, 8),
MAKE_ROUTE_PROTOCOL(IS_IS, 9),
MAKE_ROUTE_PROTOCOL(ES_IS, 10),
MAKE_ROUTE_PROTOCOL(CISCO, 11),
MAKE_ROUTE_PROTOCOL(BBN, 12),
MAKE_ROUTE_PROTOCOL(OSPF, 13),
MAKE_ROUTE_PROTOCOL(BGP, 14),
MAKE_ROUTE_PROTOCOL(NT_AUTOSTATIC, 10002),
MAKE_ROUTE_PROTOCOL(NT_STATIC, 10006),
MAKE_ROUTE_PROTOCOL(NT_STATIC_NON_DOD, 10007),
} NL_ROUTE_PROTOCOL, *PNL_ROUTE_PROTOCOL;
#endif /* __WINE_NLDEF_H */ #endif /* __WINE_NLDEF_H */
...@@ -18,25 +18,43 @@ ...@@ -18,25 +18,43 @@
#ifndef __WINE_TCPMIB_H #ifndef __WINE_TCPMIB_H
#define __WINE_TCPMIB_H #define __WINE_TCPMIB_H
#define TCPIP_OWNING_MODULE_SIZE 16
/* TCP tables */ /* TCP tables */
#define MIB_TCP_STATE_CLOSED 1 typedef enum
#define MIB_TCP_STATE_LISTEN 2 {
#define MIB_TCP_STATE_SYN_SENT 3 MIB_TCP_STATE_CLOSED = 1,
#define MIB_TCP_STATE_SYN_RCVD 4 MIB_TCP_STATE_LISTEN = 2,
#define MIB_TCP_STATE_ESTAB 5 MIB_TCP_STATE_SYN_SENT = 3,
#define MIB_TCP_STATE_FIN_WAIT1 6 MIB_TCP_STATE_SYN_RCVD = 4,
#define MIB_TCP_STATE_FIN_WAIT2 7 MIB_TCP_STATE_ESTAB = 5,
#define MIB_TCP_STATE_CLOSE_WAIT 8 MIB_TCP_STATE_FIN_WAIT1 = 6,
#define MIB_TCP_STATE_CLOSING 9 MIB_TCP_STATE_FIN_WAIT2 = 7,
#define MIB_TCP_STATE_LAST_ACK 10 MIB_TCP_STATE_CLOSE_WAIT = 8,
#define MIB_TCP_STATE_TIME_WAIT 11 MIB_TCP_STATE_CLOSING = 9,
#define MIB_TCP_STATE_DELETE_TCB 12 MIB_TCP_STATE_LAST_ACK = 10,
MIB_TCP_STATE_TIME_WAIT = 11,
MIB_TCP_STATE_DELETE_TCB = 12,
} MIB_TCP_STATE;
typedef enum
{
TcpConnectionOffloadStateInHost,
TcpConnectionOffloadStateOffloading,
TcpConnectionOffloadStateOffloaded,
TcpConnectionOffloadStateUploading,
TcpConnectionOffloadStateMax,
} TCP_CONNECTION_OFFLOAD_STATE, *PTCP_CONNECTION_OFFLOAD_STATE;
typedef struct _MIB_TCPROW typedef struct _MIB_TCPROW
{ {
DWORD dwState; union
{
DWORD dwState;
MIB_TCP_STATE State;
} DUMMYUNIONNAME;
DWORD dwLocalAddr; DWORD dwLocalAddr;
DWORD dwLocalPort; DWORD dwLocalPort;
DWORD dwRemoteAddr; DWORD dwRemoteAddr;
...@@ -49,17 +67,62 @@ typedef struct _MIB_TCPTABLE ...@@ -49,17 +67,62 @@ typedef struct _MIB_TCPTABLE
MIB_TCPROW table[1]; MIB_TCPROW table[1];
} MIB_TCPTABLE, *PMIB_TCPTABLE; } MIB_TCPTABLE, *PMIB_TCPTABLE;
typedef struct _MIB_TCPROW_OWNER_PID
{
DWORD dwState;
DWORD dwLocalAddr;
DWORD dwLocalPort;
DWORD dwRemoteAddr;
DWORD dwRemotePort;
DWORD dwOwningPid;
} MIB_TCPROW_OWNER_PID, *PMIB_TCPROW_OWNER_PID;
typedef struct _MIB_TCPTABLE_OWNER_PID
{
DWORD dwNumEntries;
MIB_TCPROW_OWNER_PID table[1];
} MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID;
typedef struct _MIB_TCPROW2
{
DWORD dwState;
DWORD dwLocalAddr;
DWORD dwLocalPort;
DWORD dwRemoteAddr;
DWORD dwRemotePort;
DWORD dwOwningPid;
TCP_CONNECTION_OFFLOAD_STATE dwOffloadState;
} MIB_TCPROW2, *PMIB_TCPROW2;
typedef struct _MIB_TCPTABLE2
{
DWORD dwNumEntries;
MIB_TCPROW2 table[1];
} MIB_TCPTABLE2, *PMIB_TCPTABLE2;
/* TCP stats */ /* TCP stats */
#define MIB_TCP_RTO_OTHER 1 typedef enum
#define MIB_TCP_RTO_CONSTANT 2 {
#define MIB_TCP_RTO_RSRE 3 TcpRtoAlgorithmOther = 0,
#define MIB_TCP_RTO_VANJ 4 TcpRtoAlgorithmConstant = 1,
TcpRtoAlgorithmRsre = 2,
TcpRtoAlgorithmVanj = 3,
MIB_TCP_RTO_OTHER = 1,
MIB_TCP_RTO_CONSTANT = 2,
MIB_TCP_RTO_RSRE = 3,
MIB_TCP_RTO_VANJ = 4,
} TCP_RTO_ALGORITHM, *PTCP_RTO_ALGORITHM;
typedef struct _MIB_TCPSTATS typedef struct _MIB_TCPSTATS
{ {
DWORD dwRtoAlgorithm; union
{
DWORD dwRtoAlgorithm;
TCP_RTO_ALGORITHM RtoAlgorithm;
} DUMMYUNIONNAME;
DWORD dwRtoMin; DWORD dwRtoMin;
DWORD dwRtoMax; DWORD dwRtoMax;
DWORD dwMaxConn; DWORD dwMaxConn;
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#ifndef __WINE_UDPMIB_H #ifndef __WINE_UDPMIB_H
#define __WINE_UDPMIB_H #define __WINE_UDPMIB_H
#define TCPIP_OWNING_MODULE_SIZE 16
/* UDP table */ /* UDP table */
...@@ -33,6 +35,18 @@ typedef struct _MIB_UDPTABLE ...@@ -33,6 +35,18 @@ typedef struct _MIB_UDPTABLE
MIB_UDPROW table[1]; MIB_UDPROW table[1];
} MIB_UDPTABLE, *PMIB_UDPTABLE; } MIB_UDPTABLE, *PMIB_UDPTABLE;
typedef struct _MIB_UDPROW_OWNER_PID
{
DWORD dwLocalAddr;
DWORD dwLocalPort;
} MIB_UDPROW_OWNER_PID, *PMIB_UDPROW_OWNER_PID;
typedef struct _MIB_UDPTABLE_OWNER_PID
{
DWORD dwNumEntries;
MIB_UDPROW_OWNER_PID table[1];
} MIB_UDPTABLE_OWNER_PID, *PMIB_UDPTABLE_OWNER_PID;
/* UDP statistics */ /* UDP statistics */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment