author | zautrix <zautrix> | 2004-08-07 17:24:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-07 17:24:40 (UTC) |
commit | 88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22 (patch) (unidiff) | |
tree | 6331418973714243beb674abc87692277b83869d /gammu/emb/common/service/gsmnet.c | |
parent | ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf (diff) | |
download | kdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.zip kdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.tar.gz kdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.tar.bz2 |
Initial revision
Diffstat (limited to 'gammu/emb/common/service/gsmnet.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/service/gsmnet.c | 444 |
1 files changed, 444 insertions, 0 deletions
diff --git a/gammu/emb/common/service/gsmnet.c b/gammu/emb/common/service/gsmnet.c new file mode 100644 index 0000000..a0ddaa7 --- a/dev/null +++ b/gammu/emb/common/service/gsmnet.c | |||
@@ -0,0 +1,444 @@ | |||
1 | /* (c) 2001-2003 by Marcin Wiacek */ | ||
2 | |||
3 | #include <string.h> | ||
4 | |||
5 | #include "gsmnet.h" | ||
6 | #include "../misc/coding/coding.h" | ||
7 | |||
8 | unsigned char *GSM_Countries[] = { | ||
9 | "202", "Greece", | ||
10 | "204", "Netherlands", | ||
11 | "206", "Belgium", | ||
12 | "208", "France", | ||
13 | "213", "Andorra" , | ||
14 | "214", "Spain", | ||
15 | "216", "Hungary", | ||
16 | "218", "Bosnia Herzegovina", | ||
17 | "219", "Croatia", | ||
18 | "220", "Yugoslavia", | ||
19 | "222", "Italy", | ||
20 | "226", "Romania", | ||
21 | "228", "Switzerland", | ||
22 | "230", "Czech Republic", | ||
23 | "231", "Slovak Republic", | ||
24 | "232", "Austria", | ||
25 | "234", "United Kingdom", | ||
26 | "238", "Denmark", | ||
27 | "240", "Sweden", | ||
28 | "242", "Norway", | ||
29 | "244", "Finland", | ||
30 | "246", "Lithuania", | ||
31 | "247", "Latvia", | ||
32 | "248", "Estonia", | ||
33 | "250", "Russia", | ||
34 | "255", "Ukraine", | ||
35 | "259", "Moldova", | ||
36 | "260", "Poland", | ||
37 | "262", "Germany", | ||
38 | "266", "Gibraltar", | ||
39 | "268", "Portugal", | ||
40 | "270", "Luxembourg", | ||
41 | "272", "Ireland", | ||
42 | "274", "Iceland", | ||
43 | "276", "Albania", | ||
44 | "278", "Malta", | ||
45 | "280", "Cyprus", | ||
46 | "282", "Georgia", | ||
47 | "283", "Armenia", | ||
48 | "284", "Bulgaria", | ||
49 | "286", "Turkey", | ||
50 | "290", "Greenland", | ||
51 | "293", "Slovenia", | ||
52 | "294", "Macedonia", | ||
53 | "302", "Canada", | ||
54 | "310", "U.S.A.", | ||
55 | "340", "French West Indies", | ||
56 | "400", "Azerbaijan", | ||
57 | "404", "India", | ||
58 | "410", "Pakistan", | ||
59 | "413", "Sri Lanka", | ||
60 | "415", "Lebanon", | ||
61 | "416", "Jordan", | ||
62 | "417", "Syria", | ||
63 | "418", "Iraq", | ||
64 | "419", "Kuwait", | ||
65 | "420", "Saudi Arabia", | ||
66 | "422", "Oman", | ||
67 | "424", "United Arab Emirates", | ||
68 | "425", "Israel", | ||
69 | "426", "Bahrain", | ||
70 | "427", "Qatar", | ||
71 | "432", "Iran", | ||
72 | "434", "Uzbekistan", | ||
73 | "437", "Kyrgyz Republic", | ||
74 | "452", "Vietnam", | ||
75 | "454", "Hong Kong", | ||
76 | "455", "Macau", | ||
77 | "456", "Cambodia", | ||
78 | "457", "Lao", | ||
79 | "460", "China", | ||
80 | "466", "Taiwan", | ||
81 | "470", "Bangladesh", | ||
82 | "502", "Malaysia", | ||
83 | "505", "Australia", | ||
84 | "510", "Indonesia", | ||
85 | "515", "Philippines", | ||
86 | "520", "Thailand", | ||
87 | "525", "Singapore", | ||
88 | "528", "Brunei Darussalam", | ||
89 | "530", "New Zealand", | ||
90 | "542", "Fiji", | ||
91 | "546", "New Caledonia", | ||
92 | "547", "French Polynesia", | ||
93 | "602", "Egypt", | ||
94 | "603", "Algeria", | ||
95 | "604", "Morocco", | ||
96 | "605", "Tunisia", | ||
97 | "608", "Senegal", | ||
98 | "611", "Guinea", | ||
99 | "612", "Cote d'Ivoire", | ||
100 | "615", "Togo", | ||
101 | "617", "Mauritius", | ||
102 | "618", "Liberia", | ||
103 | "620", "Ghana", | ||
104 | "624", "Cameroon", | ||
105 | "625", "Cape Verde", | ||
106 | "633", "Seychelles", | ||
107 | "634", "Mozambique", | ||
108 | "634", "Sudan", | ||
109 | "635", "Rwanda", | ||
110 | "636", "Ethiopia", | ||
111 | "640", "Tanzania", | ||
112 | "641", "Uganda", | ||
113 | "645", "Zambia", | ||
114 | "646", "Madagascar", | ||
115 | "647", "Reunion", | ||
116 | "648", "Zimbabwe", | ||
117 | "649", "Namibia", | ||
118 | "650", "Malawi", | ||
119 | "651", "Lesotho", | ||
120 | "652", "Botswana", | ||
121 | "655", "South Africa", | ||
122 | "730", "Chile", | ||
123 | "734", "Venezuela", | ||
124 | |||
125 | NULL | ||
126 | }; | ||
127 | |||
128 | unsigned char *GSM_Networks[] = { | ||
129 | "202 01", "Cosmote", | ||
130 | "202 05", "PANAFON", | ||
131 | "202 10", "TELESTET", | ||
132 | "204 04", "LIBERTEL", | ||
133 | "204 08", "KPN Telecom", | ||
134 | "204 12", "O2", | ||
135 | "204 16", "BEN", | ||
136 | "204 20", "Dutchtone NV", | ||
137 | "206 01", "PROXIMUS", | ||
138 | "206 10", "Mobistar", | ||
139 | "206 20", "Base", | ||
140 | "208 01", "ITINERIS", | ||
141 | "208 10", "SFR", | ||
142 | "208 20", "Bouygues Telecom", | ||
143 | "213 03", "MOBILAND", | ||
144 | "214 01", "Airtel GSM 900-Spain", | ||
145 | "214 03", "Retevision Movil", | ||
146 | "214 07", "MOVISTAR", | ||
147 | "216 01", "Pannon GSM", | ||
148 | "216 70", "Vodafone", | ||
149 | "216 30", "Westel 900", | ||
150 | "218 90", "GSMBIH", | ||
151 | "219 01", "CRONET", | ||
152 | "219 10", "VIP", | ||
153 | "220 01", "MOBTEL", | ||
154 | "220 02", "ProMonte GSM", | ||
155 | "220 03", "Telekom Srbije", | ||
156 | "222 01", "Telecom Italia Mobile", | ||
157 | "222 10", "OMNITEL", | ||
158 | "222 88", "Wind Telecomunicazioni SpA", | ||
159 | "226 01", "CONNEX GSM", | ||
160 | "226 10", "DIALOG", | ||
161 | "228 01", "NATEL International", | ||
162 | "228 02", "diAx Mobile AG", | ||
163 | "230 01", "T-Mobile CZ", | ||
164 | "230 02", "EuroTel", | ||
165 | "230 03", "Oskar", | ||
166 | "231 01", "Orange", | ||
167 | "231 02", "EuroTel GSM", | ||
168 | "232 01", "A1", | ||
169 | "232 03", "T-Mobile AT", | ||
170 | "232 05", "ONE", | ||
171 | "232 07", "tele.ring", | ||
172 | "234 10", "Cellnet", | ||
173 | "234 15", "Vodafone", | ||
174 | "234 30", "T-Mobile UK", | ||
175 | "234 33", "ORANGE", | ||
176 | "234 50", "Jersey Telecoms GSM", | ||
177 | "234 55", "Guernsey Telecoms GSM", | ||
178 | "234 58", "PRONTO GSM", | ||
179 | "238 01", "TDK-MOBIL", | ||
180 | "238 02", "SONOFON", | ||
181 | "238 20", "TELIA DK", | ||
182 | "238 30", "Mobilix", | ||
183 | "240 01", "Telia AB", | ||
184 | "240 07", "COMVIQ", | ||
185 | "240 08", "EUROPOLITAN", | ||
186 | "242 01", "Telenor Mobil", | ||
187 | "242 02", "NetCom GSM", | ||
188 | "244 03", "Telia City (Finland)", | ||
189 | "244 05", "Radiolinja", | ||
190 | "244 09", "Finnet", | ||
191 | "244 12", "DNA (FI2G)", | ||
192 | "244 14", "Alands Mobiltelefon", | ||
193 | "244 91", "Sonera", | ||
194 | "246 01", "OMNITEL", | ||
195 | "246 02", "Bite GSM", | ||
196 | "247 01", "LMT LV", | ||
197 | "247 02", "BALTCOM GSM", | ||
198 | "248 01", "EMT GSM", | ||
199 | "248 02", "Radiolinja Eesti AS", | ||
200 | "248 03", "Q GSM", | ||
201 | "250 01", "Mobile Telesystems", | ||
202 | "250 02", "North-West GSM", | ||
203 | "250 05", "Siberian Cellular Systems 900", | ||
204 | "250 07", "BM Telecom", | ||
205 | "250 10", "Don Telecom", | ||
206 | "250 12", "FECS-900", | ||
207 | "250 13", "Kuban GSM", | ||
208 | "250 39", "Uraltel", | ||
209 | "250 44", "North Caucasian GSM", | ||
210 | "250 99", "BeeLine", | ||
211 | "255 01", "UMC", | ||
212 | "255 02", "WellCOM", | ||
213 | "255 03", "Kyivstar", | ||
214 | "255 05", "Golden Telecom", | ||
215 | "259 01", "VOXTEL", | ||
216 | "260 01", "PLUS GSM", | ||
217 | "260 02", "ERA GSM", | ||
218 | "260 03", "IDEA Centertel", | ||
219 | "262 01", "T-Mobile D", | ||
220 | "262 02", "D2 PRIVAT", | ||
221 | "262 03", "E-Plus", | ||
222 | "262 07", "Interkom", | ||
223 | "266 01", "Gibtel GSM", | ||
224 | "268 01", "TELECEL", | ||
225 | "268 03", "OPTIMUS", | ||
226 | "268 06", "TMN", | ||
227 | "270 01", "LUXGSM", | ||
228 | "270 77", "TANGO", | ||
229 | "272 01", "EIRCELL-GSM", | ||
230 | "272 02", "Digifone", | ||
231 | "274 01", "Landssiminn GSM 900", | ||
232 | "274 02", "TAL hf", | ||
233 | "276 01", "AMC", | ||
234 | "278 01", "Vodafone Malta Limited", | ||
235 | "280 01", "CYTAGSM", | ||
236 | "282 01", "Geocell Limited", | ||
237 | "282 02", "Magti GSM", | ||
238 | "283 01", "ArmGSM", | ||
239 | "284 01", "M-TEL GSM BG", | ||
240 | "286 01", "Turkcell", | ||
241 | "286 02", "TELSIM GSM", | ||
242 | "288 01", "Faroese Telecom", | ||
243 | "290 01", "Tele Greenland", | ||
244 | "293 40", "SI.MOBIL d. d.", | ||
245 | "293 41", "MOBITEL", | ||
246 | "293 70", "SI VEGA 070", | ||
247 | "294 01", "MobiMak", | ||
248 | "302 37", "Microcell Connexions Inc", | ||
249 | "302 72", "Rogers AT&T", | ||
250 | "310 01", "Cellnet", | ||
251 | "310 02", "Sprint Spectrum", | ||
252 | "310 11", "Wireless 2000 Telephone Co.", | ||
253 | "310 15", "BellSouth Mobility DCS", | ||
254 | "310 16", "T-Mobile", | ||
255 | "310 17", "Pac Bell", | ||
256 | "310 20", "T-Mobile", | ||
257 | "310 21", "T-Mobile", | ||
258 | "310 22", "T-Mobile", | ||
259 | "310 23", "T-Mobile", | ||
260 | "310 24", "T-Mobile", | ||
261 | "310 25", "T-Mobile", | ||
262 | "310 26", "T-Mobile", | ||
263 | "310 27", "T-Mobile", | ||
264 | "310 31", "T-Mobile", | ||
265 | "310 38", "AT&T Wireless", | ||
266 | "310 58", "T-Mobile", | ||
267 | "310 66", "T-Mobile", | ||
268 | "310 77", "Iowa Wireless Services LP", | ||
269 | "310 80", "T-Mobile", | ||
270 | "340 01", "AMERIS", | ||
271 | "400 01", "AZERCELL GSM", | ||
272 | "400 02", "Bakcell GSM 2000", | ||
273 | "404 07", "TATA Cellular", | ||
274 | "404 10", "AirTel", | ||
275 | "404 11", "Essar Cellphone", | ||
276 | "404 12", "Escotel", | ||
277 | "404 14", "Modicom", | ||
278 | "404 15", "Essar Cellphone", | ||
279 | "404 20", "Max Touch", | ||
280 | "404 21", "BPL - Mobile", | ||
281 | "404 27", "BPL USWEST Cellular", | ||
282 | "404 30", "Command", | ||
283 | "404 40", "SkyCell", | ||
284 | "404 41", "RPG Cellular", | ||
285 | "404 42", "AIRCEL", | ||
286 | "410 01", "Mobilink", | ||
287 | "413 02", "DIALOG GSM", | ||
288 | "415 01", "CELLIS", | ||
289 | "415 03", "LIBANCELL", | ||
290 | "416 01", "Fastlink", | ||
291 | "417 09", "MOBILE SYRIA", | ||
292 | "419 02", "MTCNet", | ||
293 | "420 01", "Al Jawwal", | ||
294 | "420 07", "E.A.E", | ||
295 | "422 02", "GTO", | ||
296 | "424 02", "UAE-ETISALAT", | ||
297 | "425 01", "Partner Communications Company Ltd", | ||
298 | "425 02", "Cellcom Israel Ltd", | ||
299 | "426 01", "BHR MOBILE PLUS", | ||
300 | "427 01", "QATARNET", | ||
301 | "432 11", "TCI", | ||
302 | "434 04", "Daewoo Unitel", | ||
303 | "434 05", "Coscom", | ||
304 | "437 01", "Bitel", | ||
305 | "454 00", "TCSL GSM", | ||
306 | "454 04", "HKGHT", | ||
307 | "454 06", "SMARTONE GSM", | ||
308 | "454 10", "New World PCS", | ||
309 | "454 12", "PEOPLES", | ||
310 | "454 16", "SUNDAY", | ||
311 | "455 01", "TELEMOVEL+ GSM900-Macau", | ||
312 | "456 01", "MobiTel", | ||
313 | "456 02", "SAMART-GSM", | ||
314 | "457 01", "Lao Shinawatra Telecom", | ||
315 | "460 00", "China Telecom GSM", | ||
316 | "460 01", "CU-GSM", | ||
317 | "466 01", "Far EasTone Telecoms 900", | ||
318 | "466 06", "TUNTEX GSM 1800", | ||
319 | "466 88", "KG Telecom", | ||
320 | "466 92", "Chunghwa GSM", | ||
321 | "466 93", "MobiTai", | ||
322 | "466 97", "TWNGSM", | ||
323 | "466 99", "TransAsia", | ||
324 | "470 01", "GrameenPhone Ltd", | ||
325 | "470 19", "Mobile 2000", | ||
326 | "502 12", "Maxis Mobile", | ||
327 | "502 13", "TM Touch", | ||
328 | "502 16", "DiGi 1800", | ||
329 | "502 17", "ADAM", | ||
330 | "502 19", "CELCOM", | ||
331 | "505 01", "MobileNet", | ||
332 | "505 02", "OPTUS", | ||
333 | "505 03", "VODAFONE", | ||
334 | "505 08", "One.Tel", | ||
335 | "510 01", "SATELINDO", | ||
336 | "510 08", "LIPPO TELECOM", | ||
337 | "510 10", "TELKOMSEL", | ||
338 | "510 11", "Excelcom", | ||
339 | "510 21", "INDOSAT", | ||
340 | "515 01", "ISLACOM", | ||
341 | "515 02", "Globe Telecom", | ||
342 | "520 01", "AIS GSM", | ||
343 | "520 10", "WCS", | ||
344 | "520 18", "Worldphone 1800", | ||
345 | "520 23", "HELLO", | ||
346 | "525 01", "SingTel Mobile", | ||
347 | "525 02", "ST-PCN", | ||
348 | "525 03", "MOBILEONE", | ||
349 | "528 11", "DSTCom", | ||
350 | "530 01", "Vodafone New Zealand Limited", | ||
351 | "542 01", "Vodafone", | ||
352 | "546 01", "Mobilis", | ||
353 | "547 20", "VINI", | ||
354 | "602 01", "MobiNil", | ||
355 | "602 02", "Tunicell", | ||
356 | "603 01", "ALGERIAN MOBILE NETWORK", | ||
357 | "604 01", "I A M", | ||
358 | "608 01", "ALIZE", | ||
359 | "611 02", "Lagui", | ||
360 | "612 03", "IVOIRIS", | ||
361 | "612 05", "Telecel", | ||
362 | "615 01", "TOGO CELL", | ||
363 | "617 01", "Cellplus Mobile Comms", | ||
364 | "618 01", "Omega", | ||
365 | "620 01", "SPACEFON", | ||
366 | "625 01", "CVMOVEL", | ||
367 | "633 01", "Seychelles Cellular Services", | ||
368 | "633 10", "AIRTEL", | ||
369 | "634 01", "MobiTel", | ||
370 | "635 10", "Rwandacell", | ||
371 | "636 01", "ETMTN", | ||
372 | "640 01", "TRITEL", | ||
373 | "641 10", "MTN-Uganda", | ||
374 | "642 02", "ANTARIS", | ||
375 | "643 01", "T.D.M GSM 900", | ||
376 | "645 01", "ZAMCELL", | ||
377 | "646 01", "Madacom", | ||
378 | "646 03", "Sacel Madagascar S.A.", | ||
379 | "647 10", "SRR", | ||
380 | "648 01", "NET*ONE", | ||
381 | "648 03", "Telecel", | ||
382 | "649 01", "MTC", | ||
383 | "650 01", "Callpoint 900", | ||
384 | "651 01", "Vodacom Lesotho (Pty) Ltd", | ||
385 | "655 01", "Vodacom", | ||
386 | "655 10", "MTN", | ||
387 | "680 38", "NPI Wireless", | ||
388 | "730 01", "Entel Telefonia Movi", | ||
389 | "730 10", "Entel PCS", | ||
390 | "734 01", "Infonet", | ||
391 | |||
392 | NULL | ||
393 | }; | ||
394 | |||
395 | char *GSM_GetNetworkName(char *NetworkCode) | ||
396 | { | ||
397 | int i = 0; | ||
398 | static charretval[200]; | ||
399 | |||
400 | EncodeUnicode(retval,"unknown",7); | ||
401 | while (GSM_Networks[i*2] != NULL) { | ||
402 | if (!strncmp(GSM_Networks[i*2],NetworkCode,6)) { | ||
403 | EncodeUnicode(retval, GSM_Networks[i*2+1], strlen(GSM_Networks[i*2+1])); | ||
404 | break; | ||
405 | } | ||
406 | i++; | ||
407 | } | ||
408 | return retval; | ||
409 | } | ||
410 | |||
411 | char *GSM_GetCountryName(char *CountryCode) | ||
412 | { | ||
413 | int i = 0; | ||
414 | static charretval[200]; | ||
415 | |||
416 | EncodeUnicode(retval,"unknown",7); | ||
417 | while (GSM_Countries[i*2] != NULL) { | ||
418 | if (!strncmp(GSM_Countries[i*2],CountryCode,3)) { | ||
419 | EncodeUnicode(retval, GSM_Countries[i*2+1], strlen(GSM_Countries[i*2+1])); | ||
420 | break; | ||
421 | } | ||
422 | i++; | ||
423 | } | ||
424 | return retval; | ||
425 | } | ||
426 | |||
427 | void NOKIA_EncodeNetworkCode(unsigned char* buffer, unsigned char* output) | ||
428 | { | ||
429 | EncodeBCD(buffer, output, 6, false); | ||
430 | buffer[1] = buffer[1] | 0xf0; | ||
431 | } | ||
432 | |||
433 | void NOKIA_DecodeNetworkCode(unsigned char* buffer, unsigned char* output) | ||
434 | { | ||
435 | DecodeBCD(output, buffer, 3); | ||
436 | output[6] = output[5]; | ||
437 | output[5] = output[4]; | ||
438 | output[4] = output[3]; | ||
439 | output[3] = ' '; | ||
440 | } | ||
441 | |||
442 | /* How should editor hadle tabs in this file? Add editor commands here. | ||
443 | * vim: noexpandtab sw=8 ts=8 sts=8: | ||
444 | */ | ||