aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2005-12-13 09:30:09 +0000
committerJörg Mayer <jmayer@loplof.de>2005-12-13 09:30:09 +0000
commitf6b5a5d924deba3e3e7c4c1d8049c809df97927e (patch)
tree65168dd5d4ad1ee177dcc39f9b91a8db544f17b4 /tools
parent39d07a2555c87d2e487992307550c023e920db01 (diff)
Update from samba tree revision 12185 to 12205
============================ Samba log start ============ ------------------------------------------------------------------------ r12205 | jelmer | 2005-12-13 02:56:04 +0100 (Tue, 13 Dec 2005) | 2 lines Support 'TFS' command in conformance files ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16776
Diffstat (limited to 'tools')
-rw-r--r--tools/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm22
-rw-r--r--tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm9
2 files changed, 28 insertions, 3 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm b/tools/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm
index 1b550ae1e7..12eb718586 100644
--- a/tools/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm
+++ b/tools/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm
@@ -70,6 +70,10 @@ Change description for the specified header field. `field' is the hf name of the
Code to insert when generating the specified dissector. @HF@ and
@PARAM@ will be substituted.
+=item I<TFS> hf_name "true string" "false string"
+
+Override the text shown when a bitmap boolean value is enabled or disabled.
+
=back
=head1 EXAMPLE
@@ -125,12 +129,27 @@ sub handle_type($$$$$$$$$$)
};
}
+sub handle_tfs($$$$$)
+{
+ my ($pos,$data,$hf,$trues,$falses) = @_;
+
+ unless(defined($falses)) {
+ print "$pos: error: incomplete TFS command\n";
+ return;
+ }
+
+ $data->{tfs}->{$hf} = {
+ TRUE_STRING => $trues,
+ FALSE_STRING => $falses
+ };
+}
+
sub handle_hf_rename($$$$)
{
my ($pos,$data,$old,$new) = @_;
unless(defined($new)) {
- print "$pos: error incomplete HF_RENAME command\n";
+ print "$pos: error: incomplete HF_RENAME command\n";
return;
}
@@ -272,6 +291,7 @@ my %field_handlers = (
PARAM_VALUE => \&handle_param_value,
HF_FIELD => \&handle_hf_field,
HF_RENAME => \&handle_hf_rename,
+ TFS => \&handle_tfs,
STRIP_PREFIX => \&handle_strip_prefix,
PROTOCOL => \&handle_protocol,
FIELD_DESCRIPTION => \&handle_fielddescription,
diff --git a/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm b/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm
index 40767ef535..7dc94763ea 100644
--- a/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm
+++ b/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm
@@ -203,8 +203,13 @@ sub Bitmap($$$)
register_hf_field($hf_bitname, field2name($en), $filtername, "FT_BOOLEAN", $e->{ALIGN} * 8, "TFS(&$name\_$en\_tfs)", $ev, "");
pidl_def "static const true_false_string $name\_$en\_tfs = {";
- pidl_def " \"$en is SET\",";
- pidl_def " \"$en is NOT SET\",";
+ if (defined($conformance->{tfs}->{$hf_bitname})) {
+ pidl_def " $conformance->{tfs}->{$hf_bitname}->{TRUE_STRING},";
+ pidl_def " $conformance->{tfs}->{$hf_bitname}->{FALSE_STRING},";
+ } else {
+ pidl_def " \"$en is SET\",";
+ pidl_def " \"$en is NOT SET\",";
+ }
pidl_def "};";
pidl_code "proto_tree_add_boolean(tree, $hf_bitname, tvb, offset-$e->{ALIGN}, $e->{ALIGN}, flags);";