ReactOS  0.4.14-dev-606-g14ebc0b
info.h File Reference
#include <tcpioctl.h>
#include <in6addr.h>
#include <tcpmib.h>
#include <udpmib.h>
Include dependency graph for info.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IPADDR_ENTRY
 
struct  IPARP_ENTRY
 
struct  IPROUTE_ENTRY
 
struct  ADDRESS_INFO
 
union  TDI_INFO
 

Macros

#define DWORD   ULONG
 
#define MAX_PHYSADDR_LEN   8
 
#define MAX_IFDESCR_LEN   256
 
#define ARP_ENTRY_STATIC   4
 
#define ARP_ENTRY_DYNAMIC   3
 
#define ARP_ENTRY_INVALID   2
 
#define ARP_ENTRY_OTHER   1
 
#define TDI_SERVICE_FLAGS
 
#define TCP_MIB_STAT_ID   1
 
#define UDP_MIB_STAT_ID   1
 
#define TCP_MIB_TABLE_ID   0x101
 
#define UDP_MIB_TABLE_ID   0x101
 
#define TL_INSTANCE   0
 

Typedefs

typedef struct IPADDR_ENTRY IPADDR_ENTRY
 
typedef struct IPADDR_ENTRYPIPADDR_ENTRY
 
typedef struct IPARP_ENTRY IPARP_ENTRY
 
typedef struct IPARP_ENTRYPIPARP_ENTRY
 
typedef struct IPROUTE_ENTRY IPROUTE_ENTRY
 
typedef struct IPROUTE_ENTRYPIPROUTE_ENTRY
 
typedef struct ADDRESS_INFO ADDRESS_INFO
 
typedef struct ADDRESS_INFOPADDRESS_INFO
 
typedef union TDI_INFO TDI_INFO
 
typedef union TDI_INFOPTDI_INFO
 
typedef enum TDI_TCPUDP_CLASS_INFO TDI_TCPUDP_CLASS_INFO
 
typedef enum TDI_TCPUDP_CLASS_INFOPTDI_TCPUDP_CLASS_INFO
 

Enumerations

enum  TDI_TCPUDP_CLASS_INFO { TcpUdpClassBasic, TcpUdpClassOwnerPid, TcpUdpClassOwner }
 

Functions

