home *** CD-ROM | disk | FTP | other *** search
- /* ******************************************************************************************** */
- /* * * */
- /* * X.25 Interface Library * */
- /* * ---------------------- * */
- /* * * */
- /* * X25_Packet.h * */
- /* * * */
- /* *..........................................................................................* */
- /* * * */
- /* * X.25 Packet Format Definitions. * */
- /* * * */
- /* * * */
- /* *------------------------------------------------------------------------------------------* */
- /* * * */
- /* * Copyright © 1988-1990 Apple Computer, Inc. * */
- /* * All Rights Reserved * */
- /* * * */
- /* *------------------------------------------------------------------------------------------* */
- /* * * */
- /* * Revision History: * */
- /* * * */
- /* * Date Individual Changes * */
- /* * ......... ................... .................................................. * */
- /* * * */
- /* * 15 Aug 88 D. N. Willey Original Version * */
- /* * * */
- /* * * */
- /* ******************************************************************************************** */
-
-
- #ifndef _X25_Packet_Includes_
- #define _X25_Packet_Includes_
-
-
-
- /* ******************************************************************************************** */
- /* * * */
- /* * General X.25 Packet Definitions * */
- /* * * */
- /* ******************************************************************************************** */
-
- /* +------------------------------------------------------------------------------------------+ */
- /* | | */
- /* | General Packet Structure Definition | */
- /* | | */
- /* +------------------------------------------------------------------------------------------+ */
-
- #define packet(data_len) \
- \
- struct { \
- /* General Format Identifier (left nibble) */ \
- unsigned Q_bit : 1; /* Qualified Data Transmission */ \
- unsigned D_bit : 1; /* Delivery Confirmation Notification */ \
- unsigned modulo : 2; /* Sequence Number Modulo */ \
- unsigned l_c_g : 4; /* Logical Channel Group Number (right nibble) */ \
- unsigned l_c_n : 8; /* Logical Channel Number */ \
- unsigned pkt_type : 8; /* Packet Type Identifier */ \
- unsigned char pkt_data[data_len]; /* Begining of the Variable Packet Data Field */ \
- }
-
- #define L_bit Q_bit
-
- /* +------------------------------------------------------------------------------------------+ */
- /* | | */
- /* | Packet Types | */
- /* | | */
- /* +------------------------------------------------------------------------------------------+ */
-
-
- #define X25_Call_Request_Pkt 0x0B
- #define X25_Call_Accepted_Pkt 0x0F
-
- #define X25_Clear_Pkt 0x13
- #define X25_Clear_Conf_Pkt 0x17
-
- #define X25_Data_Pkt 0x00
-
- #define X25_Interrupt_Pkt 0x23
- #define X25_Interrupt_Conf_Pkt 0x27
-
- #define X25_Reset_Pkt 0x1B
- #define X25_Reset_Conf_Pkt 0x1F
-
- #define X25_Restart_Pkt 0xFB
- #define X25_Restart_Conf_Pkt 0xFF
-
- #define X25_Diagnostic_Pkt 0xF1
-
- #define X25_Registration_Pkt 0xF3
- #define X25_Registration_Conf_Pkt 0xF7
-
-
- /* ******************************************************************************************** */
- /* * * */
- /* * Call Facility Codes * */
- /* * * */
- /* ******************************************************************************************** */
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
- /* + + */
- /* + X.25 Call Facility Indicator Codes + */
- /* + + */
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-
- #define F_CUG_BASIC 0x03 /* closed user group - basic (2 digits) */
- #define F_CUG_EXT 0x47 /* closed user group - extended (4 digits) */
- #define F_CUG_OA_BASIC 0x09 /* cug with outgoing access - basic (2 digits) */
- #define F_CUG_OA_EXT 0x48 /* cug with outgoing access - extended (4 digits) */
- #define F_BCUG 0x41 /* bilateral closed user group */
- #define F_REV_CHARG 0x01 /* reverse charging */
- #define F_RPOA_BASIC 0x44 /* RPOA transit netmork selection - (1 address) */
- #define F_RPOA_EXT 0xC4 /* RPOA transit netmork selection - (n addresss) */
- #define F_CHARG_INFO 0x04 /* charging information */
- #define F_NUI 0xC6 /* network user identification */
- #define F_PKT_SIZE_NEG 0x42 /* Packet Size Negotiation */
- #define F_WND_SIZE_NEG 0x43 /* Window Size Negotiation */
- #define F_T_CLASS_NEG 0x02 /* Throughput Class Negotiation */
- #define F_TRANSIT_DELAY 0x49 /* Transit Delay Selection and Negotiation */
-
- #define F_MARKER 0x00 /* Facility Marker */
-
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
- /* + + */
- /* + Call Facility Bits + */
- /* + + */
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-
- #define FB_REV_CHARG 0x01 /* bit indicating reverse charging */
- #define FB_FAST_SEL 0x80 /* bit indicating fast select */
- #define FB_FAST_SEL_R 0xC0 /* bit indicating fast select restrictive */
- #define FB_CHARG_INFO 0x01 /* bit indicating charging info requested */
-
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
- /* + + */
- /* + CCITT Call Facility Indicator Codes + */
- /* + + */
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-
- #define F_CCITT_CALLED_NSAP 0xC9 /* called nsap */
- #define F_CCITT_CALLING_NSAP 0xCB /* calling nsap */
- #define F_CCITT_T_CLASS_NEG 0x0A /* Throughput Class Negotiation */
- #define F_CCITT_TRANSIT_DELAY 0xCA /* Transit Delay Selection and Negotiation */
- #define F_CCITT_E_DATA_NEG 0x0B /* Expedited Data Negotiation */
-
-
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
- /* + + */
- /* + Call Facility Bits + */
- /* + + */
- /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-
- #define FB_CCITT_E_DATA_NEG 0x01 /* Expedited Data Negotiation */
-
-
- /* ******************************************************************************************** */
- /* * * */
- /* * End * */
- /* * * */
- /* ******************************************************************************************** */
-
- #endif _X25_Packet_Includes_
-