forked from osmocom/wireshark
E.212: fix identification of PLMNs with 3 digits MNC ending with a 0
Split PLMNs arrays in 2 so as to clearly konw if the MNC is 2 or 3 digits long Bug: 13092 Change-Id: Ic5f776f3c1e5141f8739bf2137ebd046f7e4a0d6 Reviewed-on: https://code.wireshark.org/review/18679 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
5ba5727ed8
commit
f894379ea7
File diff suppressed because it is too large
Load Diff
|
@ -29,7 +29,9 @@
|
|||
|
||||
extern value_string_ext E212_codes_ext;
|
||||
|
||||
extern value_string_ext mcc_mnc_codes_ext;
|
||||
extern value_string_ext mcc_mnc_2digits_codes_ext;
|
||||
|
||||
extern value_string_ext mcc_mnc_3digits_codes_ext;
|
||||
|
||||
typedef enum {
|
||||
E212_NONE,
|
||||
|
|
|
@ -50,7 +50,8 @@ static int hf_eap_identity = -1;
|
|||
static int hf_eap_identity_actual_len = -1;
|
||||
static int hf_eap_identity_wlan_prefix = -1;
|
||||
static int hf_eap_identity_wlan_mcc = -1;
|
||||
static int hf_eap_identity_wlan_mcc_mnc = -1;
|
||||
static int hf_eap_identity_wlan_mcc_mnc_2digits = -1;
|
||||
static int hf_eap_identity_wlan_mcc_mnc_3digits = -1;
|
||||
|
||||
static int hf_eap_notification = -1;
|
||||
|
||||
|
@ -565,6 +566,7 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i
|
|||
gchar** tokens = NULL;
|
||||
guint ntokens = 0;
|
||||
gboolean ret = TRUE;
|
||||
int hf_eap_identity_wlan_mcc_mnc;
|
||||
|
||||
identity = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, size, ENC_ASCII);
|
||||
|
||||
|
@ -601,8 +603,10 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i
|
|||
|
||||
if (!g_ascii_strncasecmp(tokens[0], tokens[2] + 3, 3)) {
|
||||
mcc_mnc = 1000 * mcc + mnc;
|
||||
hf_eap_identity_wlan_mcc_mnc = hf_eap_identity_wlan_mcc_mnc_3digits;
|
||||
} else {
|
||||
mcc_mnc = 1000 * mcc + 10 * mnc;
|
||||
mcc_mnc = 100 * mcc + mnc;
|
||||
hf_eap_identity_wlan_mcc_mnc = hf_eap_identity_wlan_mcc_mnc_2digits;
|
||||
}
|
||||
|
||||
proto_tree_add_uint(eap_identity_tree, hf_eap_identity_wlan_mcc_mnc,
|
||||
|
@ -1368,9 +1372,13 @@ proto_register_eap(void)
|
|||
"WLAN Identity Mobile Country Code", "eap.identity.wlan.mcc",
|
||||
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &E212_codes_ext, 0x0, NULL, HFILL }},
|
||||
|
||||
{ &hf_eap_identity_wlan_mcc_mnc, {
|
||||
{ &hf_eap_identity_wlan_mcc_mnc_2digits, {
|
||||
"WLAN Identity Mobile Network Code", "eap.identity.wlan.mnc",
|
||||
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_codes_ext, 0x0, NULL, HFILL }},
|
||||
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_2digits_codes_ext, 0x0, NULL, HFILL }},
|
||||
|
||||
{ &hf_eap_identity_wlan_mcc_mnc_3digits, {
|
||||
"WLAN Identity Mobile Network Code", "eap.identity.wlan.mnc",
|
||||
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_3digits_codes_ext, 0x0, NULL, HFILL }},
|
||||
|
||||
{ &hf_eap_identity_actual_len, {
|
||||
"Identity Actual Length", "eap.identity.actual_len",
|
||||
|
|
Loading…
Reference in New Issue