17{
19
20
21
22 if (((*
c >> 4) & 0x0F) !=
GSM_MAGIC)
return -1;
23
24 LARc[0] = (*
c++ & 0xF) << 2;
25 LARc[0] |= (*
c >> 6) & 0x3;
26 LARc[1] = *
c++ & 0x3F;
27 LARc[2] = (*
c >> 3) & 0x1F;
28 LARc[3] = (*
c++ & 0x7) << 2;
29 LARc[3] |= (*
c >> 6) & 0x3;
30 LARc[4] = (*
c >> 2) & 0xF;
31 LARc[5] = (*
c++ & 0x3) << 2;
32 LARc[5] |= (*
c >> 6) & 0x3;
33 LARc[6] = (*
c >> 3) & 0x7;
35
36
37 Nc[0] = (*
c >> 1) & 0x7F;
38 bc[0] = (*
c++ & 0x1) << 1;
39 bc[0] |= (*
c >> 7) & 0x1;
40 Mc[0] = (*
c >> 5) & 0x3;
41 xmaxc[0] = (*
c++ & 0x1F) << 1;
42 xmaxc[0] |= (*
c >> 7) & 0x1;
43 xmc[0] = (*
c >> 4) & 0x7;
44 xmc[1] = (*
c >> 1) & 0x7;
45 xmc[2] = (*
c++ & 0x1) << 2;
46 xmc[2] |= (*
c >> 6) & 0x3;
47 xmc[3] = (*
c >> 3) & 0x7;
49 xmc[5] = (*
c >> 5) & 0x7;
50 xmc[6] = (*
c >> 2) & 0x7;
51 xmc[7] = (*
c++ & 0x3) << 1;
52 xmc[7] |= (*
c >> 7) & 0x1;
53 xmc[8] = (*
c >> 4) & 0x7;
54 xmc[9] = (*
c >> 1) & 0x7;
55 xmc[10] = (*
c++ & 0x1) << 2;
56 xmc[10] |= (*
c >> 6) & 0x3;
57 xmc[11] = (*
c >> 3) & 0x7;
59
60 Nc[1] = (*
c >> 1) & 0x7F;
61 bc[1] = (*
c++ & 0x1) << 1;
62 bc[1] |= (*
c >> 7) & 0x1;
63 Mc[1] = (*
c >> 5) & 0x3;
64 xmaxc[1] = (*
c++ & 0x1F) << 1;
65 xmaxc[1] |= (*
c >> 7) & 0x1;
66 xmc[13] = (*
c >> 4) & 0x7;
67 xmc[14] = (*
c >> 1) & 0x7;
68 xmc[15] = (*
c++ & 0x1) << 2;
69 xmc[15] |= (*
c >> 6) & 0x3;
70 xmc[16] = (*
c >> 3) & 0x7;
72 xmc[18] = (*
c >> 5) & 0x7;
73 xmc[19] = (*
c >> 2) & 0x7;
74 xmc[20] = (*
c++ & 0x3) << 1;
75 xmc[20] |= (*
c >> 7) & 0x1;
76 xmc[21] = (*
c >> 4) & 0x7;
77 xmc[22] = (*
c >> 1) & 0x7;
78 xmc[23] = (*
c++ & 0x1) << 2;
79 xmc[23] |= (*
c >> 6) & 0x3;
80 xmc[24] = (*
c >> 3) & 0x7;
82
83
84 Nc[2] = (*
c >> 1) & 0x7F;
85 bc[2] = (*
c++ & 0x1) << 1;
86 bc[2] |= (*
c >> 7) & 0x1;
87 Mc[2] = (*
c >> 5) & 0x3;
88 xmaxc[2] = (*
c++ & 0x1F) << 1;
89 xmaxc[2] |= (*
c >> 7) & 0x1;
90 xmc[26] = (*
c >> 4) & 0x7;
91 xmc[27] = (*
c >> 1) & 0x7;
92 xmc[28] = (*
c++ & 0x1) << 2;
93 xmc[28] |= (*
c >> 6) & 0x3;
94 xmc[29] = (*
c >> 3) & 0x7;
96 xmc[31] = (*
c >> 5) & 0x7;
97 xmc[32] = (*
c >> 2) & 0x7;
98 xmc[33] = (*
c++ & 0x3) << 1;
99 xmc[33] |= (*
c >> 7) & 0x1;
100 xmc[34] = (*
c >> 4) & 0x7;
101 xmc[35] = (*
c >> 1) & 0x7;
102 xmc[36] = (*
c++ & 0x1) << 2;
103 xmc[36] |= (*
c >> 6) & 0x3;
104 xmc[37] = (*
c >> 3) & 0x7;
105 xmc[38] = *
c++ & 0x7;
106
107 Nc[3] = (*
c >> 1) & 0x7F;
108 bc[3] = (*
c++ & 0x1) << 1;
109 bc[3] |= (*
c >> 7) & 0x1;
110 Mc[3] = (*
c >> 5) & 0x3;
111 xmaxc[3] = (*
c++ & 0x1F) << 1;
112 xmaxc[3] |= (*
c >> 7) & 0x1;
113
114 xmc[39] = (*
c >> 4) & 0x7;
115 xmc[40] = (*
c >> 1) & 0x7;
116 xmc[41] = (*
c++ & 0x1) << 2;
117 xmc[41] |= (*
c >> 6) & 0x3;
118 xmc[42] = (*
c >> 3) & 0x7;
119 xmc[43] = *
c++ & 0x7;
120 xmc[44] = (*
c >> 5) & 0x7;
121 xmc[45] = (*
c >> 2) & 0x7;
122 xmc[46] = (*
c++ & 0x3) << 1;
123 xmc[46] |= (*
c >> 7) & 0x1;
124 xmc[47] = (*
c >> 4) & 0x7;
125 xmc[48] = (*
c >> 1) & 0x7;
126 xmc[49] = (*
c++ & 0x1) << 2;
127 xmc[49] |= (*
c >> 6) & 0x3;
128 xmc[50] = (*
c >> 3) & 0x7;
130
131 fprintf(f,
132 "LARc:\t%2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d\n",
134
135 fprintf(f, "#1: Nc %4.4d bc %d Mc %d xmaxc %d\n",
137 fprintf(f,
138"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
141
142 fprintf(f, "#2: Nc %4.4d bc %d Mc %d xmaxc %d\n",
144 fprintf(f,
145"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
149
150 fprintf(f, "#3: Nc %4.4d bc %d Mc %d xmaxc %d\n",
152 fprintf(f,
153"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
157
158 fprintf(f, "#4: Nc %4.4d bc %d Mc %d xmaxc %d\n",
160 fprintf(f,
161"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
165
166 return 0;
167}