Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wireshark
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Gregor Jasny
wireshark
Commits
05168e61
Commit
05168e61
authored
Oct 13, 2010
by
Bill Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Access several large value-string arrays via extended value-string functions.
svn path=/trunk/; revision=34501
parent
5ed53226
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
epan/dissectors/packet-bssgp.c
epan/dissectors/packet-bssgp.c
+1
-1
epan/dissectors/packet-e212.c
epan/dissectors/packet-e212.c
+12
-7
epan/dissectors/packet-e212.h
epan/dissectors/packet-e212.h
+1
-1
No files found.
epan/dissectors/packet-bssgp.c
View file @
05168e61
...
...
@@ -6140,7 +6140,7 @@ proto_register_bssgp(void)
},
{
&
hf_bssgp_mcc
,
{
"MCC"
,
"bssgp.mcc"
,
FT_UINT8
,
BASE_DEC
,
VALS
(
E212_codes
)
,
0x0
,
FT_UINT8
,
BASE_DEC
|
BASE_EXT_STRING
,
&
E212_codes_ext
,
0x0
,
NULL
,
HFILL
}
},
{
&
hf_bssgp_mnc
,
...
...
epan/dissectors/packet-e212.c
View file @
05168e61
...
...
@@ -42,7 +42,7 @@
*
* COMPLEMENT TO ITU-T RECOMMENDATION E.212 (05/2008)
*/
const
value_string
E212_codes
[]
=
{
static
const
value_string
E212_codes
[]
=
{
{
202
,
"Greece"
},
{
204
,
"Netherlands (Kingdom of the)"
},
{
206
,
"Belgium"
},
...
...
@@ -280,6 +280,8 @@ const value_string E212_codes[] = {
{
0
,
NULL
}
};
value_string_ext
E212_codes_ext
=
VALUE_STRING_EXT_INIT
(
E212_codes
);
/*
* Annex to ITU Operational Bulletin No. 958 - 15.VI.2010
* including amendments up to ITU Operational Bulletin No. 960 - 15.VII.2010
...
...
@@ -1689,6 +1691,9 @@ static const value_string mcc_mnc_codes[] = {
{
0
,
NULL
}
};
static
value_string_ext
mcc_mnc_codes_ext
=
VALUE_STRING_EXT_INIT
(
mcc_mnc_codes
);
static
int
proto_e212
=
-
1
;
static
int
hf_E212_mcc
=
-
1
;
static
int
hf_E212_mnc
=
-
1
;
...
...
@@ -1783,12 +1788,12 @@ dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
if
(
mnc3
!=
0x0f
)
item
=
proto_tree_add_uint_format
(
tree
,
hf_E212_mnc
,
tvb
,
start_offset
+
1
,
2
,
mnc
,
"Mobile Network Code (MNC): %s (%03u)"
,
val_to_str
(
mcc
*
1000
+
mnc
,
mcc_mnc_codes
,
"Unknown"
),
val_to_str
_ext_const
(
mcc
*
1000
+
mnc
,
&
mcc_mnc_codes_ext
,
"Unknown"
),
mnc
);
else
item
=
proto_tree_add_uint_format
(
tree
,
hf_E212_mnc
,
tvb
,
start_offset
+
1
,
2
,
mnc
,
"Mobile Network Code (MNC): %s (%02u)"
,
val_to_str
(
mcc
*
1000
+
10
*
mnc
,
mcc_mnc_codes
,
"Unknown"
),
val_to_str
_ext_const
(
mcc
*
1000
+
10
*
mnc
,
&
mcc_mnc_codes_ext
,
"Unknown"
),
mnc
);
if
((
mnc1
>
9
)
||
(
mnc2
>
9
)
||
((
mnc3
>
9
)
&&
(
mnc3
!=
0x0f
)))
...
...
@@ -1869,7 +1874,7 @@ dissect_e212_mcc_mnc_in_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
mnc
=
10
*
mnc1
+
mnc2
;
/* Try to match the MCC and 2 digits MNC with an entry in our list of operators */
if
(
!
match_strval
(
mcc
*
1000
+
10
*
mnc
,
mcc_mnc_codes
))
{
if
(
!
match_strval
_ext
(
mcc
*
1000
+
10
*
mnc
,
&
mcc_mnc_codes_ext
))
{
mnc
=
10
*
mnc
+
mnc3
;
long_mnc
=
TRUE
;
}
...
...
@@ -1881,12 +1886,12 @@ dissect_e212_mcc_mnc_in_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if
(
long_mnc
)
item
=
proto_tree_add_uint_format
(
tree
,
hf_E212_mnc
,
tvb
,
start_offset
+
1
,
2
,
mnc
,
"Mobile Network Code (MNC): %s (%03u)"
,
val_to_str
(
mcc
*
1000
+
mnc
,
mcc_mnc_codes
,
"Unknown"
),
val_to_str
_ext_const
(
mcc
*
1000
+
mnc
,
&
mcc_mnc_codes_ext
,
"Unknown"
),
mnc
);
else
item
=
proto_tree_add_uint_format
(
tree
,
hf_E212_mnc
,
tvb
,
start_offset
+
1
,
2
,
mnc
,
"Mobile Network Code (MNC): %s (%02u)"
,
val_to_str
(
mcc
*
1000
+
10
*
mnc
,
mcc_mnc_codes
,
"Unknown"
),
val_to_str
_ext_const
(
mcc
*
1000
+
10
*
mnc
,
&
mcc_mnc_codes_ext
,
"Unknown"
),
mnc
);
if
((
mnc1
>
9
)
||
(
mnc2
>
9
)
||
(
long_mnc
&&
(
mnc3
>
9
)))
...
...
@@ -1914,7 +1919,7 @@ proto_register_e212(void)
static
hf_register_info
hf
[]
=
{
{
&
hf_E212_mcc
,
{
"Mobile Country Code (MCC)"
,
"e212.mcc"
,
FT_UINT16
,
BASE_DEC
,
VALS
(
E212_codes
)
,
0x0
,
FT_UINT16
,
BASE_DEC
|
BASE_EXT_STRING
,
&
E212_codes_ext
,
0x0
,
"Mobile Country Code MCC"
,
HFILL
}
},
{
&
hf_E212_mnc
,
...
...
epan/dissectors/packet-e212.h
View file @
05168e61
...
...
@@ -28,7 +28,7 @@
#include <epan/value_string.h>
extern
const
value_string
E212_codes
[]
;
extern
value_string_ext
E212_codes_ext
;
int
dissect_e212_mcc_mnc
(
tvbuff_t
*
tvb
,
packet_info
*
pinfo
,
proto_tree
*
tree
,
int
offset
,
gboolean
little_endian
);
int
dissect_e212_mcc_mnc_in_address
(
tvbuff_t
*
tvb
,
packet_info
*
pinfo
,
proto_tree
*
tree
,
int
offset
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment