aboutsummaryrefslogtreecommitdiffstats
path: root/ui/text_import.h
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2021-12-30 10:28:08 -0500
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-12-30 17:05:06 +0000
commit42084c2d17151c3bda063c1e2de2dbd49c2cb8ae (patch)
tree502a12c54bfa6ac9a2d91d054f82a57e97a396ae /ui/text_import.h
parent6c9cb8f3faf33bdbbf848397e14257eb35accfc2 (diff)
text2pcap: Move SHB and IDB setup to ui/text_import
Move the parameter setup to text_import, so that later it can be called from the GUI, including the interface name. (This has to be a separate function because these parameters need to be set before the call to wtap_dump_open, which is different for regular files vs temp files vs stdout.)
Diffstat (limited to 'ui/text_import.h')
-rw-r--r--ui/text_import.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/text_import.h b/ui/text_import.h
index 7e68fad2ca..dae7db987e 100644
--- a/ui/text_import.h
+++ b/ui/text_import.h
@@ -118,6 +118,17 @@ typedef struct
int text_import(text_import_info_t * const info);
+/* Write the SHB and IDB to the wtap_dump_params before opening the wtap dump
+ * file. While dummy headers can be written automatically, this writes out
+ * some extra information including an optional interface name.
+ *
+ * NOTE: The caller will be responsible for freeing params->idb_inf after
+ * finished with the wtap_dumper to avoid a memory leak. wtap_dump_close
+ * does not free it.
+ */
+int
+text_import_pre_open(wtap_dump_params * const params, int file_type_subtype, const char* const input_filename, const char* const interface_name);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */