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-lapb.c | |
parent | e7ea221d9c8370817a7b9c9dab3cea47586e1561 (diff) |
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-lapb.c')
-rw-r--r-- | packet-lapb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packet-lapb.c b/packet-lapb.c index 7ba2899318..e05ded16fc 100644 --- a/packet-lapb.c +++ b/packet-lapb.c @@ -2,7 +2,7 @@ * Routines for lapb frame disassembly * Olivier Abad <abad@daba.dhis.net> * - * $Id: packet-lapb.c,v 1.13 2000/05/11 08:15:18 gram Exp $ + * $Id: packet-lapb.c,v 1.14 2000/05/18 09:05:44 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-lapb.h" #include "packet-x25.h" #include "xdlc.h" @@ -49,7 +50,8 @@ static gint ett_lapb = -1; static gint ett_lapb_control = -1; void -dissect_lapb(const u_char *pd, frame_data *fd, proto_tree *tree) +dissect_lapb(const union pseudo_header *pseudo_header, const u_char *pd, + frame_data *fd, proto_tree *tree) { proto_tree *lapb_tree, *ti; int is_response; @@ -69,7 +71,7 @@ dissect_lapb(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)) @@ -82,8 +84,8 @@ dissect_lapb(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] == 0x01) || - (!(fd->pseudo_header.x25.flags & FROM_DCE) && pd[0] == 0x03)) + if (((pseudo_header->x25.flags & FROM_DCE) && pd[0] == 0x01) || + (!(pseudo_header->x25.flags & FROM_DCE) && pd[0] == 0x03)) is_response = TRUE; else is_response = FALSE; @@ -101,7 +103,7 @@ dissect_lapb(const u_char *pd, frame_data *fd, proto_tree *tree) ett_lapb_control, is_response, FALSE); /* not end of frame ==> X.25 */ - if (fd->cap_len > 2) dissect_x25(pd, 2, fd, tree); + if (fd->cap_len > 2) dissect_x25(pseudo_header, pd, 2, fd, tree); } void |