blob: edff7691fcaca1be6639d5351951f2ef04ddcc5b [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001#ifndef _GSM_04_08_H
2#define _GSM_04_08_H
3
4/* GSM TS 04.08 definitions */
Holger Freyther1adb4ff2009-02-04 00:04:52 +00005struct gsm_lchan;
Harald Welte52b1f982008-12-23 20:25:15 +00006
7/* Chapter 10.5.2.5 */
8struct gsm48_chan_desc {
9 u_int8_t chan_nr;
10 union {
11 struct {
12 u_int8_t maio_high:4,
13 h:1,
14 tsc:3;
15 u_int8_t hsn:6,
16 maio_low:2;
17 } h1;
18 struct {
19 u_int8_t arfcn_high:2,
20 spare:2,
21 h:1,
22 tsc:3;
23 u_int8_t arfcn_low;
24 } h0;
25 };
Harald Welteb84e2f42008-12-28 23:42:04 +000026} __attribute__ ((packed));
Harald Welte52b1f982008-12-23 20:25:15 +000027
28/* Chapter 10.5.2.30 */
29struct gsm48_req_ref {
30 u_int8_t ra;
31 u_int8_t t3_high:3,
32 t1_:5;
33 u_int8_t t2:5,
34 t3_low:3;
Harald Welteb84e2f42008-12-28 23:42:04 +000035} __attribute__ ((packed));
Harald Welte52b1f982008-12-23 20:25:15 +000036
Harald Welte7584aea2009-02-11 11:44:12 +000037/* Chapter 9.1.5 */
38struct gsm48_chan_mode_modify {
39 struct gsm48_chan_desc chan_desc;
40 u_int8_t mode;
41} __attribute__ ((packed));
42
Harald Welte52b1f982008-12-23 20:25:15 +000043/* Chapter 9.1.18 */
44struct gsm48_imm_ass {
45 u_int8_t l2_plen;
46 u_int8_t proto_discr;
47 u_int8_t msg_type;
48 u_int8_t page_mode;
49 struct gsm48_chan_desc chan_desc;
50 struct gsm48_req_ref req_ref;
51 u_int8_t timing_advance;
52 u_int8_t mob_alloc_len;
53 u_int8_t mob_alloc[0];
Harald Welteb84e2f42008-12-28 23:42:04 +000054} __attribute__ ((packed));
Harald Welte52b1f982008-12-23 20:25:15 +000055
Harald Welte4b634542008-12-27 01:55:51 +000056/* Chapter 10.5.1.3 */
Harald Welte52b1f982008-12-23 20:25:15 +000057struct gsm48_loc_area_id {
58 u_int8_t digits[3]; /* BCD! */
59 u_int16_t lac;
60} __attribute__ ((packed));
61
62/* Section 9.2.15 */
63struct gsm48_loc_upd_req {
64 u_int8_t type:4,
65 key_seq:4;
66 struct gsm48_loc_area_id lai;
67 u_int8_t classmark1;
Harald Welte52b1f982008-12-23 20:25:15 +000068 u_int8_t mi_len;
69 u_int8_t mi[0];
70} __attribute__ ((packed));
71
72/* Section 10.1 */
73struct gsm48_hdr {
74 u_int8_t proto_discr;
75 u_int8_t msg_type;
76 u_int8_t data[0];
77} __attribute__ ((packed));
78
Holger Freyther5e85c8e2008-12-28 16:32:39 +000079/* Section 9.1.3x System information Type header */
80struct gsm48_system_information_type_header {
81 u_int8_t l2_plen;
82 u_int8_t rr_protocol_discriminator :4,
83 skip_indicator:4;
84 u_int8_t system_information;
85} __attribute__ ((packed));
86
Harald Weltede9226d2008-12-29 02:37:23 +000087struct gsm48_rach_control {
88 u_int8_t re :1,
89 cell_bar :1,
90 tx_integer :4,
91 max_trans :2;
92 u_int8_t t2;
93 u_int8_t t3;
94} __attribute__ ((packed));
95
Holger Freyther1adb4ff2009-02-04 00:04:52 +000096/* Section 10.5.2.11 Control Channel Description , Figure 10.5.33 */
97struct gsm48_control_channel_descr {
98 u_int8_t ccch_conf :3,
99 bs_ag_blks_res :3,
100 att :1,
101 spare1 :1;
102 u_int8_t bs_pa_mfrms : 3,
103 spare2 :5;
104 u_int8_t t3212;
105} __attribute__ ((packed));
106
Harald Welte2d35ae62009-02-06 12:02:13 +0000107/* Section 9.1.25 PAGING RESPONSE */
108struct gsm48_paging_response {
109 u_int8_t spare:4,
110 cipher_keyt_seq:4;
111 /* length + 3 bytes */
112 u_int32_t classmark2;
113 u_int8_t mi_len;
114 u_int8_t mi[0];
115} __attribute__ ((packed));
116
Harald Welteba4cf162009-01-10 01:49:35 +0000117/* Section 9.2.9 CM service request */
118struct gsm48_service_request {
119 u_int8_t cm_service_type : 4,
120 cipher_key_seq : 4;
121 /* length + 3 bytes */
122 u_int32_t classmark;
123 u_int8_t mi_len;
124 u_int8_t mi[0];
125 /* optional priority level */
126} __attribute__ ((packed));
127
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000128/* Section 9.1.31 System information Type 1 */
129struct gsm48_system_information_type_1 {
130 struct gsm48_system_information_type_header header;
131 u_int8_t cell_channel_description[16];
Harald Weltede9226d2008-12-29 02:37:23 +0000132 struct gsm48_rach_control rach_control;
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000133 u_int8_t s1_reset;
134} __attribute__ ((packed));
135
136/* Section 9.1.32 System information Type 2 */
137struct gsm48_system_information_type_2 {
138 struct gsm48_system_information_type_header header;
139 u_int8_t bcch_frequency_list[16];
140 u_int8_t ncc_permitted;
Harald Weltede9226d2008-12-29 02:37:23 +0000141 struct gsm48_rach_control rach_control;
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000142} __attribute__ ((packed));
143
144/* Section 9.1.35 System information Type 3 */
145struct gsm48_system_information_type_3 {
146 struct gsm48_system_information_type_header header;
147 u_int16_t cell_identity;
148 struct gsm48_loc_area_id lai;
Holger Freyther1adb4ff2009-02-04 00:04:52 +0000149 struct gsm48_control_channel_descr control_channel_desc;
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000150 u_int8_t cell_options;
151 u_int8_t cell_selection[2];
Harald Weltede9226d2008-12-29 02:37:23 +0000152 struct gsm48_rach_control rach_control;
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000153 u_int8_t s3_reset_octets[4];
154} __attribute__ ((packed));
155
156/* Section 9.1.36 System information Type 4 */
157struct gsm48_system_information_type_4 {
158 struct gsm48_system_information_type_header header;
159 struct gsm48_loc_area_id lai;
160 u_int8_t cell_selection[2];
Harald Weltede9226d2008-12-29 02:37:23 +0000161 struct gsm48_rach_control rach_control;
Holger Freyther5e85c8e2008-12-28 16:32:39 +0000162 /* optional CBCH conditional CBCH... followed by
163 mandantory SI 4 Reset Octets
164 */
165 u_int8_t data[0];
166} __attribute__ ((packed));
167
168/* Section 9.1.37 System information Type 5 */
169struct gsm48_system_information_type_5 {
170 u_int8_t rr_protocol_discriminator :4,
171 skip_indicator:4;
172 u_int8_t system_information;
173 u_int8_t bcch_frequency_list[16];
174} __attribute__ ((packed));
175
176/* Section 9.1.40 System information Type 6 */
177struct gsm48_system_information_type_6 {
178 u_int8_t rr_protocol_discriminator :4,
179 skip_indicator:4;
180 u_int8_t system_information;
181 u_int8_t cell_identity[2];
182 struct gsm48_loc_area_id lai;
183 u_int8_t cell_options;
184 u_int8_t ncc_permitted;
185 u_int8_t si_6_reset[0];
186} __attribute__ ((packed));
187
Harald Weltebcae43f2008-12-27 21:45:37 +0000188/* Section 10.2 + GSM 04.07 12.2.3.1.1 */
189#define GSM48_PDISC_GROUP_CC 0x00
190#define GSM48_PDISC_BCAST_CC 0x01
191#define GSM48_PDISC_PDSS1 0x02
Harald Welte4b634542008-12-27 01:55:51 +0000192#define GSM48_PDISC_CC 0x03
Harald Weltebcae43f2008-12-27 21:45:37 +0000193#define GSM48_PDISC_PDSS2 0x04
Harald Welte52b1f982008-12-23 20:25:15 +0000194#define GSM48_PDISC_MM 0x05
195#define GSM48_PDISC_RR 0x06
196#define GSM48_PDISC_MM_GPRS 0x08
Harald Weltebcae43f2008-12-27 21:45:37 +0000197#define GSM48_PDISC_SMS 0x09
198#define GSM48_PDISC_SM_GPRS 0x0a
199#define GSM48_PDISC_NC_SS 0x0b
200#define GSM48_PDISC_LOC 0x0c
Harald Weltede9226d2008-12-29 02:37:23 +0000201#define GSM48_PDISC_MASK 0x0f
Harald Welte52b1f982008-12-23 20:25:15 +0000202
203/* Section 10.4 */
204#define GSM48_MT_RR_INIT_REQ 0x3c
205#define GSM48_MT_RR_ADD_ASS 0x3b
206#define GSM48_MT_RR_IMM_ASS 0x3f
207#define GSM48_MT_RR_IMM_ASS_EXT 0x39
208#define GSM48_MT_RR_IMM_ASS_REJ 0x3a
209
210#define GSM48_MT_RR_CIPH_M_CMD 0x35
211#define GSM48_MT_RR_CIPH_M_COMPL 0x32
212
213#define GSM48_MT_RR_CFG_CHG_CMD 0x30
214#define GSM48_MT_RR_CFG_CHG_ACK 0x31
215#define GSM48_MT_RR_CFG_CHG_REJ 0x33
216
217#define GSM48_MT_RR_ASS_CMD 0x2e
218#define GSM48_MT_RR_ASS_COMPL 0x29
219#define GSM48_MT_RR_ASS_FAIL 0x2f
220#define GSM48_MT_RR_HANDO_CMD 0x2b
221#define GSM48_MT_RR_HANDO_COMPL 0x2c
222#define GSM48_MT_RR_HANDO_FAIL 0x28
223#define GSM48_MT_RR_HANDO_INFO 0x2d
224
225#define GSM48_MT_RR_CELL_CHG_ORDER 0x08
226#define GSM48_MT_RR_PDCH_ASS_CMD 0x23
227
228#define GSM48_MT_RR_CHAN_REL 0x0d
229#define GSM48_MT_RR_PART_REL 0x0a
230#define GSM48_MT_RR_PART_REL_COMP 0x0f
231
232#define GSM48_MT_RR_PAG_REQ_1 0x21
233#define GSM48_MT_RR_PAG_REQ_2 0x22
234#define GSM48_MT_RR_PAG_REQ_3 0x24
235#define GSM48_MT_RR_PAG_RESP 0x27
236#define GSM48_MT_RR_NOTIF_NCH 0x20
237#define GSM48_MT_RR_NOTIF_FACCH 0x25
238#define GSM48_MT_RR_NOTIF_RESP 0x26
239
240#define GSM48_MT_RR_SYSINFO_8 0x18
241#define GSM48_MT_RR_SYSINFO_1 0x19
242#define GSM48_MT_RR_SYSINFO_2 0x1a
243#define GSM48_MT_RR_SYSINFO_3 0x1b
244#define GSM48_MT_RR_SYSINFO_4 0x1c
245#define GSM48_MT_RR_SYSINFO_5 0x1d
246#define GSM48_MT_RR_SYSINFO_6 0x1e
247#define GSM48_MT_RR_SYSINFO_7 0x1f
248
249#define GSM48_MT_RR_SYSINFO_2bis 0x02
250#define GSM48_MT_RR_SYSINFO_2ter 0x03
251#define GSM48_MT_RR_SYSINFO_5bis 0x05
252#define GSM48_MT_RR_SYSINFO_5ter 0x06
253#define GSM48_MT_RR_SYSINFO_9 0x04
254#define GSM48_MT_RR_SYSINFO_13 0x00
255
256#define GSM48_MT_RR_SYSINFO_16 0x3d
257#define GSM48_MT_RR_SYSINFO_17 0x3e
258
259#define GSM48_MT_RR_CHAN_MODE_MODIF 0x10
260#define GSM48_MT_RR_STATUS 0x12
261#define GSM48_MT_RR_CHAN_MODE_MODIF_ACK 0x17
262#define GSM48_MT_RR_FREQ_REDEF 0x14
263#define GSM48_MT_RR_MEAS_REP 0x15
264#define GSM48_MT_RR_CLSM_CHG 0x16
265#define GSM48_MT_RR_CLSM_ENQ 0x13
266#define GSM48_MT_RR_EXT_MEAS_REP 0x36
267#define GSM48_MT_RR_EXT_MEAS_REP_ORD 0x37
268#define GSM48_MT_RR_GPRS_SUSP_REQ 0x34
269
270#define GSM48_MT_RR_VGCS_UPL_GRANT 0x08
271#define GSM48_MT_RR_UPLINK_RELEASE 0x0e
272#define GSM48_MT_RR_UPLINK_FREE 0x0c
273#define GSM48_MT_RR_UPLINK_BUSY 0x2a
274#define GSM48_MT_RR_TALKER_IND 0x11
275
276#define GSM48_MT_RR_APP_INFO 0x38
277
278/* Table 10.2/3GPP TS 04.08 */
279#define GSM48_MT_MM_IMSI_DETACH_IND 0x01
280#define GSM48_MT_MM_LOC_UPD_ACCEPT 0x02
281#define GSM48_MT_MM_LOC_UPD_REJECT 0x04
282#define GSM48_MT_MM_LOC_UPD_REQUEST 0x08
283
284#define GSM48_MT_MM_AUTH_REJ 0x11
285#define GSM48_MT_MM_AUTH_REQ 0x12
286#define GSM48_MT_MM_AUTH_RESP 0x14
287#define GSM48_MT_MM_ID_REQ 0x18
288#define GSM48_MT_MM_ID_RESP 0x19
289#define GSM48_MT_MM_TMSI_REALL_CMD 0x1a
290#define GSM48_MT_MM_TMSI_REALL_COMPL 0x1b
291
292#define GSM48_MT_MM_CM_SERV_ACC 0x21
293#define GSM48_MT_MM_CM_SERV_REJ 0x22
294#define GSM48_MT_MM_CM_SERV_ABORT 0x23
295#define GSM48_MT_MM_CM_SERV_REQ 0x24
296#define GSM48_MT_MM_CM_SERV_PROMPT 0x25
297#define GSM48_MT_MM_CM_REEST_REQ 0x28
298#define GSM48_MT_MM_ABORT 0x29
299
300#define GSM48_MT_MM_NULL 0x30
301#define GSM48_MT_MM_STATUS 0x31
302#define GSM48_MT_MM_INFO 0x32
303
304/* Table 10.3/3GPP TS 04.08 */
305#define GSM48_MT_CC_ALERTING 0x01
306#define GSM48_MT_CC_CALL_CONF 0x08
307#define GSM48_MT_CC_CALL_PROC 0x02
308#define GSM48_MT_CC_CONNECT 0x07
309#define GSM48_MT_CC_CONNECT_ACK 0x0f
310#define GSM48_MT_CC_EMERG_SETUP 0x0e
311#define GSM48_MT_CC_PROGRESS 0x03
312#define GSM48_MT_CC_ESTAB 0x04
313#define GSM48_MT_CC_ESTAB_CONF 0x06
314#define GSM48_MT_CC_RECALL 0x0b
315#define GSM48_MT_CC_START_CC 0x09
316#define GSM48_MT_CC_SETUP 0x05
317
318#define GSM48_MT_CC_MODIFY 0x17
319#define GSM48_MT_CC_MODIFY_COMPL 0x1f
320#define GSM48_MT_CC_MODIFY_REJECT 0x13
321#define GSM48_MT_CC_USER_INFO 0x10
322#define GSM48_MT_CC_HOLD 0x18
323#define GSM48_MT_CC_HOLD_ACK 0x19
324#define GSM48_MT_CC_HOLD_REJ 0x1a
325#define GSM48_MT_CC_RETR 0x1c
326#define GSM48_MT_CC_RETR_ACK 0x1d
327#define GSM48_MT_CC_RETR_REJ 0x1e
328
329#define GSM48_MT_CC_DISCONNECT 0x25
330#define GSM48_MT_CC_RELEASE 0x2d
331#define GSM48_MT_CC_RELEASE_COMPL 0xea
332
333#define GSM48_MT_CC_CONG_CTRL 0x39
334#define GSM48_MT_CC_NOTIFY 0x3e
335#define GSM48_MT_CC_STATUS 0x3d
336#define GSM48_MT_CC_STATUS_ENQ 0x34
337#define GSM48_MT_CC_START_DTMF 0x35
338#define GSM48_MT_CC_STOP_DTMF 0x31
339#define GSM48_MT_CC_STOP_DTMF_ACK 0x32
340#define GSM48_MT_CC_START_DTMF_ACK 0x36
341#define GSM48_MT_CC_START_DTMF_REJ 0x37
342#define GSM48_MT_CC_FACILITY 0x3a
343
344/* FIXME: Table 10.4 / 10.4a (GPRS) */
345
346/* Section 10.5.2.26, Table 10.5.64 */
347#define GSM48_PM_MASK 0x03
348#define GSM48_PM_NORMAL 0x00
349#define GSM48_PM_EXTENDED 0x01
350#define GSM48_PM_REORG 0x02
351#define GSM48_PM_SAME 0x03
352
353/* Table 10.5.4 */
354#define GSM_MI_TYPE_MASK 0x07
355#define GSM_MI_TYPE_NONE 0x00
356#define GSM_MI_TYPE_IMSI 0x01
357#define GSM_MI_TYPE_IMEI 0x02
358#define GSM_MI_TYPE_IMEISV 0x03
359#define GSM_MI_TYPE_TMSI 0x04
360#define GSM_MI_ODD 0x08
361
Harald Welte4b634542008-12-27 01:55:51 +0000362#define GSM48_IE_MOBILE_ID 0x17
Harald Weltec6ba9c22008-12-30 18:01:02 +0000363#define GSM48_IE_NAME_LONG 0x43 /* 10.5.3.5a */
364#define GSM48_IE_NAME_SHORT 0x45 /* 10.5.3.5a */
365#define GSM48_IE_UTC 0x46 /* 10.5.3.8 */
366#define GSM48_IE_NET_TIME_TZ 0x47 /* 10.5.3.9 */
367#define GSM48_IE_LSA_IDENT 0x48 /* 10.5.3.11 */
Harald Welte4b634542008-12-27 01:55:51 +0000368
Harald Welte7584aea2009-02-11 11:44:12 +0000369#define GSM48_IE_BEARER_CAP 0x04 /* 10.5.4.5 */
370#define GSM48_IE_CAUSE 0x08 /* 10.5.4.11 */
371#define GSM48_IE_CC_CAP 0x15 /* 10.5.4.5a */
372#define GSM48_IE_ALERT 0x19 /* 10.5.4.26 */
373#define GSM48_IE_FACILITY 0x1c /* 10.5.4.15 */
374#define GSM48_IE_PROGR_IND 0x1e /* 10.5.4.21 */
375#define GSM48_IE_AUX_STATUS 0x24 /* 10.5.4.4 */
376#define GSM48_IE_KPD_FACILITY 0x2c /* 10.5.4.17 */
377#define GSM48_IE_SIGNAL 0x34 /* 10.5.4.23 */
378#define GSM48_IE_CONN_NUM 0x4c /* 10.5.4.13 */
379#define GSM48_IE_CONN_SUBADDR 0x4d /* 10.5.4.14 */
380#define GSM48_IE_CALLING_BCD 0x5c /* 10.5.4.9 */
381#define GSM48_IE_CALLING_SUB 0x5d /* 10.5.4.10 */
382#define GSM48_IE_CALLED_BCD 0x5e /* 10.5.4.7 */
383#define GSM48_IE_CALLED_SUB 0x6d /* 10.5.4.8 */
384#define GSM48_IE_REDIR_BCD 0x74 /* 10.5.4.21a */
385#define GSM48_IE_REDIR_SUB 0x75 /* 10.5.4.21b */
386#define GSM48_IE_LOWL_COMPAT 0x7c /* 10.5.4.18 */
387#define GSM48_IE_HIGHL_COMPAT 0x7d /* 10.5.4.16 */
388#define GSM48_IE_USER_USER 0x7e /* 10.5.4.25 */
389#define GSM48_IE_SS_VERS 0x7f /* 10.5.4.24 */
390#define GSM48_IE_MORE_DATA 0xa0 /* 10.5.4.19 */
391#define GSM48_IE_CLIR_SUPP 0xa1 /* 10.5.4.11a */
392#define GSM48_IE_CLIR_INVOC 0xa2 /* 10.5.4.11b */
393#define GSM48_IE_REV_C_SETUP 0xa3 /* 10.5.4.22a */
394
Harald Welte4b634542008-12-27 01:55:51 +0000395/* Section 10.5.4.11 / Table 10.5.122 */
396#define GSM48_CAUSE_CS_GSM 0x60
397
Harald Welte7584aea2009-02-11 11:44:12 +0000398/* Section 10.5.4.23 / Table 10.5.130 */
399enum gsm48_signal_val {
400 GSM48_SIGNAL_DIALTONE = 0x00,
401 GSM48_SIGNAL_RINGBACK = 0x01,
402 GSM48_SIGNAL_INTERCEPT = 0x02,
403 GSM48_SIGNAL_NET_CONG = 0x03,
404 GSM48_SIGNAL_BUSY = 0x04,
405 GSM48_SIGNAL_CONFIRM = 0x05,
406 GSM48_SIGNAL_ANSWER = 0x06,
407 GSM48_SIGNAL_CALL_WAIT = 0x07,
408 GSM48_SIGNAL_OFF_HOOK = 0x08,
409 GSM48_SIGNAL_OFF = 0x3f,
410 GSM48_SIGNAL_ALERT_OFF = 0x4f,
411};
412
Harald Welte4b634542008-12-27 01:55:51 +0000413enum gsm48_cause_loc {
414 GSM48_CAUSE_LOC_USER = 0x00,
415 GSM48_CAUSE_LOC_PRN_S_LU = 0x01,
416 GSM48_CAUSE_LOC_PUN_S_LU = 0x02,
417 GSM48_CAUSE_LOC_TRANS_NET = 0x03,
418 GSM48_CAUSE_LOC_PUN_S_RU = 0x04,
419 GSM48_CAUSE_LOC_PRN_S_RU = 0x05,
420 /* not defined */
421 GSM48_CAUSE_LOC_INN_NET = 0x07,
422 GSM48_CAUSE_LOC_NET_BEYOND = 0x0a,
423};
424
Holger Freythere64a7a32009-02-06 21:55:37 +0000425/* Section 10.5.2.31 RR Cause / Table 10.5.70 */
426enum gsm48_rr_cause {
427 GSM48_RR_CAUSE_NORMAL = 0x00,
428 GSM48_RR_CAUSE_ABNORMAL_UNSPEC = 0x01,
429 GSM48_RR_CAUSE_ABNORMAL_UNACCT = 0x02,
430 GSM48_RR_CAUSE_ABNORMAL_TIMER = 0x03,
431 GSM48_RR_CAUSE_ABNORMAL_NOACT = 0x04,
432 GSM48_RR_CAUSE_PREMPTIVE_REL = 0x05,
433 GSM48_RR_CAUSE_HNDOVER_IMP = 0x06,
434 GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x07,
435 GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x08,
436 GSM48_RR_CAUSE_CALL_ClEARED = 0x41,
437 GSM48_RR_CAUSE_SEMANT_INCORR = 0x5f,
438 GSM48_RR_CAUSE_INVALID_MAND_INF = 0x60,
439 GSM48_RR_CAUSE_MSG_TYPE_N = 0x61,
440 GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT= 0x62,
441 GSM48_RR_CAUSE_COND_IE_ERROR = 0x64,
442 GSM48_RR_CAUSE_NO_CELL_ALLOC_A = 0x65,
443 GSM48_RR_CAUSE_PROT_ERROR_UNSPC = 0x6f,
444};
445
Holger Freythera7677942008-12-30 16:18:16 +0000446/* Annex G, GSM specific cause values for mobility management */
447enum gsm48_reject_value {
448 GSM48_REJECT_IMSI_UNKNOWN_IN_HLR = 2,
449 GSM48_REJECT_ILLEGAL_MS = 3,
450 GSM48_REJECT_IMSI_UNKNOWN_IN_VLR = 4,
451 GSM48_REJECT_IMEI_NOT_ACCEPTED = 5,
452 GSM48_REJECT_ILLEGAL_ME = 6,
453 GSM48_REJECT_PLMN_NOT_ALLOWED = 11,
454 GSM48_REJECT_LOC_NOT_ALLOWED = 12,
455 GSM48_REJECT_ROAMING_NOT_ALLOWED = 13,
456 GSM48_REJECT_NETWORK_FAILURE = 17,
457 GSM48_REJECT_CONGESTION = 22,
458 GSM48_REJECT_SRV_OPT_NOT_SUPPORTED = 32,
459 GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED = 33,
460 GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER = 34,
461 GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED = 38,
462 GSM48_REJECT_INCORRECT_MESSAGE = 95,
463 GSM48_REJECT_INVALID_MANDANTORY_INF = 96,
464 GSM48_REJECT_MSG_TYPE_NOT_IMPLEMENTED = 97,
465 GSM48_REJECT_MSG_TYPE_NOT_COMPATIBLE = 98,
466 GSM48_REJECT_INF_ELEME_NOT_IMPLEMENTED = 99,
467 GSM48_REJECT_CONDTIONAL_IE_ERROR = 100,
468 GSM48_REJECT_MSG_NOT_COMPATIBLE = 101,
469 GSM48_REJECT_PROTOCOL_ERROR = 111,
470
471 /* according to G.6 Additional cause codes for GMM */
472 GSM48_REJECT_GPRS_NOT_ALLOWED = 7,
473 GSM48_REJECT_SERVICES_NOT_ALLOWED = 8,
474 GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE = 9,
475 GSM48_REJECT_IMPLICITLY_DETACHED = 10,
476 GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN = 14,
477 GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16,
478};
479
480
Harald Welte8470bf22008-12-25 23:28:35 +0000481struct msgb;
482struct gsm_bts;
Harald Welte0932d1e2009-02-16 22:53:52 +0000483struct gsm_subscriber;
Harald Welte8470bf22008-12-25 23:28:35 +0000484
Holger Freythere97f7fb2008-12-31 18:52:11 +0000485/* config options controlling the behaviour of the lower leves */
Holger Freyther89824fc2008-12-30 16:18:18 +0000486void gsm0408_allow_everyone(int allow);
Holger Freythere97f7fb2008-12-31 18:52:11 +0000487void gsm0408_set_reject_cause(int cause);
488
Harald Welte8470bf22008-12-25 23:28:35 +0000489int gsm0408_rcvmsg(struct msgb *msg);
Holger Freyther17746612008-12-28 16:32:44 +0000490void gsm0408_generate_lai(struct gsm48_loc_area_id *lai48, u_int16_t mcc,
491 u_int16_t mnc, u_int16_t lac);
Harald Welte0932d1e2009-02-16 22:53:52 +0000492int gsm48_cc_tx_setup(struct gsm_lchan *lchan, struct gsm_subscriber *calling);
Harald Welte8470bf22008-12-25 23:28:35 +0000493enum gsm_chan_t get_ctype_by_chreq(struct gsm_bts *bts, u_int8_t ra);
Harald Weltee14a57c2008-12-29 04:08:28 +0000494enum gsm_chreq_reason_t get_reason_by_chreq(struct gsm_bts *bts, u_int8_t ra);
Harald Welte8470bf22008-12-25 23:28:35 +0000495
Harald Weltec6ba9c22008-12-30 18:01:02 +0000496int gsm48_tx_mm_info(struct gsm_lchan *lchan);
Holger Freyther819dd202009-01-04 03:52:50 +0000497struct msgb *gsm48_msgb_alloc(void);
Holger Freyther3e2c3232009-01-04 03:55:31 +0000498int gsm48_sendmsg(struct msgb *msg);
Holger Freytherca362a62009-01-04 21:05:01 +0000499int generate_mid_from_tmsi(u_int8_t *buf, u_int32_t tmsi);
Harald Weltec6ba9c22008-12-30 18:01:02 +0000500
Holger Freythere64a7a32009-02-06 21:55:37 +0000501int gsm48_send_rr_release(struct gsm_lchan *lchan);
Harald Welte8470bf22008-12-25 23:28:35 +0000502
Harald Welte0932d1e2009-02-16 22:53:52 +0000503/* convert a ASCII phone number to call-control BCD */
504int encode_bcd_number(u_int8_t *bcd_lv, u_int8_t max_len,
505 u_int8_t type, const char *input);
506u_int8_t decode_bcd_number(char *output, int output_len, const u_int8_t *bcd_lv);
507
Harald Welte52b1f982008-12-23 20:25:15 +0000508#endif