Author: jgardou
Date: Tue Nov  4 10:38:26 2014
New Revision: 65241

URL: http://svn.reactos.org/svn/reactos?rev=65241&view=rev
Log:
[TCPIP/AFD]
 - Use less weird internal structures and more public headers.

Modified:
    trunk/reactos/drivers/network/afd/afd/tdi.c
    trunk/reactos/drivers/network/afd/include/afd.h
    trunk/reactos/drivers/network/tcpip/include/info.h
    trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c

Modified: trunk/reactos/drivers/network/afd/afd/tdi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/tdi.c?rev=65241&r1=65240&r2=65241&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] Tue Nov  4 
10:38:26 2014
@@ -768,7 +768,7 @@
     TDIEntityID *Entities;
     ULONG EntityCount;
     ULONG EntityType;
-    IPSNMP_INFO SnmpInfo;
+    IPSNMPInfo SnmpInfo;
     PIPADDR_ENTRY IpAddress;
     ULONG BufferSize;
     NTSTATUS Status = STATUS_SUCCESS;
@@ -832,15 +832,15 @@
                                            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 @@
                     break;
                 }
 
-                if (SnmpInfo.NumAddr != 1) {
+                if (SnmpInfo.ipsi_numaddr != 1) {
                     /* Skip loopback address */
                     *Address = DN2H(IpAddress[1].Addr);
                 } else {

Modified: trunk/reactos/drivers/network/afd/include/afd.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/include/afd.h?rev=65241&r1=65240&r2=65241&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/include/afd.h     [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/include/afd.h     [iso-8859-1] Tue Nov  4 
10:38:26 2014
@@ -14,6 +14,7 @@
 #include <ntifs.h>
 #include <ndk/obtypes.h>
 #include <tdi.h>
+#include <tcpioctl.h>
 #define _WINBASE_
 #define _WINDOWS_H
 #define _INC_WINDOWS
@@ -30,38 +31,9 @@
 #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;

Modified: trunk/reactos/drivers/network/tcpip/include/info.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/include/info.h?rev=65241&r1=65240&r2=65241&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/info.h  [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/info.h  [iso-8859-1] Tue Nov  4 
10:38:26 2014
@@ -11,32 +11,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;

Modified: trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c?rev=65241&r1=65240&r2=65241&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c   [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c   [iso-8859-1] Tue Nov  4 
10:38:26 2014
@@ -156,18 +156,18 @@
                                       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));
-
-    SnmpInfo.NumIf = IfCount;
-    SnmpInfo.NumAddr = 1;
-    SnmpInfo.NumRoutes = RouteCount;
+    RtlZeroMemory(&SnmpInfo, sizeof(SnmpInfo));
+
+    SnmpInfo.ipsi_numif = IfCount;
+    SnmpInfo.ipsi_numaddr = 1;
+    SnmpInfo.ipsi_numroutes = RouteCount;
 
     Status = InfoCopyOut( (PCHAR)&SnmpInfo, sizeof(SnmpInfo),
                          Buffer, BufferSize );


Reply via email to