[TCPIP] Implement returning UDP connections
authorPierre Schweitzer <pierre@reactos.org>
Sun, 18 Nov 2018 15:21:24 +0000 (16:21 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 18 Nov 2018 15:30:45 +0000 (16:30 +0100)
CORE-5401

drivers/network/tcpip/include/info.h
drivers/network/tcpip/tcpip/info.c
drivers/network/tcpip/tcpip/ninfo.c

index 4d9d31e..8c1625d 100644 (file)
@@ -12,6 +12,7 @@
 #define DWORD ULONG
 #include <in6addr.h>
 #include <tcpmib.h>
+#include <udpmib.h>
 
 #define MAX_PHYSADDR_LEN 8
 #define MAX_IFDESCR_LEN  256
@@ -117,6 +118,10 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable( PADDRESS_FILE AddrFile,
                                               PNDIS_BUFFER Buffer,
                                               PUINT BufferSize);
 
+TDI_STATUS InfoTdiQueryGetConnectionUdpTable( PADDRESS_FILE AddrFile,
+                                              PNDIS_BUFFER Buffer,
+                                              PUINT BufferSize);
+
 TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
                            PVOID Buffer,
                            UINT BufferSize);
index 242b811..e642bf1 100644 (file)
@@ -290,6 +290,11 @@ TDI_STATUS InfoTdiQueryInformationEx(
                          return InfoTdiQueryGetConnectionTcpTable(EntityListContext, Buffer, BufferSize);
                      else
                          return TDI_INVALID_PARAMETER;
+                 else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)
+                     if ((EntityListContext = GetContext(ID->toi_entity)))
+                         return InfoTdiQueryGetConnectionUdpTable(EntityListContext, Buffer, BufferSize);
+                     else
+                         return TDI_INVALID_PARAMETER;
                  else
                      return TDI_INVALID_PARAMETER;
 
index 280b894..f57e183 100644 (file)
@@ -216,6 +216,26 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
     return Status;
 }
 
+TDI_STATUS InfoTdiQueryGetConnectionUdpTable(PADDRESS_FILE AddrFile,
+                                   PNDIS_BUFFER Buffer,
+                                   PUINT BufferSize)
+{
+    MIB_UDPROW UdpRow;
+    TDI_STATUS Status = TDI_INVALID_REQUEST;
+
+    TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
+
+    UdpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
+    UdpRow.dwLocalPort = AddrFile->Port;
+
+    Status = InfoCopyOut( (PCHAR)&UdpRow, sizeof(UdpRow),
+                         Buffer, BufferSize );
+
+    TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
+
+    return Status;
+}
+
 TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
 {
     IP_ADDRESS Address, Netmask, Router;