Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/* atmsap.h - ATM Service Access Point addressing definitions */
2
 
3
/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
4
 
5
 
6
#ifndef _LINUX_ATMSAP_H
7
#define _LINUX_ATMSAP_H
8
 
9
#include <linux/atmapi.h>
10
 
11
/*
12
 * BEGIN_xx and END_xx markers are used for automatic generation of
13
 * documentation. Do not change them.
14
 */
15
 
16
 
17
/*
18
 * Layer 2 protocol identifiers
19
 */
20
 
21
/* BEGIN_L2 */
22
#define ATM_L2_NONE     0       /* L2 not specified */
23
#define ATM_L2_ISO1745  0x01    /* Basic mode ISO 1745 */
24
#define ATM_L2_Q291     0x02    /* ITU-T Q.291 (Rec. I.441) */
25
#define ATM_L2_X25_LL   0x06    /* ITU-T X.25, link layer */
26
#define ATM_L2_X25_ML   0x07    /* ITU-T X.25, multilink */
27
#define ATM_L2_LAPB     0x08    /* Extended LAPB, half-duplex (Rec. T.71) */
28
#define ATM_L2_HDLC_ARM 0x09    /* HDLC ARM (ISO/IEC 4335) */
29
#define ATM_L2_HDLC_NRM 0x0a    /* HDLC NRM (ISO/IEC 4335) */
30
#define ATM_L2_HDLC_ABM 0x0b    /* HDLC ABM (ISO/IEC 4335) */
31
#define ATM_L2_ISO8802  0x0c    /* LAN LLC (ISO/IEC 8802/2) */
32
#define ATM_L2_X75      0x0d    /* ITU-T X.75, SLP */
33
#define ATM_L2_Q922     0x0e    /* ITU-T Q.922 */
34
#define ATM_L2_USER     0x10    /* user-specified */
35
#define ATM_L2_ISO7776  0x11    /* ISO 7776 DTE-DTE */
36
/* END_L2 */
37
 
38
 
39
/*
40
 * Layer 3 protocol identifiers
41
 */
42
 
43
/* BEGIN_L3 */
44
#define ATM_L3_NONE     0       /* L3 not specified */
45
#define ATM_L3_X25      0x06    /* ITU-T X.25, packet layer */
46
#define ATM_L3_ISO8208  0x07    /* ISO/IEC 8208 */
47
#define ATM_L3_X223     0x08    /* ITU-T X.223 | ISO/IEC 8878 */
48
#define ATM_L3_ISO8473  0x09    /* ITU-T X.233 | ISO/IEC 8473 */
49
#define ATM_L3_T70      0x0a    /* ITU-T T.70 minimum network layer */
50
#define ATM_L3_TR9577   0x0b    /* ISO/IEC TR 9577 */
51
#define ATM_L3_H310     0x0c    /* ITU-T Recommendation H.310 */
52
#define ATM_L3_H321     0x0d    /* ITU-T Recommendation H.321 */
53
#define ATM_L3_USER     0x10    /* user-specified */
54
/* END_L3 */
55
 
56
 
57
/*
58
 * High layer identifiers
59
 */
60
 
61
/* BEGIN_HL */
62
#define ATM_HL_NONE     0       /* HL not specified */
63
#define ATM_HL_ISO      0x01    /* ISO */
64
#define ATM_HL_USER     0x02    /* user-specific */
65
#define ATM_HL_HLP      0x03    /* high layer profile - UNI 3.0 only */
66
#define ATM_HL_VENDOR   0x04    /* vendor-specific application identifier */
67
/* END_HL */
68
 
69
 
70
/*
71
 * ITU-T coded mode of operation
72
 */
73
 
74
/* BEGIN_IMD */
75
#define ATM_IMD_NONE     0      /* mode not specified */
76
#define ATM_IMD_NORMAL   1      /* normal mode of operation */
77
#define ATM_IMD_EXTENDED 2      /* extended mode of operation */
78
/* END_IMD */
79
 
80
/*
81
 * H.310 code points
82
 */
83
 
84
#define ATM_TT_NONE     0       /* terminal type not specified */
85
#define ATM_TT_RX       1       /* receive only */
86
#define ATM_TT_TX       2       /* send only */
87
#define ATM_TT_RXTX     3       /* receive and send */
88
 
89
#define ATM_MC_NONE     0       /* no multiplexing */
90
#define ATM_MC_TS       1       /* transport stream (TS) */
91
#define ATM_MC_TS_FEC   2       /* transport stream with forward error corr. */
92
#define ATM_MC_PS       3       /* program stream (PS) */
93
#define ATM_MC_PS_FEC   4       /* program stream with forward error corr. */
94
#define ATM_MC_H221     5       /* ITU-T Rec. H.221 */
95
 
96
/*
97
 * SAP structures
98
 */
99
 
100
#define ATM_MAX_HLI     8       /* maximum high-layer information length */
101
 
102
 
103
struct atm_blli {
104
    unsigned char l2_proto;     /* layer 2 protocol */
105
    union {
106
        struct {
107
            unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
108
                                /* absent */
109
            unsigned char window; /* window size (k), 1-127 (0 to omit) */
110
        } itu;                  /* ITU-T encoding */
111
        unsigned char user;     /* user-specified l2 information */
112
    } l2;
113
    unsigned char l3_proto;     /* layer 3 protocol */
114
    union {
115
        struct {
116
            unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
117
                                /* absent */
118
            unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
119
                                    /* omit) */
120
            unsigned char window;/* packet window size, 1-127 (0 to omit) */
121
        } itu;                  /* ITU-T encoding */
122
        unsigned char user;     /* user specified l3 information */
123
        struct {                      /* if l3_proto = ATM_L3_H310 */
124
            unsigned char term_type;  /* terminal type */
125
            unsigned char fw_mpx_cap; /* forward multiplexing capability */
126
                                      /* only if term_type != ATM_TT_NONE */
127
            unsigned char bw_mpx_cap; /* backward multiplexing capability */
128
                                      /* only if term_type != ATM_TT_NONE */
129
        } h310;
130
        struct {                  /* if l3_proto = ATM_L3_TR9577 */
131
            unsigned char ipi;    /* initial protocol id */
132
            unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
133
                                  /* (only if ipi == NLPID_IEEE802_1_SNAP) */
134
        } tr9577;
135
    } l3;
136
} __ATM_API_ALIGN;
137
 
138
 
139
struct atm_bhli {
140
    unsigned char hl_type;      /* high layer information type */
141
    unsigned char hl_length;    /* length (only if hl_type == ATM_HL_USER || */
142
                                /* hl_type == ATM_HL_ISO) */
143
    unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
144
};
145
 
146
 
147
#define ATM_MAX_BLLI    3               /* maximum number of BLLI elements */
148
 
149
 
150
struct atm_sap {
151
        struct atm_bhli bhli;           /* local SAP, high-layer information */
152
        struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
153
                                        /* local SAP, low-layer info */
154
};
155
 
156
 
157
static __inline__ int blli_in_use(struct atm_blli blli)
158
{
159
        return blli.l2_proto || blli.l3_proto;
160
}
161
 
162
#endif