2004-03-05 10:29:36 +00:00
|
|
|
/* packet-e164.c
|
|
|
|
* Routines for output and filtering of E164 numbers common
|
|
|
|
* to many dissectors.
|
|
|
|
* Copyright 2004, Anders Broman <anders.broman@ericsson.com>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2004-03-05 10:29:36 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-03-05 10:29:36 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2007-01-09 23:03:09 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-03-05 10:29:36 +00:00
|
|
|
*
|
2008-01-09 22:25:47 +00:00
|
|
|
* Ref ITU-T E.164 05/97
|
2007-01-09 23:03:09 +00:00
|
|
|
* Annex to ITU Operational Bulletin No. 835 - 1.V.2005
|
2004-03-05 10:29:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include "packet-e164.h"
|
|
|
|
|
|
|
|
const value_string E164_country_code_value[] = {
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x00, "Reserved (Assignment of all 0XX codes will be feasible after 31 December 2000. This question is currently under study.)"},
|
|
|
|
{ 0x01, "Americas"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x020,"Egypt"},
|
|
|
|
{ 0x0210,"Spare code"},
|
|
|
|
{ 0x0211,"Spare code"},
|
|
|
|
{ 0x0212,"Morocco"},
|
|
|
|
{ 0x0213,"Algeria"},
|
|
|
|
{ 0x0214,"spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0215,"spare code"},
|
|
|
|
{ 0x0216,"Tunisia"},
|
|
|
|
{ 0x0217,"Spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0218,"Libya"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0219,"Spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0220,"Gambia"},
|
|
|
|
{ 0x0221,"Senegal"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0222,"Mauritania"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0223,"Mali"},
|
|
|
|
{ 0x0224,"Guinea"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0225,"Ivory Coast"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0226,"Burkina Faso"},
|
|
|
|
{ 0x0227,"Niger"},
|
|
|
|
{ 0x0228,"Togolese Republic"},
|
|
|
|
{ 0x0229,"Benin"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0230,"Mauritius"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0231,"Liberia "},
|
|
|
|
{ 0x0232,"Sierra Leone"},
|
|
|
|
{ 0x0233,"Ghana"},
|
|
|
|
{ 0x0234,"Nigeria"},
|
|
|
|
{ 0x0235,"Chad"},
|
|
|
|
{ 0x0236,"Central African Republic"},
|
|
|
|
{ 0x0237,"Cameroon"},
|
|
|
|
{ 0x0238,"Cape Verde"},
|
|
|
|
{ 0x0239,"Sao Tome and Principe"},
|
|
|
|
{ 0x0240,"Equatorial Guinea"},
|
|
|
|
{ 0x0241,"Gabonese Republic"},
|
|
|
|
{ 0x0242,"Republic of Congo"},
|
|
|
|
{ 0x0243,"Democratic Republic of Congo"},
|
|
|
|
{ 0x0244,"Angola"},
|
|
|
|
{ 0x0245,"Guinea-Bissau"},
|
|
|
|
{ 0x0246,"Diego Garcia"},
|
|
|
|
{ 0x0247,"Ascension"},
|
|
|
|
{ 0x0248,"Seychelles"},
|
|
|
|
{ 0x0249,"Sudan"},
|
|
|
|
{ 0x0250,"Rwandese Republic"},
|
|
|
|
{ 0x0251,"Ethiopia"},
|
|
|
|
{ 0x0252,"Somali"},
|
|
|
|
{ 0x0253,"Djibouti"},
|
|
|
|
{ 0x0254,"Kenya"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0255,"Tanzania"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0256,"Uganda"},
|
|
|
|
{ 0x0257,"Burundi"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0258,"Mozambique"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0259,"Spare code"},
|
|
|
|
{ 0x0260,"Zambia"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0261,"Madagascar"},
|
|
|
|
{ 0x0262,"Reunion Island"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0263,"Zimbabwe"},
|
|
|
|
{ 0x0264,"Namibia"},
|
|
|
|
{ 0x0265,"Malawi"},
|
|
|
|
{ 0x0266,"Lesotho"},
|
|
|
|
{ 0x0267,"Botswana"},
|
|
|
|
{ 0x0268,"Swaziland"},
|
|
|
|
{ 0x0269,"Comoros Mayotte"},
|
|
|
|
{ 0x027,"South Africa"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x0280,"spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0281,"spare code"},
|
|
|
|
{ 0x0282,"spare code"},
|
|
|
|
{ 0x0283,"spare code"},
|
|
|
|
{ 0x0284,"spare code"},
|
|
|
|
{ 0x0285,"spare code"},
|
|
|
|
{ 0x0286,"spare code"},
|
|
|
|
{ 0x0287,"spare code"},
|
|
|
|
{ 0x0288,"spare code"},
|
|
|
|
{ 0x0289,"spare code"},
|
|
|
|
{ 0x0290,"Saint Helena"},
|
|
|
|
{ 0x0291,"Eritrea"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0292,"spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0293,"spare code"},
|
|
|
|
{ 0x0294,"spare code"},
|
|
|
|
{ 0x0295,"spare code"},
|
|
|
|
{ 0x0296,"spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0297,"Aruba"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0298,"Faroe Islands"},
|
|
|
|
{ 0x0299,"Greenland"},
|
|
|
|
{ 0x030,"Greece"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x031,"Netherlands"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x032,"Belgium"},
|
|
|
|
{ 0x033,"France"},
|
|
|
|
{ 0x034,"Spain"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0350,"Gibraltar"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0351,"Portugal"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0352,"Luxembourg"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0353,"Ireland"},
|
|
|
|
{ 0x0354,"Iceland"},
|
|
|
|
{ 0x0355,"Albania"},
|
|
|
|
{ 0x0356,"Malta"},
|
|
|
|
{ 0x0357,"Cyprus"},
|
|
|
|
{ 0x0358,"Finland"},
|
|
|
|
{ 0x0359,"Bulgaria"},
|
|
|
|
{ 0x036,"Hungary"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0370,"Lithuania"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0371,"Latvia"},
|
|
|
|
{ 0x0372,"Estonia"},
|
|
|
|
{ 0x0373,"Moldova"},
|
|
|
|
{ 0x0374,"Armenia"},
|
|
|
|
{ 0x0375,"Belarus"},
|
|
|
|
{ 0x0376,"Andorra"},
|
|
|
|
{ 0x0377,"Monaco"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0378,"San Marino"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0379,"Vatican"},
|
|
|
|
{ 0x0380,"Ukraine"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0381,"Serbia and Montenegro"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0382,"spare code"},
|
|
|
|
{ 0x0383,"spare code"},
|
|
|
|
{ 0x0384,"spare code"},
|
|
|
|
{ 0x0385,"Croatia"},
|
|
|
|
{ 0x0386,"Slovenia"},
|
|
|
|
{ 0x0387,"Bosnia and Herzegovina"},
|
2008-12-17 00:08:38 +00:00
|
|
|
{ 0x0388,"Groups of countries:"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0389,"Macedonia"},
|
|
|
|
{ 0x039,"Italy"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x040,"Romania"},
|
|
|
|
{ 0x041,"Switzerland"},
|
|
|
|
{ 0x0420,"Czech Republic"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0421,"Slovak Republic"},
|
|
|
|
{ 0x0422,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0423,"Liechtenstein"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0424,"spare code"},
|
|
|
|
{ 0x0425,"spare code"},
|
|
|
|
{ 0x0426,"spare code"},
|
|
|
|
{ 0x0427,"spare code"},
|
|
|
|
{ 0x0428,"spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0429,"spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x043,"Austria"},
|
|
|
|
{ 0x044,"United Kingdom"},
|
|
|
|
{ 0x045,"Denmark"},
|
|
|
|
{ 0x046,"Sweden"},
|
|
|
|
{ 0x047,"Norway"},
|
|
|
|
{ 0x048,"Poland"},
|
|
|
|
{ 0x049,"Germany"},
|
|
|
|
{ 0x0500,"Falkland Islands (Malvinas)"},
|
|
|
|
{ 0x0501,"Belize"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0502,"Guatemala"},
|
|
|
|
{ 0x0503,"El Salvador"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0504,"Honduras"},
|
|
|
|
{ 0x0505,"Nicaragua"},
|
|
|
|
{ 0x0506,"Costa Rica"},
|
|
|
|
{ 0x0507,"Panama"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0508,"Saint Pierre and Miquelon"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0509,"Haiti"},
|
|
|
|
{ 0x051,"Peru"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x052,"Mexico"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x053,"Cuba"},
|
|
|
|
{ 0x054,"Argentina"},
|
|
|
|
{ 0x055,"Brazil"},
|
|
|
|
{ 0x056,"Chile"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x057,"Colombia"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x058,"Venezuela"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0590,"Guadeloupe"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0591,"Bolivia"},
|
|
|
|
{ 0x0592,"Guyana"},
|
|
|
|
{ 0x0593,"Ecuador"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0594,"French Guiana"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0595,"Paraguay"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0596,"Martinique"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0597,"Suriname"},
|
|
|
|
{ 0x0598,"Uruguay"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0599,"Netherlands Antilles"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x060,"Malaysia"},
|
|
|
|
{ 0x061,"Australia"},
|
|
|
|
{ 0x062,"Indonesia"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x063,"Philippines"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x064,"New Zealand"},
|
|
|
|
{ 0x065,"Singapore"},
|
|
|
|
{ 0x066,"Thailand"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0670,"East Timor"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0671,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0672,"Australian External Territories"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0673,"Brunei Darussalam"},
|
|
|
|
{ 0x0674,"Nauru"},
|
|
|
|
{ 0x0675,"Papua New Guinea"},
|
|
|
|
{ 0x0676,"Tonga"},
|
|
|
|
{ 0x0677,"Solomon Islands"},
|
|
|
|
{ 0x0678,"Vanuatu"},
|
|
|
|
{ 0x0679,"Fiji"},
|
|
|
|
{ 0x0680,"Palau"},
|
|
|
|
{ 0x0681,"Wallis and Futuna"},
|
|
|
|
{ 0x0682,"Cook Islands"},
|
|
|
|
{ 0x0683,"Niue"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x0684,"Spare code"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0685,"Samoa"},
|
|
|
|
{ 0x0686,"Kiribati"},
|
|
|
|
{ 0x0687,"New Caledonia"},
|
|
|
|
{ 0x0688,"Tuvalu"},
|
|
|
|
{ 0x0689,"French Polynesia"},
|
|
|
|
{ 0x0690,"Tokelau"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0691,"Micronesia"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0692,"Marshall Islands"},
|
|
|
|
{ 0x0693,"spare code"},
|
|
|
|
{ 0x0694,"spare code"},
|
|
|
|
{ 0x0695,"spare code"},
|
|
|
|
{ 0x0696,"spare code"},
|
|
|
|
{ 0x0697,"spare code"},
|
|
|
|
{ 0x0698,"spare code"},
|
|
|
|
{ 0x0699,"spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x07,"Russian Federation,Kazakstan"},
|
|
|
|
{ 0x0800,"International Freephone Service (see E.169.1)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0801,"spare code"},
|
|
|
|
{ 0x0802,"spare code"},
|
|
|
|
{ 0x0803,"spare code"},
|
|
|
|
{ 0x0804,"spare code"},
|
|
|
|
{ 0x0805,"spare code"},
|
|
|
|
{ 0x0806,"spare code"},
|
|
|
|
{ 0x0807,"spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0808,"Universal International Shared Cost Number (see E.169.3)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0809,"Spare code"},
|
|
|
|
{ 0x081,"Japan"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x082,"Korea (Republic of)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0830,"Spare code"},
|
|
|
|
{ 0x0831,"Spare code"},
|
|
|
|
{ 0x0832,"Spare code"},
|
|
|
|
{ 0x0833,"Spare code"},
|
|
|
|
{ 0x0834,"Spare code"},
|
|
|
|
{ 0x0835,"Spare code"},
|
|
|
|
{ 0x0836,"Spare code"},
|
|
|
|
{ 0x0837,"Spare code"},
|
|
|
|
{ 0x0838,"Spare code"},
|
|
|
|
{ 0x0839,"Spare code"},
|
|
|
|
{ 0x084,"Viet Nam"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0850,"Democratic People's Republic of Korea"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0851,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0852,"Hong Kong, China"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0853,"Macau, China"},
|
|
|
|
{ 0x0854,"Spare code"},
|
|
|
|
{ 0x0855,"Cambodia"},
|
|
|
|
{ 0x0856,"Laos"},
|
|
|
|
{ 0x0857,"Spare code"},
|
|
|
|
{ 0x0858,"Spare code"},
|
|
|
|
{ 0x0859,"Spare code"},
|
|
|
|
{ 0x086,"China (People's Republic of)"},
|
|
|
|
{ 0x0870,"Inmarsat SNAC"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0871,"Inmarsat (Atlantic Ocean-East)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0872,"Inmarsat (Pacific Ocean)"},
|
|
|
|
{ 0x0873,"Inmarsat (Indian Ocean)"},
|
|
|
|
{ 0x0874,"Inmarsat (Atlantic Ocean-West)"},
|
|
|
|
{ 0x0875,"Reserved - Maritime Mobile Service Applications"},
|
|
|
|
{ 0x0876,"Reserved - Maritime Mobile Service Applications"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0877,"Reserved - Maritime Mobile Service Applications"},
|
|
|
|
{ 0x0878,"Reserved - Universal Personal Telecommunication Service (UPT)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0879,"Reserved for national non-commercial purposes"},
|
|
|
|
{ 0x0880,"Bangladesh"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0881,"Global Mobile Satellite System (GMSS), shared code:"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0882,"International Networks: (see E.164)"},
|
|
|
|
{ 0x0883,"Spare code"},
|
|
|
|
{ 0x0884,"Spare code"},
|
|
|
|
{ 0x0885,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0886,"Reserved"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0887,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0888,"Reserved for future global services (see E.164)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0889,"Spare code"},
|
|
|
|
{ 0x0890,"Spare code"},
|
|
|
|
{ 0x0891,"Spare code"},
|
|
|
|
{ 0x0892,"Spare code"},
|
|
|
|
{ 0x0893,"Spare code"},
|
|
|
|
{ 0x0894,"Spare code"},
|
|
|
|
{ 0x0895,"Spare code"},
|
|
|
|
{ 0x0896,"Spare code"},
|
|
|
|
{ 0x0897,"Spare code"},
|
|
|
|
{ 0x0898,"Spare code"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0899,"Spare code"},
|
|
|
|
{ 0x090,"Turkey"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x091,"India"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x092,"Pakistan"},
|
|
|
|
{ 0x093,"Afghanistan"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x094,"Sri Lanka"},
|
|
|
|
{ 0x095,"Myanmar"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0960,"Maldives"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0961,"Lebanon"},
|
|
|
|
{ 0x0962,"Jordan"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0963,"Syrian Arab Republic"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0964,"Iraq"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0965,"Kuwait"},
|
|
|
|
{ 0x0966,"Saudi Arabia"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0967,"Yemen"},
|
|
|
|
{ 0x0968,"Oman"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0969,"Reserved"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0970,"Reserved"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0971,"United Arab Emirates"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0972,"Israel"},
|
|
|
|
{ 0x0973,"Bahrain"},
|
|
|
|
{ 0x0974,"Qatar"},
|
|
|
|
{ 0x0975,"Bhutan"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0976,"Mongolia"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0977,"Nepal"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0978,"Spare code"},
|
|
|
|
{ 0x0979,"Universal International Premium Rate Number (see E.169.2)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x098,"Iran"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0990,"Spare code"},
|
|
|
|
{ 0x0991,"Trial service (see E.164.2)"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0992,"Tajikstan"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0993,"Turkmenistan"},
|
|
|
|
{ 0x0994,"Azerbaijani Republic"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0995,"Georgia"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x0996,"Kyrgyz Republic"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x0997,"Spare code"},
|
|
|
|
{ 0x0998,"Uzbekistan"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x0999,"Reserved"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0, NULL }
|
2008-01-09 22:25:47 +00:00
|
|
|
};
|
2004-03-05 10:29:36 +00:00
|
|
|
const value_string E164_International_Networks_vals[] = {
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x10, "British Telecommunications"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x11, "Singapore Telecommunications"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x12, "MCI"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x13, "Telespazio"},
|
|
|
|
{ 0x14, "GTE"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x15, "Reach"},
|
|
|
|
{ 0x16, "United Arab Emirates"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x17, "AT&T"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x18, "Teledesic"},
|
|
|
|
{ 0x19, "Telecom Italia"},
|
|
|
|
{ 0x20, "Asia Cellular Satellite"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x21, "Ameritech"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x22, "Cable & Wireless"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x23, "Sita-Equant"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x24, "TeliaSonera AB"},
|
2008-01-09 22:25:47 +00:00
|
|
|
{ 0x25, "Constellation Communications"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0x26, "SBC Communications"},
|
2007-01-09 23:03:09 +00:00
|
|
|
{ 0x28, "Deutsche Telekom"},
|
|
|
|
{ 0x29, "Q-Tel"},
|
|
|
|
{ 0x30, "Singapore Telecom"},
|
|
|
|
{ 0x31, "Telekom Malaysia"},
|
|
|
|
{ 0x32, "Maritime Communications Partners"},
|
|
|
|
{ 0x33, "Oration Technologies"},
|
|
|
|
{ 0x34, "Global Networks"},
|
|
|
|
{ 0x98, "SITA"},
|
|
|
|
{ 0x99, "Telenor"},
|
2004-03-05 10:29:36 +00:00
|
|
|
{ 0, NULL }
|
2008-01-09 22:25:47 +00:00
|
|
|
};
|
2004-03-05 10:29:36 +00:00
|
|
|
|
|
|
|
static int proto_e164 = -1;
|
|
|
|
static int hf_E164_calling_party_number = -1;
|
|
|
|
static int hf_E164_called_party_number = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2007-01-09 23:03:09 +00:00
|
|
|
dissect_e164_number(tvbuff_t *tvb, proto_tree *tree, int offset, int length,e164_info_t e164_info)
|
2004-03-05 10:29:36 +00:00
|
|
|
{
|
|
|
|
switch (e164_info.e164_number_type){
|
|
|
|
case CALLING_PARTY_NUMBER :
|
|
|
|
proto_tree_add_string(tree, hf_E164_calling_party_number, tvb, offset,
|
|
|
|
length, e164_info.E164_number_str);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CALLED_PARTY_NUMBER :
|
|
|
|
proto_tree_add_string(tree, hf_E164_called_party_number, tvb, offset,
|
|
|
|
length, e164_info.E164_number_str);
|
|
|
|
break;
|
|
|
|
|
2007-01-09 23:03:09 +00:00
|
|
|
default:
|
2004-03-05 10:29:36 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2006-05-03 18:57:32 +00:00
|
|
|
void
|
|
|
|
dissect_e164_cc(tvbuff_t *tvb, proto_tree *tree, int offset, gboolean bcd_coded){
|
|
|
|
|
2007-01-09 23:03:09 +00:00
|
|
|
int cc_offset;
|
2006-05-03 18:57:32 +00:00
|
|
|
guint8 address_digit_pair;
|
|
|
|
guint16 id_code;
|
|
|
|
guint8 cc_length;
|
|
|
|
guint8 length;
|
|
|
|
guint16 cc;
|
|
|
|
|
|
|
|
cc_offset = offset;
|
|
|
|
address_digit_pair = tvb_get_guint8(tvb, cc_offset);
|
|
|
|
|
|
|
|
if(!bcd_coded){
|
|
|
|
/* Dissect country code after removing non significant zeros */
|
|
|
|
while ( address_digit_pair == 0 ) {
|
|
|
|
cc_offset = cc_offset + 1;
|
|
|
|
address_digit_pair = tvb_get_guint8(tvb, cc_offset);
|
|
|
|
}
|
|
|
|
cc = tvb_get_ntohs(tvb, cc_offset);
|
|
|
|
if (( address_digit_pair & 0xf0 ) != 0 ){
|
|
|
|
cc = cc >> 4;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
cc = address_digit_pair &0x0f;
|
|
|
|
cc = cc << 4;
|
|
|
|
cc = cc | (address_digit_pair &0xf0)>>4;
|
|
|
|
cc = cc << 4;
|
2008-01-09 22:25:47 +00:00
|
|
|
address_digit_pair = tvb_get_guint8(tvb, cc_offset+1);
|
2007-01-09 23:03:09 +00:00
|
|
|
cc = cc | (address_digit_pair &0x0f);
|
2006-05-03 18:57:32 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ( cc & 0x0f00 ) {
|
|
|
|
|
|
|
|
case 0x0:
|
2008-01-09 22:25:47 +00:00
|
|
|
cc_length = 1;
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x0100:
|
2008-01-09 22:25:47 +00:00
|
|
|
cc_length = 1;
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x0200:
|
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0:
|
|
|
|
case 0x70 :
|
|
|
|
cc_length = 2;
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
2008-01-09 22:25:47 +00:00
|
|
|
default :
|
2006-05-03 18:57:32 +00:00
|
|
|
cc_length = 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2008-01-09 22:25:47 +00:00
|
|
|
|
2006-05-03 18:57:32 +00:00
|
|
|
case 0x0300 :
|
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0 :
|
|
|
|
case 0x10 :
|
|
|
|
case 0x20 :
|
|
|
|
case 0x30 :
|
|
|
|
case 0x40 :
|
|
|
|
case 0x60 :
|
|
|
|
case 0x90 :
|
2006-05-03 18:57:32 +00:00
|
|
|
cc_length = 2;
|
2008-01-09 22:25:47 +00:00
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
default :
|
|
|
|
cc_length = 3;
|
|
|
|
break;
|
|
|
|
}
|
2007-01-09 23:03:09 +00:00
|
|
|
break;
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0400 :
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc & 0x00f0 ) {
|
|
|
|
case 0x20 :
|
|
|
|
cc_length = 3;
|
2008-01-09 22:25:47 +00:00
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
default :
|
|
|
|
cc_length = 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0500 :
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0 :
|
2006-05-03 18:57:32 +00:00
|
|
|
case 0x90 :
|
|
|
|
cc_length = 3;
|
2008-01-09 22:25:47 +00:00
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
default :
|
|
|
|
cc_length = 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0600 :
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x70 :
|
|
|
|
case 0x80 :
|
2006-05-03 18:57:32 +00:00
|
|
|
case 0x90 :
|
2008-01-09 22:25:47 +00:00
|
|
|
cc_length = 3;
|
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
default :
|
|
|
|
cc_length = 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0700 :
|
|
|
|
cc_length = 1;
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0800 :
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x10:
|
|
|
|
case 0x20:
|
|
|
|
case 0x40:
|
2006-05-03 18:57:32 +00:00
|
|
|
case 0x60:
|
2008-01-09 22:25:47 +00:00
|
|
|
cc_length = 2;
|
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
default :
|
|
|
|
cc_length = 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0x0900 :
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc & 0x00f0 ) {
|
2008-01-09 22:25:47 +00:00
|
|
|
case 0 :
|
|
|
|
case 0x10 :
|
|
|
|
case 0x20 :
|
|
|
|
case 0x30 :
|
|
|
|
case 0x40 :
|
|
|
|
case 0x50 :
|
|
|
|
case 0x80 :
|
|
|
|
cc_length = 2;
|
|
|
|
break;
|
|
|
|
default :
|
2006-05-03 18:57:32 +00:00
|
|
|
cc_length = 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2007-01-09 23:03:09 +00:00
|
|
|
default :
|
|
|
|
cc_length = 0;
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
|
|
|
}/* End switch cc */
|
|
|
|
|
|
|
|
switch ( cc_length ) {
|
2007-01-09 23:03:09 +00:00
|
|
|
case 1 :
|
2006-05-03 18:57:32 +00:00
|
|
|
cc = cc >> 8;
|
|
|
|
length = 1;
|
|
|
|
break;
|
2007-01-09 23:03:09 +00:00
|
|
|
case 2 :
|
2006-05-03 18:57:32 +00:00
|
|
|
cc = cc >> 4;
|
|
|
|
length = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
length = 2;
|
|
|
|
break;
|
|
|
|
}/* end switch cc_length */
|
|
|
|
|
2008-01-09 22:25:47 +00:00
|
|
|
proto_tree_add_text(tree, tvb, cc_offset, length,"Country Code: %x %s length %u", cc,
|
|
|
|
val_to_str(cc,E164_country_code_value,"unknown (%x)"), cc_length);
|
2006-05-03 18:57:32 +00:00
|
|
|
switch ( cc ) {
|
|
|
|
case 0x882 :
|
|
|
|
id_code = tvb_get_ntohs(tvb, cc_offset + 1);
|
|
|
|
id_code = (id_code & 0x0fff) >> 4;
|
|
|
|
proto_tree_add_text(tree,tvb, (cc_offset + 1), 2,"Identification Code: %x %s ",id_code,
|
2008-01-09 22:25:47 +00:00
|
|
|
val_to_str(id_code,E164_International_Networks_vals,"unknown (%x)"));
|
2006-05-03 18:57:32 +00:00
|
|
|
break;
|
2007-01-09 23:03:09 +00:00
|
|
|
default:
|
|
|
|
break;
|
2006-05-03 18:57:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-03-05 10:29:36 +00:00
|
|
|
/*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Register the protocol with Wireshark.
|
2004-03-05 10:29:36 +00:00
|
|
|
*
|
|
|
|
* This format is required because a script is used to build the C function
|
|
|
|
* that calls all the protocol registration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_e164(void)
|
|
|
|
{
|
|
|
|
|
2007-01-09 23:03:09 +00:00
|
|
|
/* Setup list of header fields See Section 1.6.1 for details */
|
2004-03-05 10:29:36 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_E164_calling_party_number,
|
2004-03-19 10:24:43 +00:00
|
|
|
{ "E.164 Calling party number digits", "e164.calling_party_number.digits",
|
2004-03-05 10:29:36 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-03-05 10:29:36 +00:00
|
|
|
|
|
|
|
{ &hf_E164_called_party_number,
|
2004-03-19 10:24:43 +00:00
|
|
|
{ "E.164 Called party number digits", "e164.called_party_number.digits",
|
2004-03-05 10:29:36 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }}
|
2004-03-05 10:29:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Register the protocol name and description
|
|
|
|
*/
|
|
|
|
proto_e164 = proto_register_protocol(
|
2004-03-19 10:24:43 +00:00
|
|
|
"ITU-T E.164 number",
|
|
|
|
"E.164",
|
2004-03-05 10:29:36 +00:00
|
|
|
"e164");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Required function calls to register
|
|
|
|
* the header fields and subtrees used.
|
|
|
|
*/
|
|
|
|
proto_register_field_array(proto_e164, hf, array_length(hf));
|
|
|
|
|
|
|
|
}
|