📄 network.cpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Module Name:
network.cpp
Abstract:
Notes:
Long operator names in the OPERATORNAMEMAP should not exceeed 16 characters in
length, otherwise visual clipping of the operator name string may occur in the
user interface. The OPERATORNAMEMAP entries must be numerically ordered.
In this sample code, all PCS 1900-based networks have a single
entry listed for each operator even though there are
three-digit MNCs sometimes used in the PCS spectrum. For example, PLMN A is a PCS network and is
frequently seen in various SIM EF_PLMNsel tables as "123 45", "123 045", or "123 450", depending
on what equipment last wrote to that table. To cover each instance, we
search up to three times in the search code below.
--*/
#include "precomp.h"
//
// Registration status values
//
const DWORD g_rgdwRegStats[] =
{
RIL_REGSTAT_UNREGISTERED, // 0
RIL_REGSTAT_HOME, // 1
RIL_REGSTAT_ATTEMPTING, // 2
RIL_REGSTAT_DENIED, // 3
RIL_REGSTAT_UNKNOWN, // 4
RIL_REGSTAT_ROAMING, // 5
};
const size_t fRegStatsEcount = sizeof(g_rgdwRegStats) / sizeof(*g_rgdwRegStats);
#define UNKNOWN_COUNTRY_CODE ("--")
#define MCC_LEN (3)
//
// Long operator names
//
static const OPERATORNAMEMAP g_rgonmOperatorNames[] =
{
{ 20201, "Cosmote", "GR" },
{ 20205, "Vodafone GR", "GR" },
{ 20210, "TELESTET", "GR" },
{ 20404, "Vodafone NL", "NL" },
{ 20408, "KPN", "NL" },
{ 20412, "O2 - NL", "NL" },
{ 20416, "Ben", "NL" },
{ 20420, "dutchtone", "NL" },
{ 20601, "Proximus", "BE" },
{ 20610, "Mobistar", "BE" },
{ 20620, "Orange", "BE" },
{ 20801, "Orange", "FR" },
{ 20810, "SFR", "FR" },
{ 20820, "BOUYGTEL", "FR" },
{ 21303, "Mobiland", "AD" },
{ 21401, "Vodafone E", "ES" },
{ 21402, "MoviStar", "ES" },
{ 21403, "AMENA", "ES" },
{ 21404, "Xfera", "ES" },
{ 21407, "MoviStar", "ES" },
{ 21601, "Pannon GSM", "HU" },
{ 21630, "Westel", "HU" },
{ 21670, "Vodafone", "HU" },
{ 21803, "ERONET", "BA" },
{ 21805, "Mobilna Srpska", "BA" },
{ 21890, "GSM BiH", "BA" },
{ 21901, "CRONET", "HR" },
{ 21910, "VIP", "HR" },
{ 22001, "MOBTEL", "YU" },
{ 22002, "ProMonte", "YU" },
{ 22003, "Telekom Srbija", "YU" },
{ 22004, "MONET", "YU" },
{ 22201, "TIM", "IT" },
{ 22210, "Vodafone IT", "IT" },
{ 22288, "WIND", "IT" },
{ 22298, "Blu SpA", "IT" },
{ 22601, "CONNEX", "RO" },
{ 22603, "Cosmorom", "RO" },
{ 22610, "dialog", "RO" },
{ 22801, "Swiss GSM", "CH" },
{ 22802, "sunrise", "CH" },
{ 22803, "Orange", "CH" },
{ 23001, "PAEGAS", "CZ" },
{ 23002, "EUROTEL", "CZ" },
{ 23003, "OSKAR", "CZ" },
{ 23101, "GLOBTEL", "SK" },
{ 23102, "EUROTEL", "SK" },
{ 23201, "A1", "AT" },
{ 23203, "T-Mobile", "AT" },
{ 23205, "ONE", "AT" },
{ 23207, "tele.ring", "AT" },
{ 23410, "O2 - UK", "GB" },
{ 23415, "Vodafone", "GB" },
{ 23430, "T-Mobile UK", "GB" },
{ 23431, "T-Mobile UK", "GB" },
{ 23432, "T-Mobile UK", "GB" },
{ 23433, "Orange", "GB" },
{ 23450, "JT GSM", "GB" },
{ 23455, "GUERNSEY TEL", "GB" },
{ 23458, "MANX", "GB" },
{ 23801, "TDK-MOBIL", "DK" },
{ 23802, "SONOFON", "DK" },
{ 23820, "Telia", "DK" },
{ 23830, "Orange", "DK" },
{ 24001, "Telia S", "SE" },
{ 24007, "IQ", "SE" },
{ 24008, "Vodafone", "SE" },
{ 24201, "TELENOR", "NO" },
{ 24202, "NetCom", "NO" },
{ 24403, "Telia", "FI" },
{ 24405, "RADIOLINJA", "FI" },
{ 24409, "FINNET", "FI" },
{ 24412, "2G", "FI" },
{ 24414, "AMT", "FI" },
{ 24491, "SONERA", "FI" },
{ 24601, "OMNITEL", "LT" },
{ 24602, "Bite GSM", "LT" },
{ 24603, "TELE2", "LT" },
{ 24701, "LMT GSM", "LV" },
{ 24702, "BALTCOM", "LV" },
{ 24801, "EMT GSM", "EE" },
{ 24802, "RLE", "EE" },
{ 24803, "Q GSM", "EE" },
{ 25001, "MTS", "RU" },
{ 25002, "NorthWest GSM", "RU" },
{ 25003, "NCC", "RU" },
{ 25005, "SCS", "RU" },
{ 25007, "SMARTS", "RU" },
{ 25010, "DTC", "RU" },
{ 25011, "Orensot", "RU" },
{ 25012, "Far East", "RU" },
{ 25013, "Kuban GSM", "RU" },
{ 25016, "NTC", "RU" },
{ 25017, "Ermak RMS", "RU" },
{ 25028, "EXTEL", "RU" },
{ 25039, "Uraltel", "RU" },
{ 25044, "NC-GSM", "RU" },
{ 25091, "Sonic Duo", "RU" },
{ 25092, "Primtel", "RU" },
{ 25093, "JSC Telecom XXI", "RU" },
{ 25099, "Bee Line", "RU" },
{ 25501, "UMC", "UA" },
{ 25502, "WellCOM", "UA" },
{ 25503, "Kyivstar", "UA" },
{ 25505, "Golden Telecom", "UA" },
{ 25701, "VELCOM", "BY" },
{ 25901, "VOXTEL", "MD" },
{ 25902, "MOLDCELL", "MD" },
{ 26001, "Plus GSM", "PL" },
{ 26002, "Era GSM", "PL" },
{ 26003, "IDEA", "PL" },
{ 26201, "T-Mobile", "DE" },
{ 26202, "Vodafone D2", "DE" },
{ 26203, "E-Plus", "DE" },
{ 26207, "O2 - DE", "DE" },
{ 26213, "Mobilcom", "DE" },
{ 26601, "GIBTEL", "GI" },
{ 26801, "Vodafone", "PT" },
{ 26803, "OPTIMUS", "PT" },
{ 26806, "TMN", "PT" },
{ 27001, "LUXGSM", "LU" },
{ 27077, "TANGO", "LU" },
{ 27201, "Vodafone IRL", "IE" },
{ 27202, "O2 - IRL", "IE" },
{ 27203, "METEOR", "IE" },
{ 27401, "SIMINN", "IS" },
{ 27402, "TAL", "IS" },
{ 27404, "Viking", "IS" },
{ 27601, "AMC", "AL" },
{ 27602, "Vodafone", "AL" },
{ 27801, "Vodafone Malta", "MT" },
{ 27821, "go mobile", "MT" },
{ 28001, "CYTAGSM", "CY" },
{ 28201, "GEOCELL", "GE" },
{ 28202, "Magti GSM", "GE" },
{ 28203, "GEO 03", "GE" },
{ 28301, "ARMGSM", "AM" },
{ 28401, "M-TEL GSM", "BG" },
{ 28601, "TURKCELL", "TR" },
{ 28602, "TELSIM", "TR" },
{ 28603, "ARIA", "TR" },
{ 28604, "AYCELL", "TR" },
{ 28801, "FT GSM", "FO" },
{ 29001, "TELE Greenland", "GR" },
{ 29340, "SI.MOBIL", "SI" },
{ 29341, "MOBITEL", "SI" },
{ 29401, "MOBIMAK", "MK" },
{ 29501, "TELECOM", "LI" },
{ 29502, "MONTEL", "LI" },
{ 29505, "FL1", "LI" },
{ 29577, "LI TANGO", "LI" },
{ 30237, "Microcell", "CA" },
{ 30272, "Rogers AT&T", "CA" },
{ 31001, "Cellnet", "US" },
{ 31011, "Wireless 2000", "US" },
{ 31015, "Cingular", "US" },
{ 31016, "T-Mobile", "US" },
{ 31017, "Cingular", "US" },
{ 31018, "Cingular", "US" },
{ 31020, "T-Mobile", "US" },
{ 31021, "T-Mobile", "US" },
{ 31022, "T-Mobile", "US" },
{ 31023, "T-Mobile", "US" },
{ 31024, "T-Mobile", "US" },
{ 31025, "T-Mobile", "US" },
{ 31026, "T-Mobile", "US" },
{ 31027, "T-Mobile", "US" },
{ 31031, "T-Mobile", "US" },
{ 31034, "WestLink", "US" },
{ 31035, "Carolina", "US" },
{ 31038, "AT&T Wireless", "US" },
{ 31041, "Cingular", "US" },
{ 31046, "TMP Corp", "US" },
{ 31058, "T-Mobile", "US" },
{ 31061, "Epic Touch", "US" },
{ 31063, "AmeriLink", "US" },
{ 31064, "Einstein PCS", "US" },
{ 31066, "T-Mobile", "US" },
{ 31067, "Wireless 2000", "US" },
{ 31068, "NPI Wireless", "US" },
{ 31069, "Conestoga", "US" },
{ 31074, "Telemetrix", "US" },
{ 31076, "PTSI", "US" },
{ 31077, "Iowa Wireless", "US" },
{ 31078, "Airlink PCS", "US" },
{ 31079, "PinPoint", "US" },
{ 31080, "T-Mobile", "US" },
{ 31098, "AWS", "US" },
{ 31114, "Sprocket", UNKNOWN_COUNTRY_CODE },
{ 31601, "Nextel", UNKNOWN_COUNTRY_CODE },
{ 33805, "Digicel", "JM" },
{ 34001, "Orange ", "FW" },
{ 34020, "Bouygues", "FW" },
{ 34430, "APUA PCS", "AG" },
{ 35001, "Telecom", "BM" },
{ 36251, "Telcell GSM", "AN" },
{ 36801, "C_Com", "CU" },
{ 37001, "Orange", "DO" },
{ 40001, "AZERCELL GSM", "AZ" },
{ 40002, "BAKCELL GSM 2000", "AZ" },
{ 40101, "K-MOBILE", "KZ" },
{ 40102, "K'CELL", "KZ" },
{ 40401, "ESSAR", "IN" },
{ 40405, "CELFORCE", "IN" },
{ 40407, "TATA CELLULAR", "IN" },
{ 40409, "Reliance", "IN" },
{ 40410, "AirTel", "IN" },
{ 40411, "ESSAR", "IN" },
{ 40412, "ESCOTEL", "IN" },
{ 40414, "SPICE", "IN" },
{ 40415, "ESSAR", "IN" },
{ 40418, "Reliance", "IN" },
{ 40419, "ESCOTEL", "IN" },
{ 40420, "Orange", "IN" },
{ 40421, "BPL MOBILE", "IN" },
{ 40422, "AT&T", "IN" },
{ 40424, "AT&T", "IN" },
{ 40427, "BPL MOBILE", "IN" },
{ 40430, "COMMAND", "IN" },
{ 40431, "SPICE", "IN" },
{ 40436, "Reliance", "IN" },
{ 40440, "SKYCELL", "IN" },
{ 40441, "RPG Cellular", "IN" },
{ 40442, "AIRCEL", "IN" },
{ 40443, "BPL MOBILE", "IN" },
{ 40444, "AirTel", "IN" },
{ 40445, "AirTel", "IN" },
{ 40446, "BPL MOBILE", "IN" },
{ 40449, "AirTel", "IN" },
{ 40450, "Reliance", "IN" },
{ 40452, "Reliance", "IN" },
{ 40456, "ESCOTEL", "IN" },
{ 40460, "ESSAR", "IN" },
{ 40467, "Reliance", "IN" },
{ 40470, "hexacom", "IN" },
{ 40485, "Reliance", "IN" },
{ 41001, "Mobilink", "PK" },
{ 41302, "DIALOG", "LK" },
{ 41303, "CELLTEL", "LK" },
{ 41401, "MM 900", "MM" },
{ 41501, "Cellis", "LB" },
{ 41503, "LibanCell", "LB" },
{ 41601, "Fastlink", "JO" },
{ 41677, "MobileCom", "JO" },
{ 41702, "Spacetel", "SY" },
{ 41709, "MOBILE SYRIA", "SY" },
{ 41902, "MTCNet", "KW" },
{ 41903, "WATANIYA", "KW" },
{ 42001, "Al-Jawal", "SA" },
{ 42007, "EAE", "SA" },
{ 42102, "Spacetel", "YE" },
{ 42202, "OMAN MOBILE", "OM" },
{ 42402, "ETISALAT", "AE" },
{ 42501, "Orange", "IL" },
{ 42505, "JAWWAL", "IL" },
{ 42601, "MOBILE PLUS", "BH" },
{ 42701, "QATARNET", "QA" },
{ 42899, "MobiCom", "MN" },
{ 42901, "NTC", "NP" },
{ 43211, "TCI", "IR" },
{ 43214, "KISH", "IR" },
{ 43401, "Buztel", "UZ" },
{ 43402, "Uzmacom", "UZ" },
{ 43404, "UZB DAEWOO-GSM", "UZ" },
{ 43405, "Coscom", "UZ" },
{ 43701, "BITEL", "KG" },
{ 43801, "BCTI", "TM" },
{ 45201, "MOBIFONE", "VN" },
{ 45202, "VINAFONE", "VN" },
{ 45400, "CSL", "HK" },
{ 45401, "NEW WORLD", "HK" },
{ 45404, "Orange", "HK" },
{ 45406, "SMC", "HK" },
{ 45410, "NEW WORLD", "HK" },
{ 45412, "PEOPLES", "HK" },
{ 45416, "SUNDAY", "HK" },
{ 45500, "SmarTone", UNKNOWN_COUNTRY_CODE }, //macau
{ 45501, "CTMGSM", UNKNOWN_COUNTRY_CODE },
{ 45503, "HT Macau", UNKNOWN_COUNTRY_CODE },
{ 45601, "MobiTel", "KH" },
{ 45602, "SAMART-GSM", "KH" },
{ 45701, "LAO GSM", "LA" },
{ 46000, "China Mobile", "CN" },
{ 46001, "China Unicom", "CN" },
{ 46002, "China Mobile", "CN" },
{ 46601, "Far EasTone", "TW" },
{ 46606, "TUNTEX", "TW" },
{ 46668, "ACeS", "TW" },
{ 46688, "KGT", "TW" },
{ 46692, "Chunghwa", "TW" },
{ 46693, "MobiTai", "TW" },
{ 46697, "TWN GSM", "TW" },
{ 46699, "TransAsia", "TW" },
{ 47001, "GrameemPhone", "BD" },
{ 47002, "AKTEL", "BD" },
{ 47003, "ShebaWorld", "BD" },
{ 47019, "Mobile 2000", "BD" },
{ 47201, "DHIMOBILE", "MV" },
{ 50212, "Maxis Mobile", "MY" },
{ 50213, "TM Touch", "MY" },
{ 50216, "DiGi", "MY" },
{ 50217, "ADAM", "MY" },
{ 50219, "CELCOM", "MY" },
{ 50501, "MobileNet", "AU" },
{ 50502, "OPTUS", "AU" },
{ 50503, "Vodafone", "AU" },
{ 50508, "One.Tel", "AU" },
{ 51000, "ACeS", "ID" },
{ 51001, "SATELINDOCEL", "ID" },
{ 51008, "LIPPO TEL", "ID" },
{ 51010, "TELKOMSEL", "ID" },
{ 51011, "GSM-XL", "ID" },
{ 51021, "INDOSAT", "ID" },
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -