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