[TCPIP] Implement returning TCP connections
[reactos.git] / drivers / network / tcpip / include / info.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/info.h
5 * PURPOSE: TdiQueryInformation definitions
6 */
7
8 #pragma once
9
10 #include <tcpioctl.h>
11 /* FIXME */
12 #define DWORD ULONG
13 #include <in6addr.h>
14 #include <tcpmib.h>
15
16 #define MAX_PHYSADDR_LEN 8
17 #define MAX_IFDESCR_LEN 256
18
19 typedef struct IPADDR_ENTRY {
20 ULONG Addr;
21 ULONG Index;
22 ULONG Mask;
23 ULONG BcastAddr;
24 ULONG ReasmSize;
25 USHORT Context;
26 USHORT Pad;
27 } IPADDR_ENTRY, *PIPADDR_ENTRY;
28
29 #define ARP_ENTRY_STATIC 4
30 #define ARP_ENTRY_DYNAMIC 3
31 #define ARP_ENTRY_INVALID 2
32 #define ARP_ENTRY_OTHER 1
33
34 typedef struct IPARP_ENTRY {
35 ULONG Index;
36 ULONG AddrSize;
37 UCHAR PhysAddr[8];
38 ULONG LogAddr;
39 ULONG Type;
40 } IPARP_ENTRY, *PIPARP_ENTRY;
41
42 typedef struct IPROUTE_ENTRY {
43 ULONG Dest;
44 ULONG Index; //matches if_index in IFEntry and iae_index in IPAddrEntry
45 ULONG Metric1;
46 ULONG Metric2;
47 ULONG Metric3;
48 ULONG Metric4;
49 ULONG Gw;
50 ULONG Type;
51 ULONG Proto;
52 ULONG Age;
53 ULONG Mask;
54 ULONG Metric5;
55 ULONG Info;
56 } IPROUTE_ENTRY, *PIPROUTE_ENTRY;
57
58 /* Only UDP is supported */
59 #define TDI_SERVICE_FLAGS (TDI_SERVICE_CONNECTIONLESS_MODE | \
60 TDI_SERVICE_BROADCAST_SUPPORTED)
61
62 #define TCP_MIB_STAT_ID 1
63 #define UDP_MIB_STAT_ID 1
64 #define TCP_MIB_TABLE_ID 0x101
65 #define UDP_MIB_TABLE_ID 0x101
66
67 #define TL_INSTANCE 0
68
69
70 typedef struct ADDRESS_INFO {
71 ULONG LocalAddress;
72 ULONG LocalPort;
73 } ADDRESS_INFO, *PADDRESS_INFO;
74
75 typedef union TDI_INFO {
76 TDI_CONNECTION_INFO ConnInfo;
77 TDI_ADDRESS_INFO AddrInfo;
78 TDI_PROVIDER_INFO ProviderInfo;
79 TDI_PROVIDER_STATISTICS ProviderStats;
80 } TDI_INFO, *PTDI_INFO;
81
82 TDI_STATUS InfoCopyOut( PCHAR DataOut, UINT SizeOut,
83 PNDIS_BUFFER ClientBuf, PUINT ClientBufSize );
84
85 TDI_STATUS InfoTdiQueryInformationEx(
86 PTDI_REQUEST Request,
87 TDIObjectID *ID,
88 PNDIS_BUFFER Buffer,
89 PUINT BufferSize,
90 PVOID Context);
91
92 TDI_STATUS InfoTdiSetInformationEx(
93 PTDI_REQUEST Request,
94 TDIObjectID *ID,
95 PVOID Buffer,
96 UINT BufferSize);
97
98 TDI_STATUS InfoTdiQueryGetAddrTable(TDIEntityID ID,
99 PNDIS_BUFFER Buffer,
100 PUINT BufferSize);
101
102 TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID,
103 PIP_INTERFACE Interface,
104 PNDIS_BUFFER Buffer,
105 PUINT BufferSize);
106
107 TDI_STATUS InfoTdiQueryGetIPSnmpInfo( TDIEntityID ID,
108 PIP_INTERFACE IF,
109 PNDIS_BUFFER Buffer,
110 PUINT BufferSize );
111
112 TDI_STATUS InfoTdiQueryGetRouteTable( PIP_INTERFACE IF,
113 PNDIS_BUFFER Buffer,
114 PUINT BufferSize );
115
116 TDI_STATUS InfoTdiQueryGetConnectionTcpTable( PADDRESS_FILE AddrFile,
117 PNDIS_BUFFER Buffer,
118 PUINT BufferSize);
119
120 TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
121 PVOID Buffer,
122 UINT BufferSize);
123
124 TDI_STATUS InfoTdiSetArptableMIB(PIP_INTERFACE IF,
125 PVOID Buffer,
126 UINT BufferSize);
127
128 TDI_STATUS InfoTdiQueryGetArptableMIB(TDIEntityID ID,
129 PIP_INTERFACE Interface,
130 PNDIS_BUFFER Buffer,
131 PUINT BufferSize);
132
133 TDI_STATUS SetAddressFileInfo(TDIObjectID *ID,
134 PADDRESS_FILE AddrFile,
135 PVOID Buffer,
136 UINT BufferSize);
137
138 TDI_STATUS GetAddressFileInfo(TDIObjectID *ID,
139 PADDRESS_FILE AddrFile,
140 PVOID Buffer,
141 PUINT BufferSize);
142
143 TDI_STATUS SetConnectionInfo(TDIObjectID *ID,
144 PCONNECTION_ENDPOINT Connection,
145 PVOID Buffer,
146 UINT BufferSize);
147
148 /* Insert and remove entities */
149 VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface );
150
151 VOID RemoveTDIInterfaceEntity( PIP_INTERFACE Interface );
152
153 VOID AddEntity(ULONG EntityType,
154 PVOID Context,
155 ULONG Flags);
156
157 VOID RemoveEntityByContext(PVOID Context);
158
159 /* EOF */