Author: metze Date: 2005-09-09 19:21:26 +0000 (Fri, 09 Sep 2005) New Revision: 10128
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10128 Log: [EMAIL PROTECTED] (orig r10123): jelmer | 2005-09-09 20:21:59 +0200 Add more warnings. Support quotes in conformance command arguments [EMAIL PROTECTED] (orig r10126): metze | 2005-09-09 21:08:36 +0200 WREPL_REPL_UPDATE also takes a wrepl_table metze Modified: branches/tmp/samba4-winsrepl/ branches/tmp/samba4-winsrepl/source/librpc/idl/winsrepl.idl branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Util.pm Changeset: Property changes on: branches/tmp/samba4-winsrepl ___________________________________________________________________ Name: svk:merge - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10116 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495 a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627 + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10126 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495 a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627 Modified: branches/tmp/samba4-winsrepl/source/librpc/idl/winsrepl.idl =================================================================== --- branches/tmp/samba4-winsrepl/source/librpc/idl/winsrepl.idl 2005-09-09 19:09:42 UTC (rev 10127) +++ branches/tmp/samba4-winsrepl/source/librpc/idl/winsrepl.idl 2005-09-09 19:21:26 UTC (rev 10128) @@ -78,7 +78,7 @@ [case(WREPL_REPL_TABLE_REPLY)] wrepl_table table; [case(WREPL_REPL_SEND_REQUEST)] wrepl_wins_owner owner; [case(WREPL_REPL_SEND_REPLY)] wrepl_send_reply reply; - [case(WREPL_REPL_UPDATE)] ; + [case(WREPL_REPL_UPDATE)] wrepl_table table; [case(WREPL_REPL_5)] wrepl_table table; [case(WREPL_REPL_INFORM)] wrepl_table table; [case(WREPL_REPL_9)] wrepl_table table; Modified: branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm =================================================================== --- branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm 2005-09-09 19:09:42 UTC (rev 10127) +++ branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/Conformance.pm 2005-09-09 19:21:26 UTC (rev 10128) @@ -31,7 +31,7 @@ print "$pos: warning: invalid FT_TYPE `$ft_type'\n"; } - unless(alid_base_type($base_type)) { + unless (valid_base_type($base_type)) { print "$pos: warning: invalid BASE_TYPE `$base_type'\n"; } @@ -74,7 +74,12 @@ return; } - $data->{dissectorparams}->{$dissector_name} = $value; + $data->{dissectorparams}->{$dissector_name} = { + DISSECTOR => $dissector_name, + PARAM => $value, + POS => $pos, + USED => 0 + }; } sub valid_base_type($) @@ -158,7 +163,11 @@ { my ($pos,$data,$field,$desc) = @_; - $data->{fielddescription}->{$field} = $desc; + $data->{fielddescription}->{$field} = { + DESCRIPTION => $desc, + POS => $pos, + USED => 0 + }; } sub handle_import @@ -172,7 +181,12 @@ return; } - $data->{imports}->{$dissectorname} = join(' ', @_); + $data->{imports}->{$dissectorname} = { + NAME => $dissectorname, + DATA => join(' ', @_), + USED => 0, + POS => $pos + }; } my %field_handlers = ( Modified: branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm =================================================================== --- branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm 2005-09-09 19:09:42 UTC (rev 10127) +++ branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Ethereal/NDR.pm 2005-09-09 19:21:26 UTC (rev 10128) @@ -10,12 +10,11 @@ use strict; use Parse::Pidl::Typelist; -use Parse::Pidl::Util qw(has_property ParseExpr property_matches); +use Parse::Pidl::Util qw(has_property ParseExpr property_matches make_str); use Parse::Pidl::NDR; use Parse::Pidl::Dump qw(DumpTypedef DumpFunction); use Parse::Pidl::Ethereal::Conformance qw(ReadConformance); -my %types; my @ett; my %hf_used = (); @@ -238,7 +237,8 @@ my $param = 0; if (defined($conformance->{dissectorparams}->{$myname})) { - $param = $conformance->{dissectorparams}->{$myname}; + $conformance->{dissectorparams}->{$myname}->{PARAM} = 1; + $param = $conformance->{dissectorparams}->{$myname}->{PARAM}; } if ($l->{TYPE} eq "POINTER") { @@ -285,10 +285,12 @@ } else { my $call; - if (defined($types{$l->{DATA_TYPE}})) { - $call= $types{$l->{DATA_TYPE}}->{CALL}; - } elsif ($conformance->{imports}->{$l->{DATA_TYPE}}) { - $call = $conformance->{imports}->{$l->{DATA_TYPE}}; + if ($conformance->{imports}->{$l->{DATA_TYPE}}) { + $call = $conformance->{imports}->{$l->{DATA_TYPE}}->{DATA}; + $conformance->{imports}->{$l->{DATA_TYPE}}->{USED} = 1; + } elsif (defined($conformance->{types}->{$l->{DATA_TYPE}})) { + $call= $conformance->{types}->{$l->{DATA_TYPE}}->{DISSECTOR_NAME}; + $conformance->{types}->{$l->{DATA_TYPE}}->{USED} = 1; } else { if ($l->{DATA_TYPE} =~ /^([a-z]+)\_(.*)$/) { @@ -557,7 +559,7 @@ # These can be changed to non-pidl_code names if the old dissectors # in epan/dissctors are deleted. - my $name = "\"" . uc($x->{NAME}) . " (pidl)\""; + my $name = uc($x->{NAME}) . " (pidl)"; my $short_name = uc($x->{NAME}); my $filter_name = $x->{NAME}; @@ -571,7 +573,7 @@ $filter_name = $conformance->{protocols}->{$x->{NAME}}->{FILTERNAME}; } - pidl_code "proto_dcerpc_$x->{NAME} = proto_register_protocol($name, \"$short_name\", \"$filter_name\");"; + pidl_code "proto_dcerpc_$x->{NAME} = proto_register_protocol(".make_str($name).", ".make_str($short_name).", ".make_str($filter_name).");"; pidl_code "proto_register_field_array(proto_dcerpc_$x->{NAME}, hf, array_length (hf));"; pidl_code "proto_register_subtree_array(ett, array_length(ett));"; @@ -674,14 +676,14 @@ { my ($type,$call,$ft,$base,$mask,$vals,$length) = @_; - $types{$type} = { - TYPE => $type, - CALL => $call, + $conformance->{types}->{$type} = { + NAME => $type, + DISSECTOR_NAME => $call, FT_TYPE => $ft, - BASE => $base, + BASE_TYPE => $base, MASK => $mask, VALSSTRING => $vals, - LENGTH => $length + ALIGNMENT => $length }; } @@ -854,7 +856,8 @@ if ((not defined($blurb) or $blurb eq "") and defined($conformance->{fielddescription}->{$index})) { $conformance->{header_fields}->{$index}->{BLURB} = - $conformance->{fielddescription}->{$index}; + $conformance->{fielddescription}->{$index}->{DESCRIPTION}; + $conformance->{fielddescription}->{$index}->{USED} = 1; } return $index; @@ -881,7 +884,7 @@ foreach (values %{$conformance->{header_fields}}) { $res .= "\t{ &$_->{INDEX}, - { \"$_->{NAME}\", \"$_->{FILTER}\", $_->{FT_TYPE}, $_->{BASE_TYPE}, $_->{VALSSTRING}, $_->{MASK}, \"$_->{BLURB}\", HFILL }}, + { ".make_str($_->{NAME}).", ".make_str($_->{FILTER}).", $_->{FT_TYPE}, $_->{BASE_TYPE}, $_->{VALSSTRING}, $_->{MASK}, ".make_str($_->{BLURB}).", HFILL }}, "; } @@ -925,12 +928,29 @@ } } - #FIXME: PARAM_VALUE's - #FIXME: TYPE - #FIXME: FIELDDESCRIPTION - #FIXME: Import -} + foreach (values %{$conformance->{dissectorparams}}) { + if (not $_->{USED}) { + print "$_->{POS}: warning: dissector param never used\n"; + } + } + foreach (values %{$conformance->{imports}}) { + if (not $_->{USED}) { + print "$_->{POS}: warning: import never used\n"; + } + } + foreach (values %{$conformance->{types}}) { + if (not $_->{USED} and defined($_->{POS})) { + print "$_->{POS}: warning: type never used\n"; + } + } + foreach (values %{$conformance->{fielddescription}}) { + if (not $_->{USED}) { + print "$_->{POS}: warning: description never used\n"; + } + } +} + 1; Modified: branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Util.pm =================================================================== --- branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Util.pm 2005-09-09 19:09:42 UTC (rev 10127) +++ branches/tmp/samba4-winsrepl/source/pidl/lib/Parse/Pidl/Util.pm 2005-09-09 19:21:26 UTC (rev 10128) @@ -6,7 +6,7 @@ require Exporter; @ISA = qw(Exporter); [EMAIL PROTECTED] = qw(has_property property_matches ParseExpr is_constant); [EMAIL PROTECTED] = qw(has_property property_matches ParseExpr is_constant make_str); use strict;