diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-18 09:09:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-18 09:09:50 +0000 |
commit | f3d90d30a49382db3955b9ece00d71fe12d54c49 (patch) | |
tree | b3976154972b7e5a4d8ee25e4c4f2f5bef77d2f0 /packet.c | |
parent | e7ea221d9c8370817a7b9c9dab3cea47586e1561 (diff) | |
download | wireshark-f3d90d30a49382db3955b9ece00d71fe12d54c49.tar.gz wireshark-f3d90d30a49382db3955b9ece00d71fe12d54c49.tar.bz2 wireshark-f3d90d30a49382db3955b9ece00d71fe12d54c49.zip |
Remove the "union pseudo_header" from the "frame_data" structure;
there's no need to keep it around in memory - when the frame data is
read in when handing a frame, read in the information, if any, necessary
to reconstruct the frame header, and reconstruct it. This saves some
memory.
This requires that the seek-and-read function be implemented inside
Wiretap, and that the Wiretap handle remain open even after we've
finished reading the file sequentially.
This also points out that we can't really do X.25-over-Ethernet
correctly, as we don't know where the direction (DTE->DCE or DCE->DTE)
flag is stored; it's not clear how the Ethernet type 0x0805 for X.25
Layer 3 is supposed to be handled in any case. We eliminate
X.25-over-Ethernet support (until we find out what we're supposed to
do).
svn path=/trunk/; revision=1975
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.84 2000/05/16 06:21:33 gram Exp $ + * $Id: packet.c,v 1.85 2000/05/18 09:05:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1120,7 +1120,8 @@ init_all_protocols(void) /* this routine checks the frame type from the cf structure */ void -dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) +dissect_packet(union pseudo_header *pseudo_header, const u_char *pd, + frame_data *fd, proto_tree *tree) { proto_tree *fh_tree; proto_item *ti; @@ -1192,7 +1193,7 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) dissect_ppp(pd, 0, fd, tree); break; case WTAP_ENCAP_LAPB : - dissect_lapb(pd, fd, tree); + dissect_lapb(pseudo_header, pd, fd, tree); break; case WTAP_ENCAP_RAW_IP : dissect_raw(pd, fd, tree); @@ -1201,16 +1202,16 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) dissect_clip(pd, fd, tree); break; case WTAP_ENCAP_ATM_SNIFFER : - dissect_atm(pd, fd, tree); + dissect_atm(pseudo_header, pd, fd, tree); break; case WTAP_ENCAP_ASCEND : - dissect_ascend(tvb, &pi, tree); + dissect_ascend(tvb, pseudo_header, &pi, tree); break; case WTAP_ENCAP_LAPD : - dissect_lapd(pd, fd, tree); + dissect_lapd(pseudo_header, pd, fd, tree); break; case WTAP_ENCAP_V120 : - dissect_v120(pd, fd, tree); + dissect_v120(pseudo_header, pd, fd, tree); break; } } |