From ed86f51e49e2b1ca64525bd14698528a50f3bbb4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 23 Feb 2021 19:10:35 -0800 Subject: [PATCH] wiretap: rename wtap_register_file_type_subtypes(). It only registers one file type/subtype, so rename it to wtap_register_file_type_subtype(). That will also force plugins to be recompiled; that will produce compile errors for some plugins that didn't change to match the new contents of the file_type_subtype_info structure. Also check to make sure that the registered file type/subtype supports at least one type of block; a file type/subtype that doesn't return *any* blocks and doesn't permit *any* block types to be written is not very useful. That should also catch most if not all other plugins that didn't change to match the new contents of the file_type_subtype_info structure. Don't make errors registering a file type/subtype fatal; just complain, don't register the bogus file type/subtype, and drive on. --- debian/libwiretap0.symbols | 2 +- epan/wslua/wslua_file_handler.c | 2 +- plugins/wiretap/usbdump/usbdump.c | 2 +- wiretap/5views.c | 2 +- wiretap/aethra.c | 2 +- wiretap/ascendtext.c | 2 +- wiretap/ber.c | 2 +- wiretap/btsnoop.c | 2 +- wiretap/busmaster.c | 2 +- wiretap/camins.c | 2 +- wiretap/candump.c | 2 +- wiretap/capsa.c | 4 ++-- wiretap/catapult_dct2000.c | 2 +- wiretap/commview.c | 2 +- wiretap/cosine.c | 2 +- wiretap/csids.c | 2 +- wiretap/daintree-sna.c | 2 +- wiretap/dbs-etherwatch.c | 2 +- wiretap/dct3trace.c | 2 +- wiretap/dpa400.c | 2 +- wiretap/erf.c | 2 +- wiretap/eyesdn.c | 2 +- wiretap/file_access.c | 15 ++++++++++++--- wiretap/hcidump.c | 2 +- wiretap/i4btrace.c | 2 +- wiretap/ipfix.c | 2 +- wiretap/iptrace.c | 4 ++-- wiretap/iseries.c | 4 ++-- wiretap/json.c | 2 +- wiretap/k12.c | 2 +- wiretap/k12text.l | 2 +- wiretap/lanalyzer.c | 2 +- wiretap/libpcap.c | 14 +++++++------- wiretap/log3gpp.c | 4 ++-- wiretap/logcat.c | 2 +- wiretap/logcat_text.c | 14 +++++++------- wiretap/mime_file.c | 4 ++-- wiretap/mp2t.c | 2 +- wiretap/mp4.c | 2 +- wiretap/mpeg.c | 2 +- wiretap/mplog.c | 2 +- wiretap/netmon.c | 4 ++-- wiretap/netscaler.c | 8 ++++---- wiretap/netscreen.c | 2 +- wiretap/nettl.c | 2 +- wiretap/nettrace_3gpp_32_423.c | 2 +- wiretap/network_instruments.c | 2 +- wiretap/netxray.c | 8 ++++---- wiretap/ngsniffer.c | 4 ++-- wiretap/packetlogger.c | 2 +- wiretap/pcapng.c | 2 +- wiretap/peekclassic.c | 4 ++-- wiretap/peektagged.c | 2 +- wiretap/pppdump.c | 2 +- wiretap/radcom.c | 2 +- wiretap/rfc7468.c | 2 +- wiretap/ruby_marshal.c | 2 +- wiretap/snoop.c | 4 ++-- wiretap/stanag4607.c | 2 +- wiretap/systemd_journal.c | 2 +- wiretap/tnef.c | 2 +- wiretap/toshiba.c | 2 +- wiretap/visual.c | 2 +- wiretap/vms.c | 2 +- wiretap/vwr.c | 4 ++-- wiretap/wtap.h | 2 +- 66 files changed, 105 insertions(+), 96 deletions(-) diff --git a/debian/libwiretap0.symbols b/debian/libwiretap0.symbols index 9e5b38ce72..2006a095b3 100644 --- a/debian/libwiretap0.symbols +++ b/debian/libwiretap0.symbols @@ -144,7 +144,7 @@ libwiretap.so.0 libwiretap0 #MINVER# wtap_register_backwards_compatibility_lua_name@Base 3.5.0 wtap_register_encap_type@Base 1.9.1 wtap_register_file_type_extension@Base 1.12.0~rc1 - wtap_register_file_type_subtypes@Base 1.12.0~rc1 + wtap_register_file_type_subtype@Base 3.5.0 wtap_register_open_info@Base 1.12.0~rc1 wtap_register_plugin@Base 2.5.0 wtap_seek_read@Base 1.9.1 diff --git a/epan/wslua/wslua_file_handler.c b/epan/wslua/wslua_file_handler.c index 75c2111f73..a5fb402a97 100644 --- a/epan/wslua/wslua_file_handler.c +++ b/epan/wslua/wslua_file_handler.c @@ -783,7 +783,7 @@ WSLUA_FUNCTION wslua_register_filehandler(lua_State* L) { fh->finfo.dump_open = wslua_filehandler_dump_open; } - fh->file_type = wtap_register_file_type_subtypes(&(fh->finfo)); + fh->file_type = wtap_register_file_type_subtype(&(fh->finfo)); if (fh->is_reader) { struct open_info oi = { NULL, OPEN_INFO_HEURISTIC, NULL, NULL, NULL, NULL }; diff --git a/plugins/wiretap/usbdump/usbdump.c b/plugins/wiretap/usbdump/usbdump.c index e699548519..be979fcfe5 100644 --- a/plugins/wiretap/usbdump/usbdump.c +++ b/plugins/wiretap/usbdump/usbdump.c @@ -337,7 +337,7 @@ wtap_register_usbdump(void) wtap_register_open_info(&oi, FALSE); - usbdump_file_type_subtype = wtap_register_file_type_subtypes(&fi); + usbdump_file_type_subtype = wtap_register_file_type_subtype(&fi); } /* diff --git a/wiretap/5views.c b/wiretap/5views.c index f297f26d71..c2a87dc325 100644 --- a/wiretap/5views.c +++ b/wiretap/5views.c @@ -468,7 +468,7 @@ static const struct file_type_subtype_info _5views_info = { void register_5views(void) { - _5views_file_type_subtype = wtap_register_file_type_subtypes(&_5views_info); + _5views_file_type_subtype = wtap_register_file_type_subtype(&_5views_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/aethra.c b/wiretap/aethra.c index b6447affd9..172e4ad63a 100644 --- a/wiretap/aethra.c +++ b/wiretap/aethra.c @@ -356,7 +356,7 @@ static const struct file_type_subtype_info aethra_info = { void register_aethra(void) { - aethra_file_type_subtype = wtap_register_file_type_subtypes(&aethra_info); + aethra_file_type_subtype = wtap_register_file_type_subtype(&aethra_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/ascendtext.c b/wiretap/ascendtext.c index a44b09c189..00b3db7842 100644 --- a/wiretap/ascendtext.c +++ b/wiretap/ascendtext.c @@ -472,7 +472,7 @@ static const struct file_type_subtype_info ascend_info = { void register_ascend(void) { - ascend_file_type_subtype = wtap_register_file_type_subtypes(&ascend_info); + ascend_file_type_subtype = wtap_register_file_type_subtype(&ascend_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/ber.c b/wiretap/ber.c index c71ed65ca2..d9182c7532 100644 --- a/wiretap/ber.c +++ b/wiretap/ber.c @@ -146,7 +146,7 @@ static const struct file_type_subtype_info ber_info = { void register_ber(void) { - ber_file_type_subtype = wtap_register_file_type_subtypes(&ber_info); + ber_file_type_subtype = wtap_register_file_type_subtype(&ber_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c index 83e7807ce4..5ba65cbae4 100644 --- a/wiretap/btsnoop.c +++ b/wiretap/btsnoop.c @@ -441,7 +441,7 @@ static const struct file_type_subtype_info btsnoop_info = { void register_btsnoop(void) { - btsnoop_file_type_subtype = wtap_register_file_type_subtypes(&btsnoop_info); + btsnoop_file_type_subtype = wtap_register_file_type_subtype(&btsnoop_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/busmaster.c b/wiretap/busmaster.c index 5b0fe68100..8d6d99d6df 100644 --- a/wiretap/busmaster.c +++ b/wiretap/busmaster.c @@ -457,7 +457,7 @@ static const struct file_type_subtype_info busmaster_info = { void register_busmaster(void) { - busmaster_file_type_subtype = wtap_register_file_type_subtypes(&busmaster_info); + busmaster_file_type_subtype = wtap_register_file_type_subtype(&busmaster_info); } /* diff --git a/wiretap/camins.c b/wiretap/camins.c index 680a26c722..775c8990ee 100644 --- a/wiretap/camins.c +++ b/wiretap/camins.c @@ -467,7 +467,7 @@ static const struct file_type_subtype_info camins_info = { void register_camins(void) { - camins_file_type_subtype = wtap_register_file_type_subtypes(&camins_info); + camins_file_type_subtype = wtap_register_file_type_subtype(&camins_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/candump.c b/wiretap/candump.c index daccaa6c25..7257883585 100644 --- a/wiretap/candump.c +++ b/wiretap/candump.c @@ -244,7 +244,7 @@ static const struct file_type_subtype_info candump_info = { void register_candump(void) { - candump_file_type_subtype = wtap_register_file_type_subtypes(&candump_info); + candump_file_type_subtype = wtap_register_file_type_subtype(&candump_info); } /* diff --git a/wiretap/capsa.c b/wiretap/capsa.c index 904208c721..7aa9ae1c00 100644 --- a/wiretap/capsa.c +++ b/wiretap/capsa.c @@ -462,8 +462,8 @@ static const struct file_type_subtype_info packet_builder_info = { void register_capsa(void) { - capsa_file_type_subtype = wtap_register_file_type_subtypes(&capsa_info); - packet_builder_file_type_subtype = wtap_register_file_type_subtypes(&packet_builder_info); + capsa_file_type_subtype = wtap_register_file_type_subtype(&capsa_info); + packet_builder_file_type_subtype = wtap_register_file_type_subtype(&packet_builder_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c index 962cc953e3..0f5ccf0bf3 100644 --- a/wiretap/catapult_dct2000.c +++ b/wiretap/catapult_dct2000.c @@ -1666,7 +1666,7 @@ static const struct file_type_subtype_info dct2000_info = { void register_dct2000(void) { - dct2000_file_type_subtype = wtap_register_file_type_subtypes(&dct2000_info); + dct2000_file_type_subtype = wtap_register_file_type_subtype(&dct2000_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/commview.c b/wiretap/commview.c index d6118f6240..55b25f94b5 100644 --- a/wiretap/commview.c +++ b/wiretap/commview.c @@ -615,7 +615,7 @@ static const struct file_type_subtype_info commview_info = { void register_commview(void) { - commview_file_type_subtype = wtap_register_file_type_subtypes(&commview_info); + commview_file_type_subtype = wtap_register_file_type_subtype(&commview_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/cosine.c b/wiretap/cosine.c index 76c1082110..130a7c9a1c 100644 --- a/wiretap/cosine.c +++ b/wiretap/cosine.c @@ -503,7 +503,7 @@ static const struct file_type_subtype_info cosine_info = { void register_cosine(void) { - cosine_file_type_subtype = wtap_register_file_type_subtypes(&cosine_info); + cosine_file_type_subtype = wtap_register_file_type_subtype(&cosine_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/csids.c b/wiretap/csids.c index bbf8b0311e..68849ccb2b 100644 --- a/wiretap/csids.c +++ b/wiretap/csids.c @@ -224,7 +224,7 @@ static const struct file_type_subtype_info csids_info = { void register_csids(void) { - csids_file_type_subtype = wtap_register_file_type_subtypes(&csids_info); + csids_file_type_subtype = wtap_register_file_type_subtype(&csids_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/daintree-sna.c b/wiretap/daintree-sna.c index 70392e0f5f..418118b6c5 100644 --- a/wiretap/daintree-sna.c +++ b/wiretap/daintree-sna.c @@ -269,7 +269,7 @@ static const struct file_type_subtype_info daintree_sna_info = { void register_daintree_sna(void) { - daintree_sna_file_type_subtype = wtap_register_file_type_subtypes(&daintree_sna_info); + daintree_sna_file_type_subtype = wtap_register_file_type_subtype(&daintree_sna_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c index c213241d41..9d95ad9985 100644 --- a/wiretap/dbs-etherwatch.c +++ b/wiretap/dbs-etherwatch.c @@ -645,7 +645,7 @@ static const struct file_type_subtype_info dbs_etherwatch_info = { void register_dbs_etherwatch(void) { - dbs_etherwatch_file_type_subtype = wtap_register_file_type_subtypes(&dbs_etherwatch_info); + dbs_etherwatch_file_type_subtype = wtap_register_file_type_subtype(&dbs_etherwatch_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/dct3trace.c b/wiretap/dct3trace.c index 6e6a7e0035..242f47d53d 100644 --- a/wiretap/dct3trace.c +++ b/wiretap/dct3trace.c @@ -417,7 +417,7 @@ static const struct file_type_subtype_info dct3trace_info = { void register_dct3trace(void) { - dct3trace_file_type_subtype = wtap_register_file_type_subtypes(&dct3trace_info); + dct3trace_file_type_subtype = wtap_register_file_type_subtype(&dct3trace_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/dpa400.c b/wiretap/dpa400.c index be6d065f1c..26fe935ba4 100644 --- a/wiretap/dpa400.c +++ b/wiretap/dpa400.c @@ -261,7 +261,7 @@ static const struct file_type_subtype_info dpa400_info = { void register_dpa400(void) { - dpa400_file_type_subtype = wtap_register_file_type_subtypes(&dpa400_info); + dpa400_file_type_subtype = wtap_register_file_type_subtype(&dpa400_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/erf.c b/wiretap/erf.c index 721b180137..fd1d5c3282 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -3451,7 +3451,7 @@ static const struct file_type_subtype_info erf_info = { void register_erf(void) { - erf_file_type_subtype = wtap_register_file_type_subtypes(&erf_info); + erf_file_type_subtype = wtap_register_file_type_subtype(&erf_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c index 32b0317fa1..94730fff12 100644 --- a/wiretap/eyesdn.c +++ b/wiretap/eyesdn.c @@ -491,7 +491,7 @@ static const struct file_type_subtype_info eyesdn_info = { void register_eyesdn(void) { - eyesdn_file_type_subtype = wtap_register_file_type_subtypes(&eyesdn_info); + eyesdn_file_type_subtype = wtap_register_file_type_subtype(&eyesdn_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 3b7307c683..48b1aa9d1f 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -1314,7 +1314,7 @@ wtap_init_file_type_subtypes(void) * with that name is already registered. */ int -wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi) +wtap_register_file_type_subtype(const struct file_type_subtype_info* fi) { struct file_type_subtype_info* finfo; guint file_type_subtype; @@ -1323,7 +1323,16 @@ wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi) * Check for required fields (description and name). */ if (!fi || !fi->description || !fi->name) { - g_error("no file type info"); + g_warning("no file type info"); + return -1; + } + + /* + * There must be at least one block type that this file + * type/subtype supports. + */ + if (fi->num_supported_blocks == 0 || fi->supported_blocks == NULL) { + g_warning("no blocks supported by file type \"%s\"", fi->name); return -1; } @@ -1334,7 +1343,7 @@ wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi) /* * Yes. You don't get to replace an existing handler. */ - g_error("file type \"%s\" is already registered", fi->name); + g_warning("file type \"%s\" is already registered", fi->name); return -1; } diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c index 2423630096..a57a855b40 100644 --- a/wiretap/hcidump.c +++ b/wiretap/hcidump.c @@ -136,7 +136,7 @@ static const struct file_type_subtype_info hcidump_info = { void register_hcidump(void) { - hcidump_file_type_subtype = wtap_register_file_type_subtypes(&hcidump_info); + hcidump_file_type_subtype = wtap_register_file_type_subtype(&hcidump_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/i4btrace.c b/wiretap/i4btrace.c index 5489822c47..3b95e5ff91 100644 --- a/wiretap/i4btrace.c +++ b/wiretap/i4btrace.c @@ -312,7 +312,7 @@ static const struct file_type_subtype_info i4btrace_info = { void register_i4btrace(void) { - i4btrace_file_type_subtype = wtap_register_file_type_subtypes(&i4btrace_info); + i4btrace_file_type_subtype = wtap_register_file_type_subtype(&i4btrace_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c index a71a4a6cad..59a883c9b9 100644 --- a/wiretap/ipfix.c +++ b/wiretap/ipfix.c @@ -343,7 +343,7 @@ static const struct file_type_subtype_info ipfix_info = { void register_ipfix(void) { - ipfix_file_type_subtype = wtap_register_file_type_subtypes(&ipfix_info); + ipfix_file_type_subtype = wtap_register_file_type_subtype(&ipfix_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/iptrace.c b/wiretap/iptrace.c index d506999298..250516c273 100644 --- a/wiretap/iptrace.c +++ b/wiretap/iptrace.c @@ -881,8 +881,8 @@ static const struct file_type_subtype_info iptrace_2_0_info = { void register_iptrace(void) { - iptrace_1_0_file_type_subtype = wtap_register_file_type_subtypes(&iptrace_1_0_info); - iptrace_2_0_file_type_subtype = wtap_register_file_type_subtypes(&iptrace_2_0_info); + iptrace_1_0_file_type_subtype = wtap_register_file_type_subtype(&iptrace_1_0_info); + iptrace_2_0_file_type_subtype = wtap_register_file_type_subtype(&iptrace_2_0_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/iseries.c b/wiretap/iseries.c index cde980a12d..0ebe026138 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -1080,8 +1080,8 @@ static const struct file_type_subtype_info iseries_unicode_info = { void register_iseries(void) { - iseries_file_type_subtype = wtap_register_file_type_subtypes(&iseries_info); - iseries_unicode_file_type_subtype = wtap_register_file_type_subtypes(&iseries_unicode_info); + iseries_file_type_subtype = wtap_register_file_type_subtype(&iseries_info); + iseries_unicode_file_type_subtype = wtap_register_file_type_subtype(&iseries_unicode_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/json.c b/wiretap/json.c index b350dfeb42..e2213e95e0 100644 --- a/wiretap/json.c +++ b/wiretap/json.c @@ -84,7 +84,7 @@ static const struct file_type_subtype_info json_info = { void register_json(void) { - json_file_type_subtype = wtap_register_file_type_subtypes(&json_info); + json_file_type_subtype = wtap_register_file_type_subtype(&json_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/k12.c b/wiretap/k12.c index 7521903424..ece5b697db 100644 --- a/wiretap/k12.c +++ b/wiretap/k12.c @@ -1408,7 +1408,7 @@ static const struct file_type_subtype_info k12_info = { void register_k12(void) { - k12_file_type_subtype = wtap_register_file_type_subtypes(&k12_info); + k12_file_type_subtype = wtap_register_file_type_subtype(&k12_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 2c04b53abe..257ce6fdd6 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -591,7 +591,7 @@ static const struct file_type_subtype_info k12text_info = { void register_k12text(void) { - k12text_file_type_subtype = wtap_register_file_type_subtypes(&k12text_info); + k12text_file_type_subtype = wtap_register_file_type_subtype(&k12text_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c index a12fe158d7..c215072d46 100644 --- a/wiretap/lanalyzer.c +++ b/wiretap/lanalyzer.c @@ -979,7 +979,7 @@ static const struct file_type_subtype_info lanalyzer_info = { void register_lanalyzer(void) { - lanalyzer_file_type_subtype = wtap_register_file_type_subtypes(&lanalyzer_info); + lanalyzer_file_type_subtype = wtap_register_file_type_subtype(&lanalyzer_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index a39e97616d..a7d3a125ac 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1405,13 +1405,13 @@ static const struct file_type_subtype_info pcap_nokia_info = { void register_pcap(void) { - pcap_file_type_subtype = wtap_register_file_type_subtypes(&pcap_info); - pcap_nsec_file_type_subtype = wtap_register_file_type_subtypes(&pcap_nsec_info); - pcap_aix_file_type_subtype = wtap_register_file_type_subtypes(&pcap_aix_info); - pcap_ss990417_file_type_subtype = wtap_register_file_type_subtypes(&pcap_ss990417_info); - pcap_ss990915_file_type_subtype = wtap_register_file_type_subtypes(&pcap_ss990915_info); - pcap_ss991029_file_type_subtype = wtap_register_file_type_subtypes(&pcap_ss991029_info); - pcap_nokia_file_type_subtype = wtap_register_file_type_subtypes(&pcap_nokia_info); + pcap_file_type_subtype = wtap_register_file_type_subtype(&pcap_info); + pcap_nsec_file_type_subtype = wtap_register_file_type_subtype(&pcap_nsec_info); + pcap_aix_file_type_subtype = wtap_register_file_type_subtype(&pcap_aix_info); + pcap_ss990417_file_type_subtype = wtap_register_file_type_subtype(&pcap_ss990417_info); + pcap_ss990915_file_type_subtype = wtap_register_file_type_subtype(&pcap_ss990915_info); + pcap_ss991029_file_type_subtype = wtap_register_file_type_subtype(&pcap_ss991029_info); + pcap_nokia_file_type_subtype = wtap_register_file_type_subtype(&pcap_nokia_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/log3gpp.c b/wiretap/log3gpp.c index d4f089ed37..ba526301ef 100644 --- a/wiretap/log3gpp.c +++ b/wiretap/log3gpp.c @@ -901,7 +901,7 @@ static const struct file_type_subtype_info log3gpp_info = { void register_log3gpp(void) { - log3gpp_file_type_subtype = wtap_register_file_type_subtypes(&log3gpp_info); + log3gpp_file_type_subtype = wtap_register_file_type_subtype(&log3gpp_info); /* * Register name for backwards compatibility with the @@ -923,7 +923,7 @@ void wtap_register_phonelog(void) { wtap_register_open_info(&phonelog_oi, TRUE); encap_3gpp_log = wtap_register_encap_type("3GPP Log","3gpp_log"); - wf_3gpp_log = wtap_register_file_type_subtypes(&fi, WTAP_FILE_TYPE_SUBTYPE_UNKNOWN); + wf_3gpp_log = wtap_register_file_type_subtype(&fi, WTAP_FILE_TYPE_SUBTYPE_UNKNOWN); } #endif diff --git a/wiretap/logcat.c b/wiretap/logcat.c index 795e3ef617..765fcc3b78 100644 --- a/wiretap/logcat.c +++ b/wiretap/logcat.c @@ -379,7 +379,7 @@ static const struct file_type_subtype_info logcat_info = { void register_logcat(void) { - logcat_file_type_subtype = wtap_register_file_type_subtypes(&logcat_info); + logcat_file_type_subtype = wtap_register_file_type_subtype(&logcat_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/logcat_text.c b/wiretap/logcat_text.c index 13416ac436..639396b28a 100644 --- a/wiretap/logcat_text.c +++ b/wiretap/logcat_text.c @@ -721,13 +721,13 @@ static const struct file_type_subtype_info logcat_text_long_info = { void register_logcat_text(void) { - logcat_text_brief_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_brief_info); - logcat_text_process_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_process_info); - logcat_text_tag_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_tag_info); - logcat_text_thread_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_thread_info); - logcat_text_time_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_time_info); - logcat_text_threadtime_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_threadtime_info); - logcat_text_long_file_type_subtype = wtap_register_file_type_subtypes(&logcat_text_long_info); + logcat_text_brief_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_brief_info); + logcat_text_process_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_process_info); + logcat_text_tag_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_tag_info); + logcat_text_thread_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_thread_info); + logcat_text_time_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_time_info); + logcat_text_threadtime_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_threadtime_info); + logcat_text_long_file_type_subtype = wtap_register_file_type_subtype(&logcat_text_long_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/mime_file.c b/wiretap/mime_file.c index 074b30d835..7c5288101c 100644 --- a/wiretap/mime_file.c +++ b/wiretap/mime_file.c @@ -188,13 +188,13 @@ void register_mime(void) { int jpeg_jfif_file_type_subtype; - mime_file_type_subtype = wtap_register_file_type_subtypes(&mime_info); + mime_file_type_subtype = wtap_register_file_type_subtype(&mime_info); /* * Obsoleted by "mime", but we want it for the backwards- * compatibility table for Lua. */ - jpeg_jfif_file_type_subtype = wtap_register_file_type_subtypes(&jpeg_jfif_info); + jpeg_jfif_file_type_subtype = wtap_register_file_type_subtype(&jpeg_jfif_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/mp2t.c b/wiretap/mp2t.c index 50cc93819d..352fa6b3ef 100644 --- a/wiretap/mp2t.c +++ b/wiretap/mp2t.c @@ -410,7 +410,7 @@ static const struct file_type_subtype_info mp2t_info = { void register_mp2t(void) { - mp2t_file_type_subtype = wtap_register_file_type_subtypes(&mp2t_info); + mp2t_file_type_subtype = wtap_register_file_type_subtype(&mp2t_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/mp4.c b/wiretap/mp4.c index 3b8e7aa263..1ad140dc71 100644 --- a/wiretap/mp4.c +++ b/wiretap/mp4.c @@ -69,7 +69,7 @@ static const struct file_type_subtype_info mp4_info = { void register_mp4(void) { - mp4_file_type_subtype = wtap_register_file_type_subtypes(&mp4_info); + mp4_file_type_subtype = wtap_register_file_type_subtype(&mp4_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c index a5f4e6b46b..7c35b1580a 100644 --- a/wiretap/mpeg.c +++ b/wiretap/mpeg.c @@ -282,7 +282,7 @@ static const struct file_type_subtype_info mpeg_info = { void register_mpeg(void) { - mpeg_file_type_subtype = wtap_register_file_type_subtypes(&mpeg_info); + mpeg_file_type_subtype = wtap_register_file_type_subtype(&mpeg_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/mplog.c b/wiretap/mplog.c index 63b10cae9f..e66f365be3 100644 --- a/wiretap/mplog.c +++ b/wiretap/mplog.c @@ -269,7 +269,7 @@ static const struct file_type_subtype_info mplog_info = { void register_mplog(void) { - mplog_file_type_subtype = wtap_register_file_type_subtypes(&mplog_info); + mplog_file_type_subtype = wtap_register_file_type_subtype(&mplog_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 9e2023e09b..1fee8caf2f 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -2007,8 +2007,8 @@ static const struct file_type_subtype_info netmon_2_x_info = { void register_netmon(void) { - netmon_1_x_file_type_subtype = wtap_register_file_type_subtypes(&netmon_1_x_info); - netmon_2_x_file_type_subtype = wtap_register_file_type_subtypes(&netmon_2_x_info); + netmon_1_x_file_type_subtype = wtap_register_file_type_subtype(&netmon_1_x_info); + netmon_2_x_file_type_subtype = wtap_register_file_type_subtype(&netmon_2_x_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index af3a6b2f68..76df5c27f2 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -2469,10 +2469,10 @@ static const struct file_type_subtype_info nstrace_3_5_info = { void register_netscaler(void) { - nstrace_1_0_file_type_subtype = wtap_register_file_type_subtypes(&nstrace_1_0_info); - nstrace_2_0_file_type_subtype = wtap_register_file_type_subtypes(&nstrace_2_0_info); - nstrace_3_0_file_type_subtype = wtap_register_file_type_subtypes(&nstrace_3_0_info); - nstrace_3_5_file_type_subtype = wtap_register_file_type_subtypes(&nstrace_3_5_info); + nstrace_1_0_file_type_subtype = wtap_register_file_type_subtype(&nstrace_1_0_info); + nstrace_2_0_file_type_subtype = wtap_register_file_type_subtype(&nstrace_2_0_info); + nstrace_3_0_file_type_subtype = wtap_register_file_type_subtype(&nstrace_3_0_info); + nstrace_3_5_file_type_subtype = wtap_register_file_type_subtype(&nstrace_3_5_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c index 26fff07994..747c3064b4 100644 --- a/wiretap/netscreen.c +++ b/wiretap/netscreen.c @@ -465,7 +465,7 @@ static const struct file_type_subtype_info netscreen_info = { void register_netscreen(void) { - netscreen_file_type_subtype = wtap_register_file_type_subtypes(&netscreen_info); + netscreen_file_type_subtype = wtap_register_file_type_subtype(&netscreen_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/nettl.c b/wiretap/nettl.c index b831fe12bd..044f40b85a 100644 --- a/wiretap/nettl.c +++ b/wiretap/nettl.c @@ -812,7 +812,7 @@ static const struct file_type_subtype_info nettl_info = { void register_nettl(void) { - nettl_file_type_subtype = wtap_register_file_type_subtypes(&nettl_info); + nettl_file_type_subtype = wtap_register_file_type_subtype(&nettl_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c index 338c3ff2c7..c25b13e924 100644 --- a/wiretap/nettrace_3gpp_32_423.c +++ b/wiretap/nettrace_3gpp_32_423.c @@ -846,7 +846,7 @@ static const struct file_type_subtype_info nettrace_3gpp_32_423_info = { void register_nettrace_3gpp_32_423(void) { - nettrace_3gpp_32_423_file_type_subtype = wtap_register_file_type_subtypes(&nettrace_3gpp_32_423_info); + nettrace_3gpp_32_423_file_type_subtype = wtap_register_file_type_subtype(&nettrace_3gpp_32_423_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c index 5755e5a339..4179c9478d 100644 --- a/wiretap/network_instruments.c +++ b/wiretap/network_instruments.c @@ -895,7 +895,7 @@ static const struct file_type_subtype_info network_instruments_info = { void register_network_instruments(void) { - network_instruments_file_type_subtype = wtap_register_file_type_subtypes(&network_instruments_info); + network_instruments_file_type_subtype = wtap_register_file_type_subtype(&network_instruments_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/netxray.c b/wiretap/netxray.c index 488e83a89c..0e778e3ef0 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -2149,10 +2149,10 @@ static const struct file_type_subtype_info netxray_2_00x_info = { void register_netxray(void) { - netxray_old_file_type_subtype = wtap_register_file_type_subtypes(&netxray_old_info); - netxray_1_0_file_type_subtype = wtap_register_file_type_subtypes(&netxray_1_0_info); - netxray_1_1_file_type_subtype = wtap_register_file_type_subtypes(&netxray_1_1_info); - netxray_2_00x_file_type_subtype = wtap_register_file_type_subtypes(&netxray_2_00x_info); + netxray_old_file_type_subtype = wtap_register_file_type_subtype(&netxray_old_info); + netxray_1_0_file_type_subtype = wtap_register_file_type_subtype(&netxray_1_0_info); + netxray_1_1_file_type_subtype = wtap_register_file_type_subtype(&netxray_1_1_info); + netxray_2_00x_file_type_subtype = wtap_register_file_type_subtype(&netxray_2_00x_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 21fdeaa768..97504dffcf 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -2870,8 +2870,8 @@ static const struct file_type_subtype_info ngsniffer_compressed_info = { void register_ngsniffer(void) { - ngsniffer_uncompressed_file_type_subtype = wtap_register_file_type_subtypes(&ngsniffer_uncompressed_info); - ngsniffer_compressed_file_type_subtype = wtap_register_file_type_subtypes(&ngsniffer_compressed_info); + ngsniffer_uncompressed_file_type_subtype = wtap_register_file_type_subtype(&ngsniffer_uncompressed_info); + ngsniffer_compressed_file_type_subtype = wtap_register_file_type_subtype(&ngsniffer_compressed_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/packetlogger.c b/wiretap/packetlogger.c index 5330f0361c..31506cba6a 100644 --- a/wiretap/packetlogger.c +++ b/wiretap/packetlogger.c @@ -392,7 +392,7 @@ static const struct file_type_subtype_info packetlogger_info = { void register_packetlogger(void) { - packetlogger_file_type_subtype = wtap_register_file_type_subtypes(&packetlogger_info); + packetlogger_file_type_subtype = wtap_register_file_type_subtype(&packetlogger_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 79a2ed298f..163eab19e1 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -5092,7 +5092,7 @@ static const struct file_type_subtype_info pcapng_info = { void register_pcapng(void) { - pcapng_file_type_subtype = wtap_register_file_type_subtypes(&pcapng_info); + pcapng_file_type_subtype = wtap_register_file_type_subtype(&pcapng_info); wtap_register_backwards_compatibility_lua_name("PCAPNG", pcapng_file_type_subtype); diff --git a/wiretap/peekclassic.c b/wiretap/peekclassic.c index 095d73f809..1e99520f2a 100644 --- a/wiretap/peekclassic.c +++ b/wiretap/peekclassic.c @@ -690,8 +690,8 @@ static const struct file_type_subtype_info peekclassic_v7_info = { void register_peekclassic(void) { - peekclassic_v56_file_type_subtype = wtap_register_file_type_subtypes(&peekclassic_v56_info); - peekclassic_v7_file_type_subtype = wtap_register_file_type_subtypes(&peekclassic_v7_info); + peekclassic_v56_file_type_subtype = wtap_register_file_type_subtype(&peekclassic_v56_info); + peekclassic_v7_file_type_subtype = wtap_register_file_type_subtype(&peekclassic_v7_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/peektagged.c b/wiretap/peektagged.c index 267126454f..873d22e2c4 100644 --- a/wiretap/peektagged.c +++ b/wiretap/peektagged.c @@ -900,7 +900,7 @@ static const struct file_type_subtype_info peektagged_info = { void register_peektagged(void) { - peektagged_file_type_subtype = wtap_register_file_type_subtypes(&peektagged_info); + peektagged_file_type_subtype = wtap_register_file_type_subtype(&peektagged_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c index b484df9c10..68799df933 100644 --- a/wiretap/pppdump.c +++ b/wiretap/pppdump.c @@ -811,7 +811,7 @@ static const struct file_type_subtype_info pppdump_info = { void register_pppdump(void) { - pppdump_file_type_subtype = wtap_register_file_type_subtypes(&pppdump_info); + pppdump_file_type_subtype = wtap_register_file_type_subtype(&pppdump_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/radcom.c b/wiretap/radcom.c index cecc45e6ac..7f05100eb9 100644 --- a/wiretap/radcom.c +++ b/wiretap/radcom.c @@ -387,7 +387,7 @@ static const struct file_type_subtype_info radcom_info = { void register_radcom(void) { - radcom_file_type_subtype = wtap_register_file_type_subtypes(&radcom_info); + radcom_file_type_subtype = wtap_register_file_type_subtype(&radcom_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/rfc7468.c b/wiretap/rfc7468.c index 17fd35789b..c8afb238aa 100644 --- a/wiretap/rfc7468.c +++ b/wiretap/rfc7468.c @@ -116,7 +116,7 @@ static const struct file_type_subtype_info rfc7468_info = { void register_rfc7468(void) { - rfc7468_file_type_subtype = wtap_register_file_type_subtypes(&rfc7468_info); + rfc7468_file_type_subtype = wtap_register_file_type_subtype(&rfc7468_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/ruby_marshal.c b/wiretap/ruby_marshal.c index 66042c97ea..026f7b6596 100644 --- a/wiretap/ruby_marshal.c +++ b/wiretap/ruby_marshal.c @@ -99,7 +99,7 @@ static const struct file_type_subtype_info ruby_marshal_info = { void register_ruby_marshal(void) { - ruby_marshal_file_type_subtype = wtap_register_file_type_subtypes(&ruby_marshal_info); + ruby_marshal_file_type_subtype = wtap_register_file_type_subtype(&ruby_marshal_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/snoop.c b/wiretap/snoop.c index 30cf84648d..296716fc67 100644 --- a/wiretap/snoop.c +++ b/wiretap/snoop.c @@ -945,8 +945,8 @@ static const struct file_type_subtype_info shomiti_info = { void register_snoop(void) { - snoop_file_type_subtype = wtap_register_file_type_subtypes(&snoop_info); - shomiti_file_type_subtype = wtap_register_file_type_subtypes(&shomiti_info); + snoop_file_type_subtype = wtap_register_file_type_subtype(&snoop_info); + shomiti_file_type_subtype = wtap_register_file_type_subtype(&shomiti_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/stanag4607.c b/wiretap/stanag4607.c index 66a29efcf5..db46c446fc 100644 --- a/wiretap/stanag4607.c +++ b/wiretap/stanag4607.c @@ -223,7 +223,7 @@ static const struct file_type_subtype_info stanag4607_info = { void register_stanag4607(void) { - stanag4607_file_type_subtype = wtap_register_file_type_subtypes(&stanag4607_info); + stanag4607_file_type_subtype = wtap_register_file_type_subtype(&stanag4607_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/systemd_journal.c b/wiretap/systemd_journal.c index d829ab7105..e31e6e5d6a 100644 --- a/wiretap/systemd_journal.c +++ b/wiretap/systemd_journal.c @@ -251,7 +251,7 @@ static const struct file_type_subtype_info systemd_journal_info = { void register_systemd_journal(void) { - systemd_journal_file_type_subtype = wtap_register_file_type_subtypes(&systemd_journal_info); + systemd_journal_file_type_subtype = wtap_register_file_type_subtype(&systemd_journal_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/tnef.c b/wiretap/tnef.c index f81b3ddac2..66db868038 100644 --- a/wiretap/tnef.c +++ b/wiretap/tnef.c @@ -61,7 +61,7 @@ static const struct file_type_subtype_info tnef_info = { void register_tnef(void) { - tnef_file_type_subtype = wtap_register_file_type_subtypes(&tnef_info); + tnef_file_type_subtype = wtap_register_file_type_subtype(&tnef_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c index 7781dadc6a..912af6a803 100644 --- a/wiretap/toshiba.c +++ b/wiretap/toshiba.c @@ -444,7 +444,7 @@ static const struct file_type_subtype_info toshiba_info = { void register_toshiba(void) { - toshiba_file_type_subtype = wtap_register_file_type_subtypes(&toshiba_info); + toshiba_file_type_subtype = wtap_register_file_type_subtype(&toshiba_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/visual.c b/wiretap/visual.c index ed9db91e77..aa934cdb8e 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -876,7 +876,7 @@ static const struct file_type_subtype_info visual_info = { void register_visual(void) { - visual_file_type_subtype = wtap_register_file_type_subtypes(&visual_info); + visual_file_type_subtype = wtap_register_file_type_subtype(&visual_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/vms.c b/wiretap/vms.c index 5951520de9..44697bc83a 100644 --- a/wiretap/vms.c +++ b/wiretap/vms.c @@ -543,7 +543,7 @@ static const struct file_type_subtype_info vms_info = { void register_vms(void) { - vms_file_type_subtype = wtap_register_file_type_subtypes(&vms_info); + vms_file_type_subtype = wtap_register_file_type_subtype(&vms_info); /* * Register name for backwards compatibility with the diff --git a/wiretap/vwr.c b/wiretap/vwr.c index 953fac9a6a..768a4e6892 100644 --- a/wiretap/vwr.c +++ b/wiretap/vwr.c @@ -3398,8 +3398,8 @@ static const struct file_type_subtype_info vwr_eth_info = { void register_vwr(void) { - vwr_80211_file_type_subtype = wtap_register_file_type_subtypes(&vwr_80211_info); - vwr_eth_file_type_subtype = wtap_register_file_type_subtypes(&vwr_eth_info); + vwr_80211_file_type_subtype = wtap_register_file_type_subtype(&vwr_80211_info); + vwr_eth_file_type_subtype = wtap_register_file_type_subtype(&vwr_eth_info); /* * Register names for backwards compatibility with the diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 38fb1875b9..be7d252ac8 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -2278,7 +2278,7 @@ void wtap_deregister_open_info(const gchar *name); WS_DLL_PUBLIC unsigned int open_info_name_to_type(const char *name); WS_DLL_PUBLIC -int wtap_register_file_type_subtypes(const struct file_type_subtype_info* fi); +int wtap_register_file_type_subtype(const struct file_type_subtype_info* fi); WS_DLL_PUBLIC void wtap_deregister_file_type_subtype(const int file_type_subtype);