[TCPIP] Implement returning UDP connections

CORE-5401
This commit is contained in:
Pierre Schweitzer 2018-11-18 16:21:24 +01:00
parent 77d5f04f22
commit 007f43dd56
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
3 changed files with 30 additions and 0 deletions

View 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);

View 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;

View 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;