Ethereal-dev: RE: [Ethereal-dev] VJ compressed PPP packets ??

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

From: Jeff Foster <jfoste@xxxxxxxxxxxx>
Date: Tue, 27 Feb 2001 10:29:22 -0600
> > Ethereal has a dissector for PPP which is dissect_ppp( ).
> > However, this dissector does not handle VJ (i.e Van Jacobson)
> > compressed packets as of now.
> > 
> > So we are in the stage of adding this capability.
> > 
> > Our algorithm for uncompressing expands the data pointer passed to it.
> > (uses memove( ) on "data_ptr" for that)
> > e.g: vj_uncompress(char *data_ptr);
> 
> ....
> 
> > 3) Is there any other elegant solution?
> 
> I have some preliminary code to add tabbed pages to the
> hex dump. I need this to display data that is compressed
> during transmission and is decompressed by the dissector.
> The code works but has some problems that I have to work
> through.  I started an email yesterday to describe the
> system so others can review it. I will try to send the
> email out today.
> 
> Just hang on... help is on the way.


I rushed this to get it out today, so I may be missing some stuff..

Have a working implementation for the tabbed hex windows.  I just want
to describe it so people on the list can pick it apart before I submit
it.  


Overview-

The byte view window is changed to a gtk_notebook and the individual
hex dump windows are tabbed entries in the notebook.  The dissector
that needs to create a second (third,fourth,..) view will call a function
add_byte_tab with the tab label, data pointer, and data length.  This
function will return an index number for the new byte view. This permits
the dissector to create a new hex display window and set the data to
be displayed in the window. The dissector is responsible for management
of the secondary data array.  It can NOT be a local variable.

A byte view variable is added to the field_info structure so the correct
hex display window is selected when the protocol display tree item is 
selected. The return value from add_byte_tab is loaded into this variable
during the protocol tree generation. The actual value loaded into the
field_info structure comes from a global variable in the proto.c file.
A dissector can set this value with an accessor routine.  


Dirty details -

1) The field_info structure changed to add a bv_num. This is an integer 
   that is used to select which hex window tab to use.

2) Static integer current_bv_num added to epan/proto.c.  There are two
   routines set_bv_num and get_bv_num used to access this value.

   current_bv_num is reset to zero in the epan_dissect_new routine.

3) The proto_tree_add_item modified to set the new_fi->bv_num to the
   current_bv_num value.

4) The create_byte_view routine modified to create a notebook and 
   the first tabbed window. The tabs are not displayed at this point.

5) A add_byte_view routine added to gtk/proto_draw.c.  This routine
   will create an additional tabbed window in the byte view notebook 
   and return the index for this window.  In addition the routine
   will store the data pointer and data length in the new tab window
   object.  These are used during the packet_hex_print calls.

6) The packet_hex_print routine is modified to accept a data length
   value.  This is used in place of fd->cap_len in the current routine.

7) The tree_view_select_row_cb (gtk/main.c) is changed to select the
   correct byte view table before calling the packet_hex_print.  

8) The packet_unselect_list_cb will destroy the secondary byte views.
   Still working on this...
   
The "packet window" code, will have to perform steps 7 and 8, still
working on this...


ToDo -

1) How will this affect tethereal?  How will we display the extra byte
   view data?  

   I think it can be modified to display the "tab label" and generate
   the hex dump for each byte view.

2) How will this affect printing in ethereal? 

   Don't have this figured out...



Jeff Foster 
jfoste@xxxxxxxxxxxx