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-v120.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-v120.c')
-rw-r--r-- | packet-v120.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packet-v120.c b/packet-v120.c index 5862a67579..8a14de4c94 100644 --- a/packet-v120.c +++ b/packet-v120.c @@ -2,7 +2,7 @@ * Routines for v120 frame disassembly * Bert Driehuis <driehuis@playbeing.org> * - * $Id: packet-v120.c,v 1.6 2000/05/11 08:15:54 gram Exp $ + * $Id: packet-v120.c,v 1.7 2000/05/18 09:05:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -36,6 +36,7 @@ #include <glib.h> #include <string.h> #include "packet.h" +#include "packet-v120.h" #include "xdlc.h" #define FROM_DCE 0x80 @@ -53,7 +54,8 @@ static gint ett_v120_header = -1; static int dissect_v120_header(const u_char *pd, int offset, frame_data *fd, proto_tree *tree); void -dissect_v120(const u_char *pd, frame_data *fd, proto_tree *tree) +dissect_v120(const union pseudo_header *pseudo_header, const u_char *pd, + frame_data *fd, proto_tree *tree) { proto_tree *v120_tree, *ti, *tc, *address_tree; int is_response; @@ -77,7 +79,7 @@ dissect_v120(const u_char *pd, frame_data *fd, proto_tree *tree) return; } - if (fd->pseudo_header.x25.flags & FROM_DCE) { + if (pseudo_header->x25.flags & FROM_DCE) { if(check_col(fd, COL_RES_DL_DST)) col_add_str(fd, COL_RES_DL_DST, "DTE"); if(check_col(fd, COL_RES_DL_SRC)) @@ -90,8 +92,8 @@ dissect_v120(const u_char *pd, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_RES_DL_SRC, "DTE"); } - if (((fd->pseudo_header.x25.flags & FROM_DCE) && pd[0] & 0x02) || - (!(fd->pseudo_header.x25.flags & FROM_DCE) && !(pd[0] & 0x02))) + if (((pseudo_header->x25.flags & FROM_DCE) && pd[0] & 0x02) || + (!(pseudo_header->x25.flags & FROM_DCE) && !(pd[0] & 0x02))) is_response = TRUE; else is_response = FALSE; |