Ethereal-dev: Re: [Ethereal-dev] Pls advise for supporting new Ascend/Lucent format

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

From: Motonori Shindo <mshindo@xxxxxxxxxxx>
Date: Tue, 04 Dec 2001 09:50:35 +0900 (JST)
Hi,

From: Motonori Shindo <mshindo@xxxxxxxxxxx>
Subject: Re: [Ethereal-dev] Pls advise for supporting new Ascend/Lucent format
Date: Sun, 02 Dec 2001 18:04:57 +0900 (JST)

> > >   [0000]: ff 03 c2 23 02 01 00 19  10 35 39 cd b5 84 9d 14
> > >   [0010]: 35 39 59
> >                                                             ^
> > Could you just truncate each line at the end of the hex dump
> > before parsing? ie at the position I indicated. This might not
> > be the most flexible way to do it (eg if the address at the
> > left grows too big it may push everything to the right), but workable.
> 
> I also came up with such an idea, but I just couldn't find an easy way
> to do that, because parser generated by yacc/bison automatically reads
> the line and parse it.

I've finally come up with an idea, such that a lexer now treats 4
consecutive white spaces as a token and if such a token is present,
the rest of any characters till end of line will be ignored by a
lexer. There will be no case where 4 consecutive white spaces appears
other than as a delimiter between hex dump and character display, so
this will work. (please see the example below).

                                                        4 spaces
                                                          <-->
  [0000]: ff 03 c2 23 02 01 00 19  10 35 39 cd b5 84 9d 14    ...#.... .59.....
  [0010]: 35 39                                               59


I admit that treating white spaces as a token is not a beautiful
solution but this looks the only way to support both old and new
format of Ascend/Lucent debug output.

As far as I tested, this new scheme works well for both formats.

If there's no objection, I will post a patch here shortly.

Regards,

=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
 +----+----+     
 |.. .|    |     Motonori Shindo
 |_~__|    |     
 | .. |~~_~|     Sr. Systems Engineer
 | .  |    |     CoSine Communications Inc.
 +----+----+     
 C o S i n e     e-mail:  mshindo@xxxxxxxxxxxxx 
Communications
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=