rename net to network
[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 typedef struct IPROUTE_ENTRY {
50 ULONG Dest;
51 ULONG Index; //matches if_index in IFEntry and iae_index in IPAddrEntry
52 ULONG Metric1;
53 ULONG Metric2;
54 ULONG Metric3;
55 ULONG Metric4;
56 ULONG Gw;
57 ULONG Type;
58 ULONG Proto;
59 ULONG Age;
60 ULONG Mask;
61 ULONG Metric5;
62 ULONG Info;
63 } IPROUTE_ENTRY, *PIPROUTE_ENTRY;
64
65 typedef struct IFENTRY {
66 ULONG Index;
67 ULONG Type;
68 ULONG Mtu;
69 ULONG Speed;
70 ULONG PhysAddrLen;
71 UCHAR PhysAddr[MAX_PHYSADDR_LEN];
72 ULONG AdminStatus;
73 ULONG OperStatus;
74 ULONG LastChange;
75 ULONG InOctets;
76 ULONG InUcastPackets;
77 ULONG InNUcastPackets;
78 ULONG InDiscards;
79 ULONG InErrors;
80 ULONG InUnknownProtos;
81 ULONG OutOctets;
82 ULONG OutUcastPackets;
83 ULONG OutNUcastPackets;
84 ULONG OutDiscards;
85 ULONG OutErrors;
86 ULONG OutQLen;
87 ULONG DescrLen;
88 } IFENTRY, *PIFENTRY;
89
90 #define IP_MIB_STATS_ID 1
91 #define IF_MIB_STATS_ID 1
92
93 #ifndef IP_MIB_ROUTETABLE_ENTRY_ID
94 #define IP_MIB_ROUTETABLE_ENTRY_ID 0x101
95 #endif
96 #ifndef IP_MIB_ADDRTABLE_ENTRY_ID
97 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
98 #endif
99 #ifndef MAX_PHYSADDR_SIZE
100 #define MAX_PHYSADDR_SIZE 8
101 #endif
102
103
104 /* Only UDP is supported */
105 #define TDI_SERVICE_FLAGS (TDI_SERVICE_CONNECTIONLESS_MODE | \
106 TDI_SERVICE_BROADCAST_SUPPORTED)
107
108 #define TCP_MIB_STAT_ID 1
109 #define UDP_MIB_STAT_ID 1
110 #define TCP_MIB_TABLE_ID 0x101
111 #define UDP_MIB_TABLE_ID 0x101
112
113 #define TL_INSTANCE 0
114
115
116 typedef struct ADDRESS_INFO {
117 ULONG LocalAddress;
118 ULONG LocalPort;
119 } ADDRESS_INFO, *PADDRESS_INFO;
120
121 typedef union TDI_INFO {
122 TDI_CONNECTION_INFO ConnInfo;
123 TDI_ADDRESS_INFO AddrInfo;
124 TDI_PROVIDER_INFO ProviderInfo;
125 TDI_PROVIDER_STATISTICS ProviderStats;
126 } TDI_INFO, *PTDI_INFO;
127
128 TDI_STATUS InfoCopyOut( PCHAR DataOut, UINT SizeOut,
129 PNDIS_BUFFER ClientBuf, PUINT ClientBufSize );
130
131 TDI_STATUS InfoTdiQueryInformationEx(
132 PTDI_REQUEST Request,
133 TDIObjectID *ID,
134 PNDIS_BUFFER Buffer,
135 PUINT BufferSize,
136 PVOID Context);
137
138 TDI_STATUS InfoTdiSetInformationEx(
139 PTDI_REQUEST Request,
140 TDIObjectID *ID,
141 PVOID Buffer,
142 UINT BufferSize);
143
144 /* Network layer info functions */
145 TDI_STATUS InfoNetworkLayerTdiQueryEx( UINT InfoClass,
146 UINT InfoType,
147 UINT InfoId,
148 PVOID Context,
149 TDIEntityID *id,
150 PNDIS_BUFFER Buffer,
151 PUINT BufferSize );
152
153 TDI_STATUS InfoNetworkLayerTdiSetEx( UINT InfoClass,
154 UINT InfoType,
155 UINT InfoId,
156 PVOID Context,
157 TDIEntityID *id,
158 PCHAR Buffer,
159 UINT BufferSize );
160
161 TDI_STATUS InfoTransportLayerTdiQueryEx( 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 InfoTransportLayerTdiSetEx( UINT InfoClass,
170 UINT InfoType,
171 UINT InfoId,
172 PVOID Context,
173 TDIEntityID *id,
174 PCHAR Buffer,
175 UINT BufferSize );
176
177 TDI_STATUS InfoInterfaceTdiQueryEx( 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 InfoInterfaceTdiSetEx( UINT InfoClass,
186 UINT InfoType,
187 UINT InfoId,
188 PVOID Context,
189 TDIEntityID *id,
190 PCHAR Buffer,
191 UINT BufferSize );
192
193 /* Insert and remove interface entities */
194 VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface );
195 VOID RemoveTDIInterfaceEntity( PIP_INTERFACE Interface );
196
197 #endif /* __INFO_H */
198
199 /* EOF */