mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[TCPIP] Implement returning TCP connections
CORE-5401
This commit is contained in:
parent
e3cb9697a4
commit
77d5f04f22
3 changed files with 52 additions and 0 deletions
|
@ -8,6 +8,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <tcpioctl.h>
|
#include <tcpioctl.h>
|
||||||
|
/* FIXME */
|
||||||
|
#define DWORD ULONG
|
||||||
|
#include <in6addr.h>
|
||||||
|
#include <tcpmib.h>
|
||||||
|
|
||||||
#define MAX_PHYSADDR_LEN 8
|
#define MAX_PHYSADDR_LEN 8
|
||||||
#define MAX_IFDESCR_LEN 256
|
#define MAX_IFDESCR_LEN 256
|
||||||
|
@ -109,6 +113,10 @@ TDI_STATUS InfoTdiQueryGetRouteTable( PIP_INTERFACE IF,
|
||||||
PNDIS_BUFFER Buffer,
|
PNDIS_BUFFER Buffer,
|
||||||
PUINT BufferSize );
|
PUINT BufferSize );
|
||||||
|
|
||||||
|
TDI_STATUS InfoTdiQueryGetConnectionTcpTable( PADDRESS_FILE AddrFile,
|
||||||
|
PNDIS_BUFFER Buffer,
|
||||||
|
PUINT BufferSize);
|
||||||
|
|
||||||
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
|
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
|
||||||
PVOID Buffer,
|
PVOID Buffer,
|
||||||
UINT BufferSize);
|
UINT BufferSize);
|
||||||
|
|
|
@ -285,6 +285,11 @@ TDI_STATUS InfoTdiQueryInformationEx(
|
||||||
return InfoTdiQueryGetRouteTable(EntityListContext, Buffer, BufferSize);
|
return InfoTdiQueryGetRouteTable(EntityListContext, Buffer, BufferSize);
|
||||||
else
|
else
|
||||||
return TDI_INVALID_PARAMETER;
|
return TDI_INVALID_PARAMETER;
|
||||||
|
else if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
|
||||||
|
if ((EntityListContext = GetContext(ID->toi_entity)))
|
||||||
|
return InfoTdiQueryGetConnectionTcpTable(EntityListContext, Buffer, BufferSize);
|
||||||
|
else
|
||||||
|
return TDI_INVALID_PARAMETER;
|
||||||
else
|
else
|
||||||
return TDI_INVALID_PARAMETER;
|
return TDI_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,45 @@ TDI_STATUS InfoTdiQueryGetIPSnmpInfo( TDIEntityID ID,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
|
PNDIS_BUFFER Buffer,
|
||||||
|
PUINT BufferSize)
|
||||||
|
{
|
||||||
|
MIB_TCPROW TcpRow;
|
||||||
|
PADDRESS_FILE EndPoint;
|
||||||
|
TDI_STATUS Status = TDI_INVALID_REQUEST;
|
||||||
|
|
||||||
|
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
|
||||||
|
|
||||||
|
EndPoint = NULL;
|
||||||
|
if (AddrFile->Connection != NULL)
|
||||||
|
EndPoint = AddrFile->Connection->AddressFile;
|
||||||
|
else if (AddrFile->Listener != NULL)
|
||||||
|
EndPoint = AddrFile->Listener->AddressFile;
|
||||||
|
|
||||||
|
TcpRow.State = 0; /* FIXME */
|
||||||
|
TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
|
||||||
|
TcpRow.dwLocalPort = AddrFile->Port;
|
||||||
|
|
||||||
|
if (EndPoint != NULL)
|
||||||
|
{
|
||||||
|
TcpRow.dwRemoteAddr = EndPoint->Address.Address.IPv4Address;
|
||||||
|
TcpRow.dwRemotePort = EndPoint->Port;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TcpRow.dwRemoteAddr = 0;
|
||||||
|
TcpRow.dwRemotePort = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = InfoCopyOut( (PCHAR)&TcpRow, sizeof(TcpRow),
|
||||||
|
Buffer, BufferSize );
|
||||||
|
|
||||||
|
TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
|
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
|
||||||
{
|
{
|
||||||
IP_ADDRESS Address, Netmask, Router;
|
IP_ADDRESS Address, Netmask, Router;
|
||||||
|
|
Loading…
Reference in a new issue