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 /editcap.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 'editcap.c')
-rw-r--r-- | editcap.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,7 +1,7 @@ /* Edit capture files. We can delete records, or simply convert from one * format to another format. * - * $Id: editcap.c,v 1.9 2000/04/27 00:31:23 guy Exp $ + * $Id: editcap.c,v 1.10 2000/05/18 09:05:29 guy Exp $ * * Originally written by Richard Sharpe. * Improved by Guy Harris. @@ -130,7 +130,7 @@ typedef struct { static void edit_callback(u_char *user, const struct wtap_pkthdr *phdr, int offset, - const u_char *buf) + union pseudo_header *pseudo_header, const u_char *buf) { callback_arg *argp = (callback_arg *)user; int err; @@ -151,7 +151,7 @@ edit_callback(u_char *user, const struct wtap_pkthdr *phdr, int offset, phdr = &snap_phdr; } - if (!wtap_dump(argp->pdh, phdr, buf, &err)) { + if (!wtap_dump(argp->pdh, phdr, pseudo_header, buf, &err)) { fprintf(stderr, "editcap: Error writing to %s: %s\n", argp->filename, wtap_strerror(err)); @@ -271,7 +271,7 @@ int main(int argc, char *argv[]) } - wth = wtap_open_offline(argv[optind], &err); + wth = wtap_open_offline(argv[optind], &err, FALSE); if (!wth) { |