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