📄 sdla_x25.h
字号:
TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */
unsigned char iflags PACKED; /* 0Dh: interrupt flags */
unsigned char imask PACKED; /* 0Eh: interrupt mask */
unsigned char resrv PACKED; /* 0Eh: */
unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */
unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */
} TX25Status;
/*
* Bitmasks for the 'iflags' field.
*/
#define X25_RX_INTR 0x01 /* receive interrupt */
#define X25_TX_INTR 0x02 /* transmit interrupt */
#define X25_MODEM_INTR 0x04 /* modem status interrupt (CTS/DCD) */
#define X25_EVENT_INTR 0x10 /* asyncronous event encountered */
#define X25_CMD_INTR 0x08 /* interface command complete */
/*
* Bitmasks for the 'gflags' field.
*/
#define X25_HDLC_ABM 0x01 /* HDLC is in ABM mode */
#define X25_RX_READY 0x02 /* X.25 data available */
#define X25_TRACE_READY 0x08 /* trace data available */
#define X25_EVENT_IND 0x20 /* asynchronous event indicator */
#define X25_TX_READY 0x40 /* space is available in Tx buf.*/
/*
* Bitmasks for the 'cflags' field.
*/
#define X25_XFER_MODE 0x80 /* channel is in data transfer mode */
#define X25_TXWIN_OPEN 0x40 /* transmit window open */
#define X25_RXBUF_MASK 0x3F /* number of data buffers available */
/*****************************************************************************
* Following definitions structurize contents of the TX25Mbox.data field for
* different X.25 interface commands.
****************************************************************************/
/* ---------------------------------------------------------------------------
* X25_SET_GLOBAL_VARS Command.
*/
typedef struct X25GlobalVars
{
unsigned char resrv PACKED; /* 00h: reserved */
unsigned char dtrCtl PACKED; /* 01h: DTR control code */
unsigned char resErr PACKED; /* 01h: '1' - reset modem error */
} TX25GlobalVars;
/*
* Defines for the 'dtrCtl' field.
*/
#define X25_RAISE_DTR 0x01
#define X25_DROP_DTR 0x02
/* ---------------------------------------------------------------------------
* X25_READ_MODEM_STATUS Command.
*/
typedef struct X25ModemStatus
{
unsigned char status PACKED; /* 00h: modem status */
} TX25ModemStatus;
/*
* Defines for the 'status' field.
*/
#define X25_CTS_MASK 0x20
#define X25_DCD_MASK 0x08
/* ---------------------------------------------------------------------------
* X25_HDLC_LINK_STATUS Command.
*/
typedef struct X25LinkStatus
{
unsigned char txQueued PACKED; /* 00h: queued Tx I-frames*/
unsigned char rxQueued PACKED; /* 01h: queued Rx I-frames*/
unsigned char station PACKED; /* 02h: DTE/DCE config. */
unsigned char reserved PACKED; /* 03h: reserved */
unsigned char sfTally PACKED; /* 04h: supervisory frame tally */
} TX25LinkStatus;
/*
* Defines for the 'station' field.
*/
#define X25_STATION_DTE 0x01 /* station configured as DTE */
#define X25_STATION_DCE 0x02 /* station configured as DCE */
/* ---------------------------------------------------------------------------
* X25_HDLC_READ_STATS Command.
*/
typedef struct HdlcStats
{ /* a number of ... */
unsigned short rxIFrames PACKED; /* 00h: ready Rx I-frames */
unsigned short rxNoseq PACKED; /* 02h: frms out-of-sequence */
unsigned short rxNodata PACKED; /* 04h: I-frms without data */
unsigned short rxDiscarded PACKED; /* 06h: discarded frames */
unsigned short rxTooLong PACKED; /* 08h: frames too long */
unsigned short rxBadAddr PACKED; /* 0Ah: frms with inval.addr*/
unsigned short txAcked PACKED; /* 0Ch: acknowledged I-frms */
unsigned short txRetransm PACKED; /* 0Eh: re-transmit. I-frms */
unsigned short t1Timeout PACKED; /* 10h: T1 timeouts */
unsigned short rxSABM PACKED; /* 12h: received SABM frames */
unsigned short rxDISC PACKED; /* 14h: received DISC frames */
unsigned short rxDM PACKED; /* 16h: received DM frames */
unsigned short rxFRMR PACKED; /* 18h: FRMR frames received */
unsigned short txSABM PACKED; /* 1Ah: transm. SABM frames*/
unsigned short txDISC PACKED; /* 1Ch: transm. DISC frames*/
unsigned short txDM PACKED; /* 1Eh: transm. DM frames */
unsigned short txFRMR PACKED; /* 20h: transm. FRMR frames*/
} THdlcStats;
/* ---------------------------------------------------------------------------
* X25_HDLC_READ_COMM_ERR Command.
*/
typedef struct HdlcCommErr
{ /* a number of ... */
unsigned char rxOverrun PACKED; /* 00h: Rx overrun errors */
unsigned char rxBadCrc PACKED; /* 01h: Rx CRC errors */
unsigned char rxAborted PACKED; /* 02h: Rx aborted frames */
unsigned char rxDropped PACKED; /* 03h: frames lost */
unsigned char txAborted PACKED; /* 04h: Tx aborted frames */
unsigned char txUnderrun PACKED; /* 05h: Tx underrun errors */
unsigned char txMissIntr PACKED; /* 06h: missed underrun ints */
unsigned char reserved PACKED; /* 07h: reserved */
unsigned char droppedDCD PACKED; /* 08h: times DCD dropped */
unsigned char droppedCTS PACKED; /* 09h: times CTS dropped */
} THdlcCommErr;
/* ---------------------------------------------------------------------------
* X25_SET_CONFIGURATION & X25_READ_CONFIGURATION Commands.
*/
typedef struct X25Config
{
unsigned char baudRate PACKED; /* 00h: */
unsigned char t1 PACKED; /* 01h: */
unsigned char t2 PACKED; /* 02h: */
unsigned char n2 PACKED; /* 03h: */
unsigned short hdlcMTU PACKED; /* 04h: */
unsigned char hdlcWindow PACKED; /* 06h: */
unsigned char t4 PACKED; /* 07h: */
unsigned char autoModem PACKED; /* 08h: */
unsigned char autoHdlc PACKED; /* 09h: */
unsigned char hdlcOptions PACKED; /* 0Ah: */
unsigned char station PACKED; /* 0Bh: */
unsigned char pktWindow PACKED; /* 0Ch: */
unsigned short defPktSize PACKED; /* 0Dh: */
unsigned short pktMTU PACKED; /* 0Fh: */
unsigned short loPVC PACKED; /* 11h: */
unsigned short hiPVC PACKED; /* 13h: */
unsigned short loIncommingSVC PACKED; /* 15h: */
unsigned short hiIncommingSVC PACKED; /* 17h: */
unsigned short loTwoWaySVC PACKED; /* 19h: */
unsigned short hiTwoWaySVC PACKED; /* 1Bh: */
unsigned short loOutgoingSVC PACKED; /* 1Dh: */
unsigned short hiOutgoingSVC PACKED; /* 1Fh: */
unsigned short options PACKED; /* 21h: */
unsigned char responseOpt PACKED; /* 23h: */
unsigned short facil1 PACKED; /* 24h: */
unsigned short facil2 PACKED; /* 26h: */
unsigned short ccittFacil PACKED; /* 28h: */
unsigned short otherFacil PACKED; /* 2Ah: */
unsigned short ccittCompat PACKED; /* 2Ch: */
unsigned char t10t20 PACKED; /* 2Eh: */
unsigned char t11t21 PACKED; /* 2Fh: */
unsigned char t12t22 PACKED; /* 30h: */
unsigned char t13t23 PACKED; /* 31h: */
unsigned char t16t26 PACKED; /* 32H: */
unsigned char t28 PACKED; /* 33h: */
unsigned char r10r20 PACKED; /* 34h: */
unsigned char r12r22 PACKED; /* 35h: */
unsigned char r13r23 PACKED; /* 36h: */
} TX25Config;
/* ---------------------------------------------------------------------------
* X25_READ_CHANNEL_CONFIG Command.
*/
typedef struct X25ChanAlloc /*----- Channel allocation -*/
{
unsigned short loPVC PACKED; /* 00h: lowest PVC number */
unsigned short hiPVC PACKED; /* 02h: highest PVC number */
unsigned short loIncommingSVC PACKED; /* 04h: lowest incoming SVC */
unsigned short hiIncommingSVC PACKED; /* 06h: highest incoming SVC */
unsigned short loTwoWaySVC PACKED; /* 08h: lowest two-way SVC */
unsigned short hiTwoWaySVC PACKED; /* 0Ah: highest two-way SVC */
unsigned short loOutgoingSVC PACKED; /* 0Ch: lowest outgoing SVC */
unsigned short hiOutgoingSVC PACKED; /* 0Eh: highest outgoing SVC */
} TX25ChanAlloc;
typedef struct X25ChanCfg /*------ Channel configuration -----*/
{
unsigned char type PACKED; /* 00h: channel type */
unsigned char txConf PACKED; /* 01h: Tx packet and window sizes */
unsigned char rxConf PACKED; /* 01h: Rx packet and window sizes */
} TX25ChanCfg;
/*
* Defines for the 'type' field.
*/
#define X25_PVC 0x01 /* PVC */
#define X25_SVC_IN 0x03 /* Incoming SVC */
#define X25_SVC_TWOWAY 0x07 /* Two-way SVC */
#define X25_SVC_OUT 0x0B /* Outgoing SVC */
/*----------------------------------------------------------------------------
* X25_READ_STATISTICS Command.
*/
typedef struct X25Stats
{ /* number of packets Tx/Rx'ed */
unsigned short txRestartRqst PACKED; /* 00h: Restart Request */
unsigned short rxRestartRqst PACKED; /* 02h: Restart Request */
unsigned short txRestartConf PACKED; /* 04h: Restart Confirmation */
unsigned short rxRestartConf PACKED; /* 06h: Restart Confirmation */
unsigned short txResetRqst PACKED; /* 08h: Reset Request */
unsigned short rxResetRqst PACKED; /* 0Ah: Reset Request */
unsigned short txResetConf PACKED; /* 0Ch: Reset Confirmation */
unsigned short rxResetConf PACKED; /* 0Eh: Reset Confirmation */
unsigned short txCallRequest PACKED; /* 10h: Call Request */
unsigned short rxCallRequest PACKED; /* 12h: Call Request */
unsigned short txCallAccept PACKED; /* 14h: Call Accept */
unsigned short rxCallAccept PACKED; /* 16h: Call Accept */
unsigned short txClearRqst PACKED; /* 18h: Clear Request */
unsigned short rxClearRqst PACKED; /* 1Ah: Clear Request */
unsigned short txClearConf PACKED; /* 1Ch: Clear Confirmation */
unsigned short rxClearConf PACKED; /* 1Eh: Clear Confirmation */
unsigned short txDiagnostic PACKED; /* 20h: Diagnostic */
unsigned short rxDiagnostic PACKED; /* 22h: Diagnostic */
unsigned short txRegRqst PACKED; /* 24h: Registration Request */
unsigned short rxRegRqst PACKED; /* 26h: Registration Request */
unsigned short txRegConf PACKED; /* 28h: Registration Confirm.*/
unsigned short rxRegConf PACKED; /* 2Ah: Registration Confirm.*/
unsigned short txInterrupt PACKED; /* 2Ch: Interrupt */
unsigned short rxInterrupt PACKED; /* 2Eh: Interrupt */
unsigned short txIntrConf PACKED; /* 30h: Interrupt Confirm. */
unsigned short rxIntrConf PACKED; /* 32h: Interrupt Confirm. */
unsigned short txData PACKED; /* 34h: Data */
unsigned short rxData PACKED; /* 36h: Data */
unsigned short txRR PACKED; /* 38h: RR */
unsigned short rxRR PACKED; /* 3Ah: RR */
unsigned short txRNR PACKED; /* 3Ch: RNR */
unsigned short rxRNR PACKED; /* 3Eh: RNR */
} TX25Stats;
/*----------------------------------------------------------------------------
* X25_READ_HISTORY_TABLE Command.
*/
typedef struct X25EventLog
{
unsigned char type PACKED; /* 00h: transaction type */
unsigned short lcn PACKED; /* 01h: logical channel num */
unsigned char packet PACKED; /* 03h: async packet type */
unsigned char cause PACKED; /* 04h: X.25 cause field */
unsigned char diag PACKED; /* 05h: X.25 diag field */
TX25TimeStamp ts PACKED; /* 06h: time stamp */
} TX25EventLog;
/*
* Defines for the 'type' field.
*/
#define X25LOG_INCOMMING 0x00
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -