1 /*
2  * Copyright (C) Eicon Technology Corporation, 2000.
3  *
4  * Eicon File Revision :    1.0
5  *
6  * This software may be used and distributed according to the terms
7  * of the GNU General Public License, incorporated herein by reference.
8  *
9  */
10 
11 /*------------------------------------------------------------------*/
12 /* Q.931 information elements maximum length                        */
13 /* excluding the identifier, including the length field             */
14 /*------------------------------------------------------------------*/
15 
16 #define MAX_LEN_BC      13
17 #define MAX_LEN_LLC     19 /* ctr3 */
18 #define MAX_LEN_HLC     6  /* ctr3 */
19 #define MAX_LEN_UUI     200 /* Hicom USBS req */
20 #define MAX_LEN_NUM     24
21 #define MAX_LEN_DSP     83 /* ctr3 */
22 #define MAX_LEN_NI      4
23 #define MAX_LEN_PI      5
24 #define MAX_LEN_SIN     3
25 #define MAX_LEN_CST     4
26 #define MAX_LEN_SIG     2
27 #define MAX_LEN_SPID    32
28 #define MAX_LEN_EID     3
29 #define MAX_LEN_CHI     35  /* ctr3 */
30 #define MAX_LEN_CAU     33
31 #define MAX_LEN_FTY     130
32 #define MAX_LEN_KEY     83  /* ctr3 */
33 #define MAX_LEN_RSI     4
34 #define MAX_LEN_CAI     11
35 #define MAX_NUM_SPID    4
36 #define MAX_LEN_USERID  9
37 #define MAX_LEN_APPLID  5
38 #define MAX_LEN_NTTCIF  15
39 
40 /*------------------------------------------------------------------*/
41 /* decision return values                                           */
42 /*------------------------------------------------------------------*/
43 
44 #define YES             1
45 #define NO              0
46 
47 
48 /*-------------------------------------------------------------------*/
49 /* w element coding                                                  */
50 /*-------------------------------------------------------------------*/
51 
52 #define NTTCIF          0x01
53 #define BC              0x04
54 #define CAU             0x08
55 #define CAD             0x0c
56 #define CAI             0x10
57 #define CST             0x14
58 #define CHI             0x18
59 #define LLI             0x19
60 #define CHA             0x1a
61 #define FTY             0x1c
62 #define PI              0x1e
63 #define NFAC            0x20
64 #define TC              0x24
65 #define ATT_EID         0x26
66 #define NI              0x27
67 #define DSP             0x28
68 #define DT              0x29
69 #define KEY             0x2c
70 #define KP              0x2c
71 #define UID             0x2d
72 #define SIG             0x34
73 #define FI              0x39
74 #define SPID            0x3a
75 #define EID             0x3b
76 #define DSPF            0x3c
77 #define ECAD            0x4c
78 #define OAD             0x6c
79 #define OSA             0x6d
80 #define DAD             0x70
81 #define CPN             0x70
82 #define DSA             0x71
83 #define RDX             0x73
84 #define RAD             0x74
85 #define RDN             0x74
86 #define RSI             0x79
87 #define SCR             0x7A   /* internal unscreened CPN          */
88 #define MIE             0x7a   /* internal management info element */
89 #define LLC             0x7c
90 #define HLC             0x7d
91 #define UUI             0x7e
92 #define ESC             0x7f
93 
94 #define SHIFT           0x90
95 #define MORE            0xa0
96 #define CL              0xb0
97 
98 /* information elements used on the spid interface */
99 #define SPID_CMD        0xc0
100 #define SPID_LINK       0x10
101 #define SPID_DN         0x70
102 #define SPID_BC         0x04
103 #define SPID_SWITCH     0x11
104 
105 /*------------------------------------------------------------------*/
106 /* global configuration parameters, defined in exec.c               */
107 /* these parameters are configured with program loading             */
108 /*------------------------------------------------------------------*/
109 
110 #define PROT_1TR6       0
111 #define PROT_ETSI       1
112 #define PROT_FRANC      2
113 #define PROT_BELG       3
114 #define PROT_SWED       4
115 #define PROT_NI         5
116 #define PROT_5ESS       6
117 #define PROT_JAPAN      7
118 #define PROT_ATEL       8
119 #define PROT_US         9
120 #define PROT_ITALY      10
121 #define PROT_TWAN       11
122 #define PROT_AUSTRAL    12
123 
124 #define INIT_PROT_1TR6    0x80|PROT_1TR6
125 #define INIT_PROT_ETSI    0x80|PROT_ETSI
126 #define INIT_PROT_FRANC   0x80|PROT_FRANC
127 #define INIT_PROT_BELG    0x80|PROT_BELG
128 #define INIT_PROT_SWED    0x80|PROT_SWED
129 #define INIT_PROT_NI      0x80|PROT_NI
130 #define INIT_PROT_5ESS    0x80|PROT_5ESS
131 #define INIT_PROT_JAPAN   0x80|PROT_JAPAN
132 #define INIT_PROT_ATEL    0x80|PROT_ATEL
133 #define INIT_PROT_ITALY   0x80|PROT_ITALY
134 #define INIT_PROT_TWAN    0x80|PROT_TWAN
135 #define INIT_PROT_AUSTRAL 0x80|PROT_AUSTRAL
136 
137 
138 /* -----------------------------------------------------------**
139 ** The PROTOCOL_FEATURE_STRING in feature.h (included         **
140 ** in prstart.sx and astart.sx) defines capabilities and      **
141 ** features of the actual protocol code. It's used as a bit   **
142 ** mask.                                                      **
143 ** The following Bits are defined:                            **
144 ** -----------------------------------------------------------*/
145 
146 #define PROTCAP_TELINDUS  0x0001  /* Telindus Variant of protocol code   */
147 #define PROTCAP_MANIF     0x0002  /* Management interface implemented    */
148 #define PROTCAP_V_42      0x0004  /* V42 implemented                     */
149 #define PROTCAP_V90D      0x0008  /* V.90D (implies up to 384k DSP code) */
150 #define PROTCAP_EXTD_FAX  0x0010  /* Extended FAX (ECM, 2D, T6, Polling) */
151 #define PROTCAP_FREE4     0x0020  /* not used                            */
152 #define PROTCAP_FREE5     0x0040  /* not used                            */
153 #define PROTCAP_FREE6     0x0080  /* not used                            */
154 #define PROTCAP_FREE7     0x0100  /* not used                            */
155 #define PROTCAP_FREE8     0x0200  /* not used                            */
156 #define PROTCAP_FREE9     0x0400  /* not used                            */
157 #define PROTCAP_FREE10    0x0800  /* not used                            */
158 #define PROTCAP_FREE11    0x1000  /* not used                            */
159 #define PROTCAP_FREE12    0x2000  /* not used                            */
160 #define PROTCAP_FREE13    0x4000  /* not used                            */
161 #define PROTCAP_EXTENSION 0x8000  /* used for future extentions          */
162