From: Pierre Schweitzer Date: Sun, 18 Nov 2018 15:21:24 +0000 (+0100) Subject: [TCPIP] Implement returning UDP connections X-Git-Tag: 0.4.12-dev~166 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=007f43dd56647c43cbf70ca2f5be24fe7f57e6f3 [TCPIP] Implement returning UDP connections CORE-5401 --- diff --git a/drivers/network/tcpip/include/info.h b/drivers/network/tcpip/include/info.h index 4d9d31e8cd7..8c1625d5afa 100644 --- a/drivers/network/tcpip/include/info.h +++ b/drivers/network/tcpip/include/info.h @@ -12,6 +12,7 @@ #define DWORD ULONG #include #include +#include #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 242b8112d94..e642bf1dc16 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 280b894aae7..f57e183566d 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;