FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-gsm/cc/cc_for.c @ 673:2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 28 Sep 2014 23:20:04 +0000 |
parents | |
children | 69f70acb17c9 |
comparison
equal
deleted
inserted
replaced
672:0dc6f9e8e980 | 673:2f7df7a314f8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CC_FOR | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This Modul defines the functions for the formatter | |
18 | of the component CC. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef CC_FOR_C | |
23 #define CC_FOR_C | |
24 | |
25 #define ENTITY_CC | |
26 /*==== INCLUDES ===================================================*/ | |
27 | |
28 #include <string.h> | |
29 #include "typedefs.h" | |
30 #include "pcm.h" | |
31 #include "vsi.h" | |
32 #include "custom.h" | |
33 #include "gsm.h" | |
34 #include "message.h" | |
35 #include "ccdapi.h" | |
36 #include "prim.h" | |
37 #include "cnf_cc.h" | |
38 #include "mon_cc.h" | |
39 #include "pei.h" | |
40 #include "tok.h" | |
41 #include "cc.h" | |
42 #include "cc_em.h" | |
43 | |
44 /*==== EXPORT =====================================================*/ | |
45 | |
46 /*==== PROTOTYPES =================================================*/ | |
47 /* Implements Measure# 44 */ | |
48 LOCAL void for_send_u_release_comp (USHORT cause); | |
49 /* Implements Measure# 42 */ | |
50 LOCAL void for_fill_sdu_and_send (UBYTE msg, | |
51 USHORT len); | |
52 | |
53 /* Implements Measure# 11 */ | |
54 LOCAL void code_msg (UBYTE * msg, | |
55 USHORT len); | |
56 | |
57 | |
58 | |
59 /*==== PRIVAT =====================================================*/ | |
60 | |
61 /*==== VARIABLES ==================================================*/ | |
62 #if !defined (SHARED_CCD_BUF) | |
63 GLOBAL UBYTE _decodedMsg [MAX_MSTRUCT_LEN_CC]; | |
64 #else | |
65 GLOBAL UBYTE * _decodedMsg; | |
66 #endif | |
67 | |
68 /*==== FUNCTIONS ==================================================*/ | |
69 | |
70 #if 0 | |
71 /* xhegadeg 24th May 2005 | |
72 The part of the code between #if 0 to #endif is never executed.*/ | |
73 | |
74 /* | |
75 Reason For Commenting : | |
76 Issue CC-ENH-30714----> | |
77 All the Layer3 CC messages are now traced via TRACE_BINDUMP. | |
78 So no need of the Function cc_trace_bcap() which was earlier | |
79 used for taking Setup ( Both Uplink & Downlink),Call Confirm, | |
80 Call Proceeding Traces using TRACE_BCAP. | |
81 */ | |
82 #if defined TRACE_BCAP | |
83 | |
84 /* | |
85 +--------------------------------------------------------------------+ | |
86 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
87 | STATE : code ROUTINE : cc_trace_bcap | | |
88 +--------------------------------------------------------------------+ | |
89 | |
90 PURPOSE : Trace messages containing bearer caps. This has been shown | |
91 to be useful in the past. | |
92 | |
93 */ | |
94 | |
95 LOCAL void cc_trace_bcap (T_CC_DATA *cc_data, | |
96 const T_sdu *sdu, | |
97 UBYTE direction) | |
98 { | |
99 const UBYTE *msg_ptr; /* Pointer to non-decoded message */ | |
100 unsigned msg_len; /* Length of non-decoded message */ | |
101 unsigned str_len; /* Length of trace string */ | |
102 | |
103 /* TRACE_FUNCTION ("cc_trace_bcap()"); */ | |
104 | |
105 trace_buf[0] = '\0'; | |
106 if (direction EQ UPLINK) | |
107 { | |
108 switch (_decodedMsg[0]) | |
109 { | |
110 case U_SETUP: | |
111 strcpy (trace_buf, "U_SETUP:"); | |
112 break; | |
113 case U_CALL_CONF: | |
114 strcpy (trace_buf, "U_CCONF:"); | |
115 break; | |
116 default: | |
117 break; | |
118 } | |
119 } | |
120 else | |
121 { | |
122 switch (_decodedMsg[0]) | |
123 { | |
124 case D_SETUP: | |
125 strcpy (trace_buf, "D_SETUP:"); | |
126 break; | |
127 case D_CALL_PROCEED: | |
128 strcpy (trace_buf, "D_CPROC:"); | |
129 break; | |
130 default: | |
131 break; | |
132 } | |
133 } | |
134 | |
135 str_len = strlen (trace_buf); | |
136 msg_len = sdu->l_buf >> 3; | |
137 msg_ptr = &sdu->buf[sdu->o_buf >> 3]; | |
138 | |
139 if (str_len > 0) | |
140 { | |
141 /* Known message containing bearer caps, trace it out */ | |
142 unsigned count; /* Number of dumped hex bytes in the trace line */ | |
143 | |
144 count = 0; | |
145 | |
146 if (msg_len > 40) | |
147 msg_len = 40; /* Limit trace load */ | |
148 | |
149 while (msg_len > 0) | |
150 { | |
151 sprintf (trace_buf + str_len," %02x", *msg_ptr); | |
152 msg_ptr++; | |
153 msg_len--; | |
154 count++; | |
155 str_len += 3; | |
156 if ((msg_len > 0) AND (count >= 20)) | |
157 { | |
158 /* Start new trace line */ | |
159 TRACE_EVENT (trace_buf); | |
160 strcpy (trace_buf, " "); | |
161 str_len = strlen (trace_buf); | |
162 count = 0; | |
163 } | |
164 } | |
165 TRACE_EVENT (trace_buf); | |
166 } | |
167 } | |
168 #endif /* #if defined TRACE_BCAP */ | |
169 #endif /* #if 0 */ | |
170 | |
171 /* | |
172 +--------------------------------------------------------------------+ | |
173 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
174 | STATE : code ROUTINE : for_init | | |
175 +--------------------------------------------------------------------+ | |
176 | |
177 PURPOSE : Initialize the formatter | |
178 | |
179 */ | |
180 | |
181 GLOBAL void for_init (void) | |
182 { | |
183 TRACE_FUNCTION ("for_init()"); | |
184 } | |
185 | |
186 /* | |
187 +--------------------------------------------------------------------+ | |
188 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
189 | STATE : code ROUTINE : for_mmcm_est_ind | | |
190 +--------------------------------------------------------------------+ | |
191 | |
192 PURPOSE : Processing the primitive MMCC_EST_IND from mobility | |
193 management. | |
194 | |
195 */ | |
196 | |
197 GLOBAL void for_mmcm_est_ind (T_MMCM_ESTABLISH_IND * mmcm_establish_ind) | |
198 { | |
199 UBYTE pd; | |
200 BOOL rel_flag = FALSE; | |
201 GET_INSTANCE_DATA; | |
202 | |
203 /* Enable the PCO to correctly decode the message */ | |
204 PPASS (mmcm_establish_ind, data, MMCM_ESTABLISH_IND); | |
205 | |
206 TRACE_FUNCTION ("for_mmcm_est_ind()"); | |
207 | |
208 cc_data->ti_ext = 0; | |
209 cc_data->ti_ext_pres = FALSE; | |
210 | |
211 GET_PD (data->sdu, pd); | |
212 GET_TI (data->sdu, cc_data->ti); | |
213 cc_data->ti_rec = cc_data->ti; | |
214 | |
215 if (cc_data->ti >= 8) | |
216 cc_data->ti -= 8; | |
217 else | |
218 cc_data->ti += 8; | |
219 | |
220 if ((pd NEQ M_MM_PD_CC) | |
221 OR | |
222 (data->sdu.l_buf < 16)) | |
223 /* | |
224 * wrong protocol discriminator | |
225 * or message too short | |
226 */ | |
227 { | |
228 rel_flag = TRUE; | |
229 } | |
230 else if ((cc_data->ti & 7) EQ 7) | |
231 { | |
232 /* TI value indicates extension octet, not allowed currently */ | |
233 /* retrieve the second octet for TI and store it for subsequent handling in or_decode */ | |
234 GET_TI_EXT(data->sdu, cc_data->ti_ext); | |
235 if ((cc_data->ti_ext & EXTENDED_TI_VALID) EQ EXTENDED_TI_VALID) | |
236 { | |
237 cc_data->ti_ext_pres = TRUE; | |
238 } | |
239 else | |
240 { /* no extended TI */ | |
241 rel_flag = TRUE; | |
242 } | |
243 } | |
244 if (rel_flag==TRUE) | |
245 { | |
246 PPASS (data, rel, MMCM_RELEASE_REQ); | |
247 rel->org_entity = NAS_ORG_ENTITY_CC; | |
248 rel->ti = cc_data->ti; | |
249 PSENDX (MM, rel); | |
250 return; | |
251 | |
252 } | |
253 | |
254 cc_data->error = 0; | |
255 cc_data->error_count = 0; | |
256 for_decode ((T_PRIM*)(D2P(data)), TRUE); | |
257 | |
258 } /* for_mmcm_est_ind() */ | |
259 | |
260 /* | |
261 +--------------------------------------------------------------------+ | |
262 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
263 | STATE : code ROUTINE : for_mmcm_data_ind | | |
264 +--------------------------------------------------------------------+ | |
265 | |
266 PURPOSE : Processing the primitive MMCM_DATA_IND from mobility | |
267 management. | |
268 | |
269 */ | |
270 | |
271 GLOBAL void for_mmcm_data_ind (T_MMCM_DATA_IND * mmcm_data_ind) | |
272 { | |
273 UBYTE pd; | |
274 GET_INSTANCE_DATA; | |
275 | |
276 /* Enable the PCO to correctly decode the message */ | |
277 PPASS (mmcm_data_ind, data, MMCM_DATA_IND); | |
278 | |
279 TRACE_FUNCTION ("for_mmcm_data_ind()"); | |
280 | |
281 cc_data->ti_ext = 0; | |
282 cc_data->ti_ext_pres = FALSE; | |
283 | |
284 GET_PD (data->sdu, pd); | |
285 GET_TI (data->sdu, cc_data->ti); | |
286 cc_data->ti_rec = cc_data->ti; | |
287 | |
288 if (cc_data->ti >= 8) | |
289 cc_data->ti -= 8; | |
290 else | |
291 cc_data->ti += 8; | |
292 | |
293 if (((cc_data->ti & 7) EQ 7) | |
294 OR | |
295 (pd NEQ M_MM_PD_CC) | |
296 OR | |
297 (data->sdu.l_buf < 16)) | |
298 /* | |
299 * TI value is reserved, not allowed | |
300 * or wrong protocol discriminator | |
301 * or message too short | |
302 */ | |
303 { | |
304 PFREE (data); | |
305 } | |
306 else | |
307 { | |
308 cc_data->error = 0; | |
309 for_decode ((T_PRIM*)(D2P(data)), FALSE); | |
310 } | |
311 } | |
312 | |
313 | |
314 /* | |
315 +--------------------------------------------------------------------+ | |
316 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
317 | STATE : code ROUTINE : for_decode | | |
318 +--------------------------------------------------------------------+ | |
319 | |
320 PURPOSE : Decoding and distributing of incoming messages. | |
321 | |
322 */ | |
323 typedef void (*T_FUNC_PTR) (void); | |
324 | |
325 LOCAL const T_FUNC_PTR mess_table[] = { | |
326 cc_unknown_message, /* 0: not used */ | |
327 for_d_alert, /* 1: D_ALERT */ | |
328 for_d_call_proceed, /* 2: D_CALL_PROCEED */ | |
329 for_d_progress, /* 3: D_PROGRESS */ | |
330 for_d_cc_establishment, /* 4: D_CC_ESTABLISHMENT */ | |
331 for_d_setup, /* 5: D_SETUP */ | |
332 cc_unknown_message, /* 6: not used */ | |
333 for_d_connect, /* 7: D_CONNECT */ | |
334 cc_unknown_message, /* 8: not used */ | |
335 cc_unknown_message, /* 9: not used */ | |
336 cc_unknown_message, /* 10: not used */ | |
337 for_d_recall, /* 11: D_RECALL */ | |
338 cc_unknown_message, /* 12: not used */ | |
339 cc_unknown_message, /* 13: not used */ | |
340 cc_unknown_message, /* 14: not used */ | |
341 cc_connect_ack, /* 15: B_CONNECT_ACK */ | |
342 for_b_user_information, /* 16: B_USER_INFO */ | |
343 cc_unknown_message, /* 17: not used */ | |
344 cc_unknown_message, /* 18: not used */ | |
345 for_b_modify_rej, /* 19: B_MODIFY_REJ */ | |
346 cc_unknown_message, /* 20: not used */ | |
347 cc_unknown_message, /* 21: not used */ | |
348 cc_unknown_message, /* 22: not used */ | |
349 for_b_modify, /* 23: B_MODIFY */ | |
350 cc_unknown_message, /* 24: not used */ | |
351 cc_hold_ack, /* 25: D_HOLD_ACK */ | |
352 for_d_hold_rej, /* 26: D_HOLD_REJ */ | |
353 cc_unknown_message, /* 27: not used */ | |
354 cc_unknown_message, /* 28: not used */ | |
355 cc_retrieve_ack, /* 29: D_RETRIEVE_ACK */ | |
356 for_d_retrieve_rej, /* 30: D_RETRIEVE_REJ */ | |
357 for_b_modify_comp, /* 31: B_MODIFY_COMP */ | |
358 cc_unknown_message, /* 32: not used */ | |
359 cc_unknown_message, /* 33: not used */ | |
360 cc_unknown_message, /* 34: not used */ | |
361 cc_unknown_message, /* 35: not used */ | |
362 cc_unknown_message, /* 36: not used */ | |
363 for_d_disconnect, /* 37: D_DISCONNECT */ | |
364 cc_unknown_message, /* 38: not used */ | |
365 cc_unknown_message, /* 39: not used */ | |
366 cc_unknown_message, /* 40: not used */ | |
367 cc_unknown_message, /* 41: not used */ | |
368 for_d_release_comp, /* 42: D_RELEASE_COMP */ | |
369 cc_unknown_message, /* 43: not used */ | |
370 cc_unknown_message, /* 44: not used */ | |
371 for_d_release, /* 45: D_RELEASE */ | |
372 cc_unknown_message, /* 46: not used */ | |
373 cc_unknown_message, /* 47: not used */ | |
374 cc_unknown_message, /* 48: not used */ | |
375 cc_unknown_message, /* 49: not used */ | |
376 cc_stop_dtmf_ack, /* 50: D_STOP_DTMF_ACK */ | |
377 cc_unknown_message, /* 51: not_used */ | |
378 cc_status_enquiry, /* 52: B_STATUS_ENQ */ | |
379 cc_unknown_message, /* 53: not used */ | |
380 for_d_start_dtmf_ack, /* 54: D_START_DTMF_ACK */ | |
381 for_d_start_dtmf_rej, /* 55: D_START_DTMF_REJ */ | |
382 cc_unknown_message, /* 56: not used */ | |
383 for_b_congest_ctrl, /* 57: B_CONGEST_CTRL */ | |
384 for_d_facility, /* 58: D_FACILITY */ | |
385 cc_unknown_message, /* 59: not used */ | |
386 cc_unknown_message, /* 60: not used */ | |
387 for_b_status, /* 61: B_STATUS */ | |
388 for_b_notify, /* 62: B_NOTIFY */ | |
389 cc_unknown_message /* 63: not used */ | |
390 }; | |
391 | |
392 GLOBAL void for_decode (T_PRIM * prim, BOOL est_flag) | |
393 { | |
394 GET_INSTANCE_DATA; | |
395 U8 *payload; | |
396 U16 length; | |
397 /* Implements Measure#32: Row 43,...,70 */ | |
398 | |
399 PCAST (prim, data, MMCM_DATA_IND); | |
400 | |
401 TRACE_FUNCTION ("for_decode()"); | |
402 | |
403 if (cc_data->ti_ext_pres EQ TRUE) | |
404 { | |
405 data->sdu.l_buf -= 16; | |
406 data->sdu.o_buf += 16; | |
407 } | |
408 else | |
409 { | |
410 data->sdu.l_buf -= 8; | |
411 data->sdu.o_buf += 8; | |
412 } | |
413 | |
414 | |
415 cc_data->mt = data->sdu.buf[data->sdu.o_buf >> 3]; | |
416 | |
417 /* Obtain the internal shared CCD output buffer */ | |
418 CCD_START; | |
419 | |
420 if (ccd_decodeMsg (CCDENT_CC, | |
421 DOWNLINK, | |
422 (T_MSGBUF *) &data->sdu, | |
423 (UBYTE *) _decodedMsg, | |
424 NOT_PRESENT_8BIT) NEQ ccdOK) | |
425 { | |
426 USHORT parlist[6]; | |
427 UBYTE prev_err; | |
428 UBYTE ccd_err; | |
429 | |
430 memset (parlist,0, sizeof (parlist)); | |
431 ccd_err = ccd_getFirstError (CCDENT_CC, parlist); | |
432 /* | |
433 * Error Handling | |
434 */ | |
435 do | |
436 { | |
437 TRACE_EVENT_P1 ("cuurent_error = %d", ccd_err); | |
438 switch (ccd_err) | |
439 { | |
440 case ERR_MSG_LEN: /* ignore message & send STATUS #96 */ | |
441 case ERR_MAND_ELEM_MISS: /* ignore message & send STATUS #96 */ | |
442 case ERR_COMPREH_REQUIRED: /* ignore message & send STATUS #96 */ | |
443 | |
444 for_set_mandatory_error ((UBYTE)parlist[0]); | |
445 break; | |
446 | |
447 case ERR_INVALID_MID: /* ignore message & send STATUS #97 */ | |
448 cc_data->error = M_CC_CAUSE_MESSAGE_TYPE_NOT_IMPLEM; | |
449 break; | |
450 | |
451 case ERR_INTERNAL_ERROR: | |
452 #if defined (WIN32) | |
453 TRACE_EVENT_P1("An internal CCD error occured,CCD error code = %u", ccd_err); | |
454 #endif /* #if defined (WIN32) */ | |
455 cc_data->error = M_CC_CAUSE_MESSAGE_INCOMPAT; | |
456 break; | |
457 | |
458 case ERR_IE_SEQUENCE: | |
459 #if defined (WIN32) | |
460 TRACE_EVENT_P2("sequence error, CCD error = %u, Parameter = %d", ccd_err, parlist[0]); | |
461 #endif /* #if defined (WIN32) */ | |
462 switch (cc_data->state[srv_convert_ti (cc_data->ti)]) | |
463 { | |
464 case M_CC_CS_11: | |
465 case M_CC_CS_12: | |
466 case M_CC_CS_19: | |
467 break; | |
468 default: /* 24.008: 9.3.18.1.1 Cause ; This information element shall | |
469 * be included if this message is used to initiate call clearing. | |
470 */ | |
471 | |
472 if (parlist [0] EQ CAUSE_IEI) | |
473 { | |
474 for_set_mandatory_error ((UBYTE)parlist[0]); | |
475 } | |
476 break; | |
477 } | |
478 break; | |
479 | |
480 #if defined (WIN32) /* This part is interesting only in implementation | |
481 and testing; may be included if specific handling | |
482 for specific errors is required in future releases */ | |
483 case ERR_IE_NOT_EXPECTED: | |
484 TRACE_EVENT_P1("CCD ERROR: IE not expected. probably an R99 optional elemet like cell notification, eplmn, or t3302, CCD error code = %u", ccd_err); | |
485 break; | |
486 case ERR_MAX_IE_EXCEED: | |
487 TRACE_EVENT_P1("Maximum amount of repeatable information elements has exceeded, CCD error code = %u", ccd_err); | |
488 break; | |
489 case ERR_MAX_REPEAT: | |
490 TRACE_EVENT_P1("A repeatable element occurs too often in the message, CCD error code = %u", ccd_err); | |
491 break; | |
492 case ERR_PATTERN_MISMATCH: | |
493 case ERR_INVALID_TYPE: | |
494 TRACE_EVENT_P1 ("MNC decoding erroneous = %u", ccd_err); | |
495 break; | |
496 #endif /* #if defined (WIN32) */ | |
497 default: | |
498 #if defined (WIN32) | |
499 TRACE_EVENT_P1 ("Unexpected warnings/errors = %u", ccd_err); | |
500 #endif /* #if defined (WIN32) */ | |
501 break; /* No or non-interesting error */ | |
502 } | |
503 | |
504 prev_err = ccd_err; | |
505 ccd_err = ccd_getNextError (CCDENT_CC, parlist); | |
506 } while ( prev_err NEQ ERR_NO_MORE_ERROR | |
507 AND !cc_check_critical_error(cc_data->error) ); | |
508 } | |
509 /*lint -e416 (creation of out-of-bounds pointer)*/ | |
510 EM_CC_DOWNLINK_SETUP_RECEIVED; | |
511 | |
512 /* adding TI and PD header to data */ | |
513 data->sdu.l_buf += 8; | |
514 data->sdu.o_buf -= 8; | |
515 | |
516 payload = &(data->sdu.buf[0]); /* beginning of buffer */ | |
517 payload += ((data->sdu.o_buf) >> 3); /* plus offset (bytes) */ | |
518 length = ((data->sdu.l_buf) >> 3); /* length (bytes, bits / 8) */ | |
519 | |
520 /* Implements Measure#32: Row 43,...,70 */ | |
521 switch (_decodedMsg[0]) | |
522 { | |
523 case D_ALERT: | |
524 TRACE_BINDUMP (cc_handle, | |
525 TC_USER4, | |
526 " Alert DL ", | |
527 payload, | |
528 length); | |
529 break; | |
530 case D_CALL_PROCEED: | |
531 TRACE_BINDUMP (cc_handle, | |
532 TC_USER4, | |
533 " Call Proceed DL ", | |
534 payload, | |
535 length); | |
536 break; | |
537 case D_PROGRESS: | |
538 TRACE_BINDUMP (cc_handle, | |
539 TC_USER4, | |
540 " Progress DL ", | |
541 payload, | |
542 length); | |
543 break; | |
544 case D_CC_ESTABLISHMENT: | |
545 TRACE_BINDUMP (cc_handle, | |
546 TC_USER4, | |
547 " CC Establishment DL ", | |
548 payload, | |
549 length); | |
550 break; | |
551 case D_SETUP: | |
552 TRACE_BINDUMP (cc_handle, | |
553 TC_USER4, | |
554 " Setup DL ", | |
555 payload, | |
556 length); | |
557 break; | |
558 case D_CONNECT: | |
559 TRACE_BINDUMP (cc_handle, | |
560 TC_USER4, | |
561 " Connect DL ", | |
562 payload, | |
563 length); | |
564 break; | |
565 case D_RECALL: | |
566 TRACE_BINDUMP (cc_handle, | |
567 TC_USER4, | |
568 " Recall DL ", | |
569 payload, | |
570 length); | |
571 break; | |
572 case B_CONNECT_ACK: | |
573 TRACE_BINDUMP (cc_handle, | |
574 TC_USER4, | |
575 " Connect Acknowledge DL ", | |
576 payload, | |
577 length); | |
578 break; | |
579 case B_USER_INFO: | |
580 TRACE_BINDUMP (cc_handle, | |
581 TC_USER4, | |
582 " User Information DL ", | |
583 payload, | |
584 length); | |
585 break; | |
586 case B_MODIFY_REJ: | |
587 TRACE_BINDUMP (cc_handle, | |
588 TC_USER4, | |
589 " Modification Reject DL ", | |
590 payload, | |
591 length); | |
592 break; | |
593 case B_MODIFY: | |
594 TRACE_BINDUMP (cc_handle, | |
595 TC_USER4, | |
596 " Call Modify DL ", | |
597 payload, | |
598 length); | |
599 break; | |
600 case D_HOLD_ACK: | |
601 TRACE_BINDUMP (cc_handle, | |
602 TC_USER4, | |
603 " Hold Acknowledge DL ", | |
604 payload, | |
605 length); | |
606 break; | |
607 case D_HOLD_REJ: | |
608 TRACE_BINDUMP (cc_handle, | |
609 TC_USER4, | |
610 " Hold Reject DL ", | |
611 payload, | |
612 length); | |
613 break; | |
614 case D_RETRIEVE_ACK: | |
615 TRACE_BINDUMP (cc_handle, | |
616 TC_USER4, | |
617 " Retrieve Acknowledge DL ", | |
618 payload, | |
619 length); | |
620 break; | |
621 case D_RETRIEVE_REJ: | |
622 TRACE_BINDUMP (cc_handle, | |
623 TC_USER4, | |
624 " Retrieve Reject DL ", | |
625 payload, | |
626 length); | |
627 break; | |
628 case B_MODIFY_COMP: | |
629 TRACE_BINDUMP (cc_handle, | |
630 TC_USER4, | |
631 " Modify Complete DL ", | |
632 payload, | |
633 length); | |
634 break; | |
635 case D_DISCONNECT: | |
636 TRACE_BINDUMP (cc_handle, | |
637 TC_USER4, | |
638 " Disconnect DL ", | |
639 payload, | |
640 length); | |
641 break; | |
642 case D_RELEASE_COMP: | |
643 TRACE_BINDUMP (cc_handle, | |
644 TC_USER4, | |
645 " Release Complete DL ", | |
646 payload, | |
647 length); | |
648 break; | |
649 case D_RELEASE: | |
650 TRACE_BINDUMP (cc_handle, | |
651 TC_USER4, | |
652 " Release DL ", | |
653 payload, | |
654 length); | |
655 break; | |
656 case D_STOP_DTMF_ACK: | |
657 TRACE_BINDUMP (cc_handle, | |
658 TC_USER4, | |
659 " Stop DTMF Acknowledge DL ", | |
660 payload, | |
661 length); | |
662 break; | |
663 case B_STATUS_ENQ: | |
664 TRACE_BINDUMP (cc_handle, | |
665 TC_USER4, | |
666 " Status Enquiry DL ", | |
667 payload, | |
668 length); | |
669 break; | |
670 case D_START_DTMF_ACK: | |
671 TRACE_BINDUMP (cc_handle, | |
672 TC_USER4, | |
673 " Start DTMF Acknowledge DL ", | |
674 payload, | |
675 length); | |
676 break; | |
677 case D_START_DTMF_REJ: | |
678 TRACE_BINDUMP (cc_handle, | |
679 TC_USER4, | |
680 " Start DTMF Reject DL ", | |
681 payload, | |
682 length); | |
683 break; | |
684 case B_CONGEST_CTRL: | |
685 TRACE_BINDUMP (cc_handle, | |
686 TC_USER4, | |
687 " Congestion Control DL ", | |
688 payload, | |
689 length); | |
690 break; | |
691 case D_FACILITY: | |
692 TRACE_BINDUMP (cc_handle, | |
693 TC_USER4, | |
694 " Facility DL ", | |
695 payload, | |
696 length); | |
697 break; | |
698 case B_STATUS: | |
699 TRACE_BINDUMP (cc_handle, | |
700 TC_USER4, | |
701 " Status DL ", | |
702 payload, | |
703 length); | |
704 break; | |
705 case B_NOTIFY: | |
706 TRACE_BINDUMP (cc_handle, | |
707 TC_USER4, | |
708 " Notify DL ", | |
709 payload, | |
710 length); | |
711 break; | |
712 default: | |
713 TRACE_EVENT("Unknown Message"); | |
714 break; | |
715 } /*switch(_decodedMsg[0]) */ | |
716 | |
717 /* removing TI and PD header from data */ | |
718 data->sdu.l_buf -= 8; | |
719 data->sdu.o_buf += 8; | |
720 | |
721 #if 0 | |
722 #if defined TRACE_BCAP | |
723 cc_trace_bcap (cc_data, &data->sdu, DOWNLINK); | |
724 #endif /* #if defined TRACE_BCAP */ | |
725 #endif /* #if 0 */ | |
726 | |
727 PFREE (data); | |
728 | |
729 /* | |
730 * Only the range 0 to 63 is relevant for the cc message type. | |
731 */ | |
732 if (est_flag) | |
733 { | |
734 /* | |
735 * The message was received by MMCC_ESTABLISH_IND. | |
736 */ | |
737 UBYTE result; | |
738 | |
739 switch (_decodedMsg[0]) | |
740 { | |
741 case D_SETUP: | |
742 if ((result = srv_define_ti ()) EQ NOT_PRESENT_8BIT) | |
743 { | |
744 /* | |
745 * Internal problem: CC has run out of call table entries. | |
746 * Release the call. | |
747 */ | |
748 if ( cc_data->ti_rec < 8) /* 24.008; ch. 8.3.1 c) */ | |
749 { | |
750 /* | |
751 * for a reasoning why CAUSE_USER_BUSY was chosen see the | |
752 * definition of UDUB in GSM 02.01! | |
753 */ | |
754 for_send_u_release_comp (M_CC_CAUSE_USER_BUSY); | |
755 return; | |
756 } | |
757 } | |
758 | |
759 if (cc_data->ti_ext_pres EQ TRUE) | |
760 { | |
761 /* [ 24.008; ch. 8.3.1] | |
762 * The mobile station and network shall reject a SETUP, EMERGENCY SETUP or START CC | |
763 * message received with octet 1 part of the TI value coded as "111" by sending | |
764 * RELEASE COMPLETE with cause #81 "Invalid transaction identifier value" The TI value | |
765 * in RELEASE COMPLETE shall be the complete TI value including the extension octet | |
766 * from the message that caused the rejection. | |
767 */ | |
768 | |
769 for_send_u_release_comp (M_CC_CAUSE_INVALID_TI); | |
770 return; | |
771 } | |
772 | |
773 cc_data->index_ti = result; | |
774 | |
775 break; | |
776 | |
777 case B_STATUS: | |
778 break; | |
779 | |
780 case D_RELEASE_COMP: | |
781 CCD_END; | |
782 for_rel_req (); | |
783 return; | |
784 | |
785 default: | |
786 for_send_u_release_comp (M_CC_CAUSE_INVALID_TI); | |
787 return; | |
788 } /* switch (_decodedMsg[0]) */ | |
789 } | |
790 else | |
791 { | |
792 /* | |
793 * The message was received by MMCC_DATA_IND. | |
794 */ | |
795 if ((cc_data->index_ti = srv_convert_ti (cc_data->ti)) | |
796 EQ NOT_PRESENT_8BIT) | |
797 { | |
798 for_send_u_release_comp (M_CC_CAUSE_INVALID_TI); | |
799 return; | |
800 } | |
801 } | |
802 if (_decodedMsg[0] < 64) | |
803 { | |
804 JUMP (*mess_table [_decodedMsg[0] & 63]) (); | |
805 } | |
806 else | |
807 { | |
808 cc_unknown_message (); | |
809 } | |
810 } /* for_decode() */ | |
811 | |
812 | |
813 | |
814 /* | |
815 +--------------------------------------------------------------------+ | |
816 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
817 | STATE : code ROUTINE : for_d_alert | | |
818 +--------------------------------------------------------------------+ | |
819 | |
820 PURPOSE : Processing a D_ALERT message. | |
821 | |
822 */ | |
823 GLOBAL void for_d_alert (void) | |
824 { | |
825 MCAST (alert, D_ALERT); | |
826 | |
827 TRACE_FUNCTION ("for_d_alert()"); | |
828 | |
829 if (alert->v_progress) | |
830 { | |
831 if (for_check_progress_indicator (&alert->progress) EQ FALSE) | |
832 { | |
833 for_set_optional_error (PROGRESS_IEI); | |
834 } | |
835 } | |
836 | |
837 cc_alert (alert); | |
838 } | |
839 | |
840 /* | |
841 +--------------------------------------------------------------------+ | |
842 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
843 | STATE : code ROUTINE : for_d_call_proceed | | |
844 +--------------------------------------------------------------------+ | |
845 | |
846 PURPOSE : Processing a D_CALL_PROCEED message. | |
847 | |
848 */ | |
849 | |
850 GLOBAL void for_d_call_proceed (void) | |
851 { | |
852 MCAST (proceed, D_CALL_PROCEED); | |
853 | |
854 TRACE_FUNCTION ("for_d_call_proceed()"); | |
855 | |
856 if (proceed->v_repeat) | |
857 { | |
858 /* Repeat indicator present */ | |
859 if (for_check_repeat_indicator (proceed->repeat) EQ FALSE) | |
860 { | |
861 /* Repeat indicator contains garbage */ | |
862 for_set_optional_error (REPEAT_IEI); | |
863 } | |
864 if (!(proceed->v_bearer_cap AND proceed->v_bearer_cap_2)) | |
865 { | |
866 /* Repeat indicator, but not both bearer caps present */ | |
867 for_set_conditional_error (REPEAT_IEI); | |
868 } | |
869 } | |
870 else | |
871 { | |
872 /* No repeat indicator present */ | |
873 if (proceed->v_bearer_cap AND proceed->v_bearer_cap_2) | |
874 { | |
875 /* No repeat indicator, but both bearer caps present */ | |
876 for_set_conditional_error (REPEAT_IEI); | |
877 } | |
878 } | |
879 | |
880 cc_call_proceeding (proceed); | |
881 } | |
882 /* | |
883 +--------------------------------------------------------------------+ | |
884 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
885 | STATE : code ROUTINE : for_d_connect | | |
886 +--------------------------------------------------------------------+ | |
887 | |
888 PURPOSE : Processing a D_CONNECT message. | |
889 | |
890 */ | |
891 | |
892 GLOBAL void for_d_connect (void) | |
893 { | |
894 MCAST (connect, D_CONNECT); | |
895 | |
896 TRACE_FUNCTION ("for_d_connect()"); | |
897 | |
898 if (connect->v_progress) | |
899 { | |
900 if (for_check_progress_indicator (&connect->progress) EQ FALSE) | |
901 { | |
902 for_set_optional_error (PROGRESS_IEI); | |
903 } | |
904 } | |
905 | |
906 if (connect->v_connect_num) | |
907 { | |
908 if (for_check_calling_party_bcd | |
909 ((T_M_CC_calling_num *)&connect->connect_num) EQ FALSE) | |
910 { | |
911 for_set_optional_error (CONNECTED_NUMBER_IEI); | |
912 } | |
913 } | |
914 | |
915 if (connect->v_connect_subaddr) | |
916 { | |
917 if (for_check_calling_party_sub | |
918 ((T_M_CC_calling_subaddr *)&connect->connect_subaddr) EQ FALSE) | |
919 { | |
920 for_set_optional_error (CONNECTED_SUBADDR_IEI); | |
921 } | |
922 } | |
923 | |
924 cc_connect (connect); | |
925 } | |
926 | |
927 /* | |
928 +--------------------------------------------------------------------+ | |
929 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
930 | STATE : code ROUTINE : for_d_facility | | |
931 +--------------------------------------------------------------------+ | |
932 | |
933 PURPOSE : Processing a D_FACILITY message. | |
934 | |
935 */ | |
936 | |
937 GLOBAL void for_d_facility (void) | |
938 { | |
939 MCAST (facility, D_FACILITY); | |
940 | |
941 TRACE_FUNCTION ("for_d_facility()"); | |
942 | |
943 cc_facility (facility); | |
944 } | |
945 | |
946 /* | |
947 +--------------------------------------------------------------------+ | |
948 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
949 | STATE : code ROUTINE : for_d_disconnect | | |
950 +--------------------------------------------------------------------+ | |
951 | |
952 PURPOSE : Processing a D_DISCONNECT message. | |
953 | |
954 */ | |
955 | |
956 GLOBAL void for_d_disconnect (void) | |
957 { | |
958 MCAST (disconnect, D_DISCONNECT); | |
959 | |
960 TRACE_FUNCTION ("for_d_disconnect()"); | |
961 | |
962 if (disconnect->v_progress) | |
963 { | |
964 if (for_check_progress_indicator (&disconnect->progress) EQ FALSE) | |
965 { | |
966 for_set_optional_error (PROGRESS_IEI); | |
967 } | |
968 } | |
969 | |
970 if (for_check_cc_cause (&disconnect->cc_cause) EQ FALSE) | |
971 { | |
972 for_set_mandatory_error (CAUSE_IEI); | |
973 } | |
974 | |
975 cc_disconnect (disconnect); | |
976 } | |
977 | |
978 /* | |
979 +--------------------------------------------------------------------+ | |
980 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
981 | STATE : code ROUTINE : for_b_modify | | |
982 +--------------------------------------------------------------------+ | |
983 | |
984 PURPOSE : Processing a B_MODIFY message. | |
985 | |
986 */ | |
987 | |
988 GLOBAL void for_b_modify (void) | |
989 { | |
990 MCAST (modify, B_MODIFY); | |
991 | |
992 TRACE_FUNCTION ("for_b_modify()"); | |
993 | |
994 cc_modify (modify); | |
995 } | |
996 | |
997 /* | |
998 +--------------------------------------------------------------------+ | |
999 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1000 | STATE : code ROUTINE : for_b_modify_comp | | |
1001 +--------------------------------------------------------------------+ | |
1002 | |
1003 PURPOSE : Processing a B_MODIFY_COMP message. | |
1004 | |
1005 */ | |
1006 | |
1007 GLOBAL void for_b_modify_comp (void) | |
1008 { | |
1009 MCAST (modify_com, B_MODIFY_COMP); | |
1010 | |
1011 TRACE_FUNCTION ("for_b_modify_comp()"); | |
1012 | |
1013 cc_modify_complete (modify_com); | |
1014 } | |
1015 | |
1016 /* | |
1017 +--------------------------------------------------------------------+ | |
1018 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1019 | STATE : code ROUTINE : for_b_modify_rej | | |
1020 +--------------------------------------------------------------------+ | |
1021 | |
1022 PURPOSE : Processing a B_MODIFY_REJ message. | |
1023 | |
1024 */ | |
1025 | |
1026 GLOBAL void for_b_modify_rej (void) | |
1027 { | |
1028 MCAST (modify_rej, B_MODIFY_REJ); | |
1029 | |
1030 TRACE_FUNCTION ("for_b_modify_rej()"); | |
1031 | |
1032 if (for_check_cc_cause (&modify_rej->cc_cause) EQ FALSE) | |
1033 { | |
1034 for_set_mandatory_error (CAUSE_IEI); | |
1035 } | |
1036 | |
1037 cc_modify_reject (modify_rej); | |
1038 } | |
1039 | |
1040 /* | |
1041 +--------------------------------------------------------------------+ | |
1042 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1043 | STATE : code ROUTINE : for_b_notify | | |
1044 +--------------------------------------------------------------------+ | |
1045 | |
1046 PURPOSE : Processing a B_NOTIFY message. | |
1047 | |
1048 Issue No 7674 : | |
1049 Accept the message as according to Anite test case ETSI 11.10 clause 26.8.1.4.2 | |
1050 and do nothing,no need to send any Notification Indication to ACI.Also check the | |
1051 State of the CC, if we get a Notify in CC State other than U10 and U26 then Send | |
1052 STATUS message with cause "Message Type Incompatible" to the Network. | |
1053 */ | |
1054 | |
1055 GLOBAL void for_b_notify (void) | |
1056 { | |
1057 GET_INSTANCE_DATA; | |
1058 | |
1059 TRACE_FUNCTION ("for_b_notify()"); | |
1060 | |
1061 /* Processing an incoming notify message.*/ | |
1062 switch (cc_data->state[cc_data->index_ti]) | |
1063 { | |
1064 /* | |
1065 * CS_0 is handled by the formatter | |
1066 */ | |
1067 case M_CC_CS_10: | |
1068 case M_CC_CS_26: | |
1069 | |
1070 CCD_END; | |
1071 | |
1072 break; | |
1073 | |
1074 default: | |
1075 CCD_END; | |
1076 /* Implements Measure# 3 and streamline encoding */ | |
1077 cc_send_status (M_CC_CAUSE_MESSAGE_TYPE_INCOMPAT); | |
1078 break; | |
1079 } | |
1080 } | |
1081 | |
1082 /* | |
1083 +--------------------------------------------------------------------+ | |
1084 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1085 | STATE : code ROUTINE : for_d_progress | | |
1086 +--------------------------------------------------------------------+ | |
1087 | |
1088 PURPOSE : Processing a D_PROGRESS message. | |
1089 | |
1090 */ | |
1091 | |
1092 GLOBAL void for_d_progress (void) | |
1093 { | |
1094 MCAST (progress, D_PROGRESS); | |
1095 | |
1096 TRACE_FUNCTION ("for_d_progress()"); | |
1097 | |
1098 if (for_check_progress_indicator (&progress->progress) EQ FALSE) | |
1099 { | |
1100 for_set_mandatory_error (PROGRESS_IEI); | |
1101 } | |
1102 | |
1103 cc_progress (progress); | |
1104 } | |
1105 | |
1106 /* | |
1107 +--------------------------------------------------------------------+ | |
1108 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1109 | STATE : code ROUTINE : for_d_release | | |
1110 +--------------------------------------------------------------------+ | |
1111 | |
1112 PURPOSE : Processing a D_RELEASE message. | |
1113 | |
1114 */ | |
1115 | |
1116 GLOBAL void for_d_release (void) | |
1117 { | |
1118 MCAST (release, D_RELEASE); | |
1119 | |
1120 TRACE_FUNCTION ("for_d_release()"); | |
1121 | |
1122 if (release->v_cc_cause) | |
1123 { | |
1124 if (for_check_cc_cause (&release->cc_cause) EQ FALSE) | |
1125 { | |
1126 for_set_optional_error (CAUSE_IEI); | |
1127 } | |
1128 } | |
1129 | |
1130 if (release->v_cc_cause_2) | |
1131 { | |
1132 if (for_check_cc_cause ((T_M_CC_cc_cause*)&release->cc_cause_2) EQ FALSE) | |
1133 { | |
1134 for_set_optional_error (CAUSE_IEI); | |
1135 } | |
1136 } | |
1137 | |
1138 cc_release (release); | |
1139 } | |
1140 | |
1141 | |
1142 /* | |
1143 +--------------------------------------------------------------------+ | |
1144 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1145 | STATE : code ROUTINE : for_d_release_complete | | |
1146 +--------------------------------------------------------------------+ | |
1147 | |
1148 PURPOSE : Processing a D_RELEASE_COMPLETE message. | |
1149 | |
1150 */ | |
1151 | |
1152 GLOBAL void for_d_release_comp (void) | |
1153 { | |
1154 MCAST (rel_comp, D_RELEASE_COMP); | |
1155 | |
1156 TRACE_FUNCTION ("for_d_release_comp()"); | |
1157 | |
1158 if (rel_comp->v_cc_cause) | |
1159 { | |
1160 if (for_check_cc_cause (&rel_comp->cc_cause) EQ FALSE) | |
1161 { | |
1162 for_set_optional_error (CAUSE_IEI); | |
1163 } | |
1164 } | |
1165 | |
1166 cc_release_complete (rel_comp); | |
1167 } | |
1168 | |
1169 | |
1170 /* | |
1171 +--------------------------------------------------------------------+ | |
1172 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1173 | STATE : code ROUTINE : for_d_cc_establishment | | |
1174 +--------------------------------------------------------------------+ | |
1175 | |
1176 PURPOSE : Processing of a D_CC_ESTABLISHMENT message. | |
1177 | |
1178 */ | |
1179 | |
1180 GLOBAL void for_d_cc_establishment (void) | |
1181 { | |
1182 MCAST(cc_est, D_CC_ESTABLISHMENT); | |
1183 T_U_SETUP * setup = NULL; | |
1184 USHORT len_in_bits = (cc_est->setup_cont.c_setup_msg + 1) << 3; | |
1185 BYTE result; | |
1186 | |
1187 TRACE_FUNCTION ("for_d_cc_establishment()"); | |
1188 | |
1189 /* | |
1190 * Decode uplink setup message delivered in setup container. | |
1191 */ | |
1192 { | |
1193 PALLOC_SDU (data, MMCM_DATA_REQ, len_in_bits); | |
1194 memcpy(&data->sdu.buf[1], | |
1195 cc_est->setup_cont.setup_msg, | |
1196 cc_est->setup_cont.c_setup_msg); | |
1197 data->sdu.buf[0] = U_SETUP; | |
1198 data->sdu.l_buf = len_in_bits; | |
1199 data->sdu.o_buf = 0; | |
1200 result = ccd_decodeMsg (CCDENT_CC, | |
1201 UPLINK, | |
1202 (T_MSGBUF *) &data->sdu, | |
1203 (UBYTE *) _decodedMsg, | |
1204 NOT_PRESENT_8BIT); | |
1205 | |
1206 setup = (T_U_SETUP *)_decodedMsg; | |
1207 PFREE (data); | |
1208 } | |
1209 | |
1210 if (result NEQ ccdOK) | |
1211 { | |
1212 USHORT parlist[6]; | |
1213 UBYTE first_err; | |
1214 | |
1215 memset (parlist,0, sizeof (parlist)); | |
1216 first_err = ccd_getFirstError (CCDENT_CC, parlist); | |
1217 /* | |
1218 * Error Handling | |
1219 */ | |
1220 switch (first_err) | |
1221 { | |
1222 case ERR_COMPREH_REQUIRED: /* comprehension required */ | |
1223 for_set_mandatory_error ((UBYTE)parlist[0]); | |
1224 break; | |
1225 case ERR_MAND_ELEM_MISS: /* Mandatory elements missing */ | |
1226 /* | |
1227 * Error handling is carried out by checking the content. | |
1228 */ | |
1229 break; | |
1230 } | |
1231 } | |
1232 | |
1233 /* Check repeat indicator bearer capabilities */ | |
1234 if (setup->v_repeat ) | |
1235 { | |
1236 if (for_check_repeat_indicator (setup->repeat) EQ FALSE) | |
1237 { | |
1238 for_set_optional_error (REPEAT_IEI); | |
1239 } | |
1240 } | |
1241 | |
1242 /* Check presence of bearer capability I */ | |
1243 if (setup->v_bearer_cap) | |
1244 { | |
1245 /* Compability check not done here */ | |
1246 } | |
1247 else | |
1248 for_set_mandatory_error (BEARER_CAP_IEI); | |
1249 | |
1250 /* Check calling party subaddress */ | |
1251 if (setup->v_calling_subaddr) | |
1252 { | |
1253 if (for_check_calling_party_sub (&setup->calling_subaddr) EQ FALSE) | |
1254 { | |
1255 for_set_optional_error (CALLING_PARTY_SUB_IEI); | |
1256 } | |
1257 } | |
1258 | |
1259 /* Check called party BCD number */ | |
1260 if (setup->v_ul_called_num) | |
1261 { | |
1262 if (for_check_called_party_bcd (setup->ul_called_num.ton, | |
1263 setup->ul_called_num.npi) EQ FALSE) | |
1264 { | |
1265 for_set_mandatory_error (CALLED_PARTY_BCD_IEI); | |
1266 } | |
1267 } | |
1268 else | |
1269 { | |
1270 for_set_mandatory_error (CALLED_PARTY_BCD_IEI); | |
1271 } | |
1272 | |
1273 /* Check called party subaddress */ | |
1274 if (setup->v_called_subaddr) | |
1275 { | |
1276 if (for_check_called_party_sub (&setup->called_subaddr) EQ FALSE) | |
1277 { | |
1278 for_set_optional_error (CALLED_PARTY_SUB_IEI); | |
1279 } | |
1280 } | |
1281 | |
1282 /* Check LLC repeat indicator */ | |
1283 if (setup->v_repeat_2) | |
1284 { | |
1285 if (for_check_repeat_indicator (setup->repeat_2) EQ FALSE) | |
1286 { | |
1287 for_set_optional_error (REPEAT_IEI); | |
1288 } | |
1289 } | |
1290 | |
1291 /* Check HLC repeat indicator */ | |
1292 if (setup->v_repeat_3) | |
1293 { | |
1294 if (for_check_repeat_indicator (setup->repeat_3) EQ FALSE) | |
1295 { | |
1296 for_set_optional_error (REPEAT_IEI); | |
1297 } | |
1298 } | |
1299 | |
1300 /* Check BC repeat indicator conditions */ | |
1301 if (setup->v_repeat) | |
1302 { | |
1303 if (!(setup->v_bearer_cap AND setup->v_bearer_cap_2)) | |
1304 { | |
1305 cc_for_set_conditional_error (REPEAT_IEI); | |
1306 } | |
1307 } | |
1308 | |
1309 /* Check LLC repeat indicator conditions */ | |
1310 if (setup->v_repeat_2) | |
1311 { | |
1312 if (!(setup->v_bearer_cap | |
1313 AND setup->v_low_layer_comp | |
1314 AND (setup->v_repeat EQ setup->v_repeat_2))) | |
1315 { | |
1316 cc_for_set_conditional_error (REPEAT_IEI); | |
1317 } | |
1318 } | |
1319 | |
1320 /* Check second LLC IE condition */ | |
1321 if (setup->v_low_layer_comp_2) | |
1322 { | |
1323 if (!setup->v_repeat_2) | |
1324 { | |
1325 cc_for_set_conditional_error (REPEAT_IEI); | |
1326 } | |
1327 } | |
1328 | |
1329 /* Check HLC repeat indicator conditions */ | |
1330 if (setup->v_high_layer_comp_2) | |
1331 { | |
1332 if (!(setup->v_repeat AND setup->v_high_layer_comp)) | |
1333 { | |
1334 cc_for_set_conditional_error (REPEAT_IEI); | |
1335 } | |
1336 } | |
1337 | |
1338 /* Check second HLC IE condition */ | |
1339 if (setup->v_high_layer_comp) | |
1340 { | |
1341 if (!setup->v_repeat_3) | |
1342 { | |
1343 cc_for_set_conditional_error (REPEAT_IEI); | |
1344 } | |
1345 } | |
1346 | |
1347 /* | |
1348 * The only interesting part of the CC ESTABLISHMENT message | |
1349 * is the setup container, so only this is delivered | |
1350 */ | |
1351 cc_cc_establishment (setup); | |
1352 } | |
1353 | |
1354 | |
1355 /* | |
1356 +--------------------------------------------------------------------+ | |
1357 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1358 | STATE : code ROUTINE : for_d_cc_establishment | | |
1359 +--------------------------------------------------------------------+ | |
1360 | |
1361 PURPOSE : Processing of a D_RECALL message. | |
1362 | |
1363 */ | |
1364 | |
1365 GLOBAL void for_d_recall (void) | |
1366 { | |
1367 MCAST (recall, D_RECALL); | |
1368 | |
1369 TRACE_FUNCTION ("for_d_recall()"); | |
1370 | |
1371 cc_recall(recall); | |
1372 } | |
1373 | |
1374 | |
1375 /* | |
1376 +--------------------------------------------------------------------+ | |
1377 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1378 | STATE : code ROUTINE : for_d_setup | | |
1379 +--------------------------------------------------------------------+ | |
1380 | |
1381 PURPOSE : Processing a D_SETUP message. | |
1382 | |
1383 */ | |
1384 | |
1385 GLOBAL void for_d_setup (void) | |
1386 { | |
1387 MCAST (setup, D_SETUP); | |
1388 UBYTE rep_cnt = 0; | |
1389 UBYTE bc_cnt = 0; | |
1390 UBYTE lc_cnt = 0; | |
1391 UBYTE hc_cnt = 0; | |
1392 | |
1393 TRACE_FUNCTION ("for_d_setup()"); | |
1394 | |
1395 if (setup->v_repeat) | |
1396 { | |
1397 if (for_check_repeat_indicator (setup->repeat) EQ FALSE) | |
1398 { | |
1399 for_set_optional_error (REPEAT_IEI); | |
1400 } | |
1401 } | |
1402 | |
1403 if (setup->v_progress) | |
1404 { | |
1405 if (for_check_progress_indicator (&setup->progress) EQ FALSE) | |
1406 { | |
1407 for_set_optional_error (PROGRESS_IEI); | |
1408 } | |
1409 } | |
1410 | |
1411 if (setup->v_signal) | |
1412 { | |
1413 if (for_check_signal (setup->signal) EQ FALSE) | |
1414 { | |
1415 for_set_optional_error (SIGNAL_IEI); | |
1416 } | |
1417 } | |
1418 | |
1419 if (setup->v_calling_num) | |
1420 { | |
1421 if (for_check_calling_party_bcd (&setup->calling_num) EQ FALSE) | |
1422 { | |
1423 for_set_optional_error (CALLING_PARTY_BCD_IEI); | |
1424 } | |
1425 } | |
1426 | |
1427 if (setup->v_calling_subaddr) | |
1428 { | |
1429 if (for_check_calling_party_sub (&setup->calling_subaddr) EQ FALSE) | |
1430 { | |
1431 for_set_optional_error (CALLING_PARTY_SUB_IEI); | |
1432 } | |
1433 } | |
1434 | |
1435 if (setup->v_dl_called_num) | |
1436 { | |
1437 if (for_check_called_party_bcd (setup->dl_called_num.ton, | |
1438 setup->dl_called_num.npi) EQ FALSE) | |
1439 { | |
1440 for_set_optional_error (CALLED_PARTY_BCD_IEI); | |
1441 } | |
1442 } | |
1443 | |
1444 if (setup->v_called_subaddr) | |
1445 { | |
1446 if (for_check_called_party_sub (&setup->called_subaddr) EQ FALSE) | |
1447 { | |
1448 for_set_optional_error (CALLED_PARTY_SUB_IEI); | |
1449 } | |
1450 } | |
1451 | |
1452 if (setup->v_repeat_2) | |
1453 { | |
1454 if (for_check_repeat_indicator (setup->repeat_2) EQ FALSE) | |
1455 { | |
1456 for_set_optional_error (REPEAT_IEI); | |
1457 } | |
1458 } | |
1459 | |
1460 if (setup->v_repeat_3) | |
1461 { | |
1462 if (for_check_repeat_indicator (setup->repeat_3) EQ FALSE) | |
1463 { | |
1464 for_set_optional_error (REPEAT_IEI); | |
1465 } | |
1466 } | |
1467 | |
1468 rep_cnt = setup->v_repeat + | |
1469 setup->v_repeat_2 + | |
1470 setup->v_repeat_3; | |
1471 | |
1472 bc_cnt = setup->v_bearer_cap + | |
1473 setup->v_bearer_cap_2; | |
1474 | |
1475 lc_cnt = setup->v_low_layer_comp + | |
1476 setup->v_low_layer_comp_2; | |
1477 | |
1478 hc_cnt = setup->v_high_layer_comp + | |
1479 setup->v_high_layer_comp_2; | |
1480 | |
1481 switch (rep_cnt) | |
1482 { | |
1483 case 0: | |
1484 if ((bc_cnt EQ 2) OR | |
1485 (lc_cnt EQ 2) OR | |
1486 (hc_cnt EQ 2)) | |
1487 { | |
1488 for_set_conditional_error (REPEAT_IEI); | |
1489 } | |
1490 break; | |
1491 | |
1492 case 1: | |
1493 if ((bc_cnt NEQ 2) OR | |
1494 (lc_cnt EQ 2) OR | |
1495 (hc_cnt EQ 2)) | |
1496 { | |
1497 for_set_conditional_error (REPEAT_IEI); | |
1498 } | |
1499 break; | |
1500 | |
1501 case 2: | |
1502 if ((bc_cnt NEQ 2) OR | |
1503 (lc_cnt NEQ 2) OR | |
1504 (hc_cnt EQ 2)) | |
1505 { | |
1506 for_set_conditional_error (REPEAT_IEI); | |
1507 } | |
1508 break; | |
1509 | |
1510 case 3: | |
1511 if ((bc_cnt NEQ 2) OR | |
1512 (lc_cnt NEQ 2) OR | |
1513 (hc_cnt NEQ 2)) | |
1514 { | |
1515 for_set_conditional_error (REPEAT_IEI); | |
1516 } | |
1517 break; | |
1518 } | |
1519 | |
1520 cc_setup (setup); | |
1521 } | |
1522 | |
1523 | |
1524 | |
1525 /* | |
1526 +--------------------------------------------------------------------+ | |
1527 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1528 | STATE : code ROUTINE : for_d_start_dtmf_ack | | |
1529 +--------------------------------------------------------------------+ | |
1530 | |
1531 PURPOSE : Processing a D_START_DTMF_ACK message. | |
1532 | |
1533 */ | |
1534 | |
1535 GLOBAL void for_d_start_dtmf_ack (void) | |
1536 { | |
1537 MCAST (start_ack, D_START_DTMF_ACK); | |
1538 | |
1539 TRACE_FUNCTION ("for_d_start_dtmf_ack()"); | |
1540 | |
1541 cc_start_dtmf_ack (start_ack); | |
1542 } | |
1543 | |
1544 | |
1545 /* | |
1546 +--------------------------------------------------------------------+ | |
1547 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1548 | STATE : code ROUTINE : for_d_start_dtmf_rej | | |
1549 +--------------------------------------------------------------------+ | |
1550 | |
1551 PURPOSE : Processing a D_START_DTMF_REJ message. | |
1552 | |
1553 */ | |
1554 | |
1555 GLOBAL void for_d_start_dtmf_rej (void) | |
1556 { | |
1557 MCAST (start_rej, D_START_DTMF_REJ); | |
1558 | |
1559 TRACE_FUNCTION ("for_d_start_dtmf_rej()"); | |
1560 | |
1561 if (for_check_cc_cause (&start_rej->cc_cause) EQ FALSE) | |
1562 { | |
1563 for_set_mandatory_error (CAUSE_IEI); | |
1564 } | |
1565 | |
1566 cc_start_dtmf_rej (start_rej); | |
1567 } | |
1568 | |
1569 | |
1570 /* | |
1571 +--------------------------------------------------------------------+ | |
1572 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1573 | STATE : code ROUTINE : for_b_status | | |
1574 +--------------------------------------------------------------------+ | |
1575 | |
1576 PURPOSE : Processing a B_STATUS message. | |
1577 | |
1578 */ | |
1579 | |
1580 GLOBAL void for_b_status (void) | |
1581 { | |
1582 MCAST (status, B_STATUS); /* T_B_STATUS */ | |
1583 | |
1584 TRACE_FUNCTION ("for_b_status()"); | |
1585 if (for_check_cc_cause (&status->cc_cause) EQ FALSE) | |
1586 { | |
1587 for_set_mandatory_error (CAUSE_IEI); | |
1588 } | |
1589 | |
1590 for_check_call_state (&status->call_state); | |
1591 | |
1592 cc_status (status); | |
1593 } | |
1594 | |
1595 /* | |
1596 +--------------------------------------------------------------------+ | |
1597 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1598 | STATE : code ROUTINE : for_d_hold_rej | | |
1599 +--------------------------------------------------------------------+ | |
1600 | |
1601 PURPOSE : Processing a D_HOLD_REJ message. | |
1602 | |
1603 */ | |
1604 | |
1605 GLOBAL void for_d_hold_rej (void) | |
1606 { | |
1607 MCAST (hold_rej, D_HOLD_REJ); | |
1608 | |
1609 TRACE_FUNCTION ("for_d_hold_rej()"); | |
1610 | |
1611 if (for_check_cc_cause (&hold_rej->cc_cause) EQ FALSE) | |
1612 { | |
1613 for_set_mandatory_error (CAUSE_IEI); | |
1614 } | |
1615 | |
1616 cc_hold_rej (hold_rej); | |
1617 } | |
1618 | |
1619 | |
1620 | |
1621 /* | |
1622 +--------------------------------------------------------------------+ | |
1623 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1624 | STATE : code ROUTINE : for_d_retrieve_rej | | |
1625 +--------------------------------------------------------------------+ | |
1626 | |
1627 PURPOSE : Processing a D_RETRIEVE_REJ message. | |
1628 | |
1629 */ | |
1630 | |
1631 GLOBAL void for_d_retrieve_rej (void) | |
1632 { | |
1633 MCAST (retrieve_rej, D_RETRIEVE_REJ); | |
1634 | |
1635 TRACE_FUNCTION ("for_d_retrieve_rej()"); | |
1636 | |
1637 if (for_check_cc_cause (&retrieve_rej->cc_cause) EQ FALSE) | |
1638 { | |
1639 for_set_mandatory_error (CAUSE_IEI); | |
1640 } | |
1641 | |
1642 cc_retrieve_rej (retrieve_rej); | |
1643 } | |
1644 | |
1645 /* | |
1646 +--------------------------------------------------------------------+ | |
1647 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1648 | STATE : code ROUTINE : for_b_congest_ctrl | | |
1649 +--------------------------------------------------------------------+ | |
1650 | |
1651 PURPOSE : Processing a B_CONGEST_CTRL message. | |
1652 | |
1653 */ | |
1654 | |
1655 GLOBAL void for_b_congest_ctrl (void) | |
1656 { | |
1657 MCAST (cong, B_CONGEST_CTRL); | |
1658 | |
1659 TRACE_FUNCTION ("for_b_congest_ctrl()"); | |
1660 | |
1661 if (cong->v_cc_cause) | |
1662 { | |
1663 if (for_check_cc_cause (&cong->cc_cause) EQ FALSE) | |
1664 { | |
1665 for_set_optional_error (CAUSE_IEI); | |
1666 } | |
1667 } | |
1668 | |
1669 cc_congestion_control (cong); | |
1670 } | |
1671 | |
1672 /* | |
1673 +--------------------------------------------------------------------+ | |
1674 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1675 | STATE : code ROUTINE : for_b_user_information | | |
1676 +--------------------------------------------------------------------+ | |
1677 | |
1678 PURPOSE : Processing a B_USER_INFORMATION message. | |
1679 | |
1680 */ | |
1681 | |
1682 GLOBAL void for_b_user_information (void) | |
1683 { | |
1684 | |
1685 MCAST (user, B_USER_INFO); | |
1686 | |
1687 TRACE_FUNCTION ("for_b_user_information()"); | |
1688 | |
1689 cc_user_information (user); | |
1690 } | |
1691 | |
1692 /* | |
1693 +--------------------------------------------------------------------+ | |
1694 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1695 | STATE : code ROUTINE : for_mmcm_sync_ind | | |
1696 +--------------------------------------------------------------------+ | |
1697 | |
1698 PURPOSE : Processing the primitive MMCC_SYNC_IND from mobility | |
1699 management. | |
1700 | |
1701 */ | |
1702 | |
1703 GLOBAL void for_mmcm_sync_ind (T_MMCM_SYNC_IND * sync) | |
1704 { | |
1705 GET_INSTANCE_DATA; | |
1706 | |
1707 TRACE_FUNCTION ("for_mmcm_sync_ind()"); | |
1708 | |
1709 cc_data->ti = sync->ti; | |
1710 | |
1711 EM_CC_CHANNEL_MODE_CHANGE; | |
1712 | |
1713 cc_sync_ind (sync); | |
1714 } | |
1715 | |
1716 /* | |
1717 +--------------------------------------------------------------------+ | |
1718 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1719 | STATE : code ROUTINE : for_mmcm_est_cnf | | |
1720 +--------------------------------------------------------------------+ | |
1721 | |
1722 PURPOSE : Processing the primitive MMCC_EST_CNF from mobility | |
1723 management. | |
1724 | |
1725 */ | |
1726 | |
1727 | |
1728 GLOBAL void for_mmcm_est_cnf (T_MMCM_ESTABLISH_CNF * est_cnf) | |
1729 { | |
1730 GET_INSTANCE_DATA; | |
1731 | |
1732 TRACE_FUNCTION ("for_mmcm_est_cnf()"); | |
1733 | |
1734 cc_data->ti = est_cnf->ti; | |
1735 if ((cc_data->index_ti = srv_convert_ti (cc_data->ti)) | |
1736 NEQ NOT_PRESENT_8BIT) | |
1737 { | |
1738 cc_est_cnf (); | |
1739 } | |
1740 | |
1741 EM_CC_MM_CONNECTION_ESTABLISHED_MO; | |
1742 | |
1743 PFREE (est_cnf); | |
1744 } | |
1745 /* | |
1746 +--------------------------------------------------------------------+ | |
1747 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1748 | STATE : code ROUTINE : for_mmcm_rel_ind | | |
1749 +--------------------------------------------------------------------+ | |
1750 | |
1751 PURPOSE : Processing the primitive MMCC_REL_IND from mobility | |
1752 management. | |
1753 | |
1754 */ | |
1755 GLOBAL void for_mmcm_rel_ind (T_MMCM_RELEASE_IND * rel_ind) | |
1756 { | |
1757 GET_INSTANCE_DATA; | |
1758 | |
1759 TRACE_FUNCTION ("for_mmcm_rel_ind()"); | |
1760 | |
1761 cc_data->ti = rel_ind->ti; | |
1762 if ((cc_data->index_ti = srv_convert_ti (cc_data->ti)) | |
1763 NEQ NOT_PRESENT_8BIT) | |
1764 { | |
1765 cc_rel_ind (rel_ind->cause); | |
1766 } | |
1767 | |
1768 EM_CC_LOSS_OF_CONNECTION; | |
1769 | |
1770 PFREE (rel_ind); | |
1771 } | |
1772 | |
1773 | |
1774 | |
1775 /* | |
1776 +--------------------------------------------------------------------+ | |
1777 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1778 | STATE : code ROUTINE : for_mmcm_prompt_ind | | |
1779 +--------------------------------------------------------------------+ | |
1780 | |
1781 PURPOSE : Processing the primitive MMCC_PROMPT_IND from mobility | |
1782 management. In the CC entity nothing is done with the | |
1783 primitve, a transaction identifier still is not assigned. | |
1784 The reception of the primitive only causes the emission | |
1785 of MNCC_PROMPT_IND to upper layers. | |
1786 | |
1787 */ | |
1788 | |
1789 GLOBAL void for_mmcm_prompt_ind (T_MMCM_PROMPT_IND * mmcm_prompt_ind) | |
1790 { | |
1791 TRACE_FUNCTION ("for_mmcm_prompt_ind()"); | |
1792 | |
1793 PFREE (mmcm_prompt_ind); | |
1794 | |
1795 { | |
1796 PALLOC (mncc_prompt_ind, MNCC_PROMPT_IND); | |
1797 PSENDX (MMI, mncc_prompt_ind); | |
1798 | |
1799 // EM2 | |
1800 } | |
1801 } | |
1802 | |
1803 | |
1804 /* | |
1805 +--------------------------------------------------------------------+ | |
1806 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1807 | STATE : code ROUTINE : for_mmcm_err_ind | | |
1808 +--------------------------------------------------------------------+ | |
1809 | |
1810 PURPOSE : Processing the primitive MMCC_ERR_IND from mobility | |
1811 management. | |
1812 | |
1813 */ | |
1814 | |
1815 GLOBAL void for_mmcm_err_ind (T_MMCM_ERROR_IND * err_ind) | |
1816 { | |
1817 GET_INSTANCE_DATA; | |
1818 | |
1819 TRACE_FUNCTION ("for_mmcm_err_ind()"); | |
1820 | |
1821 EM_CC_MM_CONNECTION_FAILED; | |
1822 | |
1823 cc_data->ti = err_ind->ti; | |
1824 if ((cc_data->index_ti = srv_convert_ti (cc_data->ti)) | |
1825 NEQ NOT_PRESENT_8BIT) | |
1826 { | |
1827 cc_err_ind (err_ind); | |
1828 } | |
1829 } | |
1830 | |
1831 /* | |
1832 +--------------------------------------------------------------------+ | |
1833 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1834 | STATE : code ROUTINE : for_mmcm_reest_cnf | | |
1835 +--------------------------------------------------------------------+ | |
1836 | |
1837 PURPOSE : Processing the primitive MMCC_REEST_CNF from mobility | |
1838 management. | |
1839 | |
1840 */ | |
1841 | |
1842 GLOBAL void for_mmcm_reest_cnf (T_MMCM_REESTABLISH_CNF * reest_cnf) | |
1843 { | |
1844 GET_INSTANCE_DATA; | |
1845 | |
1846 TRACE_FUNCTION ("for_mmcm_reest_cnf()"); | |
1847 | |
1848 cc_data->ti = reest_cnf->ti; | |
1849 if ((cc_data->index_ti = srv_convert_ti (cc_data->ti)) | |
1850 NEQ NOT_PRESENT_8BIT) | |
1851 { | |
1852 cc_reest_cnf (); | |
1853 } | |
1854 | |
1855 EM_CC_REESTABLISHED_SUCCESSFUL; | |
1856 | |
1857 PFREE (reest_cnf); | |
1858 } | |
1859 | |
1860 /* | |
1861 +--------------------------------------------------------------------+ | |
1862 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1863 | STATE : code ROUTINE : for_est_req | | |
1864 +--------------------------------------------------------------------+ | |
1865 | |
1866 PURPOSE : Build the primitive MMCC_EST_REQ and send them to | |
1867 mobility management. | |
1868 | |
1869 */ | |
1870 | |
1871 GLOBAL void for_est_req (T_MMCM_ESTABLISH_REQ * mmcm_establish_req) | |
1872 { | |
1873 TRACE_FUNCTION ("for_est_req()"); | |
1874 | |
1875 EM_CC_START_MO_CALL; /*Needs perhaps a review */ | |
1876 | |
1877 PSENDX (MM, mmcm_establish_req); | |
1878 } | |
1879 | |
1880 /* | |
1881 +--------------------------------------------------------------------+ | |
1882 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1883 | STATE : code ROUTINE : for_rel_req | | |
1884 +--------------------------------------------------------------------+ | |
1885 | |
1886 PURPOSE : Build the primitive MMCC_RELEASE_REQ and send them to | |
1887 mobility management. | |
1888 | |
1889 */ | |
1890 | |
1891 GLOBAL void for_rel_req (void) | |
1892 { | |
1893 GET_INSTANCE_DATA; | |
1894 | |
1895 PALLOC (rel, MMCM_RELEASE_REQ); | |
1896 | |
1897 TRACE_FUNCTION ("for_rel_req()"); | |
1898 rel->org_entity = NAS_ORG_ENTITY_CC; | |
1899 rel->ti = cc_data->ti; | |
1900 | |
1901 PSENDX (MM, rel); | |
1902 | |
1903 EM_CC_RELEASE_SENT; | |
1904 | |
1905 if (cc_data->ti NEQ cc_data->setup_reattempt_ti) | |
1906 { | |
1907 srv_free_ti (); | |
1908 } | |
1909 } | |
1910 | |
1911 /* | |
1912 +--------------------------------------------------------------------+ | |
1913 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1914 | STATE : code ROUTINE : for_reest_req | | |
1915 +--------------------------------------------------------------------+ | |
1916 | |
1917 PURPOSE : Build the primitive MMCC_REEST_REQ and send them to | |
1918 mobility management. | |
1919 | |
1920 */ | |
1921 | |
1922 GLOBAL void for_reest_req (void) | |
1923 { | |
1924 GET_INSTANCE_DATA; | |
1925 | |
1926 PALLOC (reest, MMCM_REESTABLISH_REQ); | |
1927 | |
1928 TRACE_FUNCTION ("for_reest_req()"); | |
1929 | |
1930 reest->ti = cc_data->ti; | |
1931 | |
1932 PSENDX (MM, reest); | |
1933 } | |
1934 | |
1935 /* | |
1936 +--------------------------------------------------------------------+ | |
1937 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1938 | STATE : code ROUTINE : for_start_cc | | |
1939 +--------------------------------------------------------------------+ | |
1940 | |
1941 PURPOSE : Code the START CC message and send it to MM. | |
1942 | |
1943 */ | |
1944 | |
1945 GLOBAL void for_start_cc (T_U_START_CC * start_cc) | |
1946 { | |
1947 TRACE_FUNCTION ("for_start_cc()"); | |
1948 | |
1949 /* Implements Measure# 38 */ | |
1950 code_msg ((UBYTE *)start_cc, BSIZE_U_START_CC); | |
1951 | |
1952 } | |
1953 | |
1954 | |
1955 /* | |
1956 +--------------------------------------------------------------------+ | |
1957 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1958 | STATE : code ROUTINE : for_cc_est_confirm | | |
1959 +--------------------------------------------------------------------+ | |
1960 | |
1961 PURPOSE : Code the CC EST. CONFIRMED message and send it to MM. | |
1962 | |
1963 */ | |
1964 | |
1965 GLOBAL void for_cc_est_confirm (T_U_CC_EST_CONF * est_cnf) | |
1966 { | |
1967 TRACE_FUNCTION ("for_cc_est_confirm()"); | |
1968 | |
1969 /* Implements Measure# 38 */ | |
1970 code_msg ((UBYTE *)est_cnf, BSIZE_U_CC_EST_CONF); | |
1971 | |
1972 } | |
1973 | |
1974 | |
1975 /* | |
1976 +--------------------------------------------------------------------+ | |
1977 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
1978 | STATE : code ROUTINE : for_setup | | |
1979 +--------------------------------------------------------------------+ | |
1980 | |
1981 PURPOSE : Code the message setup. The setup | |
1982 message is here not sent to MM, but stored. | |
1983 | |
1984 */ | |
1985 | |
1986 GLOBAL void for_setup (T_U_SETUP * setup) | |
1987 { | |
1988 GET_INSTANCE_DATA; | |
1989 /* | |
1990 * the maximum length of the outgoing setup message is 128 Bytes plus | |
1991 * the length of the outgoing facility element | |
1992 */ | |
1993 | |
1994 USHORT len_in_bits = LEN_U_SETUP; | |
1995 | |
1996 if (setup->v_facility) | |
1997 len_in_bits += setup->facility.c_fac * 8; | |
1998 { | |
1999 PALLOC_SDU (data, MMCM_DATA_REQ, len_in_bits); | |
2000 | |
2001 TRACE_FUNCTION ("for_setup()"); | |
2002 | |
2003 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2004 | |
2005 ccd_codeMsg (CCDENT_CC, | |
2006 UPLINK, | |
2007 (T_MSGBUF *) &data->sdu, | |
2008 (UBYTE *) setup, | |
2009 NOT_PRESENT_8BIT); | |
2010 | |
2011 EM_CC_SENT_SETUP_MESSAGE;/*lint !e416 (creation of out-of-bounds pointer)*/ | |
2012 #if 0 | |
2013 #if defined TRACE_BCAP | |
2014 cc_trace_bcap (cc_data, &data->sdu, UPLINK); | |
2015 #endif | |
2016 #endif /* #if 0 */ | |
2017 | |
2018 srv_free_stored_setup (); /* Security */ | |
2019 cc_data->stored_setup = data; | |
2020 } | |
2021 } | |
2022 | |
2023 /* | |
2024 +--------------------------------------------------------------------+ | |
2025 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2026 | STATE : code ROUTINE : for_emergency_setup | | |
2027 +--------------------------------------------------------------------+ | |
2028 | |
2029 PURPOSE : Code the message emergency setup. The emergency setup | |
2030 message is here not sent to MM, but stored. | |
2031 | |
2032 */ | |
2033 | |
2034 GLOBAL void for_emergency_setup (T_U_EMERGE_SETUP * emerg_setup) | |
2035 { | |
2036 GET_INSTANCE_DATA; | |
2037 | |
2038 PALLOC_MSG (data, MMCM_DATA_REQ, U_EMERGE_SETUP); | |
2039 | |
2040 TRACE_FUNCTION ("for_emergency_setup()"); | |
2041 | |
2042 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2043 ccd_codeMsg (CCDENT_CC, | |
2044 UPLINK, | |
2045 (T_MSGBUF *) &data->sdu, | |
2046 (UBYTE *) emerg_setup, | |
2047 NOT_PRESENT_8BIT); | |
2048 | |
2049 EM_CC_SENT_EMERGENCY_SETUP_MESSAGE; | |
2050 | |
2051 srv_free_stored_setup (); /* Security */ | |
2052 cc_data->stored_setup = data; | |
2053 } | |
2054 | |
2055 /* | |
2056 +--------------------------------------------------------------------+ | |
2057 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2058 | STATE : code ROUTINE : for_status | | |
2059 +--------------------------------------------------------------------+ | |
2060 | |
2061 PURPOSE : Code the message status and send them to | |
2062 mobility management. | |
2063 | |
2064 */ | |
2065 | |
2066 GLOBAL void for_status (T_B_STATUS * status) | |
2067 { | |
2068 TRACE_FUNCTION ("for_status()"); | |
2069 /* Implements Measure# 22 */ | |
2070 code_msg ((UBYTE *)status, BSIZE_B_STATUS); | |
2071 EM_CC_STATUS_SENT; | |
2072 } | |
2073 | |
2074 /* | |
2075 +--------------------------------------------------------------------+ | |
2076 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2077 | STATE : code ROUTINE : for_release_complete | | |
2078 +--------------------------------------------------------------------+ | |
2079 | |
2080 PURPOSE : Code the message release_complete and send them to | |
2081 mobility management. | |
2082 | |
2083 */ | |
2084 | |
2085 GLOBAL void for_release_complete (T_U_RELEASE_COMP * rel_com) | |
2086 { | |
2087 GET_INSTANCE_DATA; | |
2088 /* | |
2089 * the sdu has a maximum length of 34 bytes. | |
2090 * User-User, facility and ss version are never used | |
2091 */ | |
2092 PALLOC_SDU (data, MMCM_DATA_REQ, LEN_U_RELEASE_COMPLETE); | |
2093 | |
2094 TRACE_FUNCTION ("for_release_complete()"); | |
2095 | |
2096 | |
2097 if (cc_data->ti_ext_pres EQ TRUE) | |
2098 { | |
2099 data->sdu.o_buf = (USHORT)(CC_ENCODE_OFFSET+8); /* additional byte for extended TI */ | |
2100 } | |
2101 else | |
2102 { | |
2103 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2104 } | |
2105 | |
2106 ccd_codeMsg (CCDENT_CC, | |
2107 UPLINK, | |
2108 (T_MSGBUF *) &data->sdu, | |
2109 (UBYTE *) rel_com, | |
2110 NOT_PRESENT_8BIT); | |
2111 | |
2112 EM_CC_RELEASE_COMPLETE_SENT; | |
2113 | |
2114 for_pd (data); | |
2115 | |
2116 } | |
2117 | |
2118 /* | |
2119 +--------------------------------------------------------------------+ | |
2120 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2121 | STATE : code ROUTINE : for_disconnect | | |
2122 +--------------------------------------------------------------------+ | |
2123 | |
2124 PURPOSE : Code the message disconnect and send them to | |
2125 mobility management. | |
2126 | |
2127 */ | |
2128 | |
2129 GLOBAL void for_disconnect (T_U_DISCONNECT * disconnect) | |
2130 { | |
2131 /* | |
2132 * The mandatory part has a length of 33 bytes. | |
2133 * User-User, facility and ss version are never used. | |
2134 */ | |
2135 TRACE_FUNCTION ("for_disconnect()"); | |
2136 /* Implements Measure# 11 */ | |
2137 code_msg ((UBYTE *)disconnect, LEN_U_DISCONNECT); | |
2138 } | |
2139 | |
2140 /* | |
2141 +--------------------------------------------------------------------+ | |
2142 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2143 | STATE : code ROUTINE : for_modify_reject | | |
2144 +--------------------------------------------------------------------+ | |
2145 | |
2146 PURPOSE : Code the message modify reject and send them to | |
2147 mobility management. | |
2148 | |
2149 */ | |
2150 | |
2151 GLOBAL void for_modify_reject (T_B_MODIFY_REJ * modify_rej) | |
2152 { | |
2153 /* | |
2154 * The message has a maximum length of 47 Bytes. | |
2155 * HLC and LLC are never used. | |
2156 */ | |
2157 TRACE_FUNCTION ("for_modify_reject()"); | |
2158 /* Implements Measure# 11 */ | |
2159 code_msg ((UBYTE *)modify_rej, LEN_U_MODIFY_REJ); | |
2160 } | |
2161 | |
2162 /* | |
2163 +--------------------------------------------------------------------+ | |
2164 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2165 | STATE : code ROUTINE : for_modify_complete | | |
2166 +--------------------------------------------------------------------+ | |
2167 | |
2168 PURPOSE : Code the message modify complete and send them to | |
2169 mobility management. | |
2170 | |
2171 */ | |
2172 GLOBAL void for_modify_complete (T_B_MODIFY_COMP * mod_com) | |
2173 { | |
2174 | |
2175 TRACE_FUNCTION ("for_modify_complete()"); | |
2176 /* Implements Measure# 27 */ | |
2177 code_msg ((UBYTE *)mod_com, BSIZE_B_MODIFY_COMP); | |
2178 } | |
2179 | |
2180 /* | |
2181 +--------------------------------------------------------------------+ | |
2182 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2183 | STATE : code ROUTINE : for_start_dtmf | | |
2184 +--------------------------------------------------------------------+ | |
2185 | |
2186 PURPOSE : Code the message start dtmf and send them to | |
2187 mobility management. | |
2188 | |
2189 */ | |
2190 | |
2191 GLOBAL void for_start_dtmf ( T_U_START_DTMF * start_dtmf) | |
2192 { | |
2193 | |
2194 TRACE_FUNCTION ("for_start_dtmf()"); | |
2195 /* Implements Measure# 22 */ | |
2196 code_msg ((UBYTE *)start_dtmf, BSIZE_U_START_DTMF); | |
2197 EM_CC_START_DTMF; | |
2198 } | |
2199 | |
2200 /* | |
2201 +--------------------------------------------------------------------+ | |
2202 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2203 | STATE : code ROUTINE : for_stop_dtmf | | |
2204 +--------------------------------------------------------------------+ | |
2205 | |
2206 PURPOSE : Code the message stop dtmf and send them to | |
2207 mobility management. | |
2208 | |
2209 */ | |
2210 | |
2211 GLOBAL void for_stop_dtmf (void) | |
2212 { | |
2213 GET_INSTANCE_DATA; | |
2214 | |
2215 | |
2216 TRACE_FUNCTION ("for_stop_dtmf()"); | |
2217 /* Implements Measure 42 */ | |
2218 for_fill_sdu_and_send (U_STOP_DTMF, BSIZE_U_STOP_DTMF); | |
2219 EM_CC_STOP_DTMF; | |
2220 } | |
2221 | |
2222 /* | |
2223 +--------------------------------------------------------------------+ | |
2224 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2225 | STATE : code ROUTINE : for_call_confirm | | |
2226 +--------------------------------------------------------------------+ | |
2227 | |
2228 PURPOSE : Code the message call confirm and send them to | |
2229 mobility management. | |
2230 | |
2231 */ | |
2232 | |
2233 /* Here measure Measure# 23 is removed since we are accessing data ptr in | |
2234 EM_CC_CALL_CONFIRM_SENT */ | |
2235 GLOBAL void for_call_confirm (T_U_CALL_CONF * call_confirm) | |
2236 { | |
2237 GET_INSTANCE_DATA; | |
2238 PALLOC_MSG (data, MMCM_DATA_REQ, U_CALL_CONF); | |
2239 | |
2240 TRACE_FUNCTION ("for_call_confirm()"); | |
2241 | |
2242 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2243 ccd_codeMsg (CCDENT_CC, | |
2244 UPLINK, | |
2245 (T_MSGBUF *) &data->sdu, | |
2246 (UBYTE *) call_confirm, | |
2247 NOT_PRESENT_8BIT); | |
2248 | |
2249 EM_CC_CALL_CONFIRM_SENT;/*lint !e416 (creation of out-of-bounds pointer)*/ | |
2250 #if 0 | |
2251 #if defined TRACE_BCAP | |
2252 cc_trace_bcap (cc_data, &data->sdu, UPLINK); | |
2253 #endif /* #if defined TRACE_BCAP */ | |
2254 #endif /* #if 0 */ | |
2255 | |
2256 for_pd (data); | |
2257 } | |
2258 | |
2259 /* | |
2260 +--------------------------------------------------------------------+ | |
2261 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2262 | STATE : code ROUTINE : for_release | | |
2263 +--------------------------------------------------------------------+ | |
2264 | |
2265 PURPOSE : Code the message release and send them to | |
2266 mobility management. | |
2267 | |
2268 */ | |
2269 | |
2270 GLOBAL void for_release (T_U_RELEASE * release) | |
2271 { | |
2272 /* | |
2273 * the message has a maximum length of 34 bytes. | |
2274 * It does not include cc_cause2, facility, | |
2275 * user-user or ss version. | |
2276 */ | |
2277 TRACE_FUNCTION ("for_release()"); | |
2278 | |
2279 /* Implements Measure# 12 */ | |
2280 code_msg ((UBYTE *)release, LEN_U_RELEASE); | |
2281 } | |
2282 | |
2283 /* | |
2284 +--------------------------------------------------------------------+ | |
2285 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2286 | STATE : code ROUTINE : for_connect_ack | | |
2287 +--------------------------------------------------------------------+ | |
2288 | |
2289 PURPOSE : Code the message connect ack and send them to | |
2290 mobility management. | |
2291 | |
2292 */ | |
2293 | |
2294 GLOBAL void for_connect_ack (T_B_CONNECT_ACK *b_connect_ack ) | |
2295 { | |
2296 GET_INSTANCE_DATA; | |
2297 | |
2298 | |
2299 TRACE_FUNCTION ("for_connect_ack()"); | |
2300 /* Implements Measure 34 */ | |
2301 for_fill_sdu_and_send (B_CONNECT_ACK, BSIZE_B_CONNECT_ACK); | |
2302 EM_CC_CONNECT_ACKNOWLEDGE; | |
2303 | |
2304 } | |
2305 | |
2306 /* | |
2307 +--------------------------------------------------------------------+ | |
2308 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2309 | STATE : code ROUTINE : for_retrieve | | |
2310 +--------------------------------------------------------------------+ | |
2311 | |
2312 PURPOSE : Code the message retrieve and send them to | |
2313 mobility management. | |
2314 | |
2315 */ | |
2316 | |
2317 GLOBAL void for_retrieve (void) | |
2318 { | |
2319 | |
2320 TRACE_FUNCTION ("for_retrieve()"); | |
2321 | |
2322 /* Implements Measure 42 */ | |
2323 for_fill_sdu_and_send (U_RETRIEVE, BSIZE_U_RETRIEVE); | |
2324 } | |
2325 | |
2326 /* | |
2327 +--------------------------------------------------------------------+ | |
2328 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2329 | STATE : code ROUTINE : for_hold | | |
2330 +--------------------------------------------------------------------+ | |
2331 | |
2332 PURPOSE : Code the message hold and send them to | |
2333 mobility management. | |
2334 | |
2335 */ | |
2336 | |
2337 GLOBAL void for_hold (void) | |
2338 { | |
2339 | |
2340 TRACE_FUNCTION ("for_hold()"); | |
2341 | |
2342 /* Implements Measure 42 */ | |
2343 for_fill_sdu_and_send (U_HOLD, BSIZE_U_HOLD); | |
2344 } | |
2345 | |
2346 /* | |
2347 +--------------------------------------------------------------------+ | |
2348 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2349 | STATE : code ROUTINE : for_user_information | | |
2350 +--------------------------------------------------------------------+ | |
2351 | |
2352 PURPOSE : Code the message user information and send them to | |
2353 mobility management. | |
2354 | |
2355 */ | |
2356 | |
2357 GLOBAL void for_user_information (T_B_USER_INFO * user_info) | |
2358 { | |
2359 GET_INSTANCE_DATA; | |
2360 | |
2361 /* | |
2362 * The length of the outgoing message depends on | |
2363 * the length of the user information plus message | |
2364 * type, transaction identifier and the more data flag. | |
2365 */ | |
2366 PALLOC_SDU (data, MMCM_DATA_REQ, | |
2367 (USHORT)(LEN_U_USER_USER + user_info->user_user.c_info * 8)); | |
2368 | |
2369 TRACE_FUNCTION ("for_user_information()"); | |
2370 | |
2371 EM_CC_USUER_TO_USER_DATA_SENT; | |
2372 | |
2373 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2374 ccd_codeMsg (CCDENT_CC, | |
2375 UPLINK, | |
2376 (T_MSGBUF *) &data->sdu, | |
2377 (UBYTE *) user_info, | |
2378 NOT_PRESENT_8BIT); | |
2379 for_pd (data); | |
2380 } | |
2381 | |
2382 /* | |
2383 +--------------------------------------------------------------------+ | |
2384 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2385 | STATE : code ROUTINE : for_congestion_control | | |
2386 +--------------------------------------------------------------------+ | |
2387 | |
2388 PURPOSE : Code the message congestion control and send them to | |
2389 mobility management. | |
2390 | |
2391 */ | |
2392 | |
2393 GLOBAL void for_congestion_control (T_B_CONGEST_CTRL * cong) | |
2394 { | |
2395 | |
2396 | |
2397 TRACE_FUNCTION ("for_congestion_control()"); | |
2398 /* Implements Measure# 27 */ | |
2399 code_msg ((UBYTE *)cong, BSIZE_B_CONGEST_CTRL); | |
2400 } | |
2401 | |
2402 /* | |
2403 +--------------------------------------------------------------------+ | |
2404 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2405 | STATE : code ROUTINE : for_modify | | |
2406 +--------------------------------------------------------------------+ | |
2407 | |
2408 PURPOSE : Code the message modify and send them to | |
2409 mobility management. | |
2410 | |
2411 */ | |
2412 | |
2413 GLOBAL void for_modify (T_B_MODIFY * modify) | |
2414 { | |
2415 | |
2416 TRACE_FUNCTION ("for_modify()"); | |
2417 | |
2418 /* Implements Measure# 28 */ | |
2419 code_msg ((UBYTE *)modify, BSIZE_B_MODIFY); | |
2420 } | |
2421 | |
2422 | |
2423 /* | |
2424 +--------------------------------------------------------------------+ | |
2425 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2426 | STATE : code ROUTINE : for_connect | | |
2427 +--------------------------------------------------------------------+ | |
2428 | |
2429 PURPOSE : Code the message connect and send them to | |
2430 mobility management. | |
2431 | |
2432 */ | |
2433 | |
2434 GLOBAL void for_connect (T_U_CONNECT * connect) | |
2435 { | |
2436 /* | |
2437 * the message contains only message type | |
2438 * and transaction identifier and no | |
2439 * optional elements | |
2440 */ | |
2441 | |
2442 TRACE_FUNCTION ("for_connect()"); | |
2443 | |
2444 /* Implements Measure# 13 */ | |
2445 code_msg ((UBYTE *)connect, LEN_U_CONNECT); | |
2446 } | |
2447 | |
2448 /* | |
2449 +--------------------------------------------------------------------+ | |
2450 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2451 | STATE : code ROUTINE : for_alert | | |
2452 +--------------------------------------------------------------------+ | |
2453 | |
2454 PURPOSE : Code the message alert and send them to | |
2455 mobility management. | |
2456 | |
2457 */ | |
2458 | |
2459 GLOBAL void for_alert (T_U_ALERT * alert) | |
2460 { | |
2461 /* | |
2462 * the message contains only message type and | |
2463 * transaction identifier and no optional | |
2464 * elements | |
2465 */ | |
2466 | |
2467 TRACE_FUNCTION ("for_alert()"); | |
2468 | |
2469 /* Implements Measure# 14 */ | |
2470 code_msg ((UBYTE *)alert, LEN_U_ALERT); | |
2471 } | |
2472 | |
2473 /* | |
2474 +--------------------------------------------------------------------+ | |
2475 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2476 | STATE : code ROUTINE : for_facility | | |
2477 +--------------------------------------------------------------------+ | |
2478 | |
2479 PURPOSE : Code the message facility and send them to | |
2480 mobility management. | |
2481 | |
2482 */ | |
2483 | |
2484 GLOBAL void for_facility (T_U_FACILITY * facility) | |
2485 { | |
2486 /* | |
2487 * The length of the outgoing message depends | |
2488 * on the length of the facility information | |
2489 * element plus message type, transaction identifier | |
2490 * and ss version. | |
2491 */ | |
2492 PALLOC_SDU (data, MMCM_DATA_REQ, | |
2493 (USHORT)(LEN_U_FACILITY + facility->facility.c_fac * 8)); | |
2494 | |
2495 TRACE_FUNCTION ("for_facility()"); | |
2496 | |
2497 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2498 ccd_codeMsg (CCDENT_CC, | |
2499 UPLINK, | |
2500 (T_MSGBUF *) &data->sdu, | |
2501 (UBYTE *) facility, | |
2502 NOT_PRESENT_8BIT); | |
2503 for_pd (data); | |
2504 } | |
2505 | |
2506 | |
2507 /* | |
2508 +--------------------------------------------------------------------+ | |
2509 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2510 | STATE : code ROUTINE : for_pd | | |
2511 +--------------------------------------------------------------------+ | |
2512 | |
2513 PURPOSE : Add protocol discriminator and transaction identifier. | |
2514 | |
2515 */ | |
2516 | |
2517 GLOBAL void for_pd (T_MMCM_DATA_REQ * data) | |
2518 { | |
2519 GET_INSTANCE_DATA; | |
2520 | |
2521 U8 *payload; | |
2522 U16 length; | |
2523 UBYTE *msg_type; | |
2524 /* Implements Measure#32: Row 71,...,95 */ | |
2525 | |
2526 | |
2527 TRACE_FUNCTION ("for_pd()"); | |
2528 | |
2529 data->org_entity = NAS_ORG_ENTITY_CC; | |
2530 | |
2531 TRACE_EVENT_P1("extended TI %spresent", (cc_data->ti_ext_pres EQ TRUE)? "":"not "); | |
2532 if (cc_data->ti_ext_pres EQ TRUE) | |
2533 { | |
2534 data->sdu.o_buf -= 8; | |
2535 data->sdu.l_buf += 8; | |
2536 data->sdu.buf[data->sdu.o_buf >> 3] = cc_data->ti_ext; | |
2537 } | |
2538 | |
2539 SET_PD (data->sdu, M_MM_PD_CC); | |
2540 SET_TI (data->sdu, cc_data->ti); | |
2541 data->sdu.l_buf += 8; | |
2542 data->sdu.o_buf -= 8; | |
2543 | |
2544 msg_type = &(data->sdu.buf[CC_ENCODE_OFFSET >> 3]);/*lint !e415 !e416 Likely access or creation of out-of-bounds pointer*/ | |
2545 payload = &(data->sdu.buf[0]); /* beginning of buffer */ | |
2546 payload += ((data->sdu.o_buf) >> 3); /* plus offset (bytes) */ | |
2547 length = ((data->sdu.l_buf) >> 3); /* length (bytes, bits / 8) */ | |
2548 | |
2549 /*lint -e{415} Likely access or creation of out-of-bounds pointer*/ | |
2550 switch (*msg_type) | |
2551 { | |
2552 case U_SETUP: | |
2553 TRACE_BINDUMP (cc_handle, | |
2554 TC_USER4, | |
2555 " Setup UL ", | |
2556 payload, | |
2557 length); | |
2558 break; | |
2559 case U_EMERGE_SETUP: | |
2560 TRACE_BINDUMP (cc_handle, | |
2561 TC_USER4, | |
2562 " Emergency Setup UL ", | |
2563 payload, | |
2564 length); | |
2565 break; | |
2566 case U_START_CC: | |
2567 TRACE_BINDUMP (cc_handle, | |
2568 TC_USER4, | |
2569 " Call Control Capability UL ", | |
2570 payload, | |
2571 length); | |
2572 break; | |
2573 case U_CC_EST_CONF: | |
2574 TRACE_BINDUMP (cc_handle, | |
2575 TC_USER4, | |
2576 " Establishment Confirm UL ", | |
2577 payload, | |
2578 length); | |
2579 break; | |
2580 case B_STATUS: | |
2581 TRACE_BINDUMP (cc_handle, | |
2582 TC_USER4, | |
2583 " Status UL ", | |
2584 payload, | |
2585 length); | |
2586 break; | |
2587 case U_DISCONNECT: | |
2588 TRACE_BINDUMP (cc_handle, | |
2589 TC_USER4, | |
2590 " Disconnect UL ", | |
2591 payload, | |
2592 length); | |
2593 break; | |
2594 case B_MODIFY_REJ: | |
2595 TRACE_BINDUMP (cc_handle, | |
2596 TC_USER4, | |
2597 " Modify Reject UL ", | |
2598 payload, | |
2599 length); | |
2600 break; | |
2601 case B_MODIFY_COMP: | |
2602 TRACE_BINDUMP (cc_handle, | |
2603 TC_USER4, | |
2604 " Modify Complete UL ", | |
2605 payload, | |
2606 length); | |
2607 break; | |
2608 case U_START_DTMF: | |
2609 TRACE_BINDUMP (cc_handle, | |
2610 TC_USER4, | |
2611 " Start DTMF UL ", | |
2612 payload, | |
2613 length); | |
2614 break; | |
2615 case U_STOP_DTMF: | |
2616 TRACE_BINDUMP (cc_handle, | |
2617 TC_USER4, | |
2618 " Stop DTMF UL ", | |
2619 payload, | |
2620 length); | |
2621 break; | |
2622 case U_CALL_CONF: | |
2623 TRACE_BINDUMP (cc_handle, | |
2624 TC_USER4, | |
2625 " Call Confirm UL ", | |
2626 payload, | |
2627 length); | |
2628 break; | |
2629 case U_RELEASE : | |
2630 TRACE_BINDUMP (cc_handle, | |
2631 TC_USER4, | |
2632 " Release UL ", | |
2633 payload, | |
2634 length); | |
2635 break; | |
2636 case B_CONNECT_ACK: | |
2637 TRACE_BINDUMP (cc_handle, | |
2638 TC_USER4, | |
2639 " Connect Acknowledge UL ", | |
2640 payload, | |
2641 length); | |
2642 break; | |
2643 case U_RETRIEVE: | |
2644 TRACE_BINDUMP (cc_handle, | |
2645 TC_USER4, | |
2646 " Retrieve UL ", | |
2647 payload, | |
2648 length); | |
2649 break; | |
2650 case U_HOLD: | |
2651 TRACE_BINDUMP (cc_handle, | |
2652 TC_USER4, | |
2653 " Hold UL ", | |
2654 payload, | |
2655 length); | |
2656 break; | |
2657 case B_USER_INFO: | |
2658 TRACE_BINDUMP (cc_handle, | |
2659 TC_USER4, | |
2660 " User Info UL ", | |
2661 payload, | |
2662 length); | |
2663 break; | |
2664 case B_CONGEST_CTRL: | |
2665 TRACE_BINDUMP (cc_handle, | |
2666 TC_USER4, | |
2667 " Congestion Control UL ", | |
2668 payload, | |
2669 length); | |
2670 break; | |
2671 case B_MODIFY: | |
2672 TRACE_BINDUMP (cc_handle, | |
2673 TC_USER4, | |
2674 " Modify UL ", | |
2675 payload, | |
2676 length); | |
2677 break; | |
2678 case U_CONNECT: | |
2679 TRACE_BINDUMP (cc_handle, | |
2680 TC_USER4, | |
2681 " Connect UL ", | |
2682 payload, | |
2683 length); | |
2684 break; | |
2685 case U_ALERT: | |
2686 TRACE_BINDUMP (cc_handle, | |
2687 TC_USER4, | |
2688 " Alert UL ", | |
2689 payload, | |
2690 length); | |
2691 break; | |
2692 case U_FACILITY: | |
2693 TRACE_BINDUMP (cc_handle, | |
2694 TC_USER4, | |
2695 " Facility UL ", | |
2696 payload, | |
2697 length); | |
2698 break; | |
2699 case U_RELEASE_COMP: | |
2700 TRACE_BINDUMP (cc_handle, | |
2701 TC_USER4, | |
2702 "Release Complete UL ", | |
2703 payload, | |
2704 length); | |
2705 break; | |
2706 case B_NOTIFY: | |
2707 TRACE_BINDUMP (cc_handle, | |
2708 TC_USER4, | |
2709 "Notify UL ", | |
2710 payload, | |
2711 length); | |
2712 break; | |
2713 case B_STATUS_ENQ: | |
2714 TRACE_BINDUMP (cc_handle, | |
2715 TC_USER4, | |
2716 "Status Enquiry UL ", | |
2717 payload, | |
2718 length); | |
2719 break; | |
2720 default: | |
2721 TRACE_EVENT("Unknown Message"); | |
2722 break; | |
2723 } /* switch (*msg_type) */ | |
2724 PSENDX (MM, data); | |
2725 } | |
2726 /* Implements Measure# 11, 12, 13, 14, 22, 27, 28 and 38 */ | |
2727 | |
2728 /* | |
2729 +--------------------------------------------------------------------+ | |
2730 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2731 | STATE : code ROUTINE : code_msg | | |
2732 +--------------------------------------------------------------------+ | |
2733 | |
2734 PURPOSE : Code the message and add protocol discriminator and | |
2735 transaction identifier. | |
2736 | |
2737 */ | |
2738 | |
2739 LOCAL void code_msg (UBYTE * mStruct, | |
2740 USHORT len) | |
2741 { | |
2742 TRACE_FUNCTION ("code_msg()"); | |
2743 { | |
2744 /* Here we are using PALLOC_SDU for PALLOC_MSG also since they are same */ | |
2745 PALLOC_SDU (data, MMCM_DATA_REQ, len); | |
2746 | |
2747 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2748 ccd_codeMsg (CCDENT_CC, | |
2749 UPLINK, | |
2750 (T_MSGBUF *) &data->sdu, | |
2751 mStruct, | |
2752 NOT_PRESENT_8BIT); | |
2753 for_pd (data); | |
2754 } | |
2755 } | |
2756 | |
2757 | |
2758 /* Implements Measure# 44 */ | |
2759 /* | |
2760 +--------------------------------------------------------------------+ | |
2761 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2762 | STATE : code ROUTINE : for_send_u_release_comp | | |
2763 +--------------------------------------------------------------------+ | |
2764 | |
2765 PURPOSE : Send release complete. | |
2766 | |
2767 */ | |
2768 LOCAL void for_send_u_release_comp (USHORT cause) | |
2769 | |
2770 { | |
2771 TRACE_FUNCTION ("for_send_u_release_comp()"); | |
2772 | |
2773 CCD_END; | |
2774 CCD_START; | |
2775 /* | |
2776 * For MM the connection is still valid | |
2777 * CC has already released the connection. | |
2778 */ | |
2779 { | |
2780 MCAST (rel_com, U_RELEASE_COMP); | |
2781 | |
2782 cc_build_release_complete (rel_com, | |
2783 CAUSE_MAKE(DEFBY_STD, | |
2784 ORIGSIDE_MS, | |
2785 MNCC_CC_ORIGINATING_ENTITY, | |
2786 cause)); | |
2787 for_release_complete (rel_com); | |
2788 } | |
2789 CCD_END; | |
2790 for_rel_req (); | |
2791 } | |
2792 | |
2793 /* Implements Measure# 42 */ | |
2794 /* | |
2795 +--------------------------------------------------------------------+ | |
2796 | PROJECT : GSM-PS (6147) MODULE : CC_FOR | | |
2797 | STATE : code ROUTINE : for_retrieve_hold | | |
2798 +--------------------------------------------------------------------+ | |
2799 | |
2800 PURPOSE : Send release complete. | |
2801 | |
2802 */ | |
2803 | |
2804 LOCAL void for_fill_sdu_and_send (UBYTE msg, | |
2805 USHORT len) | |
2806 { | |
2807 PALLOC_SDU (data, MMCM_DATA_REQ, len); | |
2808 data->sdu.o_buf = CC_ENCODE_OFFSET; | |
2809 data->sdu.l_buf = 8; | |
2810 /*lint -e{415} (warning-- Likely access or creation of out-of-bounds pointer)*/ | |
2811 data->sdu.buf [CC_ENCODE_OFFSET >> 3] = msg; | |
2812 for_pd (data); | |
2813 } | |
2814 #endif |