Hi
----- Original Message -----
From: "Guy Harris"
To: "Ronnie Sahlberg"
Sent: Tuesday, April 03, 2001 4:41 PM
Subject: Re: [Ethereal-dev] IP defragment, enjoy, please consider this for
cvs
> On Tue, Apr 03, 2001 at 12:00:19AM +1000, Ronnie Sahlberg wrote:
> > new patch for ethereal to add virtual packets, and defragmented ip
packets
> > to ethereal.
>
> It needs to be updated for Ed Warnicke's changes in the current CVS
> tree; you should probably do your development using anonymous CVS if
> possible or, if that's not possible, use the nightly snapshots of the
> anonymous CVS tree. See
Will do and resubmit.
>
> http://www.ethereal.com/development.html
>
> for information on anonymous CVS access, and links to the snapshots.
>
> For example, the patch to "epan/packet.h" needs to be applied to
> "epan/frame_data.h" instead.
>
> That particular patch, however, raises the question "why is the
> 'new_frame' flag the patch adds different from the 'visited' flag that's
> already there?" - or, rather, why is "new_frame" anything other than the
> negatiion of "visited"?
visited gets reset when you do (memory, dont have the source in front of me
now)
rescan_packets().
I only want the packets to be processed once, when reading the capture file
the first
time or when capturing from the interface.
visited and new_frame behaves differently in rescan_packets() which is why
I added new_frame.
>
> You would also need to change some files to include "wiretap/wtap.h", as
> the "frame_data" structure now has a "wtap *" as a member.
>
> > Perhaps someone who knows how the widgetset works can add a button
somewhere
> > in the gui to toggle this behaviour on/off?
> > Perhaps also a cmd-line switch?
>
> You shouldn't - and don't have to - do anything whatsoever with the
> widget set to do that; you merely have to add a preference item in the
> dissector. This adds an additional item in the "IP" tab of the
> "Edit->Preferences" dialog box, and also allows you to specify it on the
> command line with the "-o" flag. See the attached patch to
> "packet-ip.c".
Will look at it, thanks.
>
> However, if I then enable the "Reassemble fragmented datagrams" the new
> preference item adds, and click "Apply" in the dialog box, it doesn't
> reassemble anything - it just shows the first fragment as a fragment
> rather than an Echo or Echo Reply packet.
>
> If, however, I save the preferences, and then restart Ethereal, it does
> reassemble the frames in question. Both of them, however, should work.
Right now, defragmentation only occurs when initially reading the file.
I will have a look at if I can make it reflect run-time changes as you
observed.
This might need to add memory-cleanup and a new defragmentation phase when
doing
rescan_packets() (thus making my new_frame obsolete).
This would excersise the malloc()/free() and might affect runtime behaviour.
Ill test it to see how it works.
stay tuned.
>
> I tried modifying the places where "flags.visited" is cleared, when the
> packets are rescanned and re-dissected, to set "flags.new_frame", but
> that didn't seem to help. I've attached the patch to do that, in
> "file.c", as well.
>
>
Would probably not work.
If the potential perfoirmance degradation is acceptable, Ill get it to
defragment also
for rescan_packets() and remove new_fragment.