TDI_STATUS InfoCopyOut (PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
 
TDI_STATUS InfoTdiQueryInformationEx (PTDI_REQUEST Request, TDIObjectID *ID, PNDIS_BUFFER Buffer, PUINT BufferSize, PVOID Context)
 
TDI_STATUS InfoTdiSetInformationEx (PTDI_REQUEST Request, TDIObjectID *ID, PVOID Buffer, UINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetAddrTable (TDIEntityID ID, PNDIS_BUFFER Buffer, PUINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetInterfaceMIB (TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetIPSnmpInfo (TDIEntityID ID, PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetRouteTable (PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetConnectionTcpTable (PADDRESS_FILE AddrFile, PNDIS_BUFFER Buffer, PUINT BufferSize, TDI_TCPUDP_CLASS_INFO Class)
 
TDI_STATUS InfoTdiQueryGetConnectionUdpTable (PADDRESS_FILE AddrFile, PNDIS_BUFFER Buffer, PUINT BufferSize, TDI_TCPUDP_CLASS_INFO Class)
 
TDI_STATUS InfoTdiSetRoute (PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
 
TDI_STATUS InfoTdiSetArptableMIB (PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
 
TDI_STATUS InfoTdiQueryGetArptableMIB (TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize)
 
TDI_STATUS SetAddressFileInfo (TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, UINT BufferSize)
 
TDI_STATUS GetAddressFileInfo (TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, PUINT BufferSize)
 
TDI_STATUS SetConnectionInfo (TDIObjectID *ID, PCONNECTION_ENDPOINT Connection, PVOID Buffer, UINT BufferSize)
 
VOID InsertTDIInterfaceEntity (PIP_INTERFACE Interface)
 
VOID RemoveTDIInterfaceEntity (PIP_INTERFACE Interface)
 
VOID AddEntity (ULONG EntityType, PVOID Context, ULONG Flags)
 
VOID RemoveEntityByContext (PVOID Context)
 

Macro Definition Documentation

◆ ARP_ENTRY_DYNAMIC

#define ARP_ENTRY_DYNAMIC   3

Definition at line 31 of file info.h.

◆ ARP_ENTRY_INVALID

#define ARP_ENTRY_INVALID   2

Definition at line 32 of file info.h.

◆ ARP_ENTRY_OTHER

#define ARP_ENTRY_OTHER   1

Definition at line 33 of file info.h.

◆ ARP_ENTRY_STATIC

#define ARP_ENTRY_STATIC   4

Definition at line 30 of file info.h.

◆ DWORD

Definition at line 12 of file info.h.

◆ MAX_IFDESCR_LEN

#define MAX_IFDESCR_LEN   256

Definition at line 18 of file info.h.

◆ MAX_PHYSADDR_LEN

#define MAX_PHYSADDR_LEN   8

Definition at line 17 of file info.h.

◆ TCP_MIB_STAT_ID

#define TCP_MIB_STAT_ID   1

Definition at line 63 of file info.h.

◆ TCP_MIB_TABLE_ID

#define TCP_MIB_TABLE_ID   0x101

Definition at line 65 of file info.h.

◆ TDI_SERVICE_FLAGS

#define TDI_SERVICE_FLAGS
Value:
TDI_SERVICE_BROADCAST_SUPPORTED)
#define TDI_SERVICE_CONNECTIONLESS_MODE
Definition: tdi.h:247

Definition at line 60 of file info.h.

◆ TL_INSTANCE

#define TL_INSTANCE   0

Definition at line 68 of file info.h.

◆ UDP_MIB_STAT_ID

#define UDP_MIB_STAT_ID   1

Definition at line 64 of file info.h.

◆ UDP_MIB_TABLE_ID

#define UDP_MIB_TABLE_ID   0x101

Definition at line 66 of file info.h.

Typedef Documentation

◆ ADDRESS_INFO

◆ IPADDR_ENTRY

◆ IPARP_ENTRY

◆ IPROUTE_ENTRY

◆ PADDRESS_INFO

◆ PIPADDR_ENTRY

◆ PIPARP_ENTRY

◆ PIPROUTE_ENTRY

◆ PTDI_INFO

typedef union TDI_INFO * PTDI_INFO

◆ PTDI_TCPUDP_CLASS_INFO

◆ TDI_INFO

typedef union TDI_INFO TDI_INFO

◆ TDI_TCPUDP_CLASS_INFO

Enumeration Type Documentation

◆ TDI_TCPUDP_CLASS_INFO

Enumerator
TcpUdpClassBasic 
TcpUdpClassOwnerPid 
TcpUdpClassOwner 

Definition at line 83 of file info.h.

83  {
enum TDI_TCPUDP_CLASS_INFO * PTDI_TCPUDP_CLASS_INFO
TDI_TCPUDP_CLASS_INFO
Definition: info.h:83

Function Documentation

◆ AddEntity()

VOID AddEntity ( ULONG  EntityType,
PVOID  Context,
ULONG  Flags 
)

Definition at line 15 of file info.c.

16 {
17  KIRQL OldIrql;
18  ULONG i, Instance = 0;
19  BOOLEAN ChoseIndex = FALSE;
20 
22 
23  while (!ChoseIndex)
24  {
25  ChoseIndex = TRUE;
26  for (i = 0; i < EntityCount; i++)
27  {
28  if (EntityList[i].tei_entity == EntityType &&
29  EntityList[i].tei_instance == Instance)
30  {
31  Instance++;
32  ChoseIndex = FALSE;
33  }
34  }
35  }
36 
37  EntityList[EntityCount].tei_entity = EntityType;
41  EntityCount++;
42 
44 }
ULONG EntityCount
Definition: main.c:24
#define TRUE
Definition: types.h:120
KSPIN_LOCK EntityListLock
Definition: main.c:22
TDIEntityInfo * EntityList
Definition: main.c:23
UINT tei_entity
Definition: tcpip.h:146
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
UCHAR KIRQL
Definition: env_spec_w32.h:591
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char BOOLEAN
UINT tei_instance
Definition: tcpip.h:147
PVOID context
Definition: tcpip.h:148
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
UINT flags
Definition: tcpip.h:149
IN PVOID Instance
Definition: pci.h:359
struct tagContext Context
Definition: acpixf.h:1030
unsigned int ULONG
Definition: retypes.h:1

Referenced by FileOpenAddress(), and InsertTDIInterfaceEntity().

◆ GetAddressFileInfo()

TDI_STATUS GetAddressFileInfo ( TDIObjectID ID,
PADDRESS_FILE  AddrFile,
PVOID  Buffer,
PUINT  BufferSize 
)

Definition at line 67 of file ainfo.c.

71 {
73 
74  return TDI_INVALID_REQUEST;
75 }
#define UNIMPLEMENTED
Definition: debug.h:114
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63

Referenced by InfoTdiQueryInformationEx().

◆ InfoCopyOut()

TDI_STATUS InfoCopyOut ( PCHAR  DataOut,
UINT  SizeOut,
PNDIS_BUFFER  ClientBuf,
PUINT  ClientBufSize 
)

Definition at line 97 of file info.c.

98  {
99  UINT RememberedCBSize = *ClientBufSize;
100  *ClientBufSize = SizeOut;
101 
102  /* The driver returns success even when it couldn't fit every available
103  * byte. */
104  if( RememberedCBSize < SizeOut || !ClientBuf )
105  return TDI_SUCCESS;
106  else {
107  CopyBufferToBufferChain( ClientBuf, 0, (PCHAR)DataOut, SizeOut );
108  return TDI_SUCCESS;
109  }
110 }
UINT CopyBufferToBufferChain(PNDIS_BUFFER DstBuffer, UINT DstOffset, PUCHAR SrcData, UINT Length)
Definition: buffer.c:54
signed char * PCHAR
Definition: retypes.h:7
#define TDI_SUCCESS
Definition: tdistat.h:30
unsigned int UINT
Definition: ndis.h:50

Referenced by InfoTdiQueryEntityType(), InfoTdiQueryGetAddrTable(), InfoTdiQueryGetArptableMIB(), InfoTdiQueryGetATInfo(), InfoTdiQueryGetConnectionTcpTable(), InfoTdiQueryGetConnectionUdpTable(), InfoTdiQueryGetInterfaceMIB(), InfoTdiQueryGetIPSnmpInfo(), InfoTdiQueryGetRouteTable(), and InfoTransportLayerTdiQueryEx().

◆ InfoTdiQueryGetAddrTable()

TDI_STATUS InfoTdiQueryGetAddrTable ( TDIEntityID  ID,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize 
)

Definition at line 98 of file ninfo.c.

101 {
102  KIRQL OldIrql;
103  PIPADDR_ENTRY IPEntry;
104  PIP_INTERFACE CurrentIF;
105  UINT i;
106 
107  TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
108 
109 
111 
112  for (i = 0; i < EntityCount; i++)
113  {
114  if (EntityList[i].tei_entity == ID.tei_entity &&
115  EntityList[i].tei_instance == ID.tei_instance)
116  break;
117  }
118 
119  if (i == EntityCount)
120  {
122  return TDI_INVALID_PARAMETER;
123  }
124 
126  if (!IPEntry)
127  {
129  return TDI_NO_RESOURCES;
130  }
131 
132  CurrentIF = EntityList[i].context;
133 
134  IPEntry->Index = CurrentIF->Index;
135  GetInterfaceIPv4Address(CurrentIF,
136  ADE_UNICAST,
137  &IPEntry->Addr);
138  GetInterfaceIPv4Address(CurrentIF,
139  ADE_ADDRMASK,
140  &IPEntry->Mask);
141  GetInterfaceIPv4Address(CurrentIF,
143  &IPEntry->BcastAddr);
144 
146 
147  InfoCopyOut((PCHAR)IPEntry, sizeof(IPADDR_ENTRY),
148  Buffer, BufferSize);
149 
151 
152  return TDI_SUCCESS;
153 }
signed char * PCHAR
Definition: retypes.h:7
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
ULONG EntityCount
Definition: main.c:24
#define TDI_SUCCESS
Definition: tdistat.h:30
KSPIN_LOCK EntityListLock
Definition: main.c:22
Definition: afd.h:56
TDIEntityInfo * EntityList
Definition: main.c:23
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
#define ADE_BROADCAST
Definition: ip.h:111
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG Mask
Definition: afd.h:59
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
Definition: bufpool.h:45
ULONG BcastAddr
Definition: afd.h:60
UINT tei_instance
Definition: tcpip.h:147
#define IP_ADDRESS_TAG
Definition: tags.h:18
ULONG Index
Definition: afd.h:58
UINT Index
Definition: ip.h:167
PVOID context
Definition: tcpip.h:148
#define BufferSize
Definition: classpnp.h:419
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define ADE_ADDRMASK
Definition: ip.h:112
#define ID
Definition: ruserpass.c:36
NTSTATUS GetInterfaceIPv4Address(PIP_INTERFACE Interface, ULONG Type, PULONG Address)
Definition: interface.c:19
unsigned int UINT
Definition: ndis.h:50
#define TDI_NO_RESOURCES
Definition: tdistat.h:31
ULONG Addr
Definition: afd.h:57
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define ADE_UNICAST
Definition: ip.h:110
#define DEBUG_INFO
Definition: debug.h:33

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetArptableMIB()

TDI_STATUS InfoTdiQueryGetArptableMIB ( TDIEntityID  ID,
PIP_INTERFACE  Interface,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize 
)

Definition at line 105 of file iinfo.c.

108  {
110  ULONG NumNeighbors = NBCopyNeighbors( Interface, NULL );
111  ULONG MemSize = NumNeighbors * sizeof(IPARP_ENTRY);
112  PIPARP_ENTRY ArpEntries;
113 
114  if (MemSize != 0)
115  {
116  ArpEntries = ExAllocatePoolWithTag( NonPagedPool, MemSize, ARP_ENTRY_TAG );
117  if( !ArpEntries ) return STATUS_NO_MEMORY;
118 
119  NBCopyNeighbors( Interface, ArpEntries );
120 
121  Status = InfoCopyOut( (PVOID)ArpEntries, MemSize, Buffer, BufferSize );
122 
123  ExFreePoolWithTag( ArpEntries, ARP_ENTRY_TAG );
124  }
125  else
126  {
128  }
129 
130  return Status;
131 }
struct IPARP_ENTRY IPARP_ENTRY
LONG NTSTATUS
Definition: precomp.h:26
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
#define BufferSize
Definition: classpnp.h:419
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ARP_ENTRY_TAG
Definition: tags.h:40
Status
Definition: gdiplustypes.h:24
Definition: info.h:35
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
ULONG NBCopyNeighbors(PIP_INTERFACE Interface, PIPARP_ENTRY ArpTable)
Definition: neighbor.c:636
unsigned int ULONG
Definition: retypes.h:1
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetConnectionTcpTable()

TDI_STATUS InfoTdiQueryGetConnectionTcpTable ( PADDRESS_FILE  AddrFile,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize,
TDI_TCPUDP_CLASS_INFO  Class 
)

Definition at line 182 of file ninfo.c.

186 {
187  SIZE_T Size;
190 
191  TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
192 
193  if (Class == TcpUdpClassOwnerPid)
194  {
195  Size = sizeof(MIB_TCPROW_OWNER_PID);
196  }
197  else if (Class == TcpUdpClassOwner)
198  {
199  Size = sizeof(MIB_TCPROW_OWNER_MODULE);
200  }
201  else
202  {
203  Size = sizeof(MIB_TCPROW);
204  }
205 
206  TcpRow.dwOwningPid = HandleToUlong(AddrFile->ProcessId);
207  TcpRow.liCreateTimestamp = AddrFile->CreationTime;
208 
209  if (AddrFile->Listener != NULL)
210  {
211  PADDRESS_FILE EndPoint;
212 
213  EndPoint = AddrFile->Listener->AddressFile;
214 
215  TcpRow.dwState = MIB_TCP_STATE_LISTEN;
216  TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
217  TcpRow.dwLocalPort = AddrFile->Port;
218  TcpRow.dwRemoteAddr = EndPoint->Address.Address.IPv4Address;
219  TcpRow.dwRemotePort = EndPoint->Port;
220 
222  }
223  else if (AddrFile->Connection != NULL &&
224  AddrFile->Connection->SocketContext != NULL)
225  {
226  TA_IP_ADDRESS EndPoint;
227 
228  Status = TCPGetSockAddress(AddrFile->Connection, (PTRANSPORT_ADDRESS)&EndPoint, FALSE);
229  if (NT_SUCCESS(Status))
230  {
231  ASSERT(EndPoint.TAAddressCount >= 1);
232  ASSERT(EndPoint.Address[0].AddressLength == TDI_ADDRESS_LENGTH_IP);
233  TcpRow.dwLocalAddr = EndPoint.Address[0].Address[0].in_addr;
234  TcpRow.dwLocalPort = ntohs(EndPoint.Address[0].Address[0].sin_port);
235 
236  Status = TCPGetSockAddress(AddrFile->Connection, (PTRANSPORT_ADDRESS)&EndPoint, TRUE);
237  if (NT_SUCCESS(Status))
238  {
239  ASSERT(EndPoint.TAAddressCount >= 1);
240  ASSERT(EndPoint.Address[0].AddressLength == TDI_ADDRESS_LENGTH_IP);
241  TcpRow.dwRemoteAddr = EndPoint.Address[0].Address[0].in_addr;
242  TcpRow.dwRemotePort = ntohs(EndPoint.Address[0].Address[0].sin_port);
243 
244  Status = TCPGetSocketStatus(AddrFile->Connection, &TcpRow.dwState);
246  }
247  }
248  }
249 
250  if (NT_SUCCESS(Status))
251  {
252  if (Class == TcpUdpClassOwner)
253  {
254  RtlZeroMemory(&TcpRow.OwningModuleInfo[0], sizeof(TcpRow.OwningModuleInfo));
255  TcpRow.OwningModuleInfo[0] = (ULONG_PTR)AddrFile->SubProcessTag;
256  }
257 
258  Status = InfoCopyOut( (PCHAR)&TcpRow, Size,
259  Buffer, BufferSize );
260  }
261 
262  TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
263 
264  return Status;
265 }
signed char * PCHAR
Definition: retypes.h:7
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
LONG TAAddressCount
Definition: tdi.h:523
IPv4_RAW_ADDRESS IPv4Address
Definition: ip.h:26
#define TRUE
Definition: types.h:120
#define TDI_SUCCESS
Definition: tdistat.h:30
NTSTATUS TCPGetSocketStatus(PCONNECTION_ENDPOINT Connection, PULONG State)
Definition: tcp.c:695
struct _MIB_TCPROW_OWNER_MODULE MIB_TCPROW_OWNER_MODULE
#define HandleToUlong(h)
Definition: basetsd.h:79
LONG TDI_STATUS
Definition: tdi.h:36
HANDLE ProcessId
Definition: titypes.h:157
NTSTATUS TCPGetSockAddress(PCONNECTION_ENDPOINT Connection, PTRANSPORT_ADDRESS TransportAddress, BOOLEAN RemoteAddress)
Definition: tcp.c:602
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
struct _TA_ADDRESS_IP::_AddrIp Address[1]
#define ntohs(n)
Definition: ninfo.c:180
ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]
Definition: tcpmib.h:127
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LARGE_INTEGER liCreateTimestamp
Definition: tcpmib.h:126
#define BufferSize
Definition: classpnp.h:419
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct _MIB_TCPROW_OWNER_PID MIB_TCPROW_OWNER_PID
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
struct _CONNECTION_ENDPOINT * Listener
Definition: titypes.h:153
Status
Definition: gdiplustypes.h:24
PVOID SubProcessTag
Definition: titypes.h:158
ULONG_PTR SIZE_T
Definition: typedefs.h:78
IP_ADDRESS Address
Definition: titypes.h:136
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
struct _CONNECTION_ENDPOINT * Connection
Definition: titypes.h:151
USHORT Port
Definition: titypes.h:139
#define TDI_ADDRESS_LENGTH_IP
Definition: tdi.h:413
union IP_ADDRESS::@990 Address
#define DEBUG_INFO
Definition: debug.h:33
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
struct _MIB_TCPROW MIB_TCPROW
LARGE_INTEGER CreationTime
Definition: titypes.h:159

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetConnectionUdpTable()

TDI_STATUS InfoTdiQueryGetConnectionUdpTable ( PADDRESS_FILE  AddrFile,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize,
TDI_TCPUDP_CLASS_INFO  Class 
)

Definition at line 267 of file ninfo.c.

271 {
272  SIZE_T Size;
275 
276  TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
277 
278  if (Class == TcpUdpClassOwnerPid)
279  {
280  Size = sizeof(MIB_UDPROW_OWNER_PID);
281  }
282  else if (Class == TcpUdpClassOwner)
283  {
284  Size = sizeof(MIB_UDPROW_OWNER_MODULE);
285  }
286  else
287  {
288  Size = sizeof(MIB_UDPROW);
289  }
290 
291  UdpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
292  UdpRow.dwLocalPort = AddrFile->Port;
293  UdpRow.dwOwningPid = HandleToUlong(AddrFile->ProcessId);
294  UdpRow.liCreateTimestamp = AddrFile->CreationTime;
295  UdpRow.dwFlags = 0; /* FIXME */
296  if (Class == TcpUdpClassOwner)
297  {
298  RtlZeroMemory(&UdpRow.OwningModuleInfo[0], sizeof(UdpRow.OwningModuleInfo));
299  UdpRow.OwningModuleInfo[0] = (ULONG_PTR)AddrFile->SubProcessTag;
300  }
301 
302  Status = InfoCopyOut( (PCHAR)&UdpRow,
303  Size, Buffer, BufferSize );
304 
305  TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
306 
307  return Status;
308 }
signed char * PCHAR
Definition: retypes.h:7
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
IPv4_RAW_ADDRESS IPv4Address
Definition: ip.h:26
struct _MIB_UDPROW MIB_UDPROW
ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]
Definition: udpmib.h:65
#define HandleToUlong(h)
Definition: basetsd.h:79
struct _MIB_UDPROW_OWNER_PID MIB_UDPROW_OWNER_PID
LONG TDI_STATUS
Definition: tdi.h:36
HANDLE ProcessId
Definition: titypes.h:157
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
Definition: bufpool.h:45
LARGE_INTEGER liCreateTimestamp
Definition: udpmib.h:56
#define BufferSize
Definition: classpnp.h:419
struct _MIB_UDPROW_OWNER_MODULE MIB_UDPROW_OWNER_MODULE
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
PVOID SubProcessTag
Definition: titypes.h:158
ULONG_PTR SIZE_T
Definition: typedefs.h:78
IP_ADDRESS Address
Definition: titypes.h:136
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
USHORT Port
Definition: titypes.h:139
union IP_ADDRESS::@990 Address
#define DEBUG_INFO
Definition: debug.h:33
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
LARGE_INTEGER CreationTime
Definition: titypes.h:159

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetInterfaceMIB()

TDI_STATUS InfoTdiQueryGetInterfaceMIB ( TDIEntityID  ID,
PIP_INTERFACE  Interface,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize 
)

Definition at line 18 of file iinfo.c.

21  {
23  IFEntry* OutData;
24  PLAN_ADAPTER IF;
25  PCHAR IFDescr;
26  ULONG Size;
27  NDIS_STATUS NdisStatus;
28 
29  if (!Interface)
30  return TDI_INVALID_PARAMETER;
31 
33 
35  ("Getting IFEntry MIB (IF %08x LA %08x) (%04x:%d)\n",
36  Interface, IF, ID.tei_entity, ID.tei_instance));
37 
39 
40  if( !OutData ) return TDI_NO_RESOURCES; /* Out of memory */
41 
43 
44  OutData->if_index = Interface->Index;
45  /* viz: tcpip keeps those indices */
46  OutData->if_type = Interface ==
48  OutData->if_mtu = Interface->MTU;
50  ("Getting interface speed\n"));
51  OutData->if_physaddrlen = Interface->AddressLength;
53  /* NDIS_HARDWARE_STATUS -> ROUTER_CONNECTION_STATE */
55 
56  IFDescr = (PCHAR)&OutData->if_descr[0];
57 
58  if( IF ) {
61  ("IF Speed = %d * 100bps\n", OutData->if_speed));
62  memcpy(OutData->if_physaddr, Interface->Address, Interface->AddressLength);
63  TI_DbgPrint(DEBUG_INFO, ("Got HWAddr\n"));
64 
65  memcpy(&OutData->if_inoctets, &Interface->Stats, sizeof(SEND_RECV_STATS));
66 
67  NdisStatus = NDISCall(IF,
70  &OutData->if_outerrors,
71  sizeof(ULONG));
72  if (NdisStatus != NDIS_STATUS_SUCCESS)
73  OutData->if_outerrors = 0;
74 
75  TI_DbgPrint(DEBUG_INFO, ("OutErrors = %d\n", OutData->if_outerrors));
76 
77  NdisStatus = NDISCall(IF,
80  &OutData->if_inerrors,
81  sizeof(ULONG));
82  if (NdisStatus != NDIS_STATUS_SUCCESS)
83  OutData->if_inerrors = 0;
84 
85  TI_DbgPrint(DEBUG_INFO, ("InErrors = %d\n", OutData->if_inerrors));
86  }
87 
89 
90  TI_DbgPrint(DEBUG_INFO, ("Copied in name %s\n", IFDescr));
91  OutData->if_descrlen = strlen(IFDescr);
92  Size = FIELD_OFFSET(IFEntry, if_descr[OutData->if_descrlen + 1]);
93 
94  TI_DbgPrint(DEBUG_INFO, ("Finished IFEntry MIB (%04x:%d) size %d\n",
95  ID.tei_entity, ID.tei_instance, Size));
96 
97  Status = InfoCopyOut( (PCHAR)OutData, Size, Buffer, BufferSize );
98  ExFreePoolWithTag( OutData, OUT_DATA_TAG );
99 
100  TI_DbgPrint(DEBUG_INFO,("Returning %x\n", Status));
101 
102  return Status;
103 }
signed char * PCHAR
Definition: retypes.h:7
PVOID Context
Definition: lan.h:64
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
ULONG if_descrlen
Definition: tcpioctl.h:126
NDIS_STATUS NDISCall(PLAN_ADAPTER Adapter, NDIS_REQUEST_TYPE Type, NDIS_OID OID, PVOID Buffer, UINT Length)
Send a request to NDIS.
Definition: lan.c:29
ULONG if_inoctets
Definition: tcpioctl.h:114
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
ULONG if_physaddrlen
Definition: tcpioctl.h:109
#define OID_GEN_RCV_ERROR
Definition: ntddndis.h:270
LONG TDI_STATUS
Definition: tdi.h:36
ULONG if_index
Definition: tcpioctl.h:105
ULONG if_operstatus
Definition: tcpioctl.h:112
ULONG if_outerrors
Definition: tcpioctl.h:124
bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: CFontExt.cpp:34
#define MIB_IF_TYPE_LOOPBACK
Definition: ipifcons.h:227
PIP_INTERFACE Loopback
Definition: loopback.c:13
int NDIS_STATUS
Definition: ntddndis.h:471
ULONG if_type
Definition: tcpioctl.h:106
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
Definition: bufpool.h:45
ULONG if_mtu
Definition: tcpioctl.h:107
ULONG if_speed
Definition: tcpioctl.h:108
#define MIB_IF_ADMIN_STATUS_UP
Definition: ipifcons.h:232
#define PCHAR
Definition: match.c:90
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
struct LAN_ADAPTER * PLAN_ADAPTER
#define MIB_IF_TYPE_ETHERNET
Definition: ipifcons.h:223
#define BufferSize
Definition: classpnp.h:419
NTSTATUS GetInterfaceSpeed(PIP_INTERFACE Interface, PUINT Speed)
Definition: interface.c:62
ULONG if_inerrors
Definition: tcpioctl.h:118
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ID
Definition: ruserpass.c:36
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
ULONG if_adminstatus
Definition: tcpioctl.h:111
#define OID_GEN_XMIT_ERROR
Definition: ntddndis.h:269
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
VOID GetInterfaceConnectionStatus(PIP_INTERFACE Interface, PULONG OperStatus)
Definition: interface.c:254
#define TDI_NO_RESOURCES
Definition: tdistat.h:31
#define MAX_ADAPTER_DESCRIPTION_LENGTH
Definition: iinfo.c:16
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define OUT_DATA_TAG
Definition: tags.h:39
UCHAR if_physaddr[MAX_PHYSADDR_SIZE]
Definition: tcpioctl.h:110
#define DEBUG_INFO
Definition: debug.h:33
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
UCHAR if_descr[1]
Definition: tcpioctl.h:127
unsigned int * PUINT
Definition: ndis.h:50

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetIPSnmpInfo()

TDI_STATUS InfoTdiQueryGetIPSnmpInfo ( TDIEntityID  ID,
PIP_INTERFACE  IF,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize 
)

Definition at line 155 of file ninfo.c.

158  {
159  IPSNMPInfo SnmpInfo;
160  UINT IfCount = CountInterfaces();
161  UINT RouteCount = CountFIBs(IF);
163 
164  TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
165 
166  RtlZeroMemory(&SnmpInfo, sizeof(SnmpInfo));
167 
168  SnmpInfo.ipsi_numif = IfCount;
169  SnmpInfo.ipsi_numaddr = 1;
170  SnmpInfo.ipsi_numroutes = RouteCount;
171 
172  Status = InfoCopyOut( (PCHAR)&SnmpInfo, sizeof(SnmpInfo),
173  Buffer, BufferSize );
174 
175  TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
176 
177  return Status;
178 }
signed char * PCHAR
Definition: retypes.h:7
UINT CountInterfaces(VOID)
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
ULONG ipsi_numaddr
Definition: tcpioctl.h:153
LONG TDI_STATUS
Definition: tdi.h:36
UINT CountFIBs(PIP_INTERFACE IF)
Definition: router.c:101
ULONG ipsi_numroutes
Definition: tcpioctl.h:154
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
Definition: bufpool.h:45
ULONG ipsi_numif
Definition: tcpioctl.h:152
#define BufferSize
Definition: classpnp.h:419
Status
Definition: gdiplustypes.h:24
unsigned int UINT
Definition: ndis.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define DEBUG_INFO
Definition: debug.h:33
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryGetRouteTable()

TDI_STATUS InfoTdiQueryGetRouteTable ( PIP_INTERFACE  IF,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize 
)

Definition at line 17 of file ninfo.c.

17  {
19  KIRQL OldIrql;
20  UINT RtCount = CountFIBs(IF);
21  UINT Size = sizeof( IPROUTE_ENTRY ) * RtCount;
22  PFIB_ENTRY RCache, RCacheCur;
23  PIPROUTE_ENTRY RouteEntries, RtCurrent;
24  UINT i;
25 
26  TI_DbgPrint(DEBUG_INFO, ("Called, routes = %d\n",
27  RtCount));
28 
29  if (RtCount == 0)
30  return InfoCopyOut(NULL, 0, NULL, BufferSize);
31 
33  RtCurrent = RouteEntries;
34 
35  RCache = ExAllocatePoolWithTag( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount, FIB_TAG );
36  RCacheCur = RCache;
37 
38  if( !RCache || !RouteEntries ) {
39  if( RCache ) ExFreePoolWithTag( RCache, FIB_TAG );
40  if( RouteEntries ) ExFreePoolWithTag( RouteEntries, ROUTE_ENTRY_TAG );
41  return TDI_NO_RESOURCES;
42  }
43 
44  RtlZeroMemory( RouteEntries, Size );
45 
46  RtCount = CopyFIBs( IF, RCache );
47 
48  while( RtCurrent < RouteEntries + RtCount ) {
49  ASSERT(RCacheCur->Router);
50 
51  RtlCopyMemory( &RtCurrent->Dest,
52  &RCacheCur->NetworkAddress.Address,
53  sizeof(RtCurrent->Dest) );
54  RtlCopyMemory( &RtCurrent->Mask,
55  &RCacheCur->Netmask.Address,
56  sizeof(RtCurrent->Mask) );
57  RtlCopyMemory( &RtCurrent->Gw,
58  &RCacheCur->Router->Address.Address,
59  sizeof(RtCurrent->Gw) );
60 
61  RtCurrent->Metric1 = RCacheCur->Metric;
62  RtCurrent->Type = TDI_ADDRESS_TYPE_IP;
63 
65  (DEBUG_INFO,
66  ("%d: NA %08x NM %08x GW %08x MT %x\n",
67  RtCurrent - RouteEntries,
68  RtCurrent->Dest,
69  RtCurrent->Mask,
70  RtCurrent->Gw,
71  RtCurrent->Metric1 ));
72 
74  for (i = 0; i < EntityCount; i++)
75  if (EntityList[i].context == IF)
76  break;
77 
78  if (i < EntityCount)
79  RtCurrent->Index = EntityList[i].tei_instance;
80  else
81  RtCurrent->Index = 0;
82 
84 
85  RtCurrent++; RCacheCur++;
86  }
87 
88  Status = InfoCopyOut( (PCHAR)RouteEntries, Size, Buffer, BufferSize );
89 
90  ExFreePoolWithTag( RouteEntries, ROUTE_ENTRY_TAG );
91  ExFreePoolWithTag( RCache, FIB_TAG );
92 
93  TI_DbgPrint(DEBUG_INFO, ("Returning %08x\n", Status));
94 
95  return Status;
96 }
signed char * PCHAR
Definition: retypes.h:7
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
ULONG Metric1
Definition: info.h:46
ULONG EntityCount
Definition: main.c:24
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
KSPIN_LOCK EntityListLock
Definition: main.c:22
Definition: http.c:7098
#define FIB_TAG
Definition: tags.h:29
TDIEntityInfo * EntityList
Definition: main.c:23
IP_ADDRESS NetworkAddress
Definition: router.h:17
LONG TDI_STATUS
Definition: tdi.h:36
#define ROUTE_ENTRY_TAG
Definition: tags.h:38
UINT CountFIBs(PIP_INTERFACE IF)
Definition: router.c:101
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
TDI_STATUS InfoCopyOut(PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize)
Definition: info.c:97
IP_ADDRESS Netmask
Definition: router.h:18
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
ULONG Dest
Definition: info.h:44
ULONG Index
Definition: info.h:45
UINT Metric
Definition: router.h:20
UINT tei_instance
Definition: tcpip.h:147
ULONG Mask
Definition: info.h:54
#define BufferSize
Definition: classpnp.h:419
Definition: info.h:43
ULONG Gw
Definition: info.h:50
struct IPROUTE_ENTRY IPROUTE_ENTRY
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
PNEIGHBOR_CACHE_ENTRY Router
Definition: router.h:19
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define TDI_ADDRESS_TYPE_IP
Definition: tdi.h:345
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
ULONG Type
Definition: info.h:51
unsigned int UINT
Definition: ndis.h:50
#define TDI_NO_RESOURCES
Definition: tdistat.h:31
IP_ADDRESS Address
Definition: neighbor.h:36
Definition: router.h:14
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
UINT CopyFIBs(PIP_INTERFACE IF, PFIB_ENTRY Target)
Definition: router.c:120
union IP_ADDRESS::@990 Address
#define DEBUG_INFO
Definition: debug.h:33

Referenced by InfoTdiQueryInformationEx().

◆ InfoTdiQueryInformationEx()

TDI_STATUS InfoTdiQueryInformationEx ( PTDI_REQUEST  Request,
TDIObjectID ID,
PNDIS_BUFFER  Buffer,
PUINT  BufferSize,
PVOID  Context 
)

Definition at line 215 of file info.c.

233 {
234  PVOID EntityListContext;
235 
237  ("InfoEx Req: %x %x %x!%04x:%d\n",
238  ID->toi_class,
239  ID->toi_type,
240  ID->toi_id,
241  ID->toi_entity.tei_entity,
242  ID->toi_entity.tei_instance));
243 
244  switch (ID->toi_class)
245  {
246  case INFO_CLASS_GENERIC:
247  switch (ID->toi_id)
248  {
249  case ENTITY_LIST_ID:
250  if (ID->toi_type != INFO_TYPE_PROVIDER)
251  return TDI_INVALID_PARAMETER;
252 
254 
255  case ENTITY_TYPE_ID:
256  if (ID->toi_type != INFO_TYPE_PROVIDER)
257  return TDI_INVALID_PARAMETER;
258 
259  return InfoTdiQueryEntityType(ID->toi_entity, Buffer, BufferSize);
260 
261  default:
262  return TDI_INVALID_REQUEST;
263  }
264 
265  case INFO_CLASS_PROTOCOL:
266  if (ID->toi_type == INFO_TYPE_ADDRESS_OBJECT)
267  {
268  if ((EntityListContext = GetContext(ID->toi_entity)))
269  return GetAddressFileInfo(ID, EntityListContext, Buffer, BufferSize);
270  else
271  return TDI_INVALID_PARAMETER;
272  }
273 
274  switch (ID->toi_id)
275  {
276  case IF_MIB_STATS_ID:
277  if (ID->toi_type != INFO_TYPE_PROVIDER)
278  return TDI_INVALID_PARAMETER;
279 
280  if (ID->toi_entity.tei_entity == IF_ENTITY)
281  if ((EntityListContext = GetContext(ID->toi_entity)))
282  return InfoTdiQueryGetInterfaceMIB(ID->toi_entity, EntityListContext, Buffer, BufferSize);
283  else
284  return TDI_INVALID_PARAMETER;
285  else if (ID->toi_entity.tei_entity == CL_NL_ENTITY ||
286  ID->toi_entity.tei_entity == CO_NL_ENTITY)
287  if ((EntityListContext = GetContext(ID->toi_entity)))
288  return InfoTdiQueryGetIPSnmpInfo(ID->toi_entity, EntityListContext, Buffer, BufferSize);
289  else
290  return TDI_INVALID_PARAMETER;
291  else if (ID->toi_entity.tei_entity == AT_ENTITY)
292  if ((EntityListContext = GetContext(ID->toi_entity)))
293  return InfoTdiQueryGetATInfo(ID->toi_entity, EntityListContext, Buffer, BufferSize);
294  else
295  return TDI_INVALID_PARAMETER;
296  else
297  return TDI_INVALID_PARAMETER;
298 
300  if (ID->toi_type != INFO_TYPE_PROVIDER)
301  return TDI_INVALID_PARAMETER;
302 
303  if (ID->toi_entity.tei_entity == CL_NL_ENTITY ||
304  ID->toi_entity.tei_entity == CO_NL_ENTITY)
305  return InfoTdiQueryGetAddrTable(ID->toi_entity, Buffer, BufferSize);
306  else if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
307  if ((EntityListContext = GetContext(ID->toi_entity)))
309  else
310  return TDI_INVALID_PARAMETER;
311  else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)
312  if ((EntityListContext = GetContext(ID->toi_entity)))
314  else
315  return TDI_INVALID_PARAMETER;
316  else
317  return TDI_INVALID_PARAMETER;
318 
320  if (ID->toi_type != INFO_TYPE_PROVIDER)
321  return TDI_INVALID_PARAMETER;
322 
323  if (ID->toi_entity.tei_entity == AT_ENTITY)
324  if ((EntityListContext = GetContext(ID->toi_entity)))
325  return InfoTdiQueryGetArptableMIB(ID->toi_entity, EntityListContext,
326  Buffer, BufferSize);
327  else
328  return TDI_INVALID_PARAMETER;
329  else if (ID->toi_entity.tei_entity == CO_NL_ENTITY ||
330  ID->toi_entity.tei_entity == CL_NL_ENTITY)
331  if ((EntityListContext = GetContext(ID->toi_entity)))
332  return InfoTdiQueryGetRouteTable(EntityListContext, Buffer, BufferSize);
333  else
334  return TDI_INVALID_PARAMETER;
335  else if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
336  if ((EntityListContext = GetContext(ID->toi_entity)))
338  else
339  return TDI_INVALID_PARAMETER;
340  else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)
341  if ((EntityListContext = GetContext(ID->toi_entity)))
343  else
344  return TDI_INVALID_PARAMETER;
345  else
346  return TDI_INVALID_PARAMETER;
347 
348  case IP_SPECIFIC_MODULE_ENTRY_ID:
349  if (ID->toi_type != INFO_TYPE_PROVIDER)
350  return TDI_INVALID_PARAMETER;
351 
352  if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
353  if ((EntityListContext = GetContext(ID->toi_entity)))
355  else
356  return TDI_INVALID_PARAMETER;
357  else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)
358  if ((EntityListContext = GetContext(ID->toi_entity)))
360  else
361  return TDI_INVALID_PARAMETER;
362  else
363  return TDI_INVALID_PARAMETER;
364 
365 #if 0
366  case IP_INTFC_INFO_ID:
367  if (ID->toi_type != INFO_TYPE_PROVIDER)
368  return TDI_INVALID_PARAMETER;
369 
370  return InfoTdiQueryGetIFInfo(Context, Buffer, BufferSize);
371 #endif
372 
373  default:
374  return TDI_INVALID_REQUEST;
375  }
376 
377  default:
378  return TDI_INVALID_REQUEST;
379  }
380 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define AT_ENTITY
Definition: tdiinfo.h:41
TDI_STATUS InfoTdiQueryGetRouteTable(PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: ninfo.c:17
TDI_STATUS InfoTdiQueryGetArptableMIB(TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: iinfo.c:105
TDI_STATUS GetAddressFileInfo(TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, PUINT BufferSize)
Definition: ainfo.c:67
#define ENTITY_TYPE_ID
Definition: tdiinfo.h:39
TDI_STATUS InfoTdiQueryListEntities(PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: info.c:146
#define IP_MIB_ARPTABLE_ENTRY_ID
Definition: tcpioctl.h:51
PVOID GetContext(TDIEntityID ID)
Definition: info.c:68
TDI_STATUS InfoTdiQueryEntityType(TDIEntityID ID, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: info.c:112
#define CO_TL_ENTITY
Definition: tdiinfo.h:45
Definition: bufpool.h:45
TDI_STATUS InfoTdiQueryGetAddrTable(TDIEntityID ID, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: ninfo.c:98
TDI_STATUS InfoTdiQueryGetATInfo(TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: info.c:184
#define INFO_CLASS_GENERIC
Definition: tdiinfo.h:64
TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: iinfo.c:18
#define BufferSize
Definition: classpnp.h:419
#define IF_ENTITY
Definition: tdiinfo.h:47
#define CO_NL_ENTITY
Definition: tdiinfo.h:44
#define CL_NL_ENTITY
Definition: tdiinfo.h:42
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
#define INFO_TYPE_ADDRESS_OBJECT
Definition: tdiinfo.h:70
#define ID
Definition: ruserpass.c:36
TDI_STATUS InfoTdiQueryGetIPSnmpInfo(TDIEntityID ID, PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUINT BufferSize)
Definition: ninfo.c:155
#define IF_MIB_STATS_ID
Definition: tcpioctl.h:49
#define CL_TL_ENTITY
Definition: tdiinfo.h:43
#define ENTITY_LIST_ID
Definition: tdiinfo.h:38
#define INFO_TYPE_PROVIDER
Definition: tdiinfo.h:69
#define IP_INTFC_INFO_ID
Definition: tcpioctl.h:53
#define IP_MIB_ADDRTABLE_ENTRY_ID
Definition: afd.h:36
#define DEBUG_INFO
Definition: debug.h:33
TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile, PNDIS_BUFFER Buffer, PUINT BufferSize, TDI_TCPUDP_CLASS_INFO Class)
Definition: ninfo.c:182
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
TDI_STATUS InfoTdiQueryGetConnectionUdpTable(PADDRESS_FILE AddrFile, PNDIS_BUFFER Buffer, PUINT BufferSize, TDI_TCPUDP_CLASS_INFO Class)
Definition: ninfo.c:267
#define INFO_CLASS_PROTOCOL
Definition: tdiinfo.h:65

Referenced by DispTdiQueryInformationEx().

◆ InfoTdiSetArptableMIB()

TDI_STATUS InfoTdiSetArptableMIB ( PIP_INTERFACE  IF,
PVOID  Buffer,
UINT  BufferSize 
)

Definition at line 133 of file iinfo.c.

134 {
135  PIPARP_ENTRY ArpEntry = Buffer;
138 
139  if (!Buffer || BufferSize < sizeof(IPARP_ENTRY))
140  return TDI_INVALID_PARAMETER;
141 
142  AddrInitIPv4(&Address, ArpEntry->LogAddr);
143 
144  if ((NCE = NBLocateNeighbor(&Address, IF)))
145  NBRemoveNeighbor(NCE);
146 
147  if (NBAddNeighbor(IF,
148  &Address,
149  ArpEntry->PhysAddr,
150  ArpEntry->AddrSize,
152  0))
153  return TDI_SUCCESS;
154  else
155  return TDI_INVALID_PARAMETER;
156 }
#define TDI_SUCCESS
Definition: tdistat.h:30
Definition: neighbor.h:28
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
Definition: neighbor.c:417
#define NUD_PERMANENT
Definition: neighbor.h:42
Definition: ip.h:23
UCHAR PhysAddr[8]
Definition: info.h:38
static WCHAR Address[46]
Definition: ping.c:68
Definition: bufpool.h:45
VOID NBRemoveNeighbor(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:590
#define AddrInitIPv4(IPAddress, RawAddress)
Definition: address.h:16
#define BufferSize
Definition: classpnp.h:419
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, UCHAR Type, UINT EventTimer)
Definition: neighbor.c:273
ULONG LogAddr
Definition: info.h:39
Definition: info.h:35
ULONG AddrSize
Definition: info.h:37
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34

Referenced by InfoTdiSetInformationEx().

◆ InfoTdiSetInformationEx()

TDI_STATUS InfoTdiSetInformationEx ( PTDI_REQUEST  Request,
TDIObjectID ID,
PVOID  Buffer,
UINT  BufferSize 
)

Definition at line 383 of file info.c.

397 {
398  PVOID EntityListContext;
399 
400  switch (ID->toi_class)
401  {
402  case INFO_CLASS_PROTOCOL:
403  {
404  switch (ID->toi_type)
405  {
407  {
408  if ((EntityListContext = GetContext(ID->toi_entity)))
409  return SetAddressFileInfo(ID, EntityListContext, Buffer, BufferSize);
410  else
411  return TDI_INVALID_PARAMETER;
412  }
414  {
415  PADDRESS_FILE AddressFile = GetContext(ID->toi_entity);
416  if (AddressFile == NULL)
417  return TDI_INVALID_PARAMETER;
418  return SetConnectionInfo(ID, AddressFile->Connection, Buffer, BufferSize);
419  }
420  case INFO_TYPE_PROVIDER:
421  {
422  switch (ID->toi_id)
423  {
425  if (ID->toi_type != INFO_TYPE_PROVIDER)
426  return TDI_INVALID_PARAMETER;
427 
428  if (ID->toi_entity.tei_entity == AT_ENTITY)
429  if ((EntityListContext = GetContext(ID->toi_entity)))
430  return InfoTdiSetArptableMIB(EntityListContext, Buffer,
431  BufferSize);
432  else
433  return TDI_INVALID_PARAMETER;
434  else if (ID->toi_entity.tei_entity == CL_NL_ENTITY
435  || ID->toi_entity.tei_entity == CO_NL_ENTITY)
436  if ((EntityListContext = GetContext(ID->toi_entity)))
437  return InfoTdiSetRoute(EntityListContext, Buffer, BufferSize);
438  else
439  return TDI_INVALID_PARAMETER;
440  else
441  return TDI_INVALID_PARAMETER;
442 
443  default:
444  return TDI_INVALID_REQUEST;
445  }
446  }
447  default:
448  DbgPrint("TCPIP: IOCTL_TCP_SET_INFORMATION_EX - Unrecognized information type for INFO_CLASS_PROTOCOL: %#x.\n", ID->toi_type);
449  return TDI_INVALID_PARAMETER;
450  }
451  break;
452  }
453  default:
454  DbgPrint("TCPIP: IOCTL_TCP_SET_INFORMATION_EX - Unrecognized information class %#x.\n", ID->toi_class);
455  return TDI_INVALID_REQUEST;
456  }
457 }
#define AT_ENTITY
Definition: tdiinfo.h:41
#define DbgPrint
Definition: loader.c:25
#define INFO_TYPE_CONNECTION
Definition: tdiinfo.h:71
#define IP_MIB_ARPTABLE_ENTRY_ID
Definition: tcpioctl.h:51
PVOID GetContext(TDIEntityID ID)
Definition: info.c:68
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define BufferSize
Definition: classpnp.h:419
#define CO_NL_ENTITY
Definition: tdiinfo.h:44
#define CL_NL_ENTITY
Definition: tdiinfo.h:42
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
#define INFO_TYPE_ADDRESS_OBJECT
Definition: tdiinfo.h:70
#define ID
Definition: ruserpass.c:36
TDI_STATUS SetConnectionInfo(TDIObjectID *ID, PCONNECTION_ENDPOINT Connection, PVOID Buffer, UINT BufferSize)
Definition: cinfo.c:11
TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
Definition: ninfo.c:310
TDI_STATUS SetAddressFileInfo(TDIObjectID *ID, PADDRESS_FILE AddrFile, PVOID Buffer, UINT BufferSize)
Definition: ainfo.c:11
#define INFO_TYPE_PROVIDER
Definition: tdiinfo.h:69
struct _CONNECTION_ENDPOINT * Connection
Definition: titypes.h:151
TDI_STATUS InfoTdiSetArptableMIB(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
Definition: iinfo.c:133
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
#define INFO_CLASS_PROTOCOL
Definition: tdiinfo.h:65

Referenced by DispTdiSetInformationEx().

◆ InfoTdiSetRoute()

TDI_STATUS InfoTdiSetRoute ( PIP_INTERFACE  IF,
PVOID  Buffer,
UINT  BufferSize 
)

Definition at line 310 of file ninfo.c.

311 {
312  IP_ADDRESS Address, Netmask, Router;
313  PIPROUTE_ENTRY Route = Buffer;
314 
315  if (!Buffer || BufferSize < sizeof(IPROUTE_ENTRY))
316  return TDI_INVALID_PARAMETER;
317 
318  AddrInitIPv4( &Address, Route->Dest );
319  AddrInitIPv4( &Netmask, Route->Mask );
320  AddrInitIPv4( &Router, Route->Gw );
321 
322  if (IF == Loopback)
323  {
324  DbgPrint("Failing attempt to add route to loopback adapter\n");
325  return TDI_INVALID_PARAMETER;
326  }
327 
328  if( Route->Type == IP_ROUTE_TYPE_ADD ) { /* Add the route */
329  TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
330  if (!RouterCreateRoute( &Address, &Netmask, &Router,
331  IF, Route->Metric1))
332  return TDI_NO_RESOURCES;
333 
334  return TDI_SUCCESS;
335  } else if( Route->Type == IP_ROUTE_TYPE_DEL ) {
336  TI_DbgPrint(DEBUG_INFO,("Removing route (%s)\n", A2S(&Address)));
337  if (NT_SUCCESS(RouterRemoveRoute( &Address, &Router )))
338  return TDI_SUCCESS;
339  else
340  return TDI_INVALID_PARAMETER;
341  }
342 
343  return TDI_INVALID_REQUEST;
344 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
ULONG Metric1
Definition: info.h:46
#define TDI_SUCCESS
Definition: tdistat.h:30
#define DbgPrint
Definition: loader.c:25
PIP_INTERFACE Loopback
Definition: loopback.c:13
Definition: ip.h:23
static WCHAR Address[46]
Definition: ping.c:68
Definition: bufpool.h:45
ULONG Dest
Definition: info.h:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define AddrInitIPv4(IPAddress, RawAddress)
Definition: address.h:16
#define IP_ROUTE_TYPE_DEL
Definition: ninfo.c:14
ULONG Mask
Definition: info.h:54
#define BufferSize
Definition: classpnp.h:419
Definition: info.h:43
ULONG Gw
Definition: info.h:50
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router)
Definition: router.c:364
#define IP_ROUTE_TYPE_ADD
Definition: ninfo.c:13
PFIB_ENTRY RouterCreateRoute(PIP_ADDRESS NetworkAddress, PIP_ADDRESS Netmask, PIP_ADDRESS RouterAddress, PIP_INTERFACE Interface, UINT Metric)
Definition: router.c:421
ULONG Type
Definition: info.h:51
#define TDI_NO_RESOURCES
Definition: tdistat.h:31
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define DEBUG_INFO
Definition: debug.h:33
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
PCHAR A2S(PIP_ADDRESS Address)
Definition: address.c:17

Referenced by InfoTdiSetInformationEx().

◆ InsertTDIInterfaceEntity()

VOID InsertTDIInterfaceEntity ( PIP_INTERFACE  Interface)

Definition at line 158 of file iinfo.c.

158  {
160 
162  (Interface != Loopback) ? AT_ARP : AT_NULL);
163 
164  /* FIXME: This is probably wrong */
166 }
#define AT_ENTITY
Definition: tdiinfo.h:41
#define CL_NL_IP
Definition: tdiinfo.h:54
PIP_INTERFACE Loopback
Definition: loopback.c:13
#define AT_NULL
Definition: tdiinfo.h:50
#define AT_ARP
Definition: tdiinfo.h:49
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
#define IF_ENTITY
Definition: tdiinfo.h:47
#define CL_NL_ENTITY
Definition: tdiinfo.h:42
VOID AddEntity(ULONG EntityType, PVOID Context, ULONG Flags)
Definition: info.c:15
#define IF_MIB
Definition: tdiinfo.h:61

Referenced by IPCreateInterface().

◆ RemoveEntityByContext()

VOID RemoveEntityByContext ( PVOID  Context)

Definition at line 46 of file info.c.

47 {
48  ULONG i;
49  KIRQL OldIrql;
50 
52 
53  for (i = 0; i < EntityCount; i++) {
54  if( EntityList[i].context == Context ) {
55  if( i != EntityCount - 1 ) {
56  memcpy( &EntityList[i],
58  sizeof(EntityList[i]) );
59  } else {
60  EntityCount--;
61  }
62  }
63  }
64 
66 }
ULONG EntityCount
Definition: main.c:24
KSPIN_LOCK EntityListLock
Definition: main.c:22
Definition: http.c:7098
TDIEntityInfo * EntityList
Definition: main.c:23
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int ULONG
Definition: retypes.h:1

Referenced by AddrFileFree(), and RemoveTDIInterfaceEntity().

◆ RemoveTDIInterfaceEntity()

VOID RemoveTDIInterfaceEntity ( PIP_INTERFACE  Interface)

Definition at line 168 of file iinfo.c.

168  {
169  /* This removes all of them */
171 }
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
VOID RemoveEntityByContext(PVOID Context)
Definition: info.c:46

Referenced by IPDestroyInterface().

◆ SetAddressFileInfo()

TDI_STATUS SetAddressFileInfo ( TDIObjectID ID,
PADDRESS_FILE  AddrFile,
PVOID  Buffer,
UINT  BufferSize 
)

Definition at line 11 of file ainfo.c.

15 {
16  KIRQL OldIrql;
17 
18  switch (ID->toi_id)
19  {
20  case AO_OPTION_TTL:
21  if (BufferSize < sizeof(UINT))
22  return TDI_INVALID_PARAMETER;
23 
24  LockObject(AddrFile, &OldIrql);
25  AddrFile->TTL = *((PUCHAR)Buffer);
26  UnlockObject(AddrFile, OldIrql);
27 
28  return TDI_SUCCESS;
29 
31  if (BufferSize < sizeof(UINT))
32  return TDI_INVALID_PARAMETER;
33 
34  LockObject(AddrFile, &OldIrql);
35  AddrFile->DF = *((PUINT)Buffer);
36  UnlockObject(AddrFile, OldIrql);
37 
38  return TDI_SUCCESS;
39 
41  if (BufferSize < sizeof(UINT))
42  return TDI_INVALID_PARAMETER;
43 
44  LockObject(AddrFile, &OldIrql);
45  AddrFile->BCast = *((PUINT)Buffer);
46  UnlockObject(AddrFile, OldIrql);
47 
48  return TDI_SUCCESS;
49 
51  if (BufferSize < sizeof(UINT))
52  return TDI_INVALID_PARAMETER;
53 
54  LockObject(AddrFile, &OldIrql);
55  AddrFile->HeaderIncl = *((PUINT)Buffer);
56  UnlockObject(AddrFile, OldIrql);
57 
58  return TDI_SUCCESS;
59 
60  default:
61  DbgPrint("Unimplemented option %x\n", ID->toi_id);
62 
63  return TDI_INVALID_REQUEST;
64  }
65 }
#define TDI_SUCCESS
Definition: tdistat.h:30
#define DbgPrint
Definition: loader.c:25
UCHAR TTL
Definition: titypes.h:141
unsigned char * PUCHAR
Definition: retypes.h:3
#define AO_OPTION_TTL
Definition: tcpioctl.h:61
#define AO_OPTION_BROADCAST
Definition: tcpioctl.h:71
#define LockObject(Object, Irql)
Definition: titypes.h:34
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define UnlockObject(Object, OldIrql)
Definition: titypes.h:54
Definition: bufpool.h:45
#define AO_OPTION_IP_HDRINCL
Definition: tcpioctl.h:72
#define BufferSize
Definition: classpnp.h:419
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
UINT HeaderIncl
Definition: titypes.h:144
#define AO_OPTION_IP_DONTFRAGMENT
Definition: tcpioctl.h:69
#define ID
Definition: ruserpass.c:36
UINT BCast
Definition: titypes.h:143
unsigned int UINT
Definition: ndis.h:50
#define TDI_INVALID_REQUEST
Definition: tdistat.h:63
unsigned int * PUINT
Definition: ndis.h:50

Referenced by InfoTdiSetInformationEx().

◆ SetConnectionInfo()

TDI_STATUS SetConnectionInfo ( TDIObjectID ID,
PCONNECTION_ENDPOINT  Connection,
PVOID  Buffer,
UINT  BufferSize 
)

Definition at line 11 of file cinfo.c.

15 {
16  ASSERT(ID->toi_type == INFO_TYPE_CONNECTION);
17  switch (ID->toi_id)
18  {
19  case TCP_SOCKET_NODELAY:
20  {
21  BOOLEAN Set;
22  if (BufferSize < sizeof(BOOLEAN))
23  return TDI_INVALID_PARAMETER;
24  Set = *(BOOLEAN*)Buffer;
25  return TCPSetNoDelay(Connection, Set);
26  }
27  default:
28  DbgPrint("TCPIP: Unknown connection info ID: %u.\n", ID->toi_id);
29  }
30 
31  return TDI_INVALID_PARAMETER;
32 }
#define DbgPrint
Definition: loader.c:25
#define INFO_TYPE_CONNECTION
Definition: tdiinfo.h:71
static BOOL Set
Definition: pageheap.c:10
unsigned char BOOLEAN
Definition: bufpool.h:45
#define TCP_SOCKET_NODELAY
Definition: tcpioctl.h:101
#define BufferSize
Definition: classpnp.h:419
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define TDI_INVALID_PARAMETER
Definition: tdistat.h:52
#define ID
Definition: ruserpass.c:36
NTSTATUS TCPSetNoDelay(PCONNECTION_ENDPOINT Connection, BOOLEAN Set)
Definition: tcp.c:680

Referenced by InfoTdiSetInformationEx().