Support ETT_FIELD keyword.
authorJulien Kerihuel <j.kerihuel@openchange.org>
Wed, 13 Feb 2008 01:24:11 +0000 (02:24 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 13 Feb 2008 01:24:11 +0000 (02:24 +0100)
(This used to be commit ec8bd3991f76cf8746cf77c277c3491725711f9d)

source4/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index b53c56e7419f00a13afbacf794eb93fabfc77ab0..a240bbf9cdaef833cd4d7b888c1918ae93449563 100644 (file)
@@ -52,6 +52,10 @@ use old_hf_name.
 This can be used in conjunction with HF_FIELD in order to make more than 
 one element use the same filter name.
 
+=item I<ETT_FIELD> ett
+
+Register a custom ett field
+
 =item I<STRIP_PREFIX> prefix
 
 Remove the specified prefix from all function names (if present).
@@ -313,6 +317,20 @@ sub handle_import
        };
 }
 
+sub handle_ett_field
+{
+       my $pos = shift @_;
+       my $data = shift @_;
+       my $ett = shift @_;
+
+       unless(defined($ett)) {
+               error($pos, "incomplete ETT_FIELD command");
+               return;
+       };
+
+       push (@{$data->{ett}}, $ett);
+}
+
 my %field_handlers = (
        TYPE => \&handle_type,
        NOEMIT => \&handle_noemit, 
@@ -320,6 +338,7 @@ my %field_handlers = (
        PARAM_VALUE => \&handle_param_value, 
        HF_FIELD => \&handle_hf_field, 
        HF_RENAME => \&handle_hf_rename, 
+       ETT_FIELD => \&handle_ett_field,
        TFS => \&handle_tfs,
        STRIP_PREFIX => \&handle_strip_prefix,
        PROTOCOL => \&handle_protocol,
index ffe104c9418ae950bf0f149392ab6928398a420c..8846b740ab745fc2922122456093690108a893d0 100644 (file)
@@ -940,6 +940,10 @@ sub Parse($$$$$)
        $self->{res}->{headers} .= "#include \"$h_basename\"\n";
        $self->pidl_code("");
 
+       if (defined($self->{conformance}->{ett})) {
+               register_ett($self,$_) foreach(@{$self->{conformance}->{ett}})
+       }
+
        # Wireshark protocol registration
 
        foreach (@$ndr) {