From 8c9fd640303af9f786ee082db288baca7cc643c3 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Sat, 14 Feb 2004 21:27:35 +0000 Subject: [PATCH] Edited includes for new tcp ioctl needed by iphlpapi. tcpioctl.h: new I resolved a conflict between iptypes, structs and nspapi regarding some core structures. afd.h: removed definitions needed by both user land and kernel land. tdiinfo.h: added needed definitions. svn path=/trunk/; revision=8173 --- reactos/drivers/net/afd/include/afd.h | 4 - reactos/include/iptypes.h | 1 + reactos/include/net/tdi.h | 1 + reactos/include/net/tdiinfo.h | 142 +++++++++++++++++++++++++- reactos/include/nspapi.h | 37 +------ reactos/include/structs.h | 42 +------- reactos/include/tcpioctl.h | 2 + 7 files changed, 148 insertions(+), 81 deletions(-) diff --git a/reactos/drivers/net/afd/include/afd.h b/reactos/drivers/net/afd/include/afd.h index 32e61b82b41..b685487c261 100644 --- a/reactos/drivers/net/afd/include/afd.h +++ b/reactos/drivers/net/afd/include/afd.h @@ -137,10 +137,6 @@ typedef struct IPADDR_ENTRY { #define TL_INSTANCE 0 -#define IP_MIB_STATS_ID 0x1 -#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 - - /* IPv4 header format */ typedef struct IPv4_HEADER { UCHAR VerIHL; /* 4-bit version, 4-bit Internet Header Length */ diff --git a/reactos/include/iptypes.h b/reactos/include/iptypes.h index fcfb3b869da..61ec1bee469 100644 --- a/reactos/include/iptypes.h +++ b/reactos/include/iptypes.h @@ -19,6 +19,7 @@ #ifndef WINE_IPTYPES_H_ #define WINE_IPTYPES_H_ +#include #include #define MAX_ADAPTER_DESCRIPTION_LENGTH 128 diff --git a/reactos/include/net/tdi.h b/reactos/include/net/tdi.h index 7052442f023..f667fe7c423 100644 --- a/reactos/include/net/tdi.h +++ b/reactos/include/net/tdi.h @@ -150,6 +150,7 @@ typedef struct _TA_ADDRESS { #define TdiConnectionContext "ConnectionContext" #define TDI_TRANSPORT_ADDRESS_LENGTH (sizeof(TdiTransportAddress) - 1) #define TDI_CONNECTION_CONTEXT_LENGTH (sizeof(TdiConnectionContext) - 1) +#define TDI_ADDRESS_HEADER_LEN (2 * sizeof(USHORT)) typedef struct _TRANSPORT_ADDRESS { LONG TAAddressCount; diff --git a/reactos/include/net/tdiinfo.h b/reactos/include/net/tdiinfo.h index 415c66de48d..a525a4efdbe 100644 --- a/reactos/include/net/tdiinfo.h +++ b/reactos/include/net/tdiinfo.h @@ -35,10 +35,13 @@ extern "C" { #include "ntddk.h" +#ifndef TDI_SUCCESS +#define TDI_SUCCESS 0 +#endif/*TDI_SUCCESS*/ typedef struct TDIEntityID { ULONG tei_entity; - ULONG tei_instance; + ULONG tei_instance; } TDIEntityID; #define MAX_TDI_ENTITIES 512 @@ -69,6 +72,16 @@ typedef struct TDIEntityID { #define IF_GENERIC 0x200 #define IF_MIB 0x202 +/* ID to use for requesting an IFEntry for an interface */ +#define IF_MIB_STATS_ID 1 + +/* ID to use for requesting an IPSNMPInfo for an interface */ +#define IP_MIB_STATS_ID 1 /* Hmm. I'm not sure I like this */ + +/* ID to use for requesting the route table */ +#define IP_MIB_ROUTETABLE_ENTRY_ID 0x101 +#define IP_MIB_ADDRTABLE_ENTRY_ID 102 + /* TDIObjectID.toi_class constants */ #define INFO_CLASS_GENERIC 0x100 #define INFO_CLASS_PROTOCOL 0x200 @@ -86,7 +99,132 @@ typedef struct _TDIObjectID { ULONG toi_id; } TDIObjectID; -#define CONTEXT_SIZE 16 +#define MAX_PHYSADDR_SIZE 010 + +/* Basic interface information like from SIOCGIF* */ +/* 0x5c bytes without description tail */ +typedef struct _IFEntry { + ULONG if_index; + ULONG if_type; + ULONG if_mtu; + ULONG if_speed; + ULONG if_physaddrlen; + UCHAR if_physaddr[MAX_PHYSADDR_SIZE]; + ULONG if_adminstatus; + ULONG if_operstatus; + ULONG if_lastchange; + ULONG if_inoctets; + ULONG if_inucastpkts; + ULONG if_innucastpkts; + ULONG if_indiscards; + ULONG if_inerrors; + ULONG if_inunknownprotos; + ULONG if_outoctets; + ULONG if_outucastpkts; + ULONG if_outnucastpkts; + ULONG if_outdiscards; + ULONG if_outerrors; + ULONG if_outqlen; + ULONG if_descrlen; + UCHAR if_descr[1]; +} IFEntry; + +/* Control information like from /proc/sys/net/ipv4/... */ +/* 0x58 bytes */ +#if 1 +typedef struct _IPSNMPInfo { + ULONG ipsi_index; + ULONG ipsi_forwarding; + ULONG ipsi_defaultttl; + ULONG ipsi_inreceives; + ULONG ipsi_inhdrerrors; + ULONG ipsi_inaddrerrors; + ULONG ipsi_inunknownprotos; + ULONG ipsi_indiscards; + ULONG ipsi_indelivers; + ULONG ipsi_outrequests; + ULONG ipsi_routingdiscards; + ULONG ipsi_outdiscards; + ULONG ipsi_outnoroutes; + ULONG ipsi_reasmtimeout; + ULONG ipsi_reasmreqds; + ULONG ipsi_reasmoks; + ULONG ipsi_reasmfails; + ULONG ipsi_fragoks; + ULONG ipsi_fragfails; + ULONG ipsi_fragcreates; + ULONG ipsi_numif; + ULONG ipsi_numaddr; + ULONG ipsi_numroutes; +} IPSNMPInfo; +#else +typedef struct _IPSNMPInfo { + ULONG ipsi_forwarding; + ULONG ipsi_defaultttl; + ULONG ipsi_inreceives; + ULONG ipsi_inhdrerrors; + ULONG ipsi_inaddrerrors; + ULONG ipsi_inunknownprotos; + ULONG ipsi_indiscards; + ULONG ipsi_indelivers; + ULONG ipsi_outrequests; + ULONG ipsi_routingdiscards; + ULONG ipsi_outdiscards; + ULONG ipsi_outnoroutes; + ULONG ipsi_reasmtimeout; + ULONG ipsi_reasmreqds; + ULONG ipsi_reasmoks; + ULONG ipsi_reasmfails; + ULONG ipsi_fragoks; + ULONG ipsi_fragfails; + ULONG ipsi_fragcreates; + ULONG ipsi_numif; + ULONG ipsi_numaddr; + ULONG ipsi_numroutes; +} IPSNMPInfo; +#endif + +// BEGIN ORIGINAL SOURCE INFORMATION -- +// Gets ip info for the current interface list. + +// Tom Sanfilippo +// tsanfilippo@earthlink.net +// December 12, 1999 + +// Thanks are due to Thomas F. Divine +// for pointing out the updated wshsmple in the NT4DDK. +// The headers in that sample allowed the input parameters +// to finally be discovered. +// END ORIGINAL SOURCE INFORMATION -- + +typedef struct _IPRouteEntry { + ULONG ire_addr; + ULONG ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry + ULONG ire_metric; + ULONG ire_dest; //?? + ULONG ire_unk2; //?? + ULONG ire_unk3; //?? + ULONG ire_gw; + ULONG ire_unk4; //?? + ULONG ire_unk5; //?? + ULONG ire_unk6; //?? + ULONG ire_mask; + ULONG ire_unk7; //?? + ULONG ire_unk8; //?? +} IPRouteEntry; + +typedef struct _IPAddrEntry { + ULONG iae_addr; + ULONG iae_index; + ULONG iae_mask; + ULONG iae_bcastaddr; + ULONG iae_reasmsize; + ULONG iae_context; + ULONG iae_pad; +} IPAddrEntry; + +#define CONTEXT_SIZE 16 +#define MAX_ADAPTER_DESCRIPTION_LENGTH 64 /* guess */ typedef struct _TCP_REQUEST_QUERY_INFORMATION_EX { TDIObjectID ID; diff --git a/reactos/include/nspapi.h b/reactos/include/nspapi.h index 463b1390255..db9ebcd6c90 100644 --- a/reactos/include/nspapi.h +++ b/reactos/include/nspapi.h @@ -63,42 +63,7 @@ typedef struct _BLOB { } BLOB,*PBLOB,*LPBLOB; #endif -typedef struct _SERVICE_ADDRESS { - DWORD dwAddressType; - DWORD dwAddressFlags; - DWORD dwAddressLength; - DWORD dwPrincipalLength; - BYTE *lpAddress; - BYTE *lpPrincipal; -} SERVICE_ADDRESS; -typedef struct _SERVICE_ADDRESSES { - DWORD dwAddressCount; - SERVICE_ADDRESS Addresses[1]; -} SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES; -typedef struct _SERVICE_INFOA { - LPGUID lpServiceType; - LPSTR lpServiceName; - LPSTR lpComment; - LPSTR lpLocale; - DWORD dwDisplayHint; - DWORD dwVersion; - DWORD dwTime; - LPSTR lpMachineName; - LPSERVICE_ADDRESSES lpServiceAddress; - BLOB ServiceSpecificInfo; -} SERVICE_INFOA, *LPSERVICE_INFOA; -typedef struct _SERVICE_INFOW { - LPGUID lpServiceType; - LPWSTR lpServiceName; - LPWSTR lpComment; - LPWSTR lpLocale; - DWORD dwDisplayHint; - DWORD dwVersion; - DWORD dwTime; - LPWSTR lpMachineName; - LPSERVICE_ADDRESSES lpServiceAddress; - BLOB ServiceSpecificInfo; -} SERVICE_INFOW, *LPSERVICE_INFOW; +#include typedef void *LPSERVICE_ASYNC_INFO; INT WINAPI SetServiceA(DWORD,DWORD,DWORD,LPSERVICE_INFOA,LPSERVICE_ASYNC_INFO,LPDWORD); diff --git a/reactos/include/structs.h b/reactos/include/structs.h index 4c1e4f3fc80..ead9cab20e7 100644 --- a/reactos/include/structs.h +++ b/reactos/include/structs.h @@ -3746,22 +3746,11 @@ typedef struct tagNONCLIENTMETRICSW { typedef_tident(NONCLIENTMETRICS) typedef_tident(LPNONCLIENTMETRICS) -typedef struct _SERVICE_ADDRESS { - DWORD dwAddressType; - DWORD dwAddressFlags; - DWORD dwAddressLength; - DWORD dwPrincipalLength; - BYTE *lpAddress; - BYTE *lpPrincipal; -} SERVICE_ADDRESS; - -typedef struct _SERVICE_ADDRESSES { - DWORD dwAddressCount; - SERVICE_ADDRESS Addresses[1]; -} SERVICE_ADDRESSES, *LPSERVICE_ADDRESSES; +#include #ifndef GUID_DEFINED #define GUID_DEFINED + typedef struct _GUID { unsigned long Data1; @@ -3770,33 +3759,8 @@ typedef struct _GUID unsigned char Data4[8]; } GUID, *LPGUID; typedef GUID CLSID, *LPCLSID; -#endif -typedef struct _SERVICE_INFOA { - LPGUID lpServiceType; - LPSTR lpServiceName; - LPSTR lpComment; - LPSTR lpLocale; - DWORD dwDisplayHint; - DWORD dwVersion; - DWORD dwTime; - LPSTR lpMachineName; - LPSERVICE_ADDRESSES lpServiceAddress; - BLOB ServiceSpecificInfo; -} SERVICE_INFOA, *LPSERVICE_INFOA; - -typedef struct _SERVICE_INFOW { - LPGUID lpServiceType; - LPWSTR lpServiceName; - LPWSTR lpComment; - LPWSTR lpLocale; - DWORD dwDisplayHint; - DWORD dwVersion; - DWORD dwTime; - LPWSTR lpMachineName; - LPSERVICE_ADDRESSES lpServiceAddress; - BLOB ServiceSpecificInfo; -} SERVICE_INFOW, *LPSERVICE_INFOW; +#endif/*GUID_DEFINED*/ typedef_tident(SERVICE_INFO); typedef_tident(LPSERVICE_INFO); diff --git a/reactos/include/tcpioctl.h b/reactos/include/tcpioctl.h index 3a2bffe4dfd..b1e113daab7 100644 --- a/reactos/include/tcpioctl.h +++ b/reactos/include/tcpioctl.h @@ -22,6 +22,8 @@ #ifndef _TCPIOCTL_H #define _TCPIOCTL_H +#define DD_TCP_DEVICE_NAME L"\\Device\\Tcp" + /* TCP/UDP/RawIP IOCTL code definitions */ #define FSCTL_TCP_BASE FILE_DEVICE_NETWORK