aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.h
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-14 00:34:10 -0800
committerGuy Harris <gharris@sonic.net>2021-02-14 00:58:46 -0800
commitb8b3531883db249be80e217154c7e7fffb86f5bd (patch)
treebecde2c028097baae1b38d8c13b4a9827d0de8b0 /wiretap/wtap.h
parent5b3c3d0682c869e6dd19a5245b1a22c90192e9ae (diff)
wiretap: register most built-in file types from its module.
Remove most of the built-in file types from the table in wiretap/file_access.c and, instead, have the file types register themselves, using wtap_register_file_type_subtypes(). This reduces the source code changes needed to add a new file type from three (add the handler, add the file type to the table in file_access.c, add a #define for the file type in wiretap/wtap.h) to one (add the handler). (It also requires adding the handler's source file to wiretap/CMakeLists.txt, but that's required in both cases.) A few remain because the WTAP_FILE_TYPE_SUBTYPE_ #define is used elsewhere; that needs to be fixed. Fix the wiretap/CMakefile.txt file to scan k12text.l, as that now contains a registration routine. In the process, avoid scanning files that don't implement a file type and won't ever have a registration routine. Add a Lua routine to fetch the total number of file types; we use that in some code to construct the wtap_filetypes table, which we need to do in order to continue to have all the values that used to come from the WTAP_FILE_TYPE_SUBTYPE_ types. While we're at it, add modelines to a file that lacked them.
Diffstat (limited to 'wiretap/wtap.h')
-rw-r--r--wiretap/wtap.h83
1 files changed, 5 insertions, 78 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 7e3b0d076c..b9ea9bc944 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -309,84 +309,11 @@ extern "C" {
#define WTAP_FILE_TYPE_SUBTYPE_PCAP_NOKIA 6
#define WTAP_FILE_TYPE_SUBTYPE_PCAP_SS990417 7
#define WTAP_FILE_TYPE_SUBTYPE_PCAP_SS990915 8
-#define WTAP_FILE_TYPE_SUBTYPE_5VIEWS 9
-#define WTAP_FILE_TYPE_SUBTYPE_IPTRACE_1_0 10
-#define WTAP_FILE_TYPE_SUBTYPE_IPTRACE_2_0 11
-#define WTAP_FILE_TYPE_SUBTYPE_BER 12
-#define WTAP_FILE_TYPE_SUBTYPE_HCIDUMP 13
-#define WTAP_FILE_TYPE_SUBTYPE_CATAPULT_DCT2000 14
-#define WTAP_FILE_TYPE_SUBTYPE_NETXRAY_OLD 15
-#define WTAP_FILE_TYPE_SUBTYPE_NETXRAY_1_0 16
-#define WTAP_FILE_TYPE_SUBTYPE_COSINE 17
-#define WTAP_FILE_TYPE_SUBTYPE_CSIDS 18
-#define WTAP_FILE_TYPE_SUBTYPE_DBS_ETHERWATCH 19
-#define WTAP_FILE_TYPE_SUBTYPE_ERF 20
-#define WTAP_FILE_TYPE_SUBTYPE_EYESDN 21
-#define WTAP_FILE_TYPE_SUBTYPE_NETTL 22
-#define WTAP_FILE_TYPE_SUBTYPE_ISERIES 23
-#define WTAP_FILE_TYPE_SUBTYPE_ISERIES_UNICODE 24
-#define WTAP_FILE_TYPE_SUBTYPE_I4BTRACE 25
-#define WTAP_FILE_TYPE_SUBTYPE_ASCEND 26
-#define WTAP_FILE_TYPE_SUBTYPE_NETMON_1_x 27
-#define WTAP_FILE_TYPE_SUBTYPE_NETMON_2_x 28
-#define WTAP_FILE_TYPE_SUBTYPE_NGSNIFFER_UNCOMPRESSED 29
-#define WTAP_FILE_TYPE_SUBTYPE_NGSNIFFER_COMPRESSED 30
-#define WTAP_FILE_TYPE_SUBTYPE_NETXRAY_1_1 31
-#define WTAP_FILE_TYPE_SUBTYPE_NETXRAY_2_00x 32
-#define WTAP_FILE_TYPE_SUBTYPE_NETWORK_INSTRUMENTS 33
-#define WTAP_FILE_TYPE_SUBTYPE_LANALYZER 34
-#define WTAP_FILE_TYPE_SUBTYPE_PPPDUMP 35
-#define WTAP_FILE_TYPE_SUBTYPE_RADCOM 36
-#define WTAP_FILE_TYPE_SUBTYPE_SNOOP 37
-#define WTAP_FILE_TYPE_SUBTYPE_SHOMITI 38
-#define WTAP_FILE_TYPE_SUBTYPE_VMS 39
-#define WTAP_FILE_TYPE_SUBTYPE_K12 40
-#define WTAP_FILE_TYPE_SUBTYPE_TOSHIBA 41
-#define WTAP_FILE_TYPE_SUBTYPE_VISUAL_NETWORKS 42
-#define WTAP_FILE_TYPE_SUBTYPE_PEEKCLASSIC_V56 43
-#define WTAP_FILE_TYPE_SUBTYPE_PEEKCLASSIC_V7 44
-#define WTAP_FILE_TYPE_SUBTYPE_PEEKTAGGED 45
-#define WTAP_FILE_TYPE_SUBTYPE_MPEG 46
-#define WTAP_FILE_TYPE_SUBTYPE_K12TEXT 47
-#define WTAP_FILE_TYPE_SUBTYPE_NETSCREEN 48
-#define WTAP_FILE_TYPE_SUBTYPE_COMMVIEW 49
-#define WTAP_FILE_TYPE_SUBTYPE_BTSNOOP 50
-#define WTAP_FILE_TYPE_SUBTYPE_TNEF 51
-#define WTAP_FILE_TYPE_SUBTYPE_DCT3TRACE 52
-#define WTAP_FILE_TYPE_SUBTYPE_PACKETLOGGER 53
-#define WTAP_FILE_TYPE_SUBTYPE_DAINTREE_SNA 54
-#define WTAP_FILE_TYPE_SUBTYPE_NETSCALER_1_0 55
-#define WTAP_FILE_TYPE_SUBTYPE_NETSCALER_2_0 56
-#define WTAP_FILE_TYPE_SUBTYPE_JPEG_JFIF 57 /* obsoleted by WTAP_FILE_TYPE_SUBTYPE_MIME */
-#define WTAP_FILE_TYPE_SUBTYPE_IPFIX 58
-#define WTAP_FILE_TYPE_SUBTYPE_MIME 59
-#define WTAP_FILE_TYPE_SUBTYPE_AETHRA 60
-#define WTAP_FILE_TYPE_SUBTYPE_MPEG_2_TS 61
-#define WTAP_FILE_TYPE_SUBTYPE_VWR_80211 62
-#define WTAP_FILE_TYPE_SUBTYPE_VWR_ETH 63
-#define WTAP_FILE_TYPE_SUBTYPE_CAMINS 64
-#define WTAP_FILE_TYPE_SUBTYPE_STANAG_4607 65
-#define WTAP_FILE_TYPE_SUBTYPE_NETSCALER_3_0 66
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT 67
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_BRIEF 68
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_PROCESS 69
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_TAG 70
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_THREAD 71
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_TIME 72
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_THREADTIME 73
-#define WTAP_FILE_TYPE_SUBTYPE_LOGCAT_LONG 74
-#define WTAP_FILE_TYPE_SUBTYPE_COLASOFT_CAPSA 75
-#define WTAP_FILE_TYPE_SUBTYPE_COLASOFT_PACKET_BUILDER 76
-#define WTAP_FILE_TYPE_SUBTYPE_JSON 77
-#define WTAP_FILE_TYPE_SUBTYPE_NETSCALER_3_5 78
-#define WTAP_FILE_TYPE_SUBTYPE_NETTRACE_3GPP_32_423 79
-#define WTAP_FILE_TYPE_SUBTYPE_MPLOG 80
-#define WTAP_FILE_TYPE_SUBTYPE_DPA400 81
-#define WTAP_FILE_TYPE_SUBTYPE_RFC7468 82
-#define WTAP_FILE_TYPE_SUBTYPE_RUBY_MARSHAL 83
-#define WTAP_FILE_TYPE_SUBTYPE_SYSTEMD_JOURNAL 84
-#define WTAP_FILE_TYPE_SUBTYPE_LOG_3GPP 85
-#define WTAP_FILE_TYPE_SUBTYPE_MP4 86
+#define WTAP_FILE_TYPE_SUBTYPE_IPTRACE_1_0 9
+#define WTAP_FILE_TYPE_SUBTYPE_IPTRACE_2_0 10
+#define WTAP_FILE_TYPE_SUBTYPE_BER 11
+#define WTAP_FILE_TYPE_SUBTYPE_ERF 12
+#define WTAP_FILE_TYPE_SUBTYPE_SYSTEMD_JOURNAL 13
#define WTAP_NUM_FILE_TYPES_SUBTYPES wtap_get_num_file_types_subtypes()