aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pidl
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2007-03-29 07:49:48 +0000
committerJörg Mayer <jmayer@loplof.de>2007-03-29 07:49:48 +0000
commit503f881f508939b1fff0435cde5b031b32542580 (patch)
tree1f8ff815c3f5739f7714b5c46ca9421ed0f0c327 /tools/pidl
parentcee590823d58a928ae3470c2a4efc5629ff7825a (diff)
Update from samba tree revision 21970 to 22006
============================ Samba log start ============ ------------------------------------------------------------------------ r21995 | jelmer | 2007-03-28 01:04:08 +0200 (Wed, 28 Mar 2007) | 5 lines Changed paths: M /branches/SAMBA_4_0 M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm Patch from Ronnie Sahlberg. Change the signatures for all functions it generates to specify _U_ so that GCC "parameter not used" warnings are suppressed. ------------------------------------------------------------------------ r21996 | jelmer | 2007-03-28 01:22:41 +0200 (Wed, 28 Mar 2007) | 4 lines Changed paths: M /branches/SAMBA_4_0 M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm Fix a bug for invalid casts of pointers. Patch by Ronnie Sahlberg. ------------------------------------------------------------------------ r22004 | jelmer | 2007-03-29 00:52:37 +0200 (Thu, 29 Mar 2007) | 4 lines Changed paths: M /branches/SAMBA_4_0 M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm Check for dereferencing null pointers. Patch by Ronnie Sahlberg. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=21268
Diffstat (limited to 'tools/pidl')
-rw-r--r--tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm35
1 files changed, 23 insertions, 12 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 3c38801fae..51e3933013 100644
--- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -146,7 +146,7 @@ sub Enum($$$)
}
pidl_hdr "extern const value_string $valsstring\[];";
- pidl_hdr "int $dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 *param);";
+ pidl_hdr "int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_);";
pidl_def "const value_string ".$valsstring."[] = {";
foreach (@{$e->{ELEMENTS}}) {
@@ -159,10 +159,21 @@ sub Enum($$$)
pidl_fn_start $dissectorname;
pidl_code "int";
- pidl_code "$dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 *param)";
+ pidl_code "$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)";
pidl_code "{";
indent;
- pidl_code "offset = dissect_ndr_$e->{BASE_TYPE}(tvb, offset, pinfo, tree, drep, hf_index, param);";
+ pidl_code "g$e->{BASE_TYPE} parameter=0;";
+ pidl_code "if(param){";
+ indent;
+ pidl_code "parameter=(g$e->{BASE_TYPE})*param;";
+ deindent;
+ pidl_code "}";
+ pidl_code "offset = dissect_ndr_$e->{BASE_TYPE}(tvb, offset, pinfo, tree, drep, hf_index, &parameter);";
+ pidl_code "if(param){";
+ indent;
+ pidl_code "*param=(guint32)parameter;";
+ deindent;
+ pidl_code "}";
pidl_code "return offset;";
deindent;
pidl_code "}\n";
@@ -180,11 +191,11 @@ sub Bitmap($$$)
register_ett("ett_$ifname\_$name");
- pidl_hdr "int $dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hf_index, guint32 param);";
+ pidl_hdr "int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_);";
pidl_fn_start $dissectorname;
pidl_code "int";
- pidl_code "$dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)";
+ pidl_code "$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)";
pidl_code "{";
indent;
pidl_code "proto_item *item = NULL;";
@@ -390,10 +401,10 @@ sub Element($$$)
foreach (@{$e->{LEVELS}}) {
next if ($_->{TYPE} eq "SWITCH");
- pidl_def "static int $dissectorname$add(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep);";
+ pidl_def "static int $dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);";
pidl_fn_start "$dissectorname$add";
pidl_code "static int";
- pidl_code "$dissectorname$add(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep)";
+ pidl_code "$dissectorname$add(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)";
pidl_code "{";
indent;
@@ -427,7 +438,7 @@ sub Function($$$)
PrintIdl DumpFunction($fn->{ORIGINAL});
pidl_fn_start "$ifname\_dissect\_$fn_name\_response";
pidl_code "static int";
- pidl_code "$ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo, proto_tree *tree _U_, guint8 *drep _U_)";
+ pidl_code "$ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)";
pidl_code "{";
indent;
if ( not defined($fn->{RETURN_TYPE})) {
@@ -492,7 +503,7 @@ sub Function($$$)
pidl_fn_start "$ifname\_dissect\_$fn_name\_request";
pidl_code "static int";
- pidl_code "$ifname\_dissect\_${fn_name}_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo, proto_tree *tree _U_, guint8 *drep _U_)";
+ pidl_code "$ifname\_dissect\_${fn_name}_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)";
pidl_code "{";
indent;
pidl_code "pinfo->dcerpc_procedure_name=\"${fn_name}\";";
@@ -522,11 +533,11 @@ sub Struct($$$)
my $res = "";
($res.="\t".Element($_, $name, $ifname)."\n\n") foreach (@{$e->{ELEMENTS}});
- pidl_hdr "int $dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_);";
+ pidl_hdr "int $dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_);";
pidl_fn_start $dissectorname;
pidl_code "int";
- pidl_code "$dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)";
+ pidl_code "$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)";
pidl_code "{";
indent;
pidl_code "proto_item *item = NULL;";
@@ -591,7 +602,7 @@ sub Union($$$)
pidl_fn_start $dissectorname;
pidl_code "static int";
- pidl_code "$dissectorname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, int hf_index, guint32 param _U_)";
+ pidl_code "$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)";
pidl_code "{";
indent;
pidl_code "proto_item *item = NULL;";