home *** CD-ROM | disk | FTP | other *** search
- [ 3. Transport Driver Interface]
- EMBEDDED LAN TRANSPORT DRIVER INTERFACE (TDI)
- ═════════════════════════════════════════════════════════════════════════
- The Embedded LAN Transport Driver Interface (PDI) is an interface your
- applications can use to send and receive "logical" messages to coordinate
- their activities. Messages can be from 0-65535 bytes in length, and can
- be transported with full reliability or with best-effort delivery.
-
- CONNECTIONS AND DATAGRAMS
-
- Application programs that need access to TDI communication services can
- communicate using DATAGRAMS or CONNECTIONS. With datagrams, a program
- sends a message to a transport address (a name or number, or both), and
- any number of other applications running on the network listening on the
- same transport address receive the message.
-
- An application may establish a connection with another application, so
- that data can be transmitted over the connection. Applications may use
- connection-oriented services with any number of other applications
- simultaneously. With connection-oriented services, data are sent to
- a connection ID, not a transport address. The transport address is
- specified at the time the connection is opened. Connections support
- simultaneous two-way data transport.
-
- QUALITY OF SERVICE CONTROLS:
-
- TDI also supports the Embedded LAN quality-of-service options. Most
- applications require absolute data integrity; lost messages due to
- network failures require retransmissions. File service is an example
- of this type of activity. Some applications, like video conferencing,
- require that retransmissions MUST NOT occur. If the picture were to
- replay itself because of a missing 1/30th of a second frame, it would
- cause more distortion than if the frame were simply lost. To support
- a wide range of embedded communications needs, the Transport Driver
- Interface supports service parameters that allow you to control the
- data delivery and acknowledgement algorithms.
-
- TRANSPORT DRIVER INTERFACE API:
-
- TDIAPI TdiOpenEndpoint (
- IN UCHAR *PacketDriverName,
- IN PTRANSPORT_ADDRESS LocalAddress,
- IN TDIBITMASK QualityOfService,
- IN PVOID Context,
- OUT PTDIHANDLE Handle);
-
- TDIAPI TdiCloseEndpoint (
- IN TDIHANDLE Handle);
-
- TDIAPI TdiConnect (
- IN TDIHANDLE Handle,
- IN PTRANSPORT_ADDRESS RemoteAddress,
- IN PVOID Context,
- OUT USHORT * ConnectionId);
-
- TDIAPI TdiDisconnect (
- IN TDIHANDLE Handle,
- IN USHORT ConnectionId,
- IN TDIBITMASK Flags);
-
- #define TDI_DISCONNECT_ORDERLY_RELEASE 0x0001 // discon completes sends.
- #define TDI_DISCONNECT_ABORT 0x0002 // abort connection.
-
- TDIAPI TdiSend (
- IN TDIHANDLE Handle,
- IN USHORT ConnectionId,
- IN TDIBITMASK Flags,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- #define TDI_SEND_FLAGS_EOR 0x0001 // send end of record mark.
- #define TDI_SEND_FLAGS_NOFRAG 0x0002 // don't allow TDU fragmentation.
- #define TDI_SEND_FLAGS_EXPEDITED 0x0004 // this is expedited data.
-
- TDIAPI TdiSendDatagram (
- IN TDIHANDLE Handle,
- IN PTRANSPORT_ADDRESS RemoteAddress,
- IN TDIBITMASK Flags,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- TDIAPI TdiQueryInformation (
- IN TDIHANDLE Handle,
- IN USHORT InformationType,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- #define TDI_INFO_REMOTE_ADDRESS 0x100 // remote transport address.
- #define TDI_INFO_LOCAL_ADDRESS 0x101 // local transport address.
- #define TDI_INFO_ENDPOINT_STATISTICS 0x102 // statistics about endpoint.
- #define TDI_INFO_CONNECTION_STATISTICS 0x103 // statistics about connection.
- #define TDI_INFO_PROVIDER_STATISTICS 0x104 // statistics about provider.
-
- typedef struct _TRANSPORT_STATISTICS {
-
- //
- // Throughput/interface statistics.
- //
-
- QUADINT UserSends;
- QUADINT UserBytesSent;
- QUADINT UserSendErrors;
- QUADINT UserReceiveIndications;
- QUADINT UserBytesReceived;
-
- //
- // Error statistics.
- //
-
- QUADINT ReceiveErrors; // packets dropped in MAC/card.
- QUADINT TransmitErrors; // retransmitted data packets.
- QUADINT OversizeTsdus; // oversized messages received.
- QUADINT UndersizeTsdus; // undersized messages received.
-
- //
- // Connection/Indication statistics.
- //
-
- QUADINT ConnectIndications; // count of connection indications.
- QUADINT DisconnectIndications; // count of disconnection indications.
- QUADINT StatusIndications; // count of status indications.
- QUADINT ConnectionsInitiated; // connections started at endpoint.
- QUADINT ConnectionsAccepted; // connections started from remote.
-
- //
- // Other control information.
- //
-
- ULONG PriorityLevel; // priority of this endpoint/connection.
- ULONG SecurityLevel; // security level/this endpoint/connection.
- ULONG SecurityCompartment; // compartment for some protocols.
-
- //
- // Statistics about transport provider generated packets.
- //
-
- QUADINT SysSends;
- QUADINT SysBytesSent;
- QUADINT SysSendErrors;
- QUADINT SysReceiveIndications;
- QUADINT SysBytesReceived;
- } TRANSPORT_STATISTICS, *PTRANSPORT_STATISTICS;
-
- typedef union _TDI_INFORMATION_BUFFER {
- TRANSPORT_ADDRESS LocalAddress;
- TRANSPORT_ADDRESS RemoteAddress;
- TRANSPORT_STATISTICS EndpointStatistics;
- TRANSPORT_STATISTICS ConnectionStatistics;
- } TDI_INFORMATION_BUFFER, *PTDI_INFORMATION_BUFFER;
-
- TDIAPI TdiSetInformation (
- IN TDIHANDLE Handle,
- IN USHORT InformationType,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- TDIAPI TdiSetIndicationHandler (
- IN TDIHANDLE Handle,
- IN USHORT TdiIndType,
- IN PTDI_INDICATION IndicationHandler);
-
- #define TDI_IND_RECEIVE 0 // connection-oriented receive.
- #define TDI_IND_RECEIVE_DATAGRAM 1 // connectionless receive.
- #define TDI_IND_STATUS 2 // status indication.
- #define TDI_IND_CONNECT 3 // connection request.
- #define TDI_IND_DISCONNECT 4 // disconnection request.
-
- //
- // Transport Driver Interface (TDI) indication routine (user supplied) types.
- //
-
- //
- // Connection-oriented receive indication handler.
- //
-
- typedef VOID (*PIND_TDIRECEIVE)(
- IN PVOID ConnectionContext,
- IN TDIBITMASK ReceiveFlags,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- #define TDI_RECEIVE_OVERSIZE 0x0001 // TDU was oversized for media.
- #define TDI_RECEIVE_UNDERSIZE 0x0002 // TDU was too short for media.
- #define TDI_RECEIVE_DATA_ERROR 0x0004 // TDU had CRC or data error.
- #define TDI_RECEIVE_EOR 0x0008 // TDU has end of record set.
- #define TDI_RECEIVE_EXPEDITED 0x0010 // TDU contains expedited data.
-
- //
- // Connectionless receive to endpoint indication handler.
- //
-
- typedef VOID (*PIND_TDIRECEIVE_DATAGRAM)(
- IN PVOID EndpointContext,
- IN PTRANSPORT_ADDRESS RemoteAddress,
- IN TDIBITMASK ReceiveFlags,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- #define TDI_RECEIVE_DATAGRAM_OVERSIZE 0x0001 // TDU was oversized for media.
- #define TDI_RECEIVE_DATAGRAM_UNDERSIZE 0x0002 // TDU was too short for media.
- #define TDI_RECEIVE_DATAGRAM_DATA_ERROR 0x0004 // TDU had CRC or data error.
- #define TDI_RECEIVE_DATAGRAM_EOR 0x0008 // TDU has end of record mark.
-
- //
- // Change in endpoint status indication handler.
- //
-
- typedef VOID (*PIND_TDISTATUS)(
- IN PVOID EndpointContext,
- IN TDIBITMASK StatusFlags,
- IN PVOID Buffer,
- IN USHORT BufferLength);
-
- #define TDI_STATUS_IDLE 0x0000 // endpoint is idle.
- #define TDI_STATUS_CONNECTION 0x0001 // a connection is active.
-
- //
- // Connection request indication handler.
- //
-
- typedef TDISTATUS (*PIND_TDICONNECT)(
- IN PVOID EndpointContext,
- IN PTRANSPORT_ADDRESS RemoteAddress,
- IN USHORT ConnectionId,
- OUT PVOID * ConnectionContext);
-
- //
- // Disconnection notification indication handler.
- //
-
- typedef TDISTATUS (*PIND_TDIDISCONNECT)(
- IN PVOID ConnectionContext,
- IN TDIBITMASK DisconnectFlags);
-