aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-20 00:13:37 -0800
committerGuy Harris <gharris@sonic.net>2021-02-20 01:36:26 -0800
commit1f595c435c1476a24e2b443a768185ac2503087a (patch)
treed608bd80e5b357c5b11270089629dec883aabc5f /wiretap/wtap.c
parentc80c16759ba23e29c70ec8fbe62e0a9870685a66 (diff)
BER: get rid of WTAP_FILE_TYPE_SUBTYPE_BER.
Save a copy of the pathname used to open a file in the wtap structure. This allows the BER file reader to put a pointer to it in the pseudo-header; it also would allow file readers to attempt to read "associated" files that have the same name as the file, but with a different extension. Instead of having cf_open() special-case BER files, and calling a routine in the BER dissector to specify the file name to the dissector, have separate dissectors for "dissect packet payload as BER" and "dissect a file as BER", and have the latter get the pathname of the file from the pseudo-header and determine the ASN.1 syntax from that. (Side-effect - this means that you can now dissect a BER file, and have the syntax be determined by the file extension, in TShark as well; the above cf_open() special-casing was *not* done in TShark, so it didn't work before. Now the application code doesn't need to do any of that, so it works in TShark as well as Wireshark.)
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index f1d8868bf7..26dab87158 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1441,6 +1441,8 @@ wtap_close(wtap *wth)
g_free(wth->priv);
+ g_free(wth->pathname);
+
if (wth->fast_seek != NULL) {
g_ptr_array_foreach(wth->fast_seek, g_fast_seek_item_free, NULL);
g_ptr_array_free(wth->fast_seek, TRUE);