Ethereal-dev: Re: [Ethereal-dev] BER implicit_tag

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: ronnie sahlberg <ronniesahlberg@xxxxxxxxx>
Date: Mon, 31 Jan 2005 11:07:23 +1100
My approach should be functionally equivalent.

old approach when implicit_tag==TRUE
   read   tag and length,   ignore tag but use length to know how long
the field is.
my approach when implicit_tag==TRUE
   tag and length have already been stripped off by the parent dissector,
   use tvb_length_remaining() to find the length of the field.


i had to do it that way to get cmip to behave.




On Wed, 26 Jan 2005 07:28:38 +0100, Tomas Kukosa
<tomas.kukosa@xxxxxxxxxxx> wrote:
> My idea concerning implicit tags used in the asn2eth compiler and my dissectors is little
> bit different.
> 
> If implicit tag ocurs it is checked in the 'parent structure' and it is not cut but
> passesd to the 'field decoder' with implicit_tag=TRUE.
> And the 'field decoder' does not check tag value but can use all information about length
> etc. Event it can pass that tag into the next subdecoder if nested.
> 
> Which constructs for CMIP could make problem with that approach?
> Could you send me an exmaple?
> 
> Regards,
>    Tom
> 
> 
> ronnie sahlberg wrote:
> 
> > the idea was to make some CMIP stuff decode properly.
> >
> > the idea is that IF implitic_tag is set, then the identifier and
> > length is not checked at all
> > instead it is assume the value spans until the end of the tvb,   some
> > cases therefore need, to create a new sub tvb  that only spans the
> > length.
> >
> > i.e.    CHOICE {
> >           [1] IMPLICIT integer foo;
> >
> > then the identifier and length is read in the coice dissector,   and
> > since it was IMPLICIT
> > it creates a new tvb only containing as much data as length indicated.
> > then it calls the subdissector for integer/foo    since implicit_tag
> > is now set   instead of reading the identifier/length  it assumes the
> > length is  tvb_length_remaining()
> >
> >
> > it was the best i could come up with to handle some of the constructs for CMIP.
> >
> > If you have a better approach, please have a go at it.
> > I can provide the cmip captures i had problems with for you to test with.
> >
> >
> >
> >
> > On Tue, 25 Jan 2005 16:00:32 +0100, Tomas Kukosa
> > <tomas.kukosa@xxxxxxxxxxx> wrote:
> >
> >>Hi Ronnie,
> >>   I have found with delay that some my dissectors does not work properly.
> >>The reason is different behaviour of dissect_ber_sequence() if implicit_tag is TRUE.
> >>
> >>What was your idea concernig implicit tag?
> >>My original idea was that BER identifier and length is decoded for implicit tag too but
> >>the tag is not checked.
> >>But after your changes BER identifier and length is not decoded anymore for implicit tag.
> >>
> >>Could we clarify it?
> >>
> >>Regards,
> >>   Tom
> >>
> >>_______________________________________________
> >>Ethereal-dev mailing list
> >>Ethereal-dev@xxxxxxxxxxxx
> >>http://www.ethereal.com/mailman/listinfo/ethereal-dev
> >>
> >
> > 
> > _______________________________________________
> > Ethereal-dev mailing list
> > Ethereal-dev@xxxxxxxxxxxx
> > http://www.ethereal.com/mailman/listinfo/ethereal-dev
> >
> 
> --
> _________________________________________________
> 
> ANF DATA              ANF DATA spol. s r. o.
> a SIEMENS Company     MediaHall, Bidláky 20
>                        639 00 Brno
>                        Czech Republic
> Tomáš Kukosa          Tel.: +420 - 533 337 227
> PSE ECT PSS 2         Fax : +420 - 533 337 252
> Room: 2.64            mailto:tomas.kukosa@xxxxxxxxxxx
> _________________________________________________
> 
>