📄 dlcapi.h
字号:
/*++
Copyright 1991-1998 Microsoft Corporation
Module Name:
dlcapi.h
Abstract:
This module defines 32-bit Windows/NT DLC structures and manifests
Revision History:
--*/
#ifndef _DLCAPI_
#define _DLCAPI_
#ifdef __cplusplus
extern "C" {
#endif
//
// DLC Command Codes
//
#define LLC_DIR_INTERRUPT 0x00
#define LLC_DIR_OPEN_ADAPTER 0x03
#define LLC_DIR_CLOSE_ADAPTER 0x04
#define LLC_DIR_SET_MULTICAST_ADDRESS 0x05
#define LLC_DIR_SET_GROUP_ADDRESS 0x06
#define LLC_DIR_SET_FUNCTIONAL_ADDRESS 0x07
#define LLC_DIR_READ_LOG 0x08
#define LLC_TRANSMIT_FRAMES 0x09
#define LLC_TRANSMIT_DIR_FRAME 0x0A
#define LLC_TRANSMIT_I_FRAME 0x0B
#define LLC_TRANSMIT_UI_FRAME 0x0D
#define LLC_TRANSMIT_XID_CMD 0x0E
#define LLC_TRANSMIT_XID_RESP_FINAL 0x0F
#define LLC_TRANSMIT_XID_RESP_NOT_FINAL 0x10
#define LLC_TRANSMIT_TEST_CMD 0x11
#define LLC_DLC_RESET 0x14
#define LLC_DLC_OPEN_SAP 0x15
#define LLC_DLC_CLOSE_SAP 0x16
#define LLC_DLC_REALLOCATE_STATIONS 0x17
#define LLC_DLC_OPEN_STATION 0x19
#define LLC_DLC_CLOSE_STATION 0x1A
#define LLC_DLC_CONNECT_STATION 0x1B
#define LLC_DLC_MODIFY 0x1C
#define LLC_DLC_FLOW_CONTROL 0x1D
#define LLC_DLC_STATISTICS 0x1E
#define LLC_DIR_INITIALIZE 0x20
#define LLC_DIR_STATUS 0x21
#define LLC_DIR_TIMER_SET 0x22
#define LLC_DIR_TIMER_CANCEL 0x23
#define LLC_BUFFER_GET 0x26
#define LLC_BUFFER_FREE 0x27
#define LLC_RECEIVE 0x28
#define LLC_RECEIVE_CANCEL 0x29
#define LLC_RECEIVE_MODIFY 0x2A
#define LLC_DIR_TIMER_CANCEL_GROUP 0x2C
#define LLC_DIR_SET_EXCEPTION_FLAGS 0x2D
#define LLC_BUFFER_CREATE 0x30
#define LLC_READ 0x31
#define LLC_READ_CANCEL 0x32
#define LLC_DLC_SET_THRESHOLD 0x33
#define LLC_DIR_CLOSE_DIRECT 0x34
#define LLC_DIR_OPEN_DIRECT 0x35
#define LLC_MAX_DLC_COMMAND 0x37
//
// forward definitions
//
union _LLC_PARMS;
typedef union _LLC_PARMS LLC_PARMS, *PLLC_PARMS;
//
// Parameters. Can be pointer to a parameter table (32-bit flat address),
// a single 32-bit ULONG, 2 16-bit USHORTs or 4 8-bit BYTEs
//
typedef union {
PLLC_PARMS pParameterTable; // pointer to the parameter table
struct {
USHORT usStationId; // Station id
USHORT usParameter; // optional parameter
} dlc;
struct {
USHORT usParameter0; // first optional parameter
USHORT usParameter1; // second optional parameter
} dir;
UCHAR auchBuffer[4]; // group/functional address
ULONG ulParameter;
} CCB_PARMS;
//
// LLC_CCB - the Command Control Block structure
//
typedef struct _LLC_CCB {
UCHAR uchAdapterNumber; // Adapter 0 or 1
UCHAR uchDlcCommand; // DLC command
UCHAR uchDlcStatus; // DLC command completion code
UCHAR uchReserved1; // reserved for DLC DLL
struct _LLC_CCB* pNext; // CCB chain
ULONG ulCompletionFlag; // used in command completion
CCB_PARMS u; // parameters
HANDLE hCompletionEvent; // event for command completion
UCHAR uchReserved2; // reserved for DLC DLL
UCHAR uchReadFlag; // set when special READ CCB chained
USHORT usReserved3; // reserved for DLC DLL
} LLC_CCB, *PLLC_CCB;
//
// transmit/receive buffers
//
union _LLC_BUFFER;
typedef union _LLC_BUFFER LLC_BUFFER, *PLLC_BUFFER;
typedef struct {
PLLC_BUFFER pNextBuffer; // next DLC buffer in frame
USHORT cbFrame; // length of the whole received frame
USHORT cbBuffer; // length of this segment
USHORT offUserData; // offset of data from descriptor header
USHORT cbUserData; // length of the data
} LLC_NEXT_BUFFER;
typedef struct {
PLLC_BUFFER pNextBuffer; // next buffer of frame
USHORT cbFrame; // length of entire frame
USHORT cbBuffer; // length of this buffer
USHORT offUserData; // user data in this struct
USHORT cbUserData; // length of user data
USHORT usStationId; // ssnn station id
UCHAR uchOptions; // option byte from RECEIVE param tbl
UCHAR uchMsgType; // the message type
USHORT cBuffersLeft; // number of basic buffer units left
UCHAR uchRcvFS; // the reveived frame status
UCHAR uchAdapterNumber; // adapter number
PLLC_BUFFER pNextFrame; // pointer to next frame
UCHAR cbLanHeader; // length of the lan header
UCHAR cbDlcHeader; // length of the DLC header
UCHAR auchLanHeader[32]; // lan header of the received frame
UCHAR auchDlcHeader[4]; // dlc header of the received frame
USHORT usPadding; // data begins from offset 64 !!!
} LLC_NOT_CONTIGUOUS_BUFFER;
typedef struct {
PLLC_BUFFER pNextBuffer; // next buffer of frame
USHORT cbFrame; // length of entire frame
USHORT cbBuffer; // length of this buffer
USHORT offUserData; // user data in this struct
USHORT cbUserData; // length of user data
USHORT usStationId; // ssnn station id
UCHAR uchOptions; // option byte from RECEIVE param tbl
UCHAR uchMsgType; // the message type
USHORT cBuffersLeft; // number of basic buffer units left
UCHAR uchRcvFS; // the reveived frame status
UCHAR uchAdapterNumber; // adapter number
PLLC_BUFFER pNextFrame; // pointer to next frame
} LLC_CONTIGUOUS_BUFFER;
//
// Received frames are returned in these data structures
//
union _LLC_BUFFER {
PLLC_BUFFER pNext;
LLC_NEXT_BUFFER Next;
struct LlcNextBuffer {
LLC_NEXT_BUFFER Header;
UCHAR auchData[];
} Buffer;
LLC_NOT_CONTIGUOUS_BUFFER NotContiguous;
struct {
LLC_NOT_CONTIGUOUS_BUFFER Header;
UCHAR auchData[];
} NotCont;
LLC_CONTIGUOUS_BUFFER Contiguous;
struct {
LLC_CONTIGUOUS_BUFFER Header;
UCHAR auchData[];
} Cont;
};
//
// This structure is used by BUFFER.GET, BUFFER.FREE and TRANSMIT
//
struct _LLC_XMIT_BUFFER;
typedef struct _LLC_XMIT_BUFFER LLC_XMIT_BUFFER, *PLLC_XMIT_BUFFER;
struct _LLC_XMIT_BUFFER {
PLLC_XMIT_BUFFER pNext; // next buffer (or NULL)
USHORT usReserved1; //
USHORT cbBuffer; // length of transmitted data
USHORT usReserved2; //
USHORT cbUserData; // length of optional header
UCHAR auchData[]; // optional header and transmitted data
};
#define LLC_XMIT_BUFFER_SIZE sizeof(LLC_XMIT_BUFFER)
//
// CCB parameter tables
//
typedef struct {
HANDLE hBufferPool; // handle of new buffer pool
PVOID pBuffer; // any buffer in memory
ULONG cbBufferSize; // buffer size in bytes
ULONG cbMinimumSizeThreshold; // minimum locked size
} LLC_BUFFER_CREATE_PARMS, *PLLC_BUFFER_CREATE_PARMS;
typedef struct {
USHORT usReserved1; // Station id is not used
USHORT cBuffersLeft; // free 256 buffer segments
ULONG ulReserved;
PLLC_XMIT_BUFFER pFirstBuffer; // buffer chain
} LLC_BUFFER_FREE_PARMS, *PLLC_BUFFER_FREE_PARMS;
typedef struct {
USHORT usReserved1; // Station id is not used
USHORT cBuffersLeft; // free 256 buffer segments
//
// cBuffersToGet: number of buffers to get. If 0, the returned buffer list
// may consist of segment of different size
//
USHORT cBuffersToGet;
//
// cbBufferSize: size of the requested buffers. This will be rounded up to
// the next largest segment size: 256, 512, 1024, 2048 or 4096
//
USHORT cbBufferSize;
PLLC_XMIT_BUFFER pFirstBuffer;
} LLC_BUFFER_GET_PARMS, *PLLC_BUFFER_GET_PARMS;
//
// parameter table for DLC.CONNECT.STATION
//
typedef struct {
USHORT usStationId; // SAP or direct station ID, defines the pool
USHORT usReserved;
PUCHAR pRoutingInfo; // offset to the routing info
} LLC_DLC_CONNECT_PARMS, *PLLC_DLC_CONNECT_PARMS;
//
// DLC_FLOW_CONTROL Options:
//
#define LLC_RESET_LOCAL_BUSY_USER 0x80
#define LLC_RESET_LOCAL_BUSY_BUFFER 0xC0
#define LLC_SET_LOCAL_BUSY_USER 0
typedef struct {
USHORT usRes;
USHORT usStationId; // SAP or link station id
UCHAR uchT1; // response timer
UCHAR uchT2; // aknowledgment timer
UCHAR uchTi; // inactivity timer
UCHAR uchMaxOut; // max transmits without ack
UCHAR uchMaxIn; // max receives without ack
UCHAR uchMaxOutIncr; // dynamic window increment value
UCHAR uchMaxRetryCnt; // N2 value (retries)
UCHAR uchReserved1;
USHORT usMaxInfoFieldLength; // Only for link stations, NEW!!!
UCHAR uchAccessPriority; // token ring access priority
UCHAR auchReserved3[4];
UCHAR cGroupCount; // number of group SAPs of this SAP
PUCHAR pGroupList; // offset to the group list
} LLC_DLC_MODIFY_PARMS, *PLLC_DLC_MODIFY_PARMS;
#define LLC_XID_HANDLING_IN_APPLICATION 0x08
#define LLC_XID_HANDLING_IN_DLC 0
#define LLC_INDIVIDUAL_SAP 0x04
#define LLC_GROUP_SAP 0x02
#define LLC_MEMBER_OF_GROUP_SAP 0x01
typedef struct {
USHORT usStationId; // SAP or link station id
USHORT usUserStatValue; // reserved for user
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -