https://git.reactos.org/?p=reactos.git;a=commitdiff;h=007f43dd56647c43cbf70…
commit 007f43dd56647c43cbf70ca2f5be24fe7f57e6f3
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Nov 18 16:21:24 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Nov 18 16:30:45 2018 +0100
[TCPIP] Implement returning UDP connections
CORE-5401
---
drivers/network/tcpip/include/info.h | 5 +++++
drivers/network/tcpip/tcpip/info.c | 5 +++++
drivers/network/tcpip/tcpip/ninfo.c | 20 ++++++++++++++++++++
3 files changed, 30 insertions(+)
diff --git a/drivers/network/tcpip/include/info.h b/drivers/network/tcpip/include/info.h
index 4d9d31e8cd..8c1625d5af 100644
--- a/drivers/network/tcpip/include/info.h
+++ b/drivers/network/tcpip/include/info.h
@@ -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);
diff --git a/drivers/network/tcpip/tcpip/info.c b/drivers/network/tcpip/tcpip/info.c
index 242b8112d9..e642bf1dc1 100644
--- a/drivers/network/tcpip/tcpip/info.c
+++ b/drivers/network/tcpip/tcpip/info.c
@@ -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;
diff --git a/drivers/network/tcpip/tcpip/ninfo.c b/drivers/network/tcpip/tcpip/ninfo.c
index 280b894aae..f57e183566 100644
--- a/drivers/network/tcpip/tcpip/ninfo.c
+++ b/drivers/network/tcpip/tcpip/ninfo.c
@@ -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;