[TCPIP] Implement returning UDP 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 #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 TDI_STATUS InfoCopyOut( PCHAR DataOut, UINT SizeOut,
84 PNDIS_BUFFER ClientBuf, PUINT ClientBufSize );
85
86 TDI_STATUS InfoTdiQueryInformationEx(
87 PTDI_REQUEST Request,
88 TDIObjectID *ID,
89 PNDIS_BUFFER Buffer,
90 PUINT BufferSize,
91 PVOID Context);
92
93 TDI_STATUS InfoTdiSetInformationEx(
94 PTDI_REQUEST Request,
95 TDIObjectID *ID,
96 PVOID Buffer,
97 UINT BufferSize);
98
99 TDI_STATUS InfoTdiQueryGetAddrTable(TDIEntityID ID,
100 PNDIS_BUFFER Buffer,
101 PUINT BufferSize);
102
103 TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID,
104 PIP_INTERFACE Interface,
105 PNDIS_BUFFER Buffer,
106 PUINT BufferSize);
107
108 TDI_STATUS InfoTdiQueryGetIPSnmpInfo( TDIEntityID ID,
109 PIP_INTERFACE IF,
110 PNDIS_BUFFER Buffer,
111 PUINT BufferSize );
112
113 TDI_STATUS InfoTdiQueryGetRouteTable( PIP_INTERFACE IF,
114 PNDIS_BUFFER Buffer,
115 PUINT BufferSize );
116
117 TDI_STATUS InfoTdiQueryGetConnectionTcpTable( PADDRESS_FILE AddrFile,
118 PNDIS_BUFFER Buffer,
119 PUINT BufferSize);
120
121 TDI_STATUS InfoTdiQueryGetConnectionUdpTable( PADDRESS_FILE AddrFile,
122 PNDIS_BUFFER Buffer,
123 PUINT BufferSize);
124
125 TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF,
126 PVOID Buffer,
127 UINT BufferSize);
128
129 TDI_STATUS InfoTdiSetArptableMIB(PIP_INTERFACE IF,
130 PVOID Buffer,
131 UINT BufferSize);
132
133 TDI_STATUS InfoTdiQueryGetArptableMIB(TDIEntityID ID,
134 PIP_INTERFACE Interface,
135 PNDIS_BUFFER Buffer,
136 PUINT BufferSize);
137
138 TDI_STATUS SetAddressFileInfo(TDIObjectID *ID,
139 PADDRESS_FILE AddrFile,
140 PVOID Buffer,
141 UINT BufferSize);
142
143 TDI_STATUS GetAddressFileInfo(TDIObjectID *ID,
144 PADDRESS_FILE AddrFile,
145 PVOID Buffer,
146 PUINT BufferSize);
147
148 TDI_STATUS SetConnectionInfo(TDIObjectID *ID,
149 PCONNECTION_ENDPOINT Connection,
150 PVOID Buffer,
151 UINT BufferSize);
152
153 /* Insert and remove entities */
154 VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface );
155
156 VOID RemoveTDIInterfaceEntity( PIP_INTERFACE Interface );
157
158 VOID AddEntity(ULONG EntityType,
159 PVOID Context,
160 ULONG Flags);
161
162 VOID RemoveEntityByContext(PVOID Context);
163
164 /* EOF */