aboutsummaryrefslogtreecommitdiffstats
path: root/tools/convert_proto_tree_add_text.pl
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-08-05 12:16:50 +0000
committerMichael Mann <mmann78@netscape.net>2013-08-05 12:16:50 +0000
commit635d8d4f2c849ec2ae2ebcc67ac01ae03acb93dc (patch)
tree2f181557b65bac11ceb3774a2da893cd865d3c3a /tools/convert_proto_tree_add_text.pl
parentad1d32485cf6a7c810bed94bfcdec0000bb4fbd4 (diff)
Add support for determining BASE_EXT_STRING.
svn path=/trunk/; revision=51149
Diffstat (limited to 'tools/convert_proto_tree_add_text.pl')
-rwxr-xr-xtools/convert_proto_tree_add_text.pl23
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/convert_proto_tree_add_text.pl b/tools/convert_proto_tree_add_text.pl
index 5c6cad1f57..eeccc5b472 100755
--- a/tools/convert_proto_tree_add_text.pl
+++ b/tools/convert_proto_tree_add_text.pl
@@ -64,6 +64,7 @@ my %DISPLAY_BASE = ('BASE_NONE' => "BASE_NONE",
'BASE_OCT' => "BASE_OCT",
'BASE_DEC_HEX' => "BASE_DEC_HEX",
'BASE_HEX_DEC' => "BASE_HEX_DEC",
+ 'BASE_EXT_STRING' => "BASE_EXT_STRING",
'BASE_CUSTOM' => "BASE_CUSTOM");
my %ENCODINGS = ('ENC_BIG_ENDIAN' => "ENC_BIG_ENDIAN",
@@ -286,11 +287,14 @@ sub verify_line {
print "$line_number: Poorly formed hf_ variable ($proto_tree_item[3])!\n";
$errors++;
}
- if (!exists($FIELD_TYPE{$proto_tree_item[9]})) {
- print "$line_number: Field type '$proto_tree_item[9]' unknown!\n";
- $errors++;
+ foreach (split(/\|/, $proto_tree_item[9])) {
+ if (!exists($FIELD_TYPE{$_})) {
+ print "$line_number: Field type '$proto_tree_item[9]' unknown!\n";
+ $errors++;
+ }
}
- if (!exists($DISPLAY_BASE{$proto_tree_item[11]})) {
+ if ((!exists($DISPLAY_BASE{$proto_tree_item[11]})) &&
+ (!($proto_tree_item[11] =~ /\d+/))) {
print "$line_number: Display base '$proto_tree_item[11]' unknown!\n";
$errors++;
}
@@ -404,8 +408,14 @@ sub generate_hfs {
$proto_tree_item[10] =~ s/\s+|-|:/_/g;
#VALS
- if ($str =~ /val_to_str(_const)?\([^\,]*\,([^\,]*)\,/) {
+ if ($str =~ /val_to_str(_const)?\(\s*tvb_get_[^\(]*\([^\,]*,[^\)]*\)\s*\,\s*([^\,]*)\s*\,\s*([^\)]*)\)/) {
$proto_tree_item[12] = sprintf("VALS(%s)", trim($2));
+ } elsif ($str =~ /val_to_str(_const)?\([^\,]*\,([^\,]*)\,/) {
+ $proto_tree_item[12] = sprintf("VALS(%s)", trim($2));
+ } elsif ($str =~ /val_to_str_ext(_const)?\(\s*tvb_get_[^\(]*\([^\,]*,[^\)]*\)\s*\,\s*([^\,]*)\s*\,\s*([^\)]*)\)/) {
+ $proto_tree_item[12] = trim($2);
+ } elsif ($str =~ /val_to_str_ext(_const)?\([^\,]*\,([^\,]*)\,/) {
+ $proto_tree_item[12] = trim($2);
}
#field type
@@ -475,6 +485,9 @@ sub generate_hfs {
} elsif ($args[4] =~ /%[0-9]*o/) {
$proto_tree_item[11] = "BASE_OCT";
}
+ if ($str =~ /val_to_str_ext(_const)?\([^\,]*\,([^\,]*)\,/) {
+ $proto_tree_item[11] .= "|BASE_EXT_STRING";
+ }
push(@proto_tree_list, \@proto_tree_item);