diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-11-03 11:34:29 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-11-03 19:34:56 +0000 |
commit | 08a85b85ecd35aaa7fc00f50bef59cd98e36571d (patch) | |
tree | 8ad691746f3693ca1d71a4681ad1918fa4538c61 /tools | |
parent | e0c727739e06571b5b7d64cd2bfb0edc5f480a4e (diff) |
add a function to change the type of a hf_field
Pick up change from Samba:
commit 755bc4ed29c89fc15d4230ce8b828b3afcfa2912
Author: Matthieu Patou <mat@matws.net>
Date: Thu Oct 3 01:10:48 2013 -0700
pidl-wireshark: add a function to change the type of a hf_field
We can use this to change the type FT_BYTE when we realize that the
object dissected is an array of bytes
Change-Id: I1f24ce834b6a5be0d933b1fdfd9a0baa88c3761a
Reviewed-on: https://code.wireshark.org/review/5093
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index d4ffee3808..75f361aa05 100644 --- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -1183,6 +1183,23 @@ sub register_hf_field($$$$$$$$$) return $index; } +sub change_hf_field_type($$$$) +{ + my ($self,$index,$ft_type,$base_type) = @_; + if (defined ($self->{conformance}->{hf_renames}->{$index})) { + print "Field $index has been renamed to ".$self->{conformance}->{hf_renames}->{$index}->{NEWNAME}." you can't change it's type"; + return 0; + } + + if (!defined ($self->{conformance}->{header_fields}->{$index})) { + print "Field $index doesn't exists"; + return 0; + } + $self->{conformance}->{header_fields}->{$index}->{FT_TYPE} = $ft_type; + $self->{conformance}->{header_fields}->{$index}->{BASE_TYPE} = $base_type; + return 1; +} + sub DumpHfDeclaration($) { my ($self) = @_; |