Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /* atmsap.h - ATM Service Access Point addressing definitions */
0003 
0004 /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
0005 
0006 
0007 #ifndef _LINUX_ATMSAP_H
0008 #define _LINUX_ATMSAP_H
0009 
0010 #include <linux/atmapi.h>
0011 
0012 /*
0013  * BEGIN_xx and END_xx markers are used for automatic generation of
0014  * documentation. Do not change them.
0015  */
0016 
0017 
0018 /*
0019  * Layer 2 protocol identifiers
0020  */
0021 
0022 /* BEGIN_L2 */
0023 #define ATM_L2_NONE 0   /* L2 not specified */
0024 #define ATM_L2_ISO1745  0x01    /* Basic mode ISO 1745 */
0025 #define ATM_L2_Q291 0x02    /* ITU-T Q.291 (Rec. I.441) */
0026 #define ATM_L2_X25_LL   0x06    /* ITU-T X.25, link layer */
0027 #define ATM_L2_X25_ML   0x07    /* ITU-T X.25, multilink */
0028 #define ATM_L2_LAPB 0x08    /* Extended LAPB, half-duplex (Rec. T.71) */
0029 #define ATM_L2_HDLC_ARM 0x09    /* HDLC ARM (ISO/IEC 4335) */
0030 #define ATM_L2_HDLC_NRM 0x0a    /* HDLC NRM (ISO/IEC 4335) */
0031 #define ATM_L2_HDLC_ABM 0x0b    /* HDLC ABM (ISO/IEC 4335) */
0032 #define ATM_L2_ISO8802  0x0c    /* LAN LLC (ISO/IEC 8802/2) */
0033 #define ATM_L2_X75  0x0d    /* ITU-T X.75, SLP */
0034 #define ATM_L2_Q922 0x0e    /* ITU-T Q.922 */
0035 #define ATM_L2_USER 0x10    /* user-specified */
0036 #define ATM_L2_ISO7776  0x11    /* ISO 7776 DTE-DTE */
0037 /* END_L2 */
0038 
0039 
0040 /*
0041  * Layer 3 protocol identifiers
0042  */
0043 
0044 /* BEGIN_L3 */
0045 #define ATM_L3_NONE 0   /* L3 not specified */
0046 #define ATM_L3_X25  0x06    /* ITU-T X.25, packet layer */
0047 #define ATM_L3_ISO8208  0x07    /* ISO/IEC 8208 */
0048 #define ATM_L3_X223 0x08    /* ITU-T X.223 | ISO/IEC 8878 */
0049 #define ATM_L3_ISO8473  0x09    /* ITU-T X.233 | ISO/IEC 8473 */
0050 #define ATM_L3_T70  0x0a    /* ITU-T T.70 minimum network layer */
0051 #define ATM_L3_TR9577   0x0b    /* ISO/IEC TR 9577 */
0052 #define ATM_L3_H310 0x0c    /* ITU-T Recommendation H.310 */
0053 #define ATM_L3_H321 0x0d    /* ITU-T Recommendation H.321 */
0054 #define ATM_L3_USER 0x10    /* user-specified */
0055 /* END_L3 */
0056 
0057 
0058 /*
0059  * High layer identifiers
0060  */
0061 
0062 /* BEGIN_HL */
0063 #define ATM_HL_NONE 0   /* HL not specified */
0064 #define ATM_HL_ISO  0x01    /* ISO */
0065 #define ATM_HL_USER 0x02    /* user-specific */
0066 #define ATM_HL_HLP  0x03    /* high layer profile - UNI 3.0 only */
0067 #define ATM_HL_VENDOR   0x04    /* vendor-specific application identifier */
0068 /* END_HL */
0069 
0070 
0071 /*
0072  * ITU-T coded mode of operation
0073  */
0074 
0075 /* BEGIN_IMD */
0076 #define ATM_IMD_NONE     0  /* mode not specified */
0077 #define ATM_IMD_NORMAL   1  /* normal mode of operation */
0078 #define ATM_IMD_EXTENDED 2  /* extended mode of operation */
0079 /* END_IMD */
0080 
0081 /*
0082  * H.310 code points
0083  */
0084 
0085 #define ATM_TT_NONE 0   /* terminal type not specified */
0086 #define ATM_TT_RX   1   /* receive only */
0087 #define ATM_TT_TX   2   /* send only */
0088 #define ATM_TT_RXTX 3   /* receive and send */
0089 
0090 #define ATM_MC_NONE 0   /* no multiplexing */
0091 #define ATM_MC_TS   1   /* transport stream (TS) */
0092 #define ATM_MC_TS_FEC   2   /* transport stream with forward error corr. */
0093 #define ATM_MC_PS   3   /* program stream (PS) */
0094 #define ATM_MC_PS_FEC   4   /* program stream with forward error corr. */
0095 #define ATM_MC_H221 5   /* ITU-T Rec. H.221 */
0096 
0097 /*
0098  * SAP structures
0099  */
0100 
0101 #define ATM_MAX_HLI 8   /* maximum high-layer information length */
0102 
0103 
0104 struct atm_blli {
0105     unsigned char l2_proto; /* layer 2 protocol */
0106     union {
0107     struct {
0108         unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
0109                 /* absent */
0110         unsigned char window; /* window size (k), 1-127 (0 to omit) */
0111     } itu;          /* ITU-T encoding */
0112     unsigned char user; /* user-specified l2 information */
0113     } l2;
0114     unsigned char l3_proto; /* layer 3 protocol */
0115     union {
0116     struct {
0117         unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
0118                 /* absent */
0119         unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
0120                     /* omit) */
0121         unsigned char window;/* packet window size, 1-127 (0 to omit) */
0122     } itu;          /* ITU-T encoding */
0123     unsigned char user; /* user specified l3 information */
0124     struct {              /* if l3_proto = ATM_L3_H310 */
0125         unsigned char term_type;  /* terminal type */
0126         unsigned char fw_mpx_cap; /* forward multiplexing capability */
0127                       /* only if term_type != ATM_TT_NONE */
0128         unsigned char bw_mpx_cap; /* backward multiplexing capability */
0129                       /* only if term_type != ATM_TT_NONE */
0130     } h310;
0131     struct {          /* if l3_proto = ATM_L3_TR9577 */
0132         unsigned char ipi;    /* initial protocol id */
0133         unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
0134                   /* (only if ipi == NLPID_IEEE802_1_SNAP) */
0135     } tr9577;
0136     } l3;
0137 } __ATM_API_ALIGN;
0138 
0139 
0140 struct atm_bhli {
0141     unsigned char hl_type;  /* high layer information type */
0142     unsigned char hl_length;    /* length (only if hl_type == ATM_HL_USER || */
0143                 /* hl_type == ATM_HL_ISO) */
0144     unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
0145 };
0146 
0147 
0148 #define ATM_MAX_BLLI    3       /* maximum number of BLLI elements */
0149 
0150 
0151 struct atm_sap {
0152     struct atm_bhli bhli;       /* local SAP, high-layer information */
0153     struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
0154                     /* local SAP, low-layer info */
0155 };
0156 
0157 
0158 static __inline__ int blli_in_use(struct atm_blli blli)
0159 {
0160     return blli.l2_proto || blli.l3_proto;
0161 }
0162 
0163 #endif