From 0d30715ea307217c250ed13207e8cc36f696c2cc Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 30 Nov 2015 20:08:57 +0000 Subject: [PATCH] [PSDK] Attempt to improve the whole iphlpapi related headers situation. CORE-7685 CORE-10536 svn path=/trunk/; revision=70220 --- reactos/dll/win32/inetmib1/main.c | 10 +- reactos/include/psdk/ifdef.h | 286 +++++++++++++----- reactos/include/psdk/ifmib.h | 70 +++++ reactos/include/psdk/ipexport.h | 56 ++-- reactos/include/psdk/ipifcons.h | 2 + reactos/include/psdk/ipmib.h | 251 ++++++++++++++++ reactos/include/psdk/iprtrmib.h | 314 ++------------------ reactos/include/psdk/iptypes.h | 465 ++++++++++++++++++------------ reactos/include/psdk/tcpmib.h | 192 ++++++++++++ reactos/include/psdk/udpmib.h | 85 ++++++ 10 files changed, 1160 insertions(+), 571 deletions(-) create mode 100644 reactos/include/psdk/ifmib.h create mode 100644 reactos/include/psdk/ipmib.h create mode 100644 reactos/include/psdk/tcpmib.h create mode 100644 reactos/include/psdk/udpmib.h diff --git a/reactos/dll/win32/inetmib1/main.c b/reactos/dll/win32/inetmib1/main.c index 9bb2eb3e467..5deae219f27 100644 --- a/reactos/dll/win32/inetmib1/main.c +++ b/reactos/dll/win32/inetmib1/main.c @@ -674,7 +674,7 @@ static void mib2IpStatsInit(void) } 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, dwInReceives), copyInt }, /* 3 */ { FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */ @@ -831,8 +831,8 @@ static struct structToAsnValue mib2IpRouteMap[] = { { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr }, - { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardType), copyInt }, - { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardProto), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, u1.dwForwardType), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, u2.dwForwardProto), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt }, @@ -929,7 +929,7 @@ static struct structToAsnValue mib2IpNetMap[] = { { FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt }, { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr }, - { FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt }, + { FIELD_OFFSET(MIB_IPNETROW, u.dwType), copyInt }, }; static void mib2IpNetInit(void) @@ -1084,7 +1084,7 @@ static void mib2TcpInit(void) } 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, dwRtoMax), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt }, diff --git a/reactos/include/psdk/ifdef.h b/reactos/include/psdk/ifdef.h index 7b4268e0c9e..bdda8a20df8 100644 --- a/reactos/include/psdk/ifdef.h +++ b/reactos/include/psdk/ifdef.h @@ -1,83 +1,229 @@ -#ifndef _IFDEF_ -#define _IFDEF_ +/* WINE ifdef.h + * Copyright 2010 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef WINE_IFDEF_H +#define WINE_IFDEF_H + +#include + +typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID; +typedef UINT32 NET_IF_COMPARTMENT_ID, *PNET_IF_COMPARTMENT_ID; +typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID; +typedef ULONG NET_IFINDEX, *PNET_IFINDEX; +typedef NET_IFINDEX IF_INDEX, *PIF_INDEX; +typedef UINT16 NET_IFTYPE, *PNET_IFTYPE; + +#define NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED 0x00000001 +#define NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED 0x00000002 +#define NET_IF_OPER_STATUS_DORMANT_PAUSED 0x00000004 +#define NET_IF_OPER_STATUS_DORMANT_LOW_POWER 0x00000008 + +#define NET_IF_COMPARTMENT_ID_UNSPECIFIED 0 +#define NET_IF_COMPARTMENT_ID_PRIMARY 1 + +#define NET_IF_OID_IF_ALIAS 0x00000001 +#define NET_IF_OID_COMPARTMENT_ID 0x00000002 +#define NET_IF_OID_NETWORK_GUID 0x00000003 +#define NET_IF_OID_IF_ENTRY 0x00000004 + +#define NET_SET_UNSPECIFIED_NETWORK_GUID(x) +#define NET_IS_UNSPECIFIED_NETWORK_GUID(x) + +#define NET_SITEID_UNSPECIFIED 0 +#define NET_SITEID_MAXUSER 0x07ffffff +#define NET_SITEID_MAXSYSTEM 0x0fffffff + +#define NET_IFINDEX_UNSPECIFIED 0 +#define IFI_UNSPECIFIED NET_IFINDEX_UNSPECIFIED + +#define NET_IFLUID_UNSPECIFIED 0 + +#define NIIF_HARDWARE_INTERFACE 0x00000001 +#define NIIF_FILTER_INTERFACE 0x00000002 +#define NIIF_NDIS_WDM_INTERFACE 0x00000020 +#define NIIF_NDIS_ENDPOINT_INTERFACE 0x00000040 +#define NIIF_NDIS_ISCSI_INTERFACE 0x00000080 +#define NIIF_WAN_TUNNEL_TYPE_UNKNOWN 0xffffffff + +#define NET_BUS_NUMBER_UNKNOWN 0xffffffff +#define NET_SLOT_NUMBER_UNKNOWN 0xffffffff +#define NET_FUNCTION_NUMBER_UNKNOWN 0xffffffff #define IF_MAX_STRING_SIZE 256 #define IF_MAX_PHYS_ADDRESS_LENGTH 32 -typedef union _NET_LUID_LH -{ - ULONG64 Value; - struct - { - ULONG64 Reserved:24; - ULONG64 NetLuidIndex:24; - ULONG64 IfType:16; - }Info; -} NET_LUID_LH, *PNET_LUID_LH; - -typedef NET_LUID_LH NET_LUID; -typedef NET_LUID* PNET_LUID; - -typedef ULONG NET_IFINDEX, *PNET_IFINDEX; -typedef ULONG IFTYPE; -typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID; - -typedef enum { - TUNNEL_TYPE_NONE = 0, - TUNNEL_TYPE_OTHER = 1, - TUNNEL_TYPE_DIRECT = 2, - TUNNEL_TYPE_6TO4 = 11, - TUNNEL_TYPE_ISATAP = 13, - TUNNEL_TYPE_TEREDO = 14, -} TUNNEL_TYPE, *PTUNNEL_TYPE; - -typedef enum _NET_IF_ACCESS_TYPE -{ - NET_IF_ACCESS_LOOPBACK = 1, - NET_IF_ACCESS_BROADCAST = 2, - NET_IF_ACCESS_POINT_TO_POINT = 3, - NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4, - NET_IF_ACCESS_MAXIMUM = 5 -} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE; - -typedef enum _NET_IF_DIRECTION_TYPE -{ - NET_IF_DIRECTION_SENDRECEIVE, - NET_IF_DIRECTION_SENDONLY, - NET_IF_DIRECTION_RECEIVEONLY, - NET_IF_DIRECTION_MAXIMUM -} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE; - -typedef enum _NET_IF_ADMIN_STATUS -{ - NET_IF_ADMIN_STATUS_UP = 1, - NET_IF_ADMIN_STATUS_DOWN = 2, +typedef enum _NET_IF_ADMIN_STATUS { + NET_IF_ADMIN_STATUS_UP = 1, + NET_IF_ADMIN_STATUS_DOWN = 2, NET_IF_ADMIN_STATUS_TESTING = 3 } NET_IF_ADMIN_STATUS, *PNET_IF_ADMIN_STATUS; -typedef enum _NET_IF_MEDIA_CONNECT_STATE -{ - MediaConnectStateUnknown, - MediaConnectStateConnected, - MediaConnectStateDisconnected -} NET_IF_MEDIA_CONNECT_STATE, *PNET_IF_MEDIA_CONNECT_STATE; +typedef enum _NET_IF_OPER_STATUS { + NET_IF_OPER_STATUS_UP = 1, + NET_IF_OPER_STATUS_DOWN = 2, + NET_IF_OPER_STATUS_TESTING = 3, + NET_IF_OPER_STATUS_UNKNOWN = 4, + NET_IF_OPER_STATUS_DORMANT = 5, + NET_IF_OPER_STATUS_NOT_PRESENT = 6, + NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7 +} NET_IF_OPER_STATUS, *PNET_IF_OPER_STATUS; -typedef enum _NET_IF_CONNECTION_TYPE -{ - NET_IF_CONNECTION_DEDICATED = 1, - NET_IF_CONNECTION_PASSIVE = 2, - NET_IF_CONNECTION_DEMAND = 3, - NET_IF_CONNECTION_MAXIMUM = 4 +typedef enum _NET_IF_RCV_ADDRESS_TYPE { + NET_IF_RCV_ADDRESS_TYPE_OTHER = 1, + NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2, + NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3 +} NET_IF_RCV_ADDRESS_TYPE, *PNET_IF_RCV_ADDRESS_TYPE; + +typedef struct _NET_IF_RCV_ADDRESS_LH { + NET_IF_RCV_ADDRESS_TYPE ifRcvAddressType; + USHORT ifRcvAddressLength; + USHORT ifRcvAddressOffset; +} NET_IF_RCV_ADDRESS_LH, *PNET_IF_RCV_ADDRESS_LH; +typedef NET_IF_RCV_ADDRESS_LH NET_IF_RCV_ADDRESS; +typedef NET_IF_RCV_ADDRESS_LH *PNET_IF_RCV_ADDRESS; + +typedef union _NET_LUID_LH { + ULONG64 Value; + struct { + ULONG64 Reserved : 24; + ULONG64 NetLuidIndex : 24; + ULONG64 IfType : 16; + } Info; +} NET_LUID_LH, *PNET_LUID_LH; +typedef NET_LUID_LH NET_LUID; +typedef NET_LUID *PNET_LUID; +typedef NET_LUID IF_LUID; +typedef NET_LUID *PIF_LUID; + +typedef enum _NET_IF_ACCESS_TYPE { + NET_IF_ACCESS_LOOPBACK = 1, + NET_IF_ACCESS_BROADCAST = 2, + NET_IF_ACCESS_POINT_TO_POINT = 2, + NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4, + NET_IF_ACCESS_MAXIMUM = 5 +} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE; + +typedef enum _NET_IF_DIRECTION_TYPE { + NET_IF_DIRECTION_SENDRECEIVE = 0, + NET_IF_DIRECTION_SENDONLY = 1, + NET_IF_DIRECTION_RECEIVEONLY = 2, + NET_IF_DIRECTION_MAXIMUM = 3 +} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE; + +typedef enum _NET_IF_CONNECTION_TYPE { + NET_IF_CONNECTION_DEDICATED = 1, + NET_IF_CONNECTION_PASSIVE = 2, + NET_IF_CONNECTION_DEMAND = 3, + NET_IF_CONNECTION_MAXIMUM = 4, } NET_IF_CONNECTION_TYPE, *PNET_IF_CONNECTION_TYPE; +typedef enum _NET_IF_MEDIA_CONNECT_STATE { + MediaConnectStateUnknown = 0, + MediaConnectStateConnected = 1, + MediaConnectStateDisconnected = 2 +} NET_IF_MEDIA_CONNECT_STATE, *PNET_IF_MEDIA_CONNECT_STATE; + +typedef enum _NET_IF_MEDIA_DUPLEX_STATE { + MediaDuplexStateUnknown = 0, + MediaDuplexStateHalf = 1, + MediaDuplexStateFull = 2 +} NET_IF_MEDIA_DUPLEX_STATE, *PNET_IF_MEDIA_DUPLEX_STATE; + +typedef struct _NET_PHYSICAL_LOCATION_LH { + ULONG BusNumber; + ULONG SlotNumber; + ULONG FunctionNumber; +} NET_PHYSICAL_LOCATION_LH, *PNET_PHYSICAL_LOCATION_LH; +typedef NET_PHYSICAL_LOCATION_LH NET_PHYSICAL_LOCATION; +typedef NET_PHYSICAL_LOCATION *PNET_PHYSICAL_LOCATION; + +typedef struct _IF_COUNTED_STRING_LH { + USHORT Length; + WCHAR String[IF_MAX_STRING_SIZE + 1]; +} IF_COUNTED_STRING_LH, *PIF_COUNTED_STRING_LH; +typedef IF_COUNTED_STRING_LH IF_COUNTED_STRING; +typedef IF_COUNTED_STRING *PIF_COUNTED_STRING; + +typedef struct _IF_PHYSICAL_ADDRESS_LH { + USHORT Length; + UCHAR Address[IF_MAX_PHYS_ADDRESS_LENGTH]; +} IF_PHYSICAL_ADDRESS_LH, *PIF_PHYSICAL_ADDRESS_LH; +typedef IF_PHYSICAL_ADDRESS_LH IF_PHYSICAL_ADDRESS; +typedef IF_PHYSICAL_ADDRESS *PIF_PHYSICAL_ADDRESS; + typedef enum { - IfOperStatusUp = 1, - IfOperStatusDown, - IfOperStatusTesting, - IfOperStatusUnknown, - IfOperStatusDormant, - IfOperStatusNotPresent, - IfOperStatusLowerLayerDown + TUNNEL_TYPE_NONE = 0, + TUNNEL_TYPE_OTHER = 1, + TUNNEL_TYPE_DIRECT = 2, + TUNNEL_TYPE_6TO4 = 11, + TUNNEL_TYPE_ISATAP = 13, + TUNNEL_TYPE_TEREDO = 14, + TUNNEL_TYPE_IPHTTPS = 15, +} TUNNEL_TYPE; + +typedef enum _IF_ADMINISTRATIVE_STATE { + IF_ADMINISTRATIVE_STATE_DISABLED = 0, + IF_ADMINISTRATIVE_STATE_ENABLED = 1, + IF_ADMINISTRATIVE_STATE_DEMANDDIAL = 2 +} IF_ADMINISTRATIVE_STATE, *PIF_ADMINISTRATIVE_STATE; + +typedef enum { + IfOperStatusUp = 1, + IfOperStatusDown, + IfOperStatusTesting, + IfOperStatusUnknown, + IfOperStatusDormant, + IfOperStatusNotPresent, + IfOperStatusLowerLayerDown } IF_OPER_STATUS; -#endif /* _IFDEF_ */ +typedef struct _NDIS_INTERFACE_INFORMATION { + NET_IF_OPER_STATUS ifOperStatus; + ULONG ifOperStatusFlags; + NET_IF_MEDIA_CONNECT_STATE MediaConnectState; + NET_IF_MEDIA_DUPLEX_STATE MediaDuplexState; + ULONG ifMtu; + BOOLEAN ifPromiscuousMode; + BOOLEAN ifDeviceWakeUpEnable; + ULONG64 XmitLinkSpeed; + ULONG64 RcvLinkSpeed; + ULONG64 ifLastChange; + ULONG64 ifCounterDiscontinuityTime; + ULONG64 ifInUnknownProtos; + ULONG64 ifInDiscards; + ULONG64 ifInErrors; + ULONG64 ifHCInOctets; + ULONG64 ifHCInUcastPkts; + ULONG64 ifHCInMulticastPkts; + ULONG64 ifHCInBroadcastPkts; + ULONG64 ifHCOutOctets; + ULONG64 ifHCOutUcastPkts; + ULONG64 ifHCOutMulticastPkts; + ULONG64 ifHCOutBroadcastPkts; + ULONG64 ifOutErrors; + ULONG64 ifOutDiscards; + ULONG64 ifHCInUcastOctets; + ULONG64 ifHCInMulticastOctets; + ULONG64 ifHCInBroadcastOctets; + ULONG64 ifHCOutUcastOctets; + ULONG64 ifHCOutMulticastOctets; + ULONG64 ifHCOutBroadcastOctets; + NET_IF_COMPARTMENT_ID CompartmentId; + ULONG SupportedStatistics; +} NDIS_INTERFACE_INFORMATION, *PNDIS_INTERFACE_INFORMATION; + +#endif /* WINE_IFDEF_H*/ diff --git a/reactos/include/psdk/ifmib.h b/reactos/include/psdk/ifmib.h new file mode 100644 index 00000000000..440ed144037 --- /dev/null +++ b/reactos/include/psdk/ifmib.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_IFMIB_H +#define __WINE_IFMIB_H + +#include + +typedef struct _MIB_IFNUMBER +{ + DWORD dwValue; +} MIB_IFNUMBER, *PMIB_IFNUMBER; + + +/* Interface table */ + +#define MAX_INTERFACE_NAME_LEN 256 +#define MAXLEN_PHYSADDR 8 +#define MAXLEN_IFDESCR 256 + +typedef struct _MIB_IFROW +{ + WCHAR wszName[MAX_INTERFACE_NAME_LEN]; + DWORD dwIndex; + DWORD dwType; + DWORD dwMtu; + DWORD dwSpeed; + DWORD dwPhysAddrLen; + UCHAR bPhysAddr[MAXLEN_PHYSADDR]; + DWORD dwAdminStatus; + INTERNAL_IF_OPER_STATUS dwOperStatus; + DWORD dwLastChange; + DWORD dwInOctets; + DWORD dwInUcastPkts; + DWORD dwInNUcastPkts; + DWORD dwInDiscards; + DWORD dwInErrors; + DWORD dwInUnknownProtos; + DWORD dwOutOctets; + DWORD dwOutUcastPkts; + DWORD dwOutNUcastPkts; + DWORD dwOutDiscards; + DWORD dwOutErrors; + DWORD dwOutQLen; + DWORD dwDescrLen; + BYTE bDescr[MAXLEN_IFDESCR]; +} MIB_IFROW, *PMIB_IFROW; + +typedef struct _MIB_IFTABLE +{ + DWORD dwNumEntries; + MIB_IFROW table[1]; +} MIB_IFTABLE, *PMIB_IFTABLE; + + +#endif /* __WINE_IFMIB_H */ diff --git a/reactos/include/psdk/ipexport.h b/reactos/include/psdk/ipexport.h index 29995869dbd..01a1185c202 100644 --- a/reactos/include/psdk/ipexport.h +++ b/reactos/include/psdk/ipexport.h @@ -15,15 +15,18 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WINE_IPEXPORT_H #define __WINE_IPEXPORT_H -typedef unsigned long IPAddr; -typedef unsigned long IPMask; -typedef unsigned long IP_STATUS; +#include +#include + +typedef ULONG IPAddr; +typedef ULONG IPMask; +typedef ULONG IP_STATUS; struct ip_option_information { @@ -44,7 +47,6 @@ struct ip_option_information #define IP_OPT_RR 0x7 #define IP_OPT_TS 0x44 #define IP_OPT_SID 0x88 -#define IP_OPT_ROUTER_ALERT 0x94 #define MAX_OPT_SIZE 40 @@ -52,8 +54,8 @@ struct ip_option_information struct icmp_echo_reply { IPAddr Address; - unsigned long Status; - unsigned long RoundTripTime; + ULONG Status; + ULONG RoundTripTime; unsigned short DataSize; unsigned short Reserved; void* Data; @@ -91,18 +93,6 @@ typedef struct icmp_echo_reply ICMP_ECHO_REPLY, *PICMP_ECHO_REPLY; #define IP_SPEC_MTU_CHANGE (IP_STATUS_BASE + 20) #define IP_MTU_CHANGE (IP_STATUS_BASE + 21) #define IP_UNLOAD (IP_STATUS_BASE + 22) -#define IP_ADDR_ADDED (IP_STATUS_BASE + 23) -#define IP_MEDIA_CONNECT (IP_STATUS_BASE + 24) -#define IP_MEDIA_DISCONNECT (IP_STATUS_BASE + 25) -#define IP_BIND_ADAPTER (IP_STATUS_BASE + 26) -#define IP_UNBIND_ADAPTER (IP_STATUS_BASE + 27) -#define IP_DEVICE_DOES_NOT_EXIST (IP_STATUS_BASE + 28) -#define IP_DUPLICATE_ADDRESS (IP_STATUS_BASE + 29) -#define IP_INTERFACE_METRIC_CHANGE (IP_STATUS_BASE + 30) -#define IP_RECONFIG_SECFLTR (IP_STATUS_BASE + 31) -#define IP_NEGOTIATING_IPSEC (IP_STATUS_BASE + 32) -#define IP_INTERFACE_WOL_CAPABILITY_CHANGE (IP_STATUS_BASE + 33) -#define IP_DUPLICATE_IPADD (IP_STATUS_BASE + 34) #define IP_GENERAL_FAILURE (IP_STATUS_BASE + 50) #define MAX_IP_STATUS IP_GENERAL_FAILURE @@ -126,9 +116,33 @@ typedef struct _IP_UNIDIRECTIONAL_ADAPTER_ADDRESS { IPAddr Address[1]; } IP_UNIDIRECTIONAL_ADAPTER_ADDRESS, *PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS; +/* ReactOS */ + typedef struct _IP_ADAPTER_ORDER_MAP { - ULONG NumAdapters; - ULONG AdapterOrder[1]; + ULONG NumAdapters; + ULONG AdapterOrder[1]; } IP_ADAPTER_ORDER_MAP, *PIP_ADAPTER_ORDER_MAP; +#if (NTDDI_VERSION >= NTDDI_WINXP) + +#include +typedef struct _IPV6_ADDRESS_EX { + USHORT sin6_port; + ULONG sin6_flowinfo; + USHORT sin6_addr[8]; + ULONG sin6_scope_id; +} IPV6_ADDRESS_EX, *PIPV6_ADDRESS_EX; +#include + +typedef struct icmpv6_echo_reply_lh { + IPV6_ADDRESS_EX Address; + ULONG Status; + unsigned int RoundTripTime; +} ICMPV6_ECHO_REPLY_LH, *PICMPV6_ECHO_REPLY_LH; + +typedef ICMPV6_ECHO_REPLY_LH ICMPV6_ECHO_REPLY; +typedef ICMPV6_ECHO_REPLY_LH *PICMPV6_ECHO_REPLY; + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + #endif /* __WINE_IPEXPORT_H */ diff --git a/reactos/include/psdk/ipifcons.h b/reactos/include/psdk/ipifcons.h index 30a304e2b4f..9f8e4248b30 100644 --- a/reactos/include/psdk/ipifcons.h +++ b/reactos/include/psdk/ipifcons.h @@ -227,6 +227,8 @@ #define MIB_IF_TYPE_LOOPBACK 24 #define MIB_IF_TYPE_SLIP 28 +typedef ULONG IFTYPE; + #define MIB_IF_ADMIN_STATUS_UP 1 #define MIB_IF_ADMIN_STATUS_DOWN 2 #define MIB_IF_ADMIN_STATUS_TESTING 3 diff --git a/reactos/include/psdk/ipmib.h b/reactos/include/psdk/ipmib.h new file mode 100644 index 00000000000..d85ee5a8a1f --- /dev/null +++ b/reactos/include/psdk/ipmib.h @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_IPMIB_H +#define __WINE_IPMIB_H + +#include +#include + +/* Flags used in the wType field from MIB_IPADDRROW */ + +#define MIB_IPADDR_PRIMARY 0x0001 +#define MIB_IPADDR_DYNAMIC 0x0004 +#define MIB_IPADDR_DISCONNECTED 0x0008 +#define MIB_IPADDR_DELETED 0x0040 +#define MIB_IPADDR_TRANSIENT 0x0080 + +/* IPADDR table */ + +typedef struct _MIB_IPADDRROW +{ + DWORD dwAddr; + IF_INDEX dwIndex; + DWORD dwMask; + DWORD dwBCastAddr; + DWORD dwReasmSize; + unsigned short unused1; + unsigned short wType; +} MIB_IPADDRROW, *PMIB_IPADDRROW; + +typedef struct _MIB_IPADDRTABLE +{ + DWORD dwNumEntries; + MIB_IPADDRROW table[1]; +} MIB_IPADDRTABLE, *PMIB_IPADDRTABLE; + + +/* IPFORWARD table */ + +typedef struct _MIB_IPFORWARDNUMBER +{ + DWORD dwValue; +} MIB_IPFORWARDNUMBER, *PMIB_IPFORWARDNUMBER; + +typedef enum +{ + MIB_IPROUTE_TYPE_OTHER = 1, + 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 +{ + DWORD dwForwardDest; + DWORD dwForwardMask; + DWORD dwForwardPolicy; + DWORD dwForwardNextHop; + IF_INDEX dwForwardIfIndex; + union + { + DWORD dwForwardType; + MIB_IPFORWARD_TYPE ForwardType; + } DUMMYUNIONNAME1; + union + { + DWORD dwForwardProto; + MIB_IPFORWARD_PROTO ForwardProto; + } DUMMYUNIONNAME2; + DWORD dwForwardAge; + DWORD dwForwardNextHopAS; + DWORD dwForwardMetric1; + DWORD dwForwardMetric2; + DWORD dwForwardMetric3; + DWORD dwForwardMetric4; + DWORD dwForwardMetric5; +} MIB_IPFORWARDROW, *PMIB_IPFORWARDROW; + +typedef struct _MIB_IPFORWARDTABLE +{ + DWORD dwNumEntries; + MIB_IPFORWARDROW table[1]; +} MIB_IPFORWARDTABLE, *PMIB_IPFORWARDTABLE; + + +/* IPNET table */ + +typedef enum +{ + MIB_IPNET_TYPE_OTHER = 1, + MIB_IPNET_TYPE_INVALID = 2, + MIB_IPNET_TYPE_DYNAMIC = 3, + MIB_IPNET_TYPE_STATIC = 4, +} MIB_IPNET_TYPE; + +typedef struct _MIB_IPNETROW +{ + DWORD dwIndex; + DWORD dwPhysAddrLen; + BYTE bPhysAddr[MAXLEN_PHYSADDR]; + DWORD dwAddr; + union + { + DWORD dwType; + MIB_IPNET_TYPE Type; + } DUMMYUNIONNAME; +} MIB_IPNETROW, *PMIB_IPNETROW; + +typedef struct _MIB_IPNETTABLE +{ + DWORD dwNumEntries; + MIB_IPNETROW table[1]; +} MIB_IPNETTABLE, *PMIB_IPNETTABLE; + + +/* IP statistics */ + +typedef enum +{ + MIB_IP_FORWARDING = 1, + MIB_IP_NOT_FORWARDING = 2, +} MIB_IPSTATS_FORWARDING, *PMIB_IPSTATS_FORWARDING; + +typedef struct _MIB_IPSTATS +{ + union + { + DWORD dwForwarding; + MIB_IPSTATS_FORWARDING Forwarding; + } DUMMYUNIONNAME; + DWORD dwDefaultTTL; + DWORD dwInReceives; + DWORD dwInHdrErrors; + DWORD dwInAddrErrors; + DWORD dwForwDatagrams; + DWORD dwInUnknownProtos; + DWORD dwInDiscards; + DWORD dwInDelivers; + DWORD dwOutRequests; + DWORD dwRoutingDiscards; + DWORD dwOutDiscards; + DWORD dwOutNoRoutes; + DWORD dwReasmTimeout; + DWORD dwReasmReqds; + DWORD dwReasmOks; + DWORD dwReasmFails; + DWORD dwFragOks; + DWORD dwFragFails; + DWORD dwFragCreates; + DWORD dwNumIf; + DWORD dwNumAddr; + DWORD dwNumRoutes; +} MIB_IPSTATS, *PMIB_IPSTATS; + + +/* ICMP statistics */ + +typedef struct _MIBICMPSTATS +{ + DWORD dwMsgs; + DWORD dwErrors; + DWORD dwDestUnreachs; + DWORD dwTimeExcds; + DWORD dwParmProbs; + DWORD dwSrcQuenchs; + DWORD dwRedirects; + DWORD dwEchos; + DWORD dwEchoReps; + DWORD dwTimestamps; + DWORD dwTimestampReps; + DWORD dwAddrMasks; + DWORD dwAddrMaskReps; +} MIBICMPSTATS, *PMIBICMPSTATS; + +typedef struct _MIBICMPINFO +{ + MIBICMPSTATS icmpInStats; + MIBICMPSTATS icmpOutStats; +} MIBICMPINFO; + +typedef struct _MIB_ICMP +{ + MIBICMPINFO stats; +} MIB_ICMP, *PMIB_ICMP; + +typedef enum +{ + ICMP4_ECHO_REPLY = 0, + ICMP4_DST_UNREACH = 3, + ICMP4_SOURCE_QUENCH = 4, + ICMP4_REDIRECT = 5, + ICMP4_ECHO_REQUEST = 8, + ICMP4_ROUTER_ADVERT = 9, + ICMP4_ROUTER_SOLICIT = 10, + ICMP4_TIME_EXCEEDED = 11, + ICMP4_PARAM_PROB = 12, + ICMP4_TIMESTAMP_REQUEST = 13, + ICMP4_TIMESTAMP_REPLY = 14, + ICMP4_MASK_REQUEST = 17, + ICMP4_MASK_REPLY = 18, +} ICMP4_TYPE, *PICMP4_TYPE; + +typedef enum +{ + ICMP6_DST_UNREACH = 1, + ICMP6_PACKET_TOO_BIG = 2, + ICMP6_TIME_EXCEEDED = 3, + ICMP6_PARAM_PROB = 4, + ICMP6_ECHO_REQUEST = 128, + ICMP6_ECHO_REPLY = 129, + ICMP6_MEMBERSHIP_QUERY = 130, + ICMP6_MEMBERSHIP_REPORT = 131, + ICMP6_MEMBERSHIP_REDUCTION = 132, + ND_ROUTER_SOLICIT = 133, + ND_ROUTER_ADVERT = 134, + ND_NEIGHBOR_SOLICIT = 135, + ND_NEIGHBOR_ADVERT = 136, + ND_REDIRECT = 137, + ICMP6_V2_MEMBERSHIP_REPORT = 143, +} ICMP6_TYPE, *PICMP6_TYPE; + +typedef struct _MIBICMPSTATS_EX +{ + DWORD dwMsgs; + DWORD dwErrors; + DWORD rgdwTypeCount[256]; +} MIBICMPSTATS_EX, *PMIBICMPSTATS_EX; + +typedef struct _MIB_ICMP_EX +{ + MIBICMPSTATS_EX icmpInStats; + MIBICMPSTATS_EX icmpOutStats; +} MIB_ICMP_EX, *PMIB_ICMP_EX; + +#endif /* __WINE_IPMIB_H */ diff --git a/reactos/include/psdk/iprtrmib.h b/reactos/include/psdk/iprtrmib.h index 73370045367..b09f1cec5bc 100644 --- a/reactos/include/psdk/iprtrmib.h +++ b/reactos/include/psdk/iprtrmib.h @@ -13,298 +13,20 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef WINE_IPRTRMIB_H__ #define WINE_IPRTRMIB_H__ -#define MAX_INTERFACE_NAME_LEN 256 - +#include #include -#define MAXLEN_IFDESCR 256 -#define MAXLEN_PHYSADDR 8 +#include +#include +#include -//It should be 16 according to Lei Shen blog (http://www.mychinaworks.com/blog/lshen/2008/04/16/220/ -#define TCPIP_OWNING_MODULE_SIZE 16 - -typedef struct _MIB_IFROW +typedef enum _TCP_TABLE_CLASS { - WCHAR wszName[MAX_INTERFACE_NAME_LEN]; - DWORD dwIndex; - DWORD dwType; - DWORD dwMtu; - DWORD dwSpeed; - DWORD dwPhysAddrLen; - BYTE bPhysAddr[MAXLEN_PHYSADDR]; - DWORD dwAdminStatus; - DWORD dwOperStatus; - DWORD dwLastChange; - DWORD dwInOctets; - DWORD dwInUcastPkts; - DWORD dwInNUcastPkts; - DWORD dwInDiscards; - DWORD dwInErrors; - DWORD dwInUnknownProtos; - DWORD dwOutOctets; - DWORD dwOutUcastPkts; - DWORD dwOutNUcastPkts; - DWORD dwOutDiscards; - DWORD dwOutErrors; - DWORD dwOutQLen; - DWORD dwDescrLen; - BYTE bDescr[MAXLEN_IFDESCR]; -} MIB_IFROW,*PMIB_IFROW; - -typedef struct _MIB_IFTABLE -{ - DWORD dwNumEntries; - MIB_IFROW table[1]; -} MIB_IFTABLE, *PMIB_IFTABLE; - -typedef struct _MIBICMPSTATS -{ - DWORD dwMsgs; - DWORD dwErrors; - DWORD dwDestUnreachs; - DWORD dwTimeExcds; - DWORD dwParmProbs; - DWORD dwSrcQuenchs; - DWORD dwRedirects; - DWORD dwEchos; - DWORD dwEchoReps; - DWORD dwTimestamps; - DWORD dwTimestampReps; - DWORD dwAddrMasks; - DWORD dwAddrMaskReps; -} MIBICMPSTATS; - -typedef struct _MIBICMPINFO -{ - MIBICMPSTATS icmpInStats; - MIBICMPSTATS icmpOutStats; -} MIBICMPINFO; - -typedef struct _MIB_ICMP -{ - MIBICMPINFO stats; -} MIB_ICMP,*PMIB_ICMP; - -typedef struct _MIB_UDPSTATS -{ - DWORD dwInDatagrams; - DWORD dwNoPorts; - DWORD dwInErrors; - DWORD dwOutDatagrams; - DWORD dwNumAddrs; -} MIB_UDPSTATS,*PMIB_UDPSTATS; - -typedef struct _MIB_UDPROW -{ - DWORD dwLocalAddr; - DWORD dwLocalPort; -} MIB_UDPROW, *PMIB_UDPROW; - -typedef struct _MIB_UDPTABLE -{ - DWORD dwNumEntries; - MIB_UDPROW table[1]; -} MIB_UDPTABLE, *PMIB_UDPTABLE; - -typedef struct _MIB_TCPSTATS -{ - DWORD dwRtoAlgorithm; - DWORD dwRtoMin; - DWORD dwRtoMax; - DWORD dwMaxConn; - DWORD dwActiveOpens; - DWORD dwPassiveOpens; - DWORD dwAttemptFails; - DWORD dwEstabResets; - DWORD dwCurrEstab; - DWORD dwInSegs; - DWORD dwOutSegs; - DWORD dwRetransSegs; - DWORD dwInErrs; - DWORD dwOutRsts; - DWORD dwNumConns; -} MIB_TCPSTATS, *PMIB_TCPSTATS; - -typedef struct _MIBICMPSTATS_EX -{ - DWORD dwMsgs; - DWORD dwErrors; - DWORD rgdwTypeCount[256]; -} MIBICMPSTATS_EX, *PMIBICMPSTATS_EX; - -typedef struct _MIB_ICMP_EX -{ - MIBICMPSTATS_EX icmpInStats; - MIBICMPSTATS_EX icmpOutStats; -} MIB_ICMP_EX,*PMIB_ICMP_EX; - -typedef struct _MIB_TCPROW -{ - DWORD dwState; - DWORD dwLocalAddr; - DWORD dwLocalPort; - DWORD dwRemoteAddr; - DWORD dwRemotePort; -} MIB_TCPROW, *PMIB_TCPROW; - -#define MIB_TCP_STATE_CLOSED 1 -#define MIB_TCP_STATE_LISTEN 2 -#define MIB_TCP_STATE_SYN_SENT 3 -#define MIB_TCP_STATE_SYN_RCVD 4 -#define MIB_TCP_STATE_ESTAB 5 -#define MIB_TCP_STATE_FIN_WAIT1 6 -#define MIB_TCP_STATE_FIN_WAIT2 7 -#define MIB_TCP_STATE_CLOSE_WAIT 8 -#define MIB_TCP_STATE_CLOSING 9 -#define MIB_TCP_STATE_LAST_ACK 10 -#define MIB_TCP_STATE_TIME_WAIT 11 -#define MIB_TCP_STATE_DELETE_TCB 12 - -typedef struct _MIB_TCPTABLE -{ - DWORD dwNumEntries; - MIB_TCPROW table[1]; -} MIB_TCPTABLE, *PMIB_TCPTABLE; - -typedef struct _MIB_IPSTATS -{ - DWORD dwForwarding; - DWORD dwDefaultTTL; - DWORD dwInReceives; - DWORD dwInHdrErrors; - DWORD dwInAddrErrors; - DWORD dwForwDatagrams; - DWORD dwInUnknownProtos; - DWORD dwInDiscards; - DWORD dwInDelivers; - DWORD dwOutRequests; - DWORD dwRoutingDiscards; - DWORD dwOutDiscards; - DWORD dwOutNoRoutes; - DWORD dwReasmTimeout; - DWORD dwReasmReqds; - DWORD dwReasmOks; - DWORD dwReasmFails; - DWORD dwFragOks; - DWORD dwFragFails; - DWORD dwFragCreates; - DWORD dwNumIf; - DWORD dwNumAddr; - DWORD dwNumRoutes; -} MIB_IPSTATS, *PMIB_IPSTATS; - -typedef struct _MIB_IPADDRROW -{ - DWORD dwAddr; - DWORD dwIndex; - DWORD dwMask; - DWORD dwBCastAddr; - DWORD dwReasmSize; - unsigned short unused1; - unsigned short wType; -} MIB_IPADDRROW, *PMIB_IPADDRROW; - -typedef struct _MIB_IPADDRTABLE -{ - DWORD dwNumEntries; - MIB_IPADDRROW table[1]; -} MIB_IPADDRTABLE, *PMIB_IPADDRTABLE; - - -typedef struct _MIB_IPFORWARDNUMBER -{ - DWORD dwValue; -}MIB_IPFORWARDNUMBER,*PMIB_IPFORWARDNUMBER; - -typedef struct _MIB_IPFORWARDROW -{ - DWORD dwForwardDest; - DWORD dwForwardMask; - DWORD dwForwardPolicy; - DWORD dwForwardNextHop; - DWORD dwForwardIfIndex; - DWORD dwForwardType; - DWORD dwForwardProto; - DWORD dwForwardAge; - DWORD dwForwardNextHopAS; - DWORD dwForwardMetric1; - DWORD dwForwardMetric2; - DWORD dwForwardMetric3; - DWORD dwForwardMetric4; - DWORD dwForwardMetric5; -}MIB_IPFORWARDROW, *PMIB_IPFORWARDROW; - -#define MIB_IPROUTE_TYPE_OTHER 1 -#define MIB_IPROUTE_TYPE_INVALID 2 -#define MIB_IPROUTE_TYPE_DIRECT 3 -#define MIB_IPROUTE_TYPE_INDIRECT 4 - -#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 -#define MIB_IPPROTO_NT_STATIC 10006 -#define MIB_IPPROTO_NT_STATIC_NON_DOD 10007 - -typedef struct _MIB_IPFORWARDTABLE -{ - DWORD dwNumEntries; - MIB_IPFORWARDROW table[1]; -} MIB_IPFORWARDTABLE, *PMIB_IPFORWARDTABLE; - -typedef struct _MIB_IPNETROW -{ - DWORD dwIndex; - DWORD dwPhysAddrLen; - BYTE bPhysAddr[MAXLEN_PHYSADDR]; - DWORD dwAddr; - DWORD dwType; -} MIB_IPNETROW, *PMIB_IPNETROW; - -#define MIB_IPNET_TYPE_OTHER 1 -#define MIB_IPNET_TYPE_INVALID 2 -#define MIB_IPNET_TYPE_DYNAMIC 3 -#define MIB_IPNET_TYPE_STATIC 4 - -typedef struct _MIB_IPNETTABLE -{ - DWORD dwNumEntries; - MIB_IPNETROW table[1]; -} MIB_IPNETTABLE, *PMIB_IPNETTABLE; - -typedef struct _MIB_TCPROW_OWNER_MODULE { - DWORD dwState; - DWORD dwLocalAddr; - DWORD dwLocalPort; - DWORD dwRemoteAddr; - DWORD dwRemotePort; - DWORD dwOwningPid; - LARGE_INTEGER liCreateTimestamp; - ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; -} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE; - -typedef enum { - TCPIP_OWNER_MODULE_INFO_BASIC -} TCPIP_OWNER_MODULE_INFO_CLASS, *PTCPIP_OWNER_MODULE_INFO_CLASS; - -typedef enum { TCP_TABLE_BASIC_LISTENER, TCP_TABLE_BASIC_CONNECTIONS, TCP_TABLE_BASIC_ALL, @@ -316,19 +38,17 @@ typedef enum { TCP_TABLE_OWNER_MODULE_ALL } TCP_TABLE_CLASS, *PTCP_TABLE_CLASS; -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 { - DWORD dwNumEntries; - MIB_TCPROW_OWNER_PID table[1]; -} MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID; +typedef enum _UDP_TABLE_CLASS +{ + UDP_TABLE_BASIC, + UDP_TABLE_OWNER_PID, + UDP_TABLE_OWNER_MODULE +} UDP_TABLE_CLASS, *PUDP_TABLE_CLASS; +/* ReactOS */ +typedef enum _TCPIP_OWNER_MODULE_INFO_CLASS +{ + TCPIP_OWNER_MODULE_INFO_BASIC +} TCPIP_OWNER_MODULE_INFO_CLASS, *PTCPIP_OWNER_MODULE_INFO_CLASS; #endif /* WINE_IPRTRMIB_H__ */ diff --git a/reactos/include/psdk/iptypes.h b/reactos/include/psdk/iptypes.h index 38802f6db76..e3513292f58 100644 --- a/reactos/include/psdk/iptypes.h +++ b/reactos/include/psdk/iptypes.h @@ -1,206 +1,315 @@ -#ifndef _IPTYPES_H -#define _IPTYPES_H +/* WINE iptypes.h + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ -#include +#ifndef WINE_IPTYPES_H_ +#define WINE_IPTYPES_H_ + +#include #include +#include + +#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 +#define MAX_ADAPTER_NAME_LENGTH 256 +#define MAX_ADAPTER_ADDRESS_LENGTH 8 +#define MAX_HOSTNAME_LEN 128 +#define MAX_DOMAIN_NAME_LEN 128 +#define MAX_SCOPE_ID_LEN 256 +#define MAX_DHCPV6_DUID_LENGTH 130 +#define MAX_DNS_SUFFIX_STRING_LENGTH 256 + +#define BROADCAST_NODETYPE 1 +#define PEER_TO_PEER_NODETYPE 2 +#define MIXED_NODETYPE 4 +#define HYBRID_NODETYPE 8 -#ifdef __cplusplus -extern "C" { -#endif -#define DEFAULT_MINIMUM_ENTITIES 32 -#define MAX_ADAPTER_ADDRESS_LENGTH 8 -#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 -#define MAX_ADAPTER_NAME_LENGTH 256 -#define MAX_DOMAIN_NAME_LEN 128 -#define MAX_HOSTNAME_LEN 128 -#define MAX_SCOPE_ID_LEN 256 -#define BROADCAST_NODETYPE 1 -#define PEER_TO_PEER_NODETYPE 2 -#define MIXED_NODETYPE 4 -#define HYBRID_NODETYPE 8 -#define IF_OTHER_ADAPTERTYPE 0 -#define IF_ETHERNET_ADAPTERTYPE 1 -#define IF_TOKEN_RING_ADAPTERTYPE 2 -#define IF_FDDI_ADAPTERTYPE 3 -#define IF_PPP_ADAPTERTYPE 4 -#define IF_LOOPBACK_ADAPTERTYPE 5 typedef struct { - char String[16]; + char String[4 * 4]; } IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING; + typedef struct _IP_ADDR_STRING { - struct _IP_ADDR_STRING* Next; - IP_ADDRESS_STRING IpAddress; - IP_MASK_STRING IpMask; - DWORD Context; + struct _IP_ADDR_STRING* Next; + IP_ADDRESS_STRING IpAddress; + IP_MASK_STRING IpMask; + DWORD Context; } IP_ADDR_STRING, *PIP_ADDR_STRING; + typedef struct _IP_ADAPTER_INFO { - struct _IP_ADAPTER_INFO* Next; - DWORD ComboIndex; - char AdapterName[MAX_ADAPTER_NAME_LENGTH+4]; - char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4]; - UINT AddressLength; - BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]; - DWORD Index; - UINT Type; - UINT DhcpEnabled; - PIP_ADDR_STRING CurrentIpAddress; - IP_ADDR_STRING IpAddressList; - IP_ADDR_STRING GatewayList; - IP_ADDR_STRING DhcpServer; - BOOL HaveWins; - IP_ADDR_STRING PrimaryWinsServer; - IP_ADDR_STRING SecondaryWinsServer; - time_t LeaseObtained; - time_t LeaseExpires; + struct _IP_ADAPTER_INFO* Next; + DWORD ComboIndex; + char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4]; + char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4]; + UINT AddressLength; + BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD Index; + UINT Type; + UINT DhcpEnabled; + PIP_ADDR_STRING CurrentIpAddress; + IP_ADDR_STRING IpAddressList; + IP_ADDR_STRING GatewayList; + IP_ADDR_STRING DhcpServer; + BOOL HaveWins; + IP_ADDR_STRING PrimaryWinsServer; + IP_ADDR_STRING SecondaryWinsServer; + time_t LeaseObtained; + time_t LeaseExpires; } IP_ADAPTER_INFO, *PIP_ADAPTER_INFO; + typedef struct _IP_PER_ADAPTER_INFO { - UINT AutoconfigEnabled; - UINT AutoconfigActive; - PIP_ADDR_STRING CurrentDnsServer; - IP_ADDR_STRING DnsServerList; + UINT AutoconfigEnabled; + UINT AutoconfigActive; + PIP_ADDR_STRING CurrentDnsServer; + IP_ADDR_STRING DnsServerList; } IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO; + typedef struct { - ULONG Index; - ULONG MediaType; - UCHAR ConnectionType; - UCHAR AccessType; - GUID DeviceGuid; - GUID InterfaceGuid; -} IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO; -typedef struct _FIXED_INFO { - char HostName[MAX_HOSTNAME_LEN+4] ; - char DomainName[MAX_DOMAIN_NAME_LEN+4]; - PIP_ADDR_STRING CurrentDnsServer; - IP_ADDR_STRING DnsServerList; - UINT NodeType; - char ScopeId[MAX_SCOPE_ID_LEN+4]; - UINT EnableRouting; - UINT EnableProxy; - UINT EnableDns; + char HostName[MAX_HOSTNAME_LEN + 4] ; + char DomainName[MAX_DOMAIN_NAME_LEN + 4]; + PIP_ADDR_STRING CurrentDnsServer; + IP_ADDR_STRING DnsServerList; + UINT NodeType; + char ScopeId[MAX_SCOPE_ID_LEN + 4]; + UINT EnableRouting; + UINT EnableProxy; + UINT EnableDns; } FIXED_INFO, *PFIXED_INFO; + +typedef NL_PREFIX_ORIGIN IP_PREFIX_ORIGIN; +typedef NL_SUFFIX_ORIGIN IP_SUFFIX_ORIGIN; +typedef NL_DAD_STATE IP_DAD_STATE; + +/* ReactOS */ +#if (NTDDI_VERSION >= NTDDI_WIN2KSP1) +typedef struct _IP_INTERFACE_NAME_INFO { + ULONG Index; + ULONG MediaType; + UCHAR ConnectionType; + UCHAR AccessType; + GUID DeviceGuid; + GUID InterfaceGuid; +} IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO; +#endif + #ifdef _WINSOCK2API_ -typedef enum { - IpPrefixOriginOther = 0, - IpPrefixOriginManual, - IpPrefixOriginWellKnown, - IpPrefixOriginDhcp, - IpPrefixOriginRouterAdvertisement, -} IP_PREFIX_ORIGIN; -typedef enum { - IpSuffixOriginOther = 0, - IpSuffixOriginManual, - IpSuffixOriginWellKnown, - IpSuffixOriginDhcp, - IpSuffixOriginLinkLayerAddress, - IpSuffixOriginRandom, -} IP_SUFFIX_ORIGIN; -typedef enum { - IpDadStateInvalid = 0, - IpDadStateTentative, - IpDadStateDuplicate, - IpDadStateDeprecated, - IpDadStatePreferred, -} IP_DAD_STATE; + typedef struct _IP_ADAPTER_UNICAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_UNICAST_ADDRESS *Next; - SOCKET_ADDRESS Address; - IP_PREFIX_ORIGIN PrefixOrigin; - IP_SUFFIX_ORIGIN SuffixOrigin; - IP_DAD_STATE DadState; - ULONG ValidLifetime; - ULONG PreferredLifetime; - ULONG LeaseLifetime; + union { + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_UNICAST_ADDRESS *Next; + SOCKET_ADDRESS Address; + IP_PREFIX_ORIGIN PrefixOrigin; + IP_SUFFIX_ORIGIN SuffixOrigin; + IP_DAD_STATE DadState; + ULONG ValidLifetime; + ULONG PreferredLifetime; + ULONG LeaseLifetime; } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS; + typedef struct _IP_ADAPTER_ANYCAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_ANYCAST_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ANYCAST_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS; + typedef struct _IP_ADAPTER_MULTICAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_MULTICAST_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_MULTICAST_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS; + typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Reserved; - }; - }; - struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS; + typedef struct _IP_ADAPTER_PREFIX { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_PREFIX *Next; - SOCKET_ADDRESS Address; - ULONG PrefixLength; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_PREFIX *Next; + SOCKET_ADDRESS Address; + ULONG PrefixLength; } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX; -typedef struct _IP_ADAPTER_ADDRESSES { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD IfIndex; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - struct _IP_ADAPTER_ADDRESSES *Next; - PCHAR AdapterName; - PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; - PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; - PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; - PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; - PWCHAR DnsSuffix; - PWCHAR Description; - PWCHAR FriendlyName; - BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; - DWORD PhysicalAddressLength; - DWORD Flags; - DWORD Mtu; - DWORD IfType; - IF_OPER_STATUS OperStatus; - DWORD Ipv6IfIndex; - DWORD ZoneIndices[16]; - PIP_ADAPTER_PREFIX FirstPrefix; -} IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES; -#define GAA_FLAG_SKIP_UNICAST 0x00000001 -#define GAA_FLAG_SKIP_ANYCAST 0x00000002 -#define GAA_FLAG_SKIP_MULTICAST 0x00000004 -#define GAA_FLAG_SKIP_DNS_SERVER 0x00000008 -#define GAA_FLAG_INCLUDE_PREFIX 0x00000010 -#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 +typedef struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH *Next; + SOCKET_ADDRESS Address; +} IP_ADAPTER_WINS_SERVER_ADDRESS_LH, *PIP_ADAPTER_WINS_SERVER_ADDRESS_LH; +typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH IP_ADAPTER_WINS_SERVER_ADDRESS; +typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH *PIP_ADAPTER_WINS_SERVER_ADDRESS; +typedef struct _IP_ADAPTER_GATEWAY_ADDRESS_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_GATEWAY_ADDRESS_LH *Next; + SOCKET_ADDRESS Address; +} IP_ADAPTER_GATEWAY_ADDRESS_LH, *PIP_ADAPTER_GATEWAY_ADDRESS_LH; +typedef IP_ADAPTER_GATEWAY_ADDRESS_LH IP_ADAPTER_GATEWAY_ADDRESS; +typedef IP_ADAPTER_GATEWAY_ADDRESS_LH *PIP_ADAPTER_GATEWAY_ADDRESS; + +typedef struct _IP_ADAPTER_DNS_SUFFIX { + struct _IP_ADAPTER_DNS_SUFFIX *Next; + WCHAR String[MAX_DNS_SUFFIX_STRING_LENGTH]; +} IP_ADAPTER_DNS_SUFFIX, *PIP_ADAPTER_DNS_SUFFIX; + +#define IP_ADAPTER_DDNS_ENABLED 0x1 +#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x2 +#define IP_ADAPTER_DHCP_ENABLED 0x4 +#define IP_ADAPTER_RECEIVE_ONLY 0x8 +#define IP_ADAPTER_NO_MULTICAST 0x10 +#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20 +#define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x40 +#define IP_ADAPTER_IPV4_ENABLED 0x80 +#define IP_ADAPTER_IPV6_ENABLED 0x100 +#define IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG 0x200 + +typedef struct _IP_ADAPTER_ADDRESSES_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD IfIndex; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ADDRESSES_LH *Next; + PCHAR AdapterName; + PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; + PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; + PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; + PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; + PWCHAR DnsSuffix; + PWCHAR Description; + PWCHAR FriendlyName; + BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD PhysicalAddressLength; + DWORD Flags; + DWORD Mtu; + DWORD IfType; + IF_OPER_STATUS OperStatus; + DWORD Ipv6IfIndex; + DWORD ZoneIndices[16]; + PIP_ADAPTER_PREFIX FirstPrefix; + ULONG64 TransmitLinkSpeed; + ULONG64 ReceiveLinkSpeed; + PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress; + PIP_ADAPTER_GATEWAY_ADDRESS_LH FirstGatewayAddress; + ULONG Ipv4Metric; + ULONG Ipv6Metric; + IF_LUID Luid; + SOCKET_ADDRESS Dhcpv4Server; + NET_IF_COMPARTMENT_ID CompartmentId; + NET_IF_NETWORK_GUID NetworkGuid; + NET_IF_CONNECTION_TYPE ConnectionType; + TUNNEL_TYPE TunnelType; + SOCKET_ADDRESS Dhcpv6Server; + BYTE Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH]; + ULONG Dhcpv6ClientDuidLength; + ULONG Dhcpv6Iaid; + PIP_ADAPTER_DNS_SUFFIX FirstDnsSuffix; +} IP_ADAPTER_ADDRESSES_LH, *PIP_ADAPTER_ADDRESSES_LH; + +typedef struct _IP_ADAPTER_ADDRESSES_XP { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD IfIndex; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ADDRESSES_XP *Next; + PCHAR AdapterName; + PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; + PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; + PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; + PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; + PWCHAR DnsSuffix; + PWCHAR Description; + PWCHAR FriendlyName; + BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD PhysicalAddressLength; + DWORD Flags; + DWORD Mtu; + DWORD IfType; + IF_OPER_STATUS OperStatus; + DWORD Ipv6IfIndex; + DWORD ZoneIndices[16]; + PIP_ADAPTER_PREFIX FirstPrefix; +} IP_ADAPTER_ADDRESSES_XP, *PIP_ADAPTER_ADDRESSES_XP; + +/* ReactOS */ +#if (NTDDI_VERSION >= NTDDI_VISTA) +typedef IP_ADAPTER_ADDRESSES_LH IP_ADAPTER_ADDRESSES; +typedef IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES; +#else +typedef IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES; +typedef IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES; #endif -#ifdef __cplusplus -} -#endif -#endif /* _IPTYPES_H */ +#define GAA_FLAG_SKIP_UNICAST 0x00000001 +#define GAA_FLAG_SKIP_ANYCAST 0x00000002 +#define GAA_FLAG_SKIP_MULTICAST 0x00000004 +#define GAA_FLAG_SKIP_DNS_SERVER 0x00000008 +#define GAA_FLAG_INCLUDE_PREFIX 0x00000010 +#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 +#define GAA_FLAG_INCLUDE_WINS_INFO 0x00000040 +#define GAA_FLAG_INCLUDE_ALL_GATEWAYS 0x00000080 +#define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x00000100 +#define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS 0x00000200 +#define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x00000400 + +#endif /* _WINSOCK2API_ */ + +#endif /* WINE_IPTYPES_H_*/ diff --git a/reactos/include/psdk/tcpmib.h b/reactos/include/psdk/tcpmib.h new file mode 100644 index 00000000000..477500c4fb2 --- /dev/null +++ b/reactos/include/psdk/tcpmib.h @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_TCPMIB_H +#define __WINE_TCPMIB_H + +#define TCPIP_OWNING_MODULE_SIZE 16 + + +/* TCP tables */ + +typedef enum +{ + MIB_TCP_STATE_CLOSED = 1, + MIB_TCP_STATE_LISTEN = 2, + MIB_TCP_STATE_SYN_SENT = 3, + MIB_TCP_STATE_SYN_RCVD = 4, + MIB_TCP_STATE_ESTAB = 5, + MIB_TCP_STATE_FIN_WAIT1 = 6, + MIB_TCP_STATE_FIN_WAIT2 = 7, + MIB_TCP_STATE_CLOSE_WAIT = 8, + MIB_TCP_STATE_CLOSING = 9, + 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 +{ + union + { + DWORD dwState; + MIB_TCP_STATE State; + } DUMMYUNIONNAME; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; +} MIB_TCPROW, *PMIB_TCPROW; + +typedef struct _MIB_TCPTABLE +{ + DWORD dwNumEntries; + MIB_TCPROW table[1]; +} MIB_TCPTABLE, *PMIB_TCPTABLE; + +typedef struct _MIB_TCP6ROW { + MIB_TCP_STATE State; + IN6_ADDR LocalAddr; + DWORD dwLocalScopeId; + DWORD dwLocalPort; + IN6_ADDR RemoteAddr; + DWORD dwRemoteScopeId; + DWORD dwRemotePort; +} MIB_TCP6ROW, *PMIB_TCP6ROW; + +typedef struct _MIB_TCP6TABLE { + DWORD dwNumEntries; + MIB_TCP6ROW table[1]; +} MIB_TCP6TABLE, *PMIB_TCP6TABLE; + +typedef struct _MIB_TCP6ROW2 { + IN6_ADDR LocalAddr; + DWORD dwLocalScopeId; + DWORD dwLocalPort; + IN6_ADDR RemoteAddr; + DWORD dwRemoteScopeId; + DWORD dwRemotePort; + MIB_TCP_STATE State; + DWORD dwOwningPid; + TCP_CONNECTION_OFFLOAD_STATE dwOffloadState; +} MIB_TCP6ROW2, *PMIB_TCP6ROW2; + +typedef struct _MIB_TCP6TABLE2 { + DWORD dwNumEntries; + MIB_TCP6ROW2 table[1]; +} MIB_TCP6TABLE2, *PMIB_TCP6TABLE2; + +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_TCPROW_OWNER_MODULE +{ + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; + LARGE_INTEGER liCreateTimestamp; + ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; +} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE; + +typedef struct _MIB_TCPTABLE_OWNER_MODULE +{ + DWORD dwNumEntries; + MIB_TCPROW_OWNER_MODULE table[1]; +} MIB_TCPTABLE_OWNER_MODULE, *PMIB_TCPTABLE_OWNER_MODULE; + +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 */ + +typedef enum +{ + TcpRtoAlgorithmOther = 0, + 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 +{ + union + { + DWORD dwRtoAlgorithm; + TCP_RTO_ALGORITHM RtoAlgorithm; + } DUMMYUNIONNAME; + DWORD dwRtoMin; + DWORD dwRtoMax; + DWORD dwMaxConn; + DWORD dwActiveOpens; + DWORD dwPassiveOpens; + DWORD dwAttemptFails; + DWORD dwEstabResets; + DWORD dwCurrEstab; + DWORD dwInSegs; + DWORD dwOutSegs; + DWORD dwRetransSegs; + DWORD dwInErrs; + DWORD dwOutRsts; + DWORD dwNumConns; +} MIB_TCPSTATS, *PMIB_TCPSTATS; + +#endif /* __WINE_TCPMIB_H */ diff --git a/reactos/include/psdk/udpmib.h b/reactos/include/psdk/udpmib.h new file mode 100644 index 00000000000..6b3f51cf2fe --- /dev/null +++ b/reactos/include/psdk/udpmib.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_UDPMIB_H +#define __WINE_UDPMIB_H + +#define TCPIP_OWNING_MODULE_SIZE 16 + + +/* UDP table */ + +typedef struct _MIB_UDPROW +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; +} MIB_UDPROW, *PMIB_UDPROW; + +typedef struct _MIB_UDPTABLE +{ + DWORD dwNumEntries; + MIB_UDPROW table[1]; +} MIB_UDPTABLE, *PMIB_UDPTABLE; + +typedef struct _MIB_UDPROW_OWNER_PID +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwOwningPid; +} 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; + +typedef struct _MIB_UDPROW_OWNER_MODULE +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwOwningPid; + LARGE_INTEGER liCreateTimestamp; + __C89_NAMELESS union + { + __C89_NAMELESS struct + { + int SpecificPortBind:1; + } __C89_NAMELESSSTRUCTNAME; + int dwFlags; + } __C89_NAMELESSUNIONNAME; + ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; +} MIB_UDPROW_OWNER_MODULE, *PMIB_UDPROW_OWNER_MODULE; + +typedef struct _MIB_UDPTABLE_OWNER_MODULE +{ + DWORD dwNumEntries; + MIB_UDPROW_OWNER_MODULE table[1]; +} MIB_UDPTABLE_OWNER_MODULE, *PMIB_UDPTABLE_OWNER_MODULE; + +/* UDP statistics */ + +typedef struct _MIB_UDPSTATS +{ + DWORD dwInDatagrams; + DWORD dwNoPorts; + DWORD dwInErrors; + DWORD dwOutDatagrams; + DWORD dwNumAddrs; +} MIB_UDPSTATS, *PMIB_UDPSTATS; + +#endif /* __WINE_UDPMIB_H */