aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/pcap-common.h
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-23 01:18:31 -0800
committerGuy Harris <gharris@sonic.net>2021-02-23 21:56:20 +0000
commit166159f15d24cea75934b9e435e925254d141ae9 (patch)
treef95f098cb6d119d2e2481223bab2a1db449ec7ba /wiretap/pcap-common.h
parent3742f921b2e54373483df1e9e78b7421bd32bd69 (diff)
wiretap: eliminate the pcap/nspcap/pcapng WTAP_FILE_TYPE_SUBTYPE_ values.
Register the pcap and pcapng file types/subtypes rather than hardwiring them into the table. Call the registration routines for them directly, rather than through a generated table; they're always supposed to be there, as some code in Wireshark either writes only one of those formats or defaults to writing one of those formats. Don't run their source code through the registration-routine-finder script. Have the file type/subtype codes for them be directly exported to the libwiretap core, and provide routines to return each of them, to be used by the aforementioned code. When reporting errors with cfile_write_failure_message(), use wtap_dump_file_type_subtype() to get the file type/subtype value for the wtap_dumper to which we're writing, rather than hardcoding it. Have the "export PDU" code capable of supporting arbitrary file types/subtypes, although we currently only use pcapng. Get rid of declarations of now-static can_write_encap and dump_open routines in various headers.
Diffstat (limited to 'wiretap/pcap-common.h')
-rw-r--r--wiretap/pcap-common.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/wiretap/pcap-common.h b/wiretap/pcap-common.h
index fc79cacae8..323cb9c7b3 100644
--- a/wiretap/pcap-common.h
+++ b/wiretap/pcap-common.h
@@ -19,10 +19,11 @@
extern guint wtap_max_snaplen_for_encap(int wtap_encap);
-extern int pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
- guint packet_size, wtap_rec *rec, int *err, gchar **err_info);
+extern int pcap_process_pseudo_header(FILE_T fh, gboolean is_nokia,
+ int wtap_encap, guint packet_size, wtap_rec *rec,
+ int *err, gchar **err_info);
-extern void pcap_read_post_process(int file_type, int wtap_encap,
+extern void pcap_read_post_process(gboolean is_nokia, int wtap_encap,
wtap_rec *rec, guint8 *pd, gboolean bytes_swapped, int fcs_len);
extern int pcap_get_phdr_size(int encap,