From: Jérôme Gardou Date: Tue, 4 Nov 2014 10:38:26 +0000 (+0000) Subject: [TCPIP/AFD] X-Git-Tag: backups/tcpip_revolution@71025~100 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=5e4cc9a9c9a9fe7e57907f9acccd0717356657b4 [TCPIP/AFD] - Use less weird internal structures and more public headers. svn path=/trunk/; revision=65241 --- diff --git a/reactos/drivers/network/afd/afd/tdi.c b/reactos/drivers/network/afd/afd/tdi.c index 333462ee779..27b844470fc 100644 --- a/reactos/drivers/network/afd/afd/tdi.c +++ b/reactos/drivers/network/afd/afd/tdi.c @@ -768,7 +768,7 @@ NTSTATUS TdiQueryAddress( TDIEntityID *Entities; ULONG EntityCount; ULONG EntityType; - IPSNMP_INFO SnmpInfo; + IPSNMPInfo SnmpInfo; PIPADDR_ENTRY IpAddress; ULONG BufferSize; NTSTATUS Status = STATUS_SUCCESS; @@ -832,15 +832,15 @@ NTSTATUS TdiQueryAddress( IP_MIB_STATS_ID, /* Entity id */ &SnmpInfo, /* Output buffer */ &BufferSize); /* Output buffer size */ - if (!NT_SUCCESS(Status) || (SnmpInfo.NumAddr == 0)) { + if (!NT_SUCCESS(Status) || (SnmpInfo.ipsi_numaddr == 0)) { AFD_DbgPrint(MIN_TRACE, ("Unable to get SNMP information or no IP addresses available (Status = 0x%X).\n", Status)); break; } /* Query device for all IP addresses */ - if (SnmpInfo.NumAddr != 0) { - BufferSize = SnmpInfo.NumAddr * sizeof(IPADDR_ENTRY); + if (SnmpInfo.ipsi_numaddr != 0) { + BufferSize = SnmpInfo.ipsi_numaddr * sizeof(IPADDR_ENTRY); IpAddress = (PIPADDR_ENTRY)ExAllocatePool(NonPagedPool, BufferSize); if (!IpAddress) { AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); @@ -861,7 +861,7 @@ NTSTATUS TdiQueryAddress( break; } - if (SnmpInfo.NumAddr != 1) { + if (SnmpInfo.ipsi_numaddr != 1) { /* Skip loopback address */ *Address = DN2H(IpAddress[1].Addr); } else { diff --git a/reactos/drivers/network/afd/include/afd.h b/reactos/drivers/network/afd/include/afd.h index 36aed14015c..f3ae253affe 100644 --- a/reactos/drivers/network/afd/include/afd.h +++ b/reactos/drivers/network/afd/include/afd.h @@ -14,6 +14,7 @@ #include #include #include +#include #define _WINBASE_ #define _WINDOWS_H #define _INC_WINDOWS @@ -30,39 +31,10 @@ #define MIN(x,y) (((x)<(y))?(x):(y)) #endif -#define IOCTL_TCP_QUERY_INFORMATION_EX \ - CTL_CODE(FILE_DEVICE_NETWORK, 0, METHOD_NEITHER, FILE_ANY_ACCESS) - #define TL_INSTANCE 0 #define IP_MIB_STATS_ID 1 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 -typedef struct IPSNMP_INFO { - ULONG Forwarding; - ULONG DefaultTTL; - ULONG InReceives; - ULONG InHdrErrors; - ULONG InAddrErrors; - ULONG ForwDatagrams; - ULONG InUnknownProtos; - ULONG InDiscards; - ULONG InDelivers; - ULONG OutRequests; - ULONG RoutingDiscards; - ULONG OutDiscards; - ULONG OutNoRoutes; - ULONG ReasmTimeout; - ULONG ReasmReqds; - ULONG ReasmOks; - ULONG ReasmFails; - ULONG FragOks; - ULONG FragFails; - ULONG FragCreates; - ULONG NumIf; - ULONG NumAddr; - ULONG NumRoutes; -} IPSNMP_INFO, *PIPSNMP_INFO; - typedef struct IPADDR_ENTRY { ULONG Addr; ULONG Index; diff --git a/reactos/drivers/network/tcpip/include/info.h b/reactos/drivers/network/tcpip/include/info.h index 2bf4edb0835..222f3d56a30 100644 --- a/reactos/drivers/network/tcpip/include/info.h +++ b/reactos/drivers/network/tcpip/include/info.h @@ -12,32 +12,6 @@ #define MAX_PHYSADDR_LEN 8 #define MAX_IFDESCR_LEN 256 -typedef struct IPSNMP_INFO { - ULONG Forwarding; - ULONG DefaultTTL; - ULONG InReceives; - ULONG InHdrErrors; - ULONG InAddrErrors; - ULONG ForwDatagrams; - ULONG InUnknownProtos; - ULONG InDiscards; - ULONG InDelivers; - ULONG OutRequests; - ULONG RoutingDiscards; - ULONG OutDiscards; - ULONG OutNoRoutes; - ULONG ReasmTimeout; - ULONG ReasmReqds; - ULONG ReasmOks; - ULONG ReasmFails; - ULONG FragOks; - ULONG FragFails; - ULONG FragCreates; - ULONG NumIf; - ULONG NumAddr; - ULONG NumRoutes; -} IPSNMP_INFO, *PIPSNMP_INFO; - typedef struct IPADDR_ENTRY { ULONG Addr; ULONG Index; diff --git a/reactos/drivers/network/tcpip/tcpip/ninfo.c b/reactos/drivers/network/tcpip/tcpip/ninfo.c index 40710ccb641..bd9e7b95a74 100644 --- a/reactos/drivers/network/tcpip/tcpip/ninfo.c +++ b/reactos/drivers/network/tcpip/tcpip/ninfo.c @@ -156,18 +156,18 @@ TDI_STATUS InfoTdiQueryGetIPSnmpInfo( TDIEntityID ID, PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize ) { - IPSNMP_INFO SnmpInfo; + IPSNMPInfo SnmpInfo; UINT IfCount = CountInterfaces(); UINT RouteCount = CountFIBs(IF); TDI_STATUS Status = TDI_INVALID_REQUEST; TI_DbgPrint(DEBUG_INFO, ("Called.\n")); - RtlZeroMemory(&SnmpInfo, sizeof(IPSNMP_INFO)); + RtlZeroMemory(&SnmpInfo, sizeof(SnmpInfo)); - SnmpInfo.NumIf = IfCount; - SnmpInfo.NumAddr = 1; - SnmpInfo.NumRoutes = RouteCount; + SnmpInfo.ipsi_numif = IfCount; + SnmpInfo.ipsi_numaddr = 1; + SnmpInfo.ipsi_numroutes = RouteCount; Status = InfoCopyOut( (PCHAR)&SnmpInfo, sizeof(SnmpInfo), Buffer, BufferSize );