comparison gsm-fw/ccd/ccd_globs.h @ 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 | Project :
4 | Modul : ccd_globs.h
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 : Condat Coder Decoder
18 | Definition of C struct containing ccd internal global variables
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef __CCD_GLOBS_H
23 #define __CCD_GLOBS_H
24
25 #include <setjmp.h>
26 #include "ccdtable.h"
27 /*
28 * Constants needed for ccd_globs.h
29 */
30 #include "ccdapi.h"
31
32 #if !defined (CCDDATA_DYN) && !defined (CCD_TEST)
33 #include "vsi.h"
34 #endif
35
36 /*
37 * stack size for the UPN calculator
38 */
39 #define MAX_UPN_STACK_SIZE 20
40 #define MAX_KEEP_REG_SIZE 15
41
42 /*
43 * the two constants give the size of the iei table
44 */
45 #define MAX_IE_PER_MSG 40
46 #define MAX_RECURSIONS_PER_MSG 8
47
48 #ifdef CCD_GPRS_ONLY
49 #define CCD_ERR_STK_SZ (MAX_RECURSIONS_PER_MSG+2)
50 #else
51 #define CCD_ERR_STK_SZ 50
52 #endif
53
54 /*
55 * constants and types needed for error handling
56 */
57 #define MAX_ERRORS 10
58
59 #define ENCODE_FUN 0
60 #define DECODE_FUN 1
61
62 /*
63 * declare a table for the iei processing. This table
64 * contains for each iei a low and high boundary of
65 * valid repeats and the actual number of repeats
66 */
67 typedef struct
68 {
69 unsigned valid:4;
70 unsigned multiple:2;
71 unsigned exhausted:2; /* for GSM1_ASN elements */
72 /* BOOL choice; version does not use GSM1_ASNCHC */
73 /* UBYTE min_amount; seams to be an unused variable */
74 UBYTE max_amount;
75 UBYTE act_amount;
76 UBYTE ident;
77 } T_IEI_TABLE;
78
79
80 /*
81 * for each msg an initialisation of e.g. the iei_table is to
82 * perform. See cdc_GSM_start();
83 */
84
85 typedef struct
86 {
87 unsigned valid:4;
88 unsigned EOCPending:4; /* for ASN1-BER elements only */
89 UBYTE countSkipped; /* for GSM1_ASN elements */
90 USHORT melemStart;
91 USHORT melemLast;
92 USHORT ieTableLen;
93 T_IEI_TABLE iei_table[MAX_IE_PER_MSG];
94 } T_IEI_CONTEXT;
95
96
97
98 typedef struct
99 {
100 #if defined (CCDDATA_DYN) || defined (CCD_TEST)
101 int me;
102 #else
103 T_HANDLE me; /* entity calling CCD */
104 #endif
105 SHORT CCD_Error; /* return variable overwritten by ccd_setError */
106
107 /*
108 * variable used for processing of nested information elements
109 */
110 UBYTE ccd_recurs_level;
111
112 /*
113 * ccd uses setjmp() and longjmp to process some error cases.
114 */
115 BOOL jmp_mark_set;
116 jmp_buf jmp_mark;
117
118 #ifdef DYNAMIC_ARRAYS
119 /*
120 * Pointer to head of allocation chain for primitives with pointer types.
121 */
122 U8 *alloc_head;
123 #endif
124
125 /*
126 * variables used for bit buffering and manipulation of a message
127 */
128 UBYTE *bitbuf;
129 UBYTE *pstruct;
130 ULONG pstructOffs;
131 USHORT bitpos;
132 USHORT bytepos;
133 USHORT buflen;
134 USHORT bitoffs;
135 USHORT lastbytepos16;
136 USHORT lastbytepos32;
137 USHORT maxBitpos;
138 UBYTE byteoffs;
139 /*
140 * variables used by the UPN caculator
141 */
142 UBYTE SP;
143 ULONG Stack[MAX_UPN_STACK_SIZE];
144 ULONG KeepReg[MAX_KEEP_REG_SIZE];
145 BOOL StackOvfl;
146
147 /*
148 * variable used when detecting unknown extensions
149 * of IEs of type CCDTYPE_GSM5_TLV.
150 */
151 BOOL SeekTLVExt;
152
153 /*
154 * variables used as cash to keep data on octet boundaries
155 */
156 USHORT last16Bit;
157 ULONG last32Bit;
158
159 #ifdef ERR_TRC_STK_CCD
160 U16 error_stack[CCD_ERR_STK_SZ];/*??*/
161 #endif /* ERR_TRC_STK_CCD */
162 U8 errLabel;
163 U8 continue_array;
164 U16 msgLen;
165
166 /*
167 * variables used by the modules in cdc_gsm.c
168 */
169 T_IEI_CONTEXT iei_ctx[MAX_RECURSIONS_PER_MSG];
170 USHORT RefBeforeError;
171 USHORT akt1VPos;
172 USHORT next1VPos;
173 BOOL TagPending;
174 UBYTE PendingTag;
175 BOOL SequenceError;
176 BOOL Swap1V_inProgress;
177 UBYTE last_level;
178 UBYTE numEOCPending;
179
180 #ifdef DEBUG_CCD
181 BOOL TraceIt;
182 char buf[33];
183 #endif
184
185 } T_CCD_Globs;
186
187 #endif