Revert r64621.
[reactos.git] / reactos / 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
12 #define MAX_PHYSADDR_LEN 8
13 #define MAX_IFDESCR_LEN 256
14
15 typedef struct IPSNMP_INFO {
16 ULONG Forwarding;
17 ULONG DefaultTTL;
18 ULONG InReceives;
19 ULONG InHdrErrors;
20 ULONG InAddrErrors;
21 ULONG ForwDatagrams;
22 ULONG InUnknownProtos;
23 ULONG InDiscards;
24 ULONG InDelivers;
25 ULONG OutRequests;
26 ULONG RoutingDiscards;
27 ULONG OutDiscards;
28 ULONG OutNoRoutes;
29 ULONG ReasmTimeout;
30 ULONG ReasmReqds;
31 ULONG ReasmOks;
32 ULONG ReasmFails;
33 ULONG FragOks;
34 ULONG FragFails;
35 ULONG FragCreates;
36 ULONG NumIf;
37 ULONG NumAddr;
38 ULONG NumRoutes;
39 } IPSNMP_INFO, *PIPSNMP_INFO;
40
41 typedef struct IPADDR_ENTRY {
42 ULONG Addr;
43 ULONG Index;
44 ULONG Mask;
45 ULONG BcastAddr;
46 ULONG ReasmSize;
47 USHORT Context;
48 USHORT Pad;
49 } IPADDR_ENTRY, *PIPADDR_ENTRY;
50
51 #define ARP_ENTRY_STATIC 4
52 #define ARP_ENTRY_DYNAMIC 3
53 #define ARP_ENTRY_INVALID 2
54 #define ARP_ENTRY_OTHER 1
55
56 typedef struct IPARP_ENTRY {
57 ULONG Index;
58 ULONG AddrSize;
59 UCHAR PhysAddr[8];
60 ULONG LogAddr;
61 ULONG Type;
62 } IPARP_ENTRY, *PIPARP_ENTRY;
63
64 typedef struct IPROUTE_ENTRY {
65 ULONG Dest;
66 ULONG Index; //matches if_index in IFEntry and iae_index in IPAddrEntry
67 ULONG Metric1;
68 ULONG Metric2;
69 ULONG Metric3;
70 ULONG Metric4;
71 ULONG Gw;
72 ULONG Type;
73 ULONG Proto;
74 ULONG Age;
75 ULONG Mask;
76 ULONG Metric5;
77 ULONG Info;
78 } IPROUTE_ENTRY, *PIPROUTE_ENTRY;
79
80 typedef struct IFENTRY {
81 ULONG Index;
82 ULONG Type;
83 ULONG Mtu;
84 ULONG Speed;
85 ULONG PhysAddrLen;
86 UCHAR PhysAddr[MAX_PHYSADDR_LEN];
87 ULONG AdminStatus;
88 ULONG OperStatus;
89 ULONG LastChange;
90 ULONG InOctets;
91 ULONG InUcastPackets;
92 ULONG InNUcastPackets;
93 ULONG InDiscards;
94 ULONG InErrors;
95 ULONG InUnknownProtos;
96 ULONG OutOctets;
97 ULONG OutUcastPackets;
98 ULONG OutNUcastPackets;
99 ULONG OutDiscards;
100 ULONG OutErrors;
101 ULONG OutQLen;
102 ULONG DescrLen;
103 } IFENTRY, *PIFENTRY;
104
105 /* Only UDP is supported */
106 #define TDI_SERVICE_FLAGS (TDI_SERVICE_CONNECTIONLESS_MODE | \
107 TDI_SERVICE_BROADCAST_SUPPORTED)
108
109 #define TCP_MIB_STAT_ID 1
110 #define UDP_MIB_STAT_ID 1
111 #define TCP_MIB_TABLE_ID 0x101
112 #define UDP_MIB_TABLE_ID 0x101
113
114 #define TL_INSTANCE 0
115
116
117 typedef struct ADDRESS_INFO {
118 ULONG LocalAddress;
119 ULONG LocalPort;
120 } ADDRESS_INFO, *PADDRESS_INFO;
121
122 typedef union TDI_INFO {
123 TDI_CONNECTION_INFO ConnInfo;
124 TDI_ADDRESS_INFO AddrInfo;
125 TDI_PROVIDER_INFO ProviderInfo;
126 TDI_PROVIDER_STATISTICS ProviderStats;
127 } TDI_INFO, *PTDI_INFO;
128
129 TDI_STATUS InfoCopyOut( PCHAR DataOut, UINT SizeOut,
130 PNDIS_BUFFER ClientBuf, PUINT ClientBufSize );
131
132 TDI_STATUS InfoTdiQueryInformationEx(
133 PTDI_REQUEST Request,
134 TDIObjectID *ID,
135 PNDIS_BUFFER Buffer,
136 PUINT BufferSize,
137 PVOID Context);
138
139 TDI_STATUS InfoTdiSetInformationEx(
140 PTDI_REQUEST Request,
141 TDIObjectID *ID,
142 PVOID Buffer,
143 UINT BufferSize);
144
145 TDI_STATUS InfoTdiQueryGetAddrTable(TDIEntityID ID,
146 PNDIS_BUFFER Buffer,
147 PUINT BufferSize);
148
149 TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID,
150 PIP_INTERFACE Interface,
151 PNDIS_BUFFER Buffer,
152 PUINT BufferSize);
153
154 TDI_STATUS InfoTdiQueryGetIPSnmpInfo( TDIEntityID ID,
155 PIP_INTERFACE IF,
156 PNDIS_BUFFER Buffer,
157 PUINT BufferSize );
158
159 TDI_STATUS InfoTdiQueryGetRouteTable( PIP_INTERFACE IF,
160 PNDIS_BUFFER Buffer,
161 PUINT BufferSize );
162
163 TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
164 PVOID Buffer,
165 UINT BufferSize);
166
167 TDI_STATUS InfoTdiSetArptableMIB(PIP_INTERFACE IF,
168 PVOID Buffer,
169 UINT BufferSize);
170
171 TDI_STATUS InfoTdiQueryGetArptableMIB(TDIEntityID ID,
172 PIP_INTERFACE Interface,
173 PNDIS_BUFFER Buffer,
174 PUINT BufferSize);
175
176 TDI_STATUS SetAddressFileInfo(TDIObjectID *ID,
177 PADDRESS_FILE AddrFile,
178 PVOID Buffer,
179 UINT BufferSize);
180
181 TDI_STATUS GetAddressFileInfo(TDIObjectID *ID,
182 PADDRESS_FILE AddrFile,
183 PVOID Buffer,
184 PUINT BufferSize);
185
186 /* Insert and remove entities */
187 VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface );
188
189 VOID RemoveTDIInterfaceEntity( PIP_INTERFACE Interface );
190
191 VOID AddEntity(ULONG EntityType,
192 PVOID Context,
193 ULONG Flags);
194
195 VOID RemoveEntityByContext(PVOID Context);
196
197 /* EOF */