The STREAMS_TDI_INFO structure provides information necessary to the TDI-TPI mapping portion of STREAMS. It is supplied in calls to StrmRegisterDriver described in B.2.2. The structure is defined as follows:
typedef struct _STREAMS_TDI_INFO{
long SERV_type;
struct streamtab *Partner;
long PSERV_type;
long OPT_length;
PVOID OPT_ptr;
BOOLEAN ReuseAddr;
int AddressInfoCount;
PSTREAMS_TDI_ADDRESS_INFO AddressInfo;
} STREAMS_TDI_INFO, *PSTREAMS_TDI_INFO;
The structure for this array is STREAMS_TDI_ADDRESS_INFO, described below:
typedef struct _STREAMS_TDI_ADDRESS_INFO {
long ADDR_length;
USHORT AddressType;
BOOLEAN DirectedRouted;
PVOID ADDR_ptr;
BOOLEAN (*AddressCompare)(char *, int, char *, int, int);
} STREAMS_TDI_ADDRESS_INFO, *PSTREAMS_TDI_ADDRESS_INFO;
By default, STREAMS performs a simple memory comparison to compare transport addresses for equality. For some transports, this test may not be sufficient. These transports may provide their own transport comparison function in the STREAMS_TDI_ADDRESS_INFO structure. The definition of a function of this type is as follows:
BOOLEAN AddressCompare( IN CHAR * First Address, IN int FirstAddressLen, IN char * SecondAddress, IN int SecondAddressLen, IN int CompareType );
Comparisons are required on two operations: bind and receive. During a bind, the FirstAddress parameter specifies the value passed in the T_BIND_REQ message. This value may contain wild cards. The SecondAddress parameter specifies the value returned in the T_BIND_ACK message, which will have been resolved by the transport to be a specific address devoid of wild cards. The two addresses are equal if a T_BIND_REQ of the FirstAddress should result in a T_BIND_ACK of the SecondAddress.
During a receive, the FirstAddress parameter specifies the address passed down by the transport user as a receive filter. The SecondAddress parameter specifies the address of the network packet being received. The two addresses are equal if a a filter specified by the FirstAddress should result in receiving packets addressed to the SecondAddress.