xref: /reactos/sdk/include/psdk/tdi.h (revision c2c66aff)
1 /*
2  * tdi.h
3  *
4  * TDI user mode definitions
5  *
6  * This file is part of the w32api package.
7  *
8  * Contributors:
9  *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #ifndef __TDI_H
24 #define __TDI_H
25 
26 #include "ntddtdi.h"
27 #include "tdistat.h"
28 #include "netpnp.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /* Basic types */
35 
36 typedef LONG TDI_STATUS;
37 typedef PVOID CONNECTION_CONTEXT;
38 
39 typedef struct _TDI_CONNECTION_INFORMATION {
40   LONG  UserDataLength;
41   PVOID  UserData;
42   LONG  OptionsLength;
43   PVOID  Options;
44   LONG  RemoteAddressLength;
45   PVOID  RemoteAddress;
46 } TDI_CONNECTION_INFORMATION, *PTDI_CONNECTION_INFORMATION;
47 
48 typedef struct _TDI_REQUEST {
49   union {
50     HANDLE  AddressHandle;
51     CONNECTION_CONTEXT  ConnectionContext;
52     HANDLE  ControlChannel;
53   } Handle;
54   PVOID  RequestNotifyObject;
55   PVOID  RequestContext;
56   TDI_STATUS  TdiStatus;
57 } TDI_REQUEST, *PTDI_REQUEST;
58 
59 typedef struct _TDI_REQUEST_STATUS {
60   TDI_STATUS  Status;
61   PVOID  RequestContext;
62   ULONG  BytesTransferred;
63 } TDI_REQUEST_STATUS, *PTDI_REQUEST_STATUS;
64 
65 typedef struct _TDI_CONNECT_REQUEST {
66 	TDI_REQUEST  Request;
67 	PTDI_CONNECTION_INFORMATION  RequestConnectionInformation;
68 	PTDI_CONNECTION_INFORMATION  ReturnConnectionInformation;
69 	LARGE_INTEGER  Timeout;
70 } TDI_REQUEST_CONNECT, *PTDI_REQUEST_CONNECT;
71 
72 typedef struct _TDI_REQUEST_ACCEPT {
73   TDI_REQUEST  Request;
74   PTDI_CONNECTION_INFORMATION  RequestConnectionInformation;
75   PTDI_CONNECTION_INFORMATION  ReturnConnectionInformation;
76 } TDI_REQUEST_ACCEPT, *PTDI_REQUEST_ACCEPT;
77 
78 typedef struct _TDI_REQUEST_LISTEN {
79   TDI_REQUEST  Request;
80   PTDI_CONNECTION_INFORMATION  RequestConnectionInformation;
81   PTDI_CONNECTION_INFORMATION  ReturnConnectionInformation;
82   USHORT  ListenFlags;
83 } TDI_REQUEST_LISTEN, *PTDI_REQUEST_LISTEN;
84 
85 typedef struct _TDI_DISCONNECT_REQUEST {
86   TDI_REQUEST  Request;
87   LARGE_INTEGER  Timeout;
88 } TDI_REQUEST_DISCONNECT, *PTDI_REQUEST_DISCONNECT;
89 
90 typedef struct _TDI_REQUEST_SEND {
91   TDI_REQUEST  Request;
92   USHORT  SendFlags;
93 } TDI_REQUEST_SEND, *PTDI_REQUEST_SEND;
94 
95 typedef struct _TDI_REQUEST_RECEIVE {
96   TDI_REQUEST  Request;
97   USHORT  ReceiveFlags;
98 } TDI_REQUEST_RECEIVE, *PTDI_REQUEST_RECEIVE;
99 
100 typedef struct _TDI_REQUEST_SEND_DATAGRAM {
101   TDI_REQUEST  Request;
102   PTDI_CONNECTION_INFORMATION  SendDatagramInformation;
103 } TDI_REQUEST_SEND_DATAGRAM, *PTDI_REQUEST_SEND_DATAGRAM;
104 
105 typedef struct _TDI_REQUEST_RECEIVE_DATAGRAM {
106   TDI_REQUEST  Request;
107   PTDI_CONNECTION_INFORMATION  ReceiveDatagramInformation;
108   PTDI_CONNECTION_INFORMATION  ReturnInformation;
109   USHORT  ReceiveFlags;
110 } TDI_REQUEST_RECEIVE_DATAGRAM, *PTDI_REQUEST_RECEIVE_DATAGRAM;
111 
112 typedef struct _TDI_REQUEST_SET_EVENT {
113   TDI_REQUEST  Request;
114   LONG  EventType;
115   PVOID  EventHandler;
116   PVOID  EventContext;
117 } TDI_REQUEST_SET_EVENT_HANDLER, *PTDI_REQUEST_SET_EVENT_HANDLER;
118 
119 #define TDI_RECEIVE_BROADCAST             0x00000004
120 #define TDI_RECEIVE_MULTICAST             0x00000008
121 #define TDI_RECEIVE_PARTIAL               0x00000010
122 #define TDI_RECEIVE_NORMAL                0x00000020
123 #define TDI_RECEIVE_EXPEDITED             0x00000040
124 #define TDI_RECEIVE_PEEK                  0x00000080
125 #define TDI_RECEIVE_NO_RESPONSE_EXP       0x00000100
126 #define TDI_RECEIVE_COPY_LOOKAHEAD        0x00000200
127 #define TDI_RECEIVE_ENTIRE_MESSAGE        0x00000400
128 #define TDI_RECEIVE_AT_DISPATCH_LEVEL     0x00000800
129 #define TDI_RECEIVE_CONTROL_INFO          0x00001000
130 
131 /* Listen flags */
132 #define TDI_QUERY_ACCEPT                  0x00000001
133 
134 /* Options used for both SendOptions and ReceiveIndicators */
135 #define TDI_SEND_EXPEDITED                0x0020
136 #define TDI_SEND_PARTIAL                  0x0040
137 #define TDI_SEND_NO_RESPONSE_EXPECTED     0x0080
138 #define TDI_SEND_NON_BLOCKING             0x0100
139 #define TDI_SEND_AND_DISCONNECT           0x0200
140 
141 /* Disconnect Flags */
142 #define TDI_DISCONNECT_WAIT               0x0001
143 #define TDI_DISCONNECT_ABORT              0x0002
144 #define TDI_DISCONNECT_RELEASE            0x0004
145 
146 /* TdiRequest structure for TdiQueryInformation request */
147 typedef struct _TDI_REQUEST_QUERY_INFORMATION {
148   TDI_REQUEST  Request;
149   ULONG  QueryType;
150   PTDI_CONNECTION_INFORMATION  RequestConnectionInformation;
151 } TDI_REQUEST_QUERY_INFORMATION, *PTDI_REQUEST_QUERY_INFORMATION;
152 
153 /* TdiRequest structure for TdiSetInformation request */
154 typedef struct _TDI_REQUEST_SET_INFORMATION {
155   TDI_REQUEST  Request;
156   ULONG  SetType;
157   PTDI_CONNECTION_INFORMATION  RequestConnectionInformation;
158 } TDI_REQUEST_SET_INFORMATION, *PTDI_REQUEST_SET_INFORMATION;
159 
160 typedef TDI_REQUEST_SET_INFORMATION  TDI_REQ_SET_INFORMATION, *PTDI_REQ_SET_INFORMATION;
161 
162 typedef union _TDI_REQUEST_TYPE {
163   TDI_REQUEST_ACCEPT  TdiAccept;
164   TDI_REQUEST_CONNECT  TdiConnect;
165   TDI_REQUEST_DISCONNECT  TdiDisconnect;
166   TDI_REQUEST_LISTEN  TdiListen;
167   TDI_REQUEST_QUERY_INFORMATION  TdiQueryInformation;
168   TDI_REQUEST_RECEIVE  TdiReceive;
169   TDI_REQUEST_RECEIVE_DATAGRAM  TdiReceiveDatagram;
170   TDI_REQUEST_SEND  TdiSend;
171   TDI_REQUEST_SEND_DATAGRAM  TdiSendDatagram;
172   TDI_REQUEST_SET_EVENT_HANDLER  TdiSetEventHandler;
173   TDI_REQUEST_SET_INFORMATION   TdiSetInformation;
174 } TDI_REQUEST_TYPE, *PTDI_REQUEST_TYPE;
175 
176 /* Query information types */
177 
178 /* Generic query info types that must be supported by all transports */
179 #define TDI_QUERY_BROADCAST_ADDRESS     0x00000001
180 #define TDI_QUERY_PROVIDER_INFO         0x00000002
181 #define TDI_QUERY_ADDRESS_INFO          0x00000003
182 #define TDI_QUERY_CONNECTION_INFO       0x00000004
183 #define TDI_QUERY_PROVIDER_STATISTICS   0x00000005
184 #define TDI_QUERY_DATAGRAM_INFO         0x00000006
185 #define TDI_QUERY_DATA_LINK_ADDRESS     0x00000007
186 #define TDI_QUERY_NETWORK_ADDRESS       0x00000008
187 #define TDI_QUERY_MAX_DATAGRAM_INFO     0x00000009
188 
189 /* Netbios specific query information types */
190 #define TDI_QUERY_ADAPTER_STATUS        0x00000100
191 #define TDI_QUERY_SESSION_STATUS        0x00000200
192 #define TDI_QUERY_FIND_NAME             0x00000300
193 
194 /* Structures used for TdiQueryInformation and TdiSetInformation */
195 
196 typedef struct _TDI_ENDPOINT_INFO {
197   ULONG  State;
198   ULONG  Event;
199   ULONG  TransmittedTsdus;
200   ULONG  ReceivedTsdus;
201   ULONG  TransmissionErrors;
202   ULONG  ReceiveErrors;
203   ULONG  MinimumLookaheadData;
204   ULONG  MaximumLookaheadData;
205   ULONG  PriorityLevel;
206   ULONG  SecurityLevel;
207   ULONG  SecurityCompartment;
208 } TDI_ENDPOINT_INFO, *PTDI_ENDPOINT_INFO;
209 
210 typedef struct _TDI_CONNECTION_INFO {
211   ULONG  State;
212   ULONG  Event;
213   ULONG  TransmittedTsdus;
214   ULONG  ReceivedTsdus;
215   ULONG  TransmissionErrors;
216   ULONG  ReceiveErrors;
217   LARGE_INTEGER  Throughput;
218   LARGE_INTEGER  Delay;
219   ULONG  SendBufferSize;
220   ULONG  ReceiveBufferSize;
221   BOOLEAN  Unreliable;
222 } TDI_CONNECTION_INFO, *PTDI_CONNECTION_INFO;
223 
224 typedef struct _TDI_DATAGRAM_INFO {
225   ULONG  MaximumDatagramBytes;
226   ULONG  MaximumDatagramCount;
227 } TDI_DATAGRAM_INFO, *PTDI_DATAGRAM_INFO;
228 
229 typedef struct _TDI_MAX_DATAGRAM_INFO {
230   ULONG  MaxDatagramSize;
231 } TDI_MAX_DATAGRAM_INFO, *PTDI_MAX_DATAGRAM_INFO;
232 
233 typedef struct _TDI_PROVIDER_INFO {
234   ULONG  Version;
235   ULONG  MaxSendSize;
236   ULONG  MaxConnectionUserData;
237   ULONG  MaxDatagramSize;
238   ULONG  ServiceFlags;
239   ULONG  MinimumLookaheadData;
240   ULONG  MaximumLookaheadData;
241   ULONG  NumberOfResources;
242   LARGE_INTEGER  StartTime;
243 } TDI_PROVIDER_INFO, *PTDI_PROVIDER_INFO;
244 
245 #define TDI_SERVICE_CONNECTION_MODE     0x00000001
246 #define TDI_SERVICE_ORDERLY_RELEASE     0x00000002
247 #define TDI_SERVICE_CONNECTIONLESS_MODE 0x00000004
248 #define TDI_SERVICE_ERROR_FREE_DELIVERY 0x00000008
249 #define TDI_SERVICE_SECURITY_LEVEL      0x00000010
250 #define TDI_SERVICE_BROADCAST_SUPPORTED 0x00000020
251 #define TDI_SERVICE_MULTICAST_SUPPORTED 0x00000040
252 #define TDI_SERVICE_DELAYED_ACCEPTANCE  0x00000080
253 #define TDI_SERVICE_EXPEDITED_DATA      0x00000100
254 #define TDI_SERVICE_INTERNAL_BUFFERING  0x00000200
255 #define TDI_SERVICE_ROUTE_DIRECTED      0x00000400
256 #define TDI_SERVICE_NO_ZERO_LENGTH      0x00000800
257 #define TDI_SERVICE_POINT_TO_POINT      0x00001000
258 #define TDI_SERVICE_MESSAGE_MODE        0x00002000
259 #define TDI_SERVICE_HALF_DUPLEX         0x00004000
260 #define TDI_SERVICE_DGRAM_CONNECTION    0x00008000
261 #define TDI_SERVICE_FORCE_ACCESS_CHECK  0x00010000
262 #define TDI_SERVICE_SEND_AND_DISCONNECT 0x00020000
263 #define TDI_SERVICE_DIRECT_ACCEPT       0x00040000
264 #define TDI_SERVICE_ACCEPT_LOCAL_ADDR   0x00080000
265 #define TDI_SERVICE_ADDRESS_SECURITY    0x00100000
266 #define TDI_SERVICE_PREPOST_RECVS       0x00200000
267 #define TDI_SERVICE_NO_PUSH             0x00400000
268 
269 typedef struct _TDI_PROVIDER_RESOURCE_STATS {
270   ULONG  ResourceId;
271   ULONG  MaximumResourceUsed;
272   ULONG  AverageResourceUsed;
273   ULONG  ResourceExhausted;
274 } TDI_PROVIDER_RESOURCE_STATS, *PTDI_PROVIDER_RESOURCE_STATS;
275 
276 typedef struct _TDI_PROVIDER_STATISTICS {
277   ULONG  Version;
278   ULONG  OpenConnections;
279   ULONG  ConnectionsAfterNoRetry;
280   ULONG  ConnectionsAfterRetry;
281   ULONG  LocalDisconnects;
282   ULONG  RemoteDisconnects;
283   ULONG  LinkFailures;
284   ULONG  AdapterFailures;
285   ULONG  SessionTimeouts;
286   ULONG  CancelledConnections;
287   ULONG  RemoteResourceFailures;
288   ULONG  LocalResourceFailures;
289   ULONG  NotFoundFailures;
290   ULONG  NoListenFailures;
291   ULONG  DatagramsSent;
292   LARGE_INTEGER  DatagramBytesSent;
293   ULONG  DatagramsReceived;
294   LARGE_INTEGER  DatagramBytesReceived;
295   ULONG  PacketsSent;
296   ULONG  PacketsReceived;
297   ULONG  DataFramesSent;
298   LARGE_INTEGER  DataFrameBytesSent;
299   ULONG  DataFramesReceived;
300   LARGE_INTEGER  DataFrameBytesReceived;
301   ULONG  DataFramesResent;
302   LARGE_INTEGER  DataFrameBytesResent;
303   ULONG  DataFramesRejected;
304   LARGE_INTEGER  DataFrameBytesRejected;
305   ULONG  ResponseTimerExpirations;
306   ULONG  AckTimerExpirations;
307   ULONG  MaximumSendWindow;
308   ULONG  AverageSendWindow;
309   ULONG  PiggybackAckQueued;
310   ULONG  PiggybackAckTimeouts;
311   LARGE_INTEGER  WastedPacketSpace;
312   ULONG  WastedSpacePackets;
313   ULONG  NumberOfResources;
314   TDI_PROVIDER_RESOURCE_STATS  ResourceStats[1];
315 } TDI_PROVIDER_STATISTICS, *PTDI_PROVIDER_STATISTICS;
316 
317 #define TDI_EVENT_CONNECT                 0
318 #define TDI_EVENT_DISCONNECT              1
319 #define TDI_EVENT_ERROR                   2
320 #define TDI_EVENT_RECEIVE                 3
321 #define TDI_EVENT_RECEIVE_DATAGRAM        4
322 #define TDI_EVENT_RECEIVE_EXPEDITED       5
323 #define TDI_EVENT_SEND_POSSIBLE           6
324 
325 typedef struct _TDI_REQUEST_ASSOCIATE {
326   TDI_REQUEST  Request;
327   HANDLE  AddressHandle;
328 } TDI_REQUEST_ASSOCIATE_ADDRESS, *PTDI_REQUEST_ASSOCIATE_ADDRESS;
329 
330 #define NDIS_PACKET_POOL_TAG_FOR_NWLNKIPX   'iPDN'
331 #define NDIS_PACKET_POOL_TAG_FOR_NWLNKSPX   'sPDN'
332 #define NDIS_PACKET_POOL_TAG_FOR_NWLNKNB    'nPDN'
333 #define NDIS_PACKET_POOL_TAG_FOR_TCPIP      'tPDN'
334 #define NDIS_PACKET_POOL_TAG_FOR_NBF        'bPDN'
335 #define NDIS_PACKET_POOL_TAG_FOR_APPLETALK  'aPDN'
336 
337 typedef struct _TA_ADDRESS {
338   USHORT  AddressLength;
339   USHORT  AddressType;
340   UCHAR  Address[1];
341 } TA_ADDRESS, *PTA_ADDRESS;
342 
343 #define TDI_ADDRESS_TYPE_UNSPEC             0
344 #define TDI_ADDRESS_TYPE_UNIX               1
345 #define TDI_ADDRESS_TYPE_IP                 2
346 #define TDI_ADDRESS_TYPE_IMPLINK            3
347 #define TDI_ADDRESS_TYPE_PUP                4
348 #define TDI_ADDRESS_TYPE_CHAOS              5
349 #define TDI_ADDRESS_TYPE_NS                 6
350 #define TDI_ADDRESS_TYPE_IPX                6
351 #define TDI_ADDRESS_TYPE_NBS                7
352 #define TDI_ADDRESS_TYPE_ECMA               8
353 #define TDI_ADDRESS_TYPE_DATAKIT            9
354 #define TDI_ADDRESS_TYPE_CCITT              10
355 #define TDI_ADDRESS_TYPE_SNA                11
356 #define TDI_ADDRESS_TYPE_DECnet             12
357 #define TDI_ADDRESS_TYPE_DLI                13
358 #define TDI_ADDRESS_TYPE_LAT                14
359 #define TDI_ADDRESS_TYPE_HYLINK             15
360 #define TDI_ADDRESS_TYPE_APPLETALK          16
361 #define TDI_ADDRESS_TYPE_NETBIOS            17
362 #define TDI_ADDRESS_TYPE_8022               18
363 #define TDI_ADDRESS_TYPE_OSI_TSAP           19
364 #define TDI_ADDRESS_TYPE_NETONE             20
365 #define TDI_ADDRESS_TYPE_VNS                21
366 #define TDI_ADDRESS_TYPE_NETBIOS_EX         22
367 #define TDI_ADDRESS_TYPE_IP6                23
368 #define TDI_ADDRESS_TYPE_NETBIOS_UNICODE_EX 24
369 
370 #define TdiTransportAddress               "TransportAddress"
371 #define TdiConnectionContext              "ConnectionContext"
372 #define TDI_TRANSPORT_ADDRESS_LENGTH      (sizeof(TdiTransportAddress) - 1)
373 #define TDI_CONNECTION_CONTEXT_LENGTH     (sizeof(TdiConnectionContext) - 1)
374 
375 typedef struct _TRANSPORT_ADDRESS {
376   LONG  TAAddressCount;
377   TA_ADDRESS  Address[1];
378 } TRANSPORT_ADDRESS, *PTRANSPORT_ADDRESS;
379 
380 typedef struct _TDI_ACTION_HEADER {
381   ULONG  TransportId;
382   USHORT  ActionCode;
383   USHORT  Reserved;
384 } TDI_ACTION_HEADER, *PTDI_ACTION_HEADER;
385 
386 typedef struct _TDI_ADDRESS_INFO {
387   ULONG  ActivityCount;
388   TRANSPORT_ADDRESS  Address;
389 } TDI_ADDRESS_INFO, *PTDI_ADDRESS_INFO;
390 
391 #include "pshpack1.h"
392 
393 typedef struct _TDI_ADDRESS_8022 {
394   UCHAR  MACAddress[6];
395 } TDI_ADDRESS_8022, *PTDI_ADDRESS_8022;
396 
397 #define TDI_ADDRESS_LENGTH_8022           sizeof(TDI_ADDRESS_8022);
398 
399 typedef struct _TDI_ADDRESS_APPLETALK {
400   USHORT  Network;
401   UCHAR  Node;
402   UCHAR  Socket;
403 } TDI_ADDRESS_APPLETALK, *PTDI_ADDRESS_APPLETALK;
404 
405 #define TDI_ADDRESS_LENGTH_APPLETALK      sizeof(TDI_ADDRESS_APPLETALK)
406 
407 typedef struct _TDI_ADDRESS_IP {
408   USHORT  sin_port;
409   ULONG  in_addr;
410   UCHAR  sin_zero[8];
411 } TDI_ADDRESS_IP, *PTDI_ADDRESS_IP;
412 
413 #define TDI_ADDRESS_LENGTH_IP             sizeof(TDI_ADDRESS_IP)
414 
415 typedef struct _TDI_ADDRESS_IPX {
416   ULONG  NetworkAddress;
417   UCHAR  NodeAddress[6];
418   USHORT  Socket;
419 } TDI_ADDRESS_IPX, *PTDI_ADDRESS_IPX;
420 
421 #define TDI_ADDRESS_LENGTH_IPX            sizeof(TDI_ADDRESS_IPX)
422 
423 /* TDI_ADDRESS_NETBIOS.NetbiosNameType constants */
424 #define TDI_ADDRESS_NETBIOS_TYPE_UNIQUE       0x0000
425 #define TDI_ADDRESS_NETBIOS_TYPE_GROUP        0x0001
426 #define TDI_ADDRESS_NETBIOS_TYPE_QUICK_UNIQUE 0x0002
427 #define TDI_ADDRESS_NETBIOS_TYPE_QUICK_GROUP  0x0003
428 
429 typedef struct _TDI_ADDRESS_NETBIOS {
430   USHORT  NetbiosNameType;
431   UCHAR  NetbiosName[16];
432 } TDI_ADDRESS_NETBIOS, *PTDI_ADDRESS_NETBIOS;
433 
434 #define TDI_ADDRESS_LENGTH_NETBIOS        sizeof(TDI_ADDRESS_NETBIOS)
435 
436 typedef struct _TDI_ADDRESS_NETBIOS_EX {
437   UCHAR  EndpointName[16];
438   TDI_ADDRESS_NETBIOS  NetbiosAddress;
439 } TDI_ADDRESS_NETBIOS_EX, *PTDI_ADDRESS_NETBIOS_EX;
440 
441 #define TDI_ADDRESS_LENGTH_NETBIOS_EX     sizeof(TDI_ADDRESS_NETBIOS_EX)
442 
443 /* TDI_ADDRESS_NETONE.NetoneNameType constants */
444 #define TDI_ADDRESS_NETONE_TYPE_UNIQUE    0x0000
445 #define TDI_ADDRESS_NETONE_TYPE_ROTORED   0x0001
446 
447 typedef struct _TDI_ADDRESS_NETONE {
448   USHORT  NetoneNameType;
449   UCHAR  NetoneName[20];
450 } TDI_ADDRESS_NETONE, *PTDI_ADDRESS_NETONE;
451 
452 #define TDI_ADDRESS_LENGTH_NETONE         sizeof(TDI_ADDRESS_NETONE)
453 
454 typedef struct _TDI_ADDRESS_NS
455 {
456     ULONG   NetworkAddress;
457     UCHAR   NodeAddress[6];
458     USHORT  Socket;
459 } TDI_ADDRESS_NS, *PTDI_ADDRESS_NS;
460 
461 #define TDI_ADDRESS_LENGTH_NS             sizeof(TDI_ADDRESS_NS)
462 
463 #define ISO_MAX_ADDR_LENGTH               64
464 
465 /* TDI_ADDRESS_OSI_TSAP.tp_addr_type constants */
466 #define ISO_HIERARCHICAL                  0
467 #define ISO_NON_HIERARCHICAL              1
468 
469 typedef struct _TDI_ADDRESS_OSI_TSAP {
470   USHORT  tp_addr_type;
471   USHORT  tp_taddr_len;
472   USHORT  tp_tsel_len;
473   UCHAR  tp_addr[ISO_MAX_ADDR_LENGTH];
474 } TDI_ADDRESS_OSI_TSAP, *PTDI_ADDRESS_OSI_TSAP;
475 
476 #define TDI_ADDRESS_LENGTH_OSI_TSAP       sizeof(TDI_ADDRESS_OSI_TSAP)
477 
478 typedef struct _TDI_ADDRESS_VNS {
479   UCHAR  net_address[4];
480   UCHAR  subnet_addr[2];
481   UCHAR  port[2];
482   UCHAR  hops;
483   UCHAR  filler[5];
484 } TDI_ADDRESS_VNS, *PTDI_ADDRESS_VNS;
485 
486 #define TDI_ADDRESS_LENGTH_VNS            sizeof(TDI_ADDRESS_VNS)
487 
488 typedef struct _TDI_ADDRESS_IP6 {
489   USHORT  sin6_port;
490   ULONG  sin6_flowinfo;
491   USHORT  sin6_addr[8];
492   ULONG  sin6_scope_id;
493 } TDI_ADDRESS_IP6, *PTDI_ADDRESS_IP6;
494 
495 #define TDI_ADDRESS_LENGTH_IP6            sizeof(TDI_ADDRESS_IP6)
496 
497 enum eNameBufferType {
498 	NBT_READONLY = 0,
499 	NBT_WRITEONLY,
500 	NBT_READWRITE,
501 	NBT_WRITTEN
502 };
503 
504 typedef struct _TDI_ADDRESS_NETBIOS_UNICODE_EX {
505   USHORT  NetbiosNameType;
506   enum eNameBufferType  NameBufferType;
507   UNICODE_STRING  EndpointName;
508   UNICODE_STRING  RemoteName;
509   WCHAR  EndpointBuffer[17];
510   WCHAR  RemoteNameBuffer[1];
511 } TDI_ADDRESS_NETBIOS_UNICODE_EX, *PTDI_ADDRESS_NETBIOS_UNICODE_EX;
512 
513 typedef struct _TA_APPLETALK_ADDR {
514   LONG  TAAddressCount;
515   struct _AddrAtalk {
516     USHORT  AddressLength;
517     USHORT  AddressType;
518     TDI_ADDRESS_APPLETALK  Address[1];
519   } Address[1];
520 } TA_APPLETALK_ADDRESS, *PTA_APPLETALK_ADDRESS;
521 
522 typedef struct _TA_ADDRESS_IP {
523   LONG  TAAddressCount;
524   struct _AddrIp {
525     USHORT  AddressLength;
526     USHORT  AddressType;
527     TDI_ADDRESS_IP  Address[1];
528   } Address[1];
529 } TA_IP_ADDRESS, *PTA_IP_ADDRESS;
530 
531 typedef struct _TA_ADDRESS_IPX {
532   LONG  TAAddressCount;
533   struct _AddrIpx {
534     USHORT  AddressLength;
535     USHORT  AddressType;
536     TDI_ADDRESS_IPX  Address[1];
537   } Address[1];
538 } TA_IPX_ADDRESS, *PTA_IPX_ADDRESS;
539 
540 typedef struct _TA_NETBIOS_ADDRESS {
541   LONG  TAAddressCount;
542   struct _Addr{
543     USHORT  AddressLength;
544     USHORT  AddressType;
545     TDI_ADDRESS_NETBIOS  Address[1];
546   } Address[1];
547 } TA_NETBIOS_ADDRESS, *PTA_NETBIOS_ADDRESS;
548 
549 typedef struct _TA_ADDRESS_NS {
550   LONG  TAAddressCount;
551   struct  _AddrNs {
552     USHORT  AddressLength;
553     USHORT  AddressType;
554     TDI_ADDRESS_NS  Address[1];
555   } Address[1];
556 } TA_NS_ADDRESS, *PTA_NS_ADDRESS;
557 
558 typedef struct _TA_ADDRESS_VNS {
559   LONG  TAAddressCount;
560   struct  _AddrVns {
561     USHORT  AddressLength;
562     USHORT  AddressType;
563     TDI_ADDRESS_VNS  Address[1];
564   } Address[1];
565 } TA_VNS_ADDRESS, *PTA_VNS_ADDRESS;
566 
567 typedef struct _TA_ADDRESS_IP6 {
568   LONG  TAAddressCount;
569   struct _AddrIp6 {
570     USHORT  AddressLength;
571     USHORT  AddressType;
572     TDI_ADDRESS_IP6  Address[1];
573   } Address [1];
574 } TA_IP6_ADDRESS, *PTA_IP6_ADDRESS;
575 
576 typedef struct _TA_ADDRESS_NETBIOS_UNICODE_EX {
577   LONG  TAAddressCount;
578   struct _AddrNetbiosWCharEx {
579     USHORT  AddressLength;
580     USHORT  AddressType;
581     TDI_ADDRESS_NETBIOS_UNICODE_EX  Address[1];
582   } Address [1];
583 } TA_NETBIOS_UNICODE_EX_ADDRESS, *PTA_NETBIOS_UNICODE_EX_ADDRESS;
584 
585 #include "poppack.h"
586 
587 #ifdef __cplusplus
588 }
589 #endif
590 
591 #endif /* __TDI_H */
592