comparison gsm-fw/ccd/noncritical_ext.c @ 648:970d6199f2c5

gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 04 Sep 2014 05:48:57 +0000
parents
children
comparison
equal deleted inserted replaced
647:a60b375014e3 648:970d6199f2c5
1
2 /*
3 +------------------------------------------------------------------------------
4 | File: noncritical_ext.c
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: Encoding and decoding functions for nonCriticalExtensions elements
18 |
19 | $Identity:$
20 +------------------------------------------------------------------------------
21 */
22
23 /*
24 * Standard definitions like UCHAR, ERROR etc.
25 */
26 #include "typedefs.h"
27 #include "header.h"
28
29 /*
30 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only
31 * look at ccdapi.h
32 */
33 #undef USE_DRIVER
34 #include "ccdapi.h"
35
36 /*
37 * Types and functions for bit access and manipulation
38 */
39 #include "ccd_globs.h"
40 #include "bitfun.h"
41
42 /*
43 * Prototypes and constants in the common part of ccd
44 */
45 #include "ccd.h"
46
47 /*
48 * Declaration of coder/decoder tables
49 */
50 #include "ccdtable.h"
51 #include "ccddata.h"
52
53 #ifndef RUN_INT_RAM
54 /*
55 +------------------------------------------------------------------------+
56 | PROJECT : CCD (6144) MODULE : noncritical_ext |
57 | STATE : code ROUTINE : cdc_noncritical_ext_decode |
58 +------------------------------------------------------------------------+
59
60 PURPOSE : Decode elements of type nonCriticalExtensions
61
62 An element of this type should never be encoded or decoded.
63 If the coder faces an IE of this type, it should report a
64 warning and continue decoding.
65 Whenever a nonCriticalExtensions-IE is extended from NULL or
66 SEQUENCE {} to another type, its CCD coding type will change
67 and the functions in this file will not be called for that IE
68 any more.
69
70 According to 3GPP TS25.331 V3.6.0, 10.1.1.1:
71 Information elements applicable to choices reserved for future
72 releases of the protocol shall be added to the end of the message.
73 In future releases non critical informaion elements ... shall
74 be appended at the end of the message.
75 See also 3GPP TS25.921 V4.3.0, 10.4.
76
77 */
78 SHORT cdc_noncritical_ext_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
79 {
80 #ifdef DEBUG_CCD
81 #ifndef CCD_SYMBOLS
82 TRACE_CCD (globs, "cdc_noncritical_ext_decode()");
83 #else
84 TRACE_CCD (globs, "cdc_noncritical_ext_decode() %s", mcomp[melem[e_ref].elemRef].name);
85 #endif
86 #endif
87
88 globs->pstructOffs = melem[e_ref].structOffs;
89
90 /* For optional elements we have already set the valid flag in the
91 * C-structure. We have done it while processing ASN1_SEQ.
92 */
93 if ( ! cdc_isPresent(e_ref, globs) ) {
94 return 1;
95 }
96
97 if (melem[e_ref].elemType EQ 'V' AND mvar[melem[e_ref].elemRef].bSize EQ 0)
98 {
99 return 0;
100 }
101 /*
102 * Currently CCD tool chain does not support extensions of this type.
103 * This else-implementation is just an outlook.
104 *
105 else
106 {
107 U16 compRef = melem[e_ref].elemRef;
108 U16 elemRef = mcomp[compRef].componentRef;
109 (void) codec[melem[Elem].codingType][DECODE_FUN]
110 (compRef, elemRef, globs);
111 }*/
112 return 1;
113 }
114 #endif /* !RUN_INT_RAM */
115
116 #ifndef RUN_INT_RAM
117 /*
118 +------------------------------------------------------------------------+
119 | PROJECT : CCD (6144) MODULE : noncritical_ext |
120 | STATE : code ROUTINE : cdc_noncritical_ext_encode |
121 +------------------------------------------------------------------------+
122
123 PURPOSE : Encode elements of type nonCriticalExtensions
124
125 An element of this type should never be encoded or decoded.
126 If the coder faces an IE of this type, it should report an
127 error report and abort.
128 */
129 SHORT cdc_noncritical_ext_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
130 {
131
132 #ifdef DEBUG_CCD
133 #ifndef CCD_SYMBOLS
134 TRACE_CCD (globs, "cdc_noncritical_ext_encode()");
135 #else
136 TRACE_CCD (globs, "cdc_noncritical_ext_encode() %s", mcomp[melem[e_ref].elemRef].name);
137 #endif
138 #endif
139
140 globs->pstructOffs = melem[e_ref].structOffs;
141
142 /* For optional elements we have already set the valid flag in the
143 * C-structure. We have done it while processing ASN1_SEQ.
144 */
145 if ( ! cdc_isPresent(e_ref, globs) ) {
146 return 1;
147 }
148
149 if (melem[e_ref].elemType EQ 'V' AND mvar[melem[e_ref].elemRef].bSize EQ 0)
150 {
151 return 0;
152 }
153 /*
154 * Currently CCD tool chain does not support extensions of this type.
155 * This else-implementation is just an outlook.
156 *
157 else
158 {
159 U16 compRef = melem[e_ref].elemRef;
160 U16 elemRef = mcomp[compRef].componentRef;
161 (void) codec[melem[Elem].codingType][ENCODE_FUN]
162 (compRef, elemRef, globs);
163 }*/
164 return 1;
165 }
166 #endif /* !RUN_INT_RAM */