📄 cdi.h
字号:
#ifndef _SYS_CDI_H#define _SYS_CDI_H#ident "@(#) cdi.h 1.20 11/17/03"/* * cdi.h header for Communications Device Interface * * Copyright (c) 1989 NCR Comten * * This file distributed by Gcom, Inc with permission of NCR Comten *//* * Primitives for Local Management Services */#define CD_INFO_REQ 0x00 /* Information request */#define CD_INFO_ACK 0x01 /* Information acknowledgement */#define CD_ATTACH_REQ 0x02 /* Attach a PPA */#define CD_DETACH_REQ 0x03 /* Detach a PPA */#define CD_ENABLE_REQ 0x04 /* Prepare a device */#define CD_DISABLE_REQ 0x05 /* Disable a device */#define CD_OK_ACK 0x06 /* Success acknowledgement */#define CD_ERROR_ACK 0x07 /* Error acknowledgement */#define CD_ENABLE_CON 0x08 /* Enable confirmation */#define CD_DISABLE_CON 0x09 /* Disable confirmation */#define CD_ERROR_IND 0x0a /* Error indication *//* * Primitives used for Data Transfer */#define CD_ALLOW_INPUT_REQ 0x0b /* Allow input */#define CD_READ_REQ 0x0c /* Wait-for-input request */#define CD_UNITDATA_REQ 0x0d /* Data send request */#define CD_WRITE_READ_REQ 0x0e /* Write/read request */#define CD_UNITDATA_ACK 0x0f /* Data send acknowledgement */#define CD_UNITDATA_IND 0x10 /* Data receive indication */#define CD_HALT_INPUT_REQ 0x11 /* Halt input */#define CD_ABORT_OUTPUT_REQ 0x12 /* Abort output */#define CD_MUX_NAME_REQ 0x13 /* get mux name (Gcom) */#define CD_BAD_FRAME_IND 0x14 /* frame w/error (Gcom extension) */#define CD_MODEM_SIG_REQ 0x15 /* Assert modem signals (Gcom) */#define CD_MODEM_SIG_IND 0x16 /* Report modem signal state (Gcom) */#define CD_MODEM_SIG_POLL 0x17 /* requests a CD_MODEM_SIG_IND (Gcom) *//* * CDI device states */#define CD_UNATTACHED 0x00 /* No PPA attached */#define CD_UNUSABLE 0x01 /* PPA cannot be used */#define CD_DISABLED 0x02 /* PPA attached */#define CD_ENABLE_PENDING 0x03 /* Waiting ack of enable req */#define CD_ENABLED 0x04 /* Awaiting use */#define CD_READ_ACTIVE 0x05 /* Input section enabled; */ /* disabled after data arrives */#define CD_INPUT_ALLOWED 0x06 /* Input section permanently enabled */#define CD_DISABLE_PENDING 0x07 /* Waiting ack of disable req */#define CD_OUTPUT_ACTIVE 0x08 /* Output section active only */#define CD_XRAY 0x09 /* Xray-ing another ppa */#define CD_NOT_AUTH 0x0A /* Not authorized, unusable *//* * CD_ERROR_ACK and CD_ERROR_IND error return values */#define CD_BADADDRESS 0x01 /* Address was invalid */#define CD_BADADDRTYPE 0x02 /* Invalid address type */#define CD_BADDIAL 0x03 /* Dial information was invalid */#define CD_BADDIALTYPE 0x04 /* Invalid dial information type */#define CD_BADDISPOSAL 0x05 /* Invalid disposal parameter */#define CD_BADFRAME 0x06 /* Defective SDU received */#define CD_BADPPA 0x07 /* Invalid PPA identifier */#define CD_BADPRIM 0x08 /* Unrecognized primitive */#define CD_DISC 0x09 /* Disconnected */#define CD_EVENT 0x0a /* Protocol-specific event occurred */#define CD_FATALERR 0x0b /* Device has become unusable */#define CD_INITFAILED 0x0c /* Line initialization failed */#define CD_NOTSUPP 0x0d /* Primitive not supported by this device */#define CD_OUTSTATE 0x0e /* Primitive was issued from an invalid state */#define CD_PROTOSHORT 0x0f /* M_PROTO block too short */#define CD_READTIMEOUT 0x10 /* Read request timed out before data arrived */#define CD_SYSERR 0x11 /* UNIX system error */#define CD_WRITEFAIL 0x12 /* Unitdata request failed *//* * Error explanations */#define CD_CRCERR 0x01 /* CRC or FCS error */#define CD_DLE_EOT 0x02 /* DLE EOT detected */#define CD_FORMAT 0x03 /* Format error detected */#define CD_HDLC_ABORT 0x04 /* Aborted frame detected */#define CD_OVERRUN 0x05 /* Input overrun */#define CD_TOOSHORT 0x06 /* Frame too short */#define CD_INCOMPLETE 0x07 /* Partial frame received */#define CD_BUSY 0x08 /* Telephone was busy */#define CD_NOANSWER 0x09 /* Connection went unanswered */#define CD_CALLREJECT 0x0a /* Connection rejected */#define CD_HDLC_IDLE 0x0b /* HDLC line went idle */#define CD_HDLC_NOTIDLE 0x0c /* HDLC line no longer idle */#define CD_QUIESCENT 0x0d /* Line being reassigned */#define CD_RESUMED 0x0e /* Line has been reassigned */#define CD_DSRTIMEOUT 0x0f /* Did not see DSR in time */#define CD_LAN_COLLISIONS 0x10 /* LAN excessive collisions */#define CD_LAN_REFUSED 0x11 /* LAN message refused */#define CD_LAN_NOSTATION 0x12 /* LAN no such station */#define CD_LOSTCTS 0x13 /* Lost Clear to Send signal */#define CD_DEVERR 0x100 /* Start of device-specific codes *//* * CDI device classes */#define CD_HDLC 0x00 /* Bit-synchronous */#define CD_BISYNC 0x01 /* Character-synchronous */#define CD_LAN 0x02 /* ISO 8802-3,4,5 local-area network MAC */#define CD_NODEV 0x03 /* no device, ppa used for X-ray *//* * CDI duplex types */#define CD_FULLDUPLEX 0x00 /* Full duplex; allow input supported */#define CD_HALFDUPLEX 0x01 /* Half duplex; read and write/read supported *//* * CDI output styles */#define CD_UNACKEDOUTPUT 0x00 /* No unitdata acknowledgements */#define CD_ACKEDOUTPUT 0x01 /* Unitdata acknowledgements */#define CD_PACEDOUTPUT 0x02 /* Unitdata acks as output timing hints *//* * CDI optional features */#define CD_CANREAD 0x01 /* Read request supported on full duplex */#define CD_CANDIAL 0x02 /* Dial information supported */#define CD_AUTOALLOW 0x04 /* CD_INPUT_ALLOWED as soon as enabled */#define CD_KEEPALIVE 0x08 /* Gcom: Don't send off at CD_DISABLE_REQ *//* * CDI provider style. * The CDI provider style which determines whether a provider * requires a CD_ATTACH_REQ to inform the provider which PPA * user messages should be sent/received on. */#define CD_STYLE1 0x00 /* PPA is implicitly bound by open(2) */#define CD_STYLE2 0x01 /* PPA must be explicitly bound via CD_ATTACH_REQ */#define CD_STYLE_1 CD_STYLE1 /* Gcom -- to match document */#define CD_STYLE_2 CD_STYLE2 /* Gcom -- to match document *//* * Symbolic value for "no dialing information" */#define CD_NODIAL 0x00/* * Actions to take with undelivered data in a CD_DISABLE_REQ orCD_HALT_INPUT_REQ */#define CD_FLUSH 0x00 /* Discard undelivered data */#define CD_WAIT 0x01 /* Attempt to deliver unsent data */#define CD_DELIVER 0x02/* * Address types */#define CD_SPECIFIC 0x00 /* Specific address follows */#define CD_BROADCAST 0x01 /* Broadcast; no address follows */#define CD_IMPLICIT 0x02 /* No address or embedded address *//* * Error types for CD_BAD_FRAME_IND */#define CD_FRMTOOLONG 0xFFFF /* frame overflowed rcv bfr */#define CD_FRMNONOCTET 0xFFFE /* frame not octet-aligned */#define CD_EMPTY_BFR 0xFFFD /* empty rcv buffer (not used) */#define CD_BAD_CRC 0xFFFC /* CRC error */#define CD_FRM_ABORTED 0xFFFB /* frame aborted */#define CD_RCV_OVERRUN 0xFFFA /* receive overrun *//* * Modem signal bits for modem signal related requests and indications */#define CD_DTR 0x01#define CD_RTS 0x02#define CD_DSR 0x04#define CD_DCD 0x08#define CD_CTS 0x10#define CD_RI 0x20/* * CDI interface primitive definitions. * * Each primitive is sent as a Stream message. It is possible that * the messages may be viewed as a sequence of bytes that have the * following form without any padding. The structure definition * of the following messages may have to change depending on the * underlying hardware architecture and crossing of a hardware * boundary with a different hardware architecture. * * Each message has the name defined followed by the * Stream message type (M_PROTO, M_PCPROTO, M_DATA) */#if !defined(_LINUX_TYPES_H) && !defined(_INTTYPES_H)# if defined(__sparcv9) /* 64-bit SPARC compile */ typedef unsigned int cd_ulong ; typedef unsigned short cd_ushort ;# else typedef unsigned long cd_ulong ; typedef unsigned short cd_ushort ;# endif#else typedef uint32_t cd_ulong ; typedef uint16_t cd_ushort ;#endif/* * LOCAL MANAGEMENT PRIMITIVES *//* * CD_INFO_REQ, M_PROTO or M_PCPROTO type */typedef struct { cd_ulong cd_primitive;} cd_info_req_t;/* * CD_INFO_ACK, M_PROTO or M_PCPROTO type */typedef struct { cd_ulong cd_primitive; cd_ulong cd_state; cd_ulong cd_max_sdu; cd_ulong cd_min_sdu; cd_ulong cd_class; cd_ulong cd_duplex; cd_ulong cd_output_style; cd_ulong cd_features; cd_ulong cd_addr_length; cd_ulong cd_ppa_style;} cd_info_ack_t;/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -