16 # define Nc *((gsm_signal (*) [17])(target + 8)) 17 # define bc *((gsm_signal (*) [17])(target + 9)) 18 # define Mc *((gsm_signal (*) [17])(target + 10)) 19 # define xmaxc *((gsm_signal (*) [17])(target + 11)) 30 LARc[0] = sr & 0x3f; sr >>= 6;
31 sr |= (
uword)*c++ << 2;
32 LARc[1] = sr & 0x3f; sr >>= 6;
33 sr |= (
uword)*c++ << 4;
34 LARc[2] = sr & 0x1f; sr >>= 5;
35 LARc[3] = sr & 0x1f; sr >>= 5;
36 sr |= (
uword)*c++ << 2;
37 LARc[4] = sr & 0xf; sr >>= 4;
38 LARc[5] = sr & 0xf; sr >>= 4;
39 sr |= (
uword)*c++ << 2;
40 LARc[6] = sr & 0x7; sr >>= 3;
41 LARc[7] = sr & 0x7; sr >>= 3;
42 sr |= (
uword)*c++ << 4;
43 Nc[0] = sr & 0x7f; sr >>= 7;
44 bc[0] = sr & 0x3; sr >>= 2;
45 Mc[0] = sr & 0x3; sr >>= 2;
46 sr |= (
uword)*c++ << 1;
47 xmaxc[0] = sr & 0x3f; sr >>= 6;
49 #define xmc (target + 12) 50 xmc[0] = sr & 0x7; sr >>= 3;
52 xmc[1] = sr & 0x7; sr >>= 3;
53 xmc[2] = sr & 0x7; sr >>= 3;
54 sr |= (
uword)*c++ << 2;
55 xmc[3] = sr & 0x7; sr >>= 3;
56 xmc[4] = sr & 0x7; sr >>= 3;
57 xmc[5] = sr & 0x7; sr >>= 3;
58 sr |= (
uword)*c++ << 1;
59 xmc[6] = sr & 0x7; sr >>= 3;
60 xmc[7] = sr & 0x7; sr >>= 3;
61 xmc[8] = sr & 0x7; sr >>= 3;
63 xmc[9] = sr & 0x7; sr >>= 3;
64 xmc[10] = sr & 0x7; sr >>= 3;
65 sr |= (
uword)*c++ << 2;
66 xmc[11] = sr & 0x7; sr >>= 3;
67 xmc[12] = sr & 0x7; sr >>= 3;
68 sr |= (
uword)*c++ << 4;
69 Nc[1] = sr & 0x7f; sr >>= 7;
70 bc[1] = sr & 0x3; sr >>= 2;
71 Mc[1] = sr & 0x3; sr >>= 2;
72 sr |= (
uword)*c++ << 1;
73 xmaxc[1] = sr & 0x3f; sr >>= 6;
75 #define xmc (target + 29 - 13) 77 xmc[13] = sr & 0x7; sr >>= 3;
79 xmc[14] = sr & 0x7; sr >>= 3;
80 xmc[15] = sr & 0x7; sr >>= 3;
81 sr |= (
uword)*c++ << 2;
82 xmc[16] = sr & 0x7; sr >>= 3;
83 xmc[17] = sr & 0x7; sr >>= 3;
84 xmc[18] = sr & 0x7; sr >>= 3;
85 sr |= (
uword)*c++ << 1;
86 xmc[19] = sr & 0x7; sr >>= 3;
87 xmc[20] = sr & 0x7; sr >>= 3;
88 xmc[21] = sr & 0x7; sr >>= 3;
90 xmc[22] = sr & 0x7; sr >>= 3;
91 xmc[23] = sr & 0x7; sr >>= 3;
92 sr |= (
uword)*c++ << 2;
93 xmc[24] = sr & 0x7; sr >>= 3;
94 xmc[25] = sr & 0x7; sr >>= 3;
95 sr |= (
uword)*c++ << 4;
96 Nc[2] = sr & 0x7f; sr >>= 7;
97 bc[2] = sr & 0x3; sr >>= 2;
98 Mc[2] = sr & 0x3; sr >>= 2;
99 sr |= (
uword)*c++ << 1;
100 xmaxc[2] = sr & 0x3f; sr >>= 6;
103 #define xmc (target + 46 - 26) 105 xmc[26] = sr & 0x7; sr >>= 3;
107 xmc[27] = sr & 0x7; sr >>= 3;
108 xmc[28] = sr & 0x7; sr >>= 3;
109 sr |= (
uword)*c++ << 2;
110 xmc[29] = sr & 0x7; sr >>= 3;
111 xmc[30] = sr & 0x7; sr >>= 3;
112 xmc[31] = sr & 0x7; sr >>= 3;
113 sr |= (
uword)*c++ << 1;
114 xmc[32] = sr & 0x7; sr >>= 3;
115 xmc[33] = sr & 0x7; sr >>= 3;
116 xmc[34] = sr & 0x7; sr >>= 3;
118 xmc[35] = sr & 0x7; sr >>= 3;
119 xmc[36] = sr & 0x7; sr >>= 3;
120 sr |= (
uword)*c++ << 2;
121 xmc[37] = sr & 0x7; sr >>= 3;
122 xmc[38] = sr & 0x7; sr >>= 3;
123 sr |= (
uword)*c++ << 4;
124 Nc[3] = sr & 0x7f; sr >>= 7;
125 bc[3] = sr & 0x3; sr >>= 2;
126 Mc[3] = sr & 0x3; sr >>= 2;
127 sr |= (
uword)*c++ << 1;
128 xmaxc[3] = sr & 0x3f; sr >>= 6;
130 #define xmc (target + 63 - 39) 132 xmc[39] = sr & 0x7; sr >>= 3;
134 xmc[40] = sr & 0x7; sr >>= 3;
135 xmc[41] = sr & 0x7; sr >>= 3;
136 sr |= (
uword)*c++ << 2;
137 xmc[42] = sr & 0x7; sr >>= 3;
138 xmc[43] = sr & 0x7; sr >>= 3;
139 xmc[44] = sr & 0x7; sr >>= 3;
140 sr |= (
uword)*c++ << 1;
141 xmc[45] = sr & 0x7; sr >>= 3;
142 xmc[46] = sr & 0x7; sr >>= 3;
143 xmc[47] = sr & 0x7; sr >>= 3;
145 xmc[48] = sr & 0x7; sr >>= 3;
146 xmc[49] = sr & 0x7; sr >>= 3;
147 sr |= (
uword)*c++ << 2;
148 xmc[50] = sr & 0x7; sr >>= 3;
149 xmc[51] = sr & 0x7; sr >>= 3;
155 sr |= (
uword)*c++ << 4;
156 LARc[0] = sr & 0x3f; sr >>= 6;
157 LARc[1] = sr & 0x3f; sr >>= 6;
159 LARc[2] = sr & 0x1f; sr >>= 5;
160 sr |= (
uword)*c++ << 3;
161 LARc[3] = sr & 0x1f; sr >>= 5;
162 LARc[4] = sr & 0xf; sr >>= 4;
163 sr |= (
uword)*c++ << 2;
164 LARc[5] = sr & 0xf; sr >>= 4;
165 LARc[6] = sr & 0x7; sr >>= 3;
166 LARc[7] = sr & 0x7; sr >>= 3;
168 Nc[0] = sr & 0x7f; sr >>= 7;
169 sr |= (
uword)*c++ << 1;
170 bc[0] = sr & 0x3; sr >>= 2;
171 Mc[0] = sr & 0x3; sr >>= 2;
172 sr |= (
uword)*c++ << 5;
173 xmaxc[0] = sr & 0x3f; sr >>= 6;
175 #define xmc (target + 12) 176 xmc[0] = sr & 0x7; sr >>= 3;
177 xmc[1] = sr & 0x7; sr >>= 3;
178 sr |= (
uword)*c++ << 1;
179 xmc[2] = sr & 0x7; sr >>= 3;
180 xmc[3] = sr & 0x7; sr >>= 3;
181 xmc[4] = sr & 0x7; sr >>= 3;
183 xmc[5] = sr & 0x7; sr >>= 3;
184 xmc[6] = sr & 0x7; sr >>= 3;
185 sr |= (
uword)*c++ << 2;
186 xmc[7] = sr & 0x7; sr >>= 3;
187 xmc[8] = sr & 0x7; sr >>= 3;
188 xmc[9] = sr & 0x7; sr >>= 3;
189 sr |= (
uword)*c++ << 1;
190 xmc[10] = sr & 0x7; sr >>= 3;
191 xmc[11] = sr & 0x7; sr >>= 3;
192 xmc[12] = sr & 0x7; sr >>= 3;
194 Nc[1] = sr & 0x7f; sr >>= 7;
195 sr |= (
uword)*c++ << 1;
196 bc[1] = sr & 0x3; sr >>= 2;
197 Mc[1] = sr & 0x3; sr >>= 2;
198 sr |= (
uword)*c++ << 5;
199 xmaxc[1] = sr & 0x3f; sr >>= 6;
201 #define xmc (target + 29 - 13) 203 xmc[13] = sr & 0x7; sr >>= 3;
204 xmc[14] = sr & 0x7; sr >>= 3;
205 sr |= (
uword)*c++ << 1;
206 xmc[15] = sr & 0x7; sr >>= 3;
207 xmc[16] = sr & 0x7; sr >>= 3;
208 xmc[17] = sr & 0x7; sr >>= 3;
210 xmc[18] = sr & 0x7; sr >>= 3;
211 xmc[19] = sr & 0x7; sr >>= 3;
212 sr |= (
uword)*c++ << 2;
213 xmc[20] = sr & 0x7; sr >>= 3;
214 xmc[21] = sr & 0x7; sr >>= 3;
215 xmc[22] = sr & 0x7; sr >>= 3;
216 sr |= (
uword)*c++ << 1;
217 xmc[23] = sr & 0x7; sr >>= 3;
218 xmc[24] = sr & 0x7; sr >>= 3;
219 xmc[25] = sr & 0x7; sr >>= 3;
221 Nc[2] = sr & 0x7f; sr >>= 7;
222 sr |= (
uword)*c++ << 1;
223 bc[2] = sr & 0x3; sr >>= 2;
224 Mc[2] = sr & 0x3; sr >>= 2;
225 sr |= (
uword)*c++ << 5;
226 xmaxc[2] = sr & 0x3f; sr >>= 6;
228 #define xmc (target + 46 - 26) 229 xmc[26] = sr & 0x7; sr >>= 3;
230 xmc[27] = sr & 0x7; sr >>= 3;
231 sr |= (
uword)*c++ << 1;
232 xmc[28] = sr & 0x7; sr >>= 3;
233 xmc[29] = sr & 0x7; sr >>= 3;
234 xmc[30] = sr & 0x7; sr >>= 3;
236 xmc[31] = sr & 0x7; sr >>= 3;
237 xmc[32] = sr & 0x7; sr >>= 3;
238 sr |= (
uword)*c++ << 2;
239 xmc[33] = sr & 0x7; sr >>= 3;
240 xmc[34] = sr & 0x7; sr >>= 3;
241 xmc[35] = sr & 0x7; sr >>= 3;
242 sr |= (
uword)*c++ << 1;
243 xmc[36] = sr & 0x7; sr >>= 3;
244 xmc[37] = sr & 0x7; sr >>= 3;
245 xmc[38] = sr & 0x7; sr >>= 3;
247 Nc[3] = sr & 0x7f; sr >>= 7;
248 sr |= (
uword)*c++ << 1;
249 bc[3] = sr & 0x3; sr >>= 2;
250 Mc[3] = sr & 0x3; sr >>= 2;
251 sr |= (
uword)*c++ << 5;
252 xmaxc[3] = sr & 0x3f; sr >>= 6;
255 #define xmc (target + 63 - 39) 257 xmc[39] = sr & 0x7; sr >>= 3;
258 xmc[40] = sr & 0x7; sr >>= 3;
259 sr |= (
uword)*c++ << 1;
260 xmc[41] = sr & 0x7; sr >>= 3;
261 xmc[42] = sr & 0x7; sr >>= 3;
262 xmc[43] = sr & 0x7; sr >>= 3;
264 xmc[44] = sr & 0x7; sr >>= 3;
265 xmc[45] = sr & 0x7; sr >>= 3;
266 sr |= (
uword)*c++ << 2;
267 xmc[46] = sr & 0x7; sr >>= 3;
268 xmc[47] = sr & 0x7; sr >>= 3;
269 xmc[48] = sr & 0x7; sr >>= 3;
270 sr |= (
uword)*c++ << 1;
271 xmc[49] = sr & 0x7; sr >>= 3;
272 xmc[50] = sr & 0x7; sr >>= 3;
273 xmc[51] = sr & 0x7; sr >>= 3;
281 if (((*c >> 4) & 0x0F) !=
GSM_MAGIC)
return -1;
283 LARc[0] = (*c++ & 0xF) << 2;
284 LARc[0] |= (*c >> 6) & 0x3;
285 LARc[1] = *c++ & 0x3F;
286 LARc[2] = (*c >> 3) & 0x1F;
287 LARc[3] = (*c++ & 0x7) << 2;
288 LARc[3] |= (*c >> 6) & 0x3;
289 LARc[4] = (*c >> 2) & 0xF;
290 LARc[5] = (*c++ & 0x3) << 2;
291 LARc[5] |= (*c >> 6) & 0x3;
292 LARc[6] = (*c >> 3) & 0x7;
293 LARc[7] = *c++ & 0x7;
295 Nc[0] = (*c >> 1) & 0x7F;
297 bc[0] = (*c++ & 0x1) << 1;
298 bc[0] |= (*c >> 7) & 0x1;
300 Mc[0] = (*c >> 5) & 0x3;
302 xmaxc[0] = (*c++ & 0x1F) << 1;
303 xmaxc[0] |= (*c >> 7) & 0x1;
306 #define xmc (target + 12) 308 xmc[0] = (*c >> 4) & 0x7;
309 xmc[1] = (*c >> 1) & 0x7;
310 xmc[2] = (*c++ & 0x1) << 2;
311 xmc[2] |= (*c >> 6) & 0x3;
312 xmc[3] = (*c >> 3) & 0x7;
314 xmc[5] = (*c >> 5) & 0x7;
315 xmc[6] = (*c >> 2) & 0x7;
316 xmc[7] = (*c++ & 0x3) << 1;
317 xmc[7] |= (*c >> 7) & 0x1;
318 xmc[8] = (*c >> 4) & 0x7;
319 xmc[9] = (*c >> 1) & 0x7;
320 xmc[10] = (*c++ & 0x1) << 2;
321 xmc[10] |= (*c >> 6) & 0x3;
322 xmc[11] = (*c >> 3) & 0x7;
323 xmc[12] = *c++ & 0x7;
325 Nc[1] = (*c >> 1) & 0x7F;
327 bc[1] = (*c++ & 0x1) << 1;
328 bc[1] |= (*c >> 7) & 0x1;
330 Mc[1] = (*c >> 5) & 0x3;
332 xmaxc[1] = (*c++ & 0x1F) << 1;
333 xmaxc[1] |= (*c >> 7) & 0x1;
336 #define xmc (target + 29 - 13) 338 xmc[13] = (*c >> 4) & 0x7;
339 xmc[14] = (*c >> 1) & 0x7;
340 xmc[15] = (*c++ & 0x1) << 2;
341 xmc[15] |= (*c >> 6) & 0x3;
342 xmc[16] = (*c >> 3) & 0x7;
343 xmc[17] = *c++ & 0x7;
344 xmc[18] = (*c >> 5) & 0x7;
345 xmc[19] = (*c >> 2) & 0x7;
346 xmc[20] = (*c++ & 0x3) << 1;
347 xmc[20] |= (*c >> 7) & 0x1;
348 xmc[21] = (*c >> 4) & 0x7;
349 xmc[22] = (*c >> 1) & 0x7;
350 xmc[23] = (*c++ & 0x1) << 2;
351 xmc[23] |= (*c >> 6) & 0x3;
352 xmc[24] = (*c >> 3) & 0x7;
353 xmc[25] = *c++ & 0x7;
355 Nc[2] = (*c >> 1) & 0x7F;
357 bc[2] = (*c++ & 0x1) << 1;
358 bc[2] |= (*c >> 7) & 0x1;
360 Mc[2] = (*c >> 5) & 0x3;
362 xmaxc[2] = (*c++ & 0x1F) << 1;
363 xmaxc[2] |= (*c >> 7) & 0x1;
366 #define xmc (target + 46 - 26) 368 xmc[26] = (*c >> 4) & 0x7;
369 xmc[27] = (*c >> 1) & 0x7;
370 xmc[28] = (*c++ & 0x1) << 2;
371 xmc[28] |= (*c >> 6) & 0x3;
372 xmc[29] = (*c >> 3) & 0x7;
373 xmc[30] = *c++ & 0x7;
374 xmc[31] = (*c >> 5) & 0x7;
375 xmc[32] = (*c >> 2) & 0x7;
376 xmc[33] = (*c++ & 0x3) << 1;
377 xmc[33] |= (*c >> 7) & 0x1;
378 xmc[34] = (*c >> 4) & 0x7;
379 xmc[35] = (*c >> 1) & 0x7;
380 xmc[36] = (*c++ & 0x1) << 2;
381 xmc[36] |= (*c >> 6) & 0x3;
382 xmc[37] = (*c >> 3) & 0x7;
383 xmc[38] = *c++ & 0x7;
385 Nc[3] = (*c >> 1) & 0x7F;
387 bc[3] = (*c++ & 0x1) << 1;
388 bc[3] |= (*c >> 7) & 0x1;
390 Mc[3] = (*c >> 5) & 0x3;
392 xmaxc[3] = (*c++ & 0x1F) << 1;
393 xmaxc[3] |= (*c >> 7) & 0x1;
396 #define xmc (target + 63 - 39) 398 xmc[39] = (*c >> 4) & 0x7;
399 xmc[40] = (*c >> 1) & 0x7;
400 xmc[41] = (*c++ & 0x1) << 2;
401 xmc[41] |= (*c >> 6) & 0x3;
402 xmc[42] = (*c >> 3) & 0x7;
403 xmc[43] = *c++ & 0x7;
404 xmc[44] = (*c >> 5) & 0x7;
405 xmc[45] = (*c >> 2) & 0x7;
406 xmc[46] = (*c++ & 0x3) << 1;
407 xmc[46] |= (*c >> 7) & 0x1;
408 xmc[47] = (*c >> 4) & 0x7;
409 xmc[48] = (*c >> 1) & 0x7;
410 xmc[49] = (*c++ & 0x1) << 2;
411 xmc[49] |= (*c >> 6) & 0x3;
412 xmc[50] = (*c >> 3) & 0x7;
unsigned char frame_index
int gsm_explode P3((s, c, target), gsm s, gsm_byte *c, gsm_signal *target)
unsigned char frame_chain