📄 tdi.h
字号:
/*++Copyright (c) 1989-2000 Microsoft Corporation. All rights reserved.Module Name: tdi.hAbstract: This header file contains interface definitions for NT transport providers. This interface is documented in the NT Transport Driver Interface (TDI) Specification, Version 2.--*///// Include the types which are common to TDI and other network users//#ifndef _TDI_USER_#define _TDI_USER_#include <nettypes.h>//// Include Transport driver interface definitions// All of the following have two definitions; ones that correspond exactly to// the TDI spec, and those that correspond to the NT coding standards. They// should be equivalent.//typedef LONG TDI_STATUS;typedef PVOID CONNECTION_CONTEXT; // connection context//// Basic type used to represent an address at the transport level. There may// be many addresses represented in a single address structure. If there are// multiple addresses, a given provider must understand all of them or it can// use none of them. Note that it is acceptible for the provider to not know// how to use the address, as long as it knows the address type. Thus, a// TCP/IP NetBIOS provider may know both NetBIOS and TCP/IP addresses, but// use only the NetBIOS address; the TCP/IP address would (likely) be passed on// to the TCP/IP provider.//typedef struct _TA_ADDRESS { DWORD AddressLength; // length in bytes of Address[] in this USHORT AddressType; // type of this address UCHAR Address[1]; // actually AddressLength bytes long} TA_ADDRESS, *PTA_ADDRESS;typedef struct _TRANSPORT_ADDRESS { LONG TAAddressCount; // number of addresses following TA_ADDRESS Address[1]; // actually TAAddressCount elements long} TRANSPORT_ADDRESS, *PTRANSPORT_ADDRESS;//// define some names for the EAs so people don't have to make them up.//#define TdiTransportAddress "TransportAddress"#define TdiConnectionContext "ConnectionContext"#define TDI_TRANSPORT_ADDRESS_LENGTH (sizeof (TdiTransportAddress) - 1)#define TDI_CONNECTION_CONTEXT_LENGTH (sizeof (TdiConnectionContext) - 1)//// Known Address types//// NOTE: these MUST match the AF_ types otherwise things will not work!// if you change or add to any of these be sure to modify the AF_ def's// in winsock.h as well!#define TDI_ADDRESS_TYPE_UNSPEC ((USHORT)0) // unspecified#define TDI_ADDRESS_TYPE_UNIX ((USHORT)1) // local to host (pipes, portals)#define TDI_ADDRESS_TYPE_IP ((USHORT)2) // internetwork: UDP, TCP, etc.#define TDI_ADDRESS_TYPE_IMPLINK ((USHORT)3) // arpanet imp addresses#define TDI_ADDRESS_TYPE_PUP ((USHORT)4) // pup protocols: e.g. BSP#define TDI_ADDRESS_TYPE_CHAOS ((USHORT)5) // mit CHAOS protocols#define TDI_ADDRESS_TYPE_NS ((USHORT)6) // XEROX NS protocols#define TDI_ADDRESS_TYPE_IPX ((USHORT)6) // Netware IPX#define TDI_ADDRESS_TYPE_NBS ((USHORT)7) // nbs protocols#define TDI_ADDRESS_TYPE_ECMA ((USHORT)8) // european computer manufacturers#define TDI_ADDRESS_TYPE_DATAKIT ((USHORT)9) // datakit protocols#define TDI_ADDRESS_TYPE_CCITT ((USHORT)10) // CCITT protocols, X.25 etc#define TDI_ADDRESS_TYPE_SNA ((USHORT)11) // IBM SNA#define TDI_ADDRESS_TYPE_DECnet ((USHORT)12) // DECnet#define TDI_ADDRESS_TYPE_DLI ((USHORT)13) // Direct data link interface#define TDI_ADDRESS_TYPE_LAT ((USHORT)14) // LAT#define TDI_ADDRESS_TYPE_HYLINK ((USHORT)15) // NSC Hyperchannel#define TDI_ADDRESS_TYPE_APPLETALK ((USHORT)16) // AppleTalk#define TDI_ADDRESS_TYPE_NETBIOS ((USHORT)17) // Netbios Addresses#define TDI_ADDRESS_TYPE_8022 ((USHORT)18) //#define TDI_ADDRESS_TYPE_OSI_TSAP ((USHORT)19) //#define TDI_ADDRESS_TYPE_NETONE ((USHORT)20) // for WzMail#define TDI_ADDRESS_TYPE_PG ((USHORT)21) // CE specific#define TDI_ADDRESS_TYPE_RBDS ((USHORT)23) // //// Definition of address structures. These need to be packed// and misaligned where necessary.//#include <packon.h>//// NetBIOS//typedef struct _TDI_ADDRESS_NETBIOS { USHORT NetbiosNameType; UCHAR NetbiosName[16];} TDI_ADDRESS_NETBIOS, *PTDI_ADDRESS_NETBIOS;#define TDI_ADDRESS_NETBIOS_TYPE_UNIQUE ((USHORT)0x0000)#define TDI_ADDRESS_NETBIOS_TYPE_GROUP ((USHORT)0x0001)#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_UNIQUE ((USHORT)0x0002)#define TDI_ADDRESS_NETBIOS_TYPE_QUICK_GROUP ((USHORT)0x0003)#define TDI_ADDRESS_LENGTH_NETBIOS sizeof (TDI_ADDRESS_NETBIOS)//// Xns address for UB//typedef struct _TDI_ADDRESS_NETONE { USHORT NetoneNameType; UCHAR NetoneName[20];} TDI_ADDRESS_NETONE, *PTDI_ADDRESS_NETONE;#define TDI_ADDRESS_NETONE_TYPE_UNIQUE ((USHORT)0x0000)#define TDI_ADDRESS_NETONE_TYPE_ROTORED ((USHORT)0x0001)#define TDI_ADDRESS_LENGTH_NETONE sizeof (TDI_ADDRESS_NETONE)//// AppleTalk//typedef struct _TDI_ADDRESS_APPLETALK { USHORT Network; UCHAR Node; UCHAR Socket;} TDI_ADDRESS_APPLETALK, *PTDI_ADDRESS_APPLETALK;#define TDI_ADDRESS_LENGTH_APPLETALK sizeof (TDI_ADDRESS_APPLETALK)//// 802.2 MAC addresses//typedef struct _TDI_ADDRESS_8022 { UCHAR MACAddress[6];} TDI_ADDRESS_8022, *PTDI_ADDRESS_8022;#define TDI_ADDRESS_LENGTH_8022 sizeof (TDI_ADDRESS_8022);//// IP address//typedef struct _TDI_ADDRESS_IP { USHORT sin_port; ULONG in_addr; UCHAR sin_zero[8];} TDI_ADDRESS_IP, *PTDI_ADDRESS_IP;#define TDI_ADDRESS_LENGTH_IP sizeof (TDI_ADDRESS_IP)typedef struct _TDI_ADDRESS_PG { UCHAR spg_capcode_idx; UCHAR spg_subaddr; // Subaddress to use UINT32 spg_extaddr; // Extended address (if any) UCHAR empty[8]; // total len should be 16 to match other sockaddr's} TDI_ADDRESS_PG, *PTDI_ADDRESS_PG;#define TDI_ADDRESS_LENGTH_PG sizeof (TDI_ADDRESS_PG)typedef struct _TDI_ADDRESS_RBDS { UCHAR srbds_tuner_id; // Tuner ID UCHAR srbds_type; // RBDS message types UCHAR srbds_mbs_sysid; // MBS system ID UCHAR empty[11]; // total len should be 16 to match other sockaddr's} TDI_ADDRESS_RBDS, *PTDI_ADDRESS_RBDS;#define TDI_ADDRESS_LENGTH_RBDS sizeof (TDI_ADDRESS_RBDS)//// IPX address//typedef struct _TDI_ADDRESS_IPX { ULONG NetworkAddress; UCHAR NodeAddress[6]; USHORT Socket;} TDI_ADDRESS_IPX, *PTDI_ADDRESS_IPX;#define TDI_ADDRESS_LENGTH_IPX sizeof (TDI_ADDRESS_IPX)//// XNS address (same as IPX)//typedef struct _TDI_ADDRESS_NS { ULONG NetworkAddress; UCHAR NodeAddress[6]; USHORT Socket;} TDI_ADDRESS_NS, *PTDI_ADDRESS_NS;#define TDI_ADDRESS_LENGTH_NS sizeof (TDI_ADDRESS_NS)// OSI TSAP// TBD#include <packoff.h>//// Some pre-defined structures to make life easier for// the 99.99% of us who use but one address.//typedef struct _TA_ADDRESS_NETBIOS { LONG TAAddressCount; struct _Addr { DWORD AddressLength; // length in bytes of this address == 18 USHORT AddressType; // this will == TDI_ADDRESS_TYPE_NETBIOS TDI_ADDRESS_NETBIOS Address[1]; } Address [1];} TA_NETBIOS_ADDRESS, *PTA_NETBIOS_ADDRESS;typedef struct _TA_APPLETALK_ADDR { LONG TAAddressCount; struct _AddrAtalk { DWORD AddressLength; // length in bytes of this address == 4 USHORT AddressType; // this will == TDI_ADDRESS_TYPE_APPLETALK TDI_ADDRESS_APPLETALK Address[1]; } Address[1];} TA_APPLETALK_ADDRESS, *PTA_APPLETALK_ADDRESS;typedef struct _TA_ADDRESS_IP { LONG TAAddressCount; struct _AddrIp { DWORD AddressLength; // length in bytes of this address == 14 USHORT AddressType; // this will == TDI_ADDRESS_TYPE_IP TDI_ADDRESS_IP Address[1]; } Address [1];} TA_IP_ADDRESS, *PTA_IP_ADDRESS;typedef struct _TA_ADDRESS_IPX { LONG TAAddressCount; struct _AddrIpx { DWORD AddressLength; // length in bytes of this address == 12 USHORT AddressType; // this will == TDI_ADDRESS_TYPE_IPX TDI_ADDRESS_IPX Address[1]; } Address [1];} TA_IPX_ADDRESS, *PTA_IPX_ADDRESS;typedef struct _TA_ADDRESS_NS { LONG TAAddressCount; struct _AddrNs { DWORD AddressLength; // length in bytes of this address == 12 USHORT AddressType; // this will == TDI_ADDRESS_TYPE_NS TDI_ADDRESS_NS Address[1]; } Address [1];} TA_NS_ADDRESS, *PTA_NS_ADDRESS;//// This structure is passed with every request to TDI. It describes that// request and the parameters to it.//typedef struct _TDI_REQUEST { union { HANDLE AddressHandle; CONNECTION_CONTEXT ConnectionContext; HANDLE ControlChannel; } Handle; PVOID RequestNotifyObject; PVOID RequestContext; TDI_STATUS TdiStatus; DWORD ProcPerm; // this is new & not part of the TDI spec
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -