aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/CMakeLists.txt
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/CMakeLists.txt
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/CMakeLists.txt')
-rw-r--r--wiretap/CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt
index 406bbf1352..2b119f2fe1 100644
--- a/wiretap/CMakeLists.txt
+++ b/wiretap/CMakeLists.txt
@@ -23,6 +23,11 @@ set(WIRETAP_PUBLIC_HEADERS
# file types. (For cases where more than one source file is
# used, this should be the one that contains a registration routine.)
#
+# This does not include libpcap.c and pcapng.c; those are listed below,
+# and we don't scan them to see whether they have registration
+# routines, we *require* them to have registration routines named
+# register_pcap() and register_pcapng(), and directly call those routines.
+#
set(WIRETAP_C_MODULE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/5views.c
${CMAKE_CURRENT_SOURCE_DIR}/aethra.c
@@ -52,7 +57,6 @@ set(WIRETAP_C_MODULE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/json.c
${CMAKE_CURRENT_SOURCE_DIR}/k12.c
${CMAKE_CURRENT_SOURCE_DIR}/lanalyzer.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libpcap.c
${CMAKE_CURRENT_SOURCE_DIR}/log3gpp.c
${CMAKE_CURRENT_SOURCE_DIR}/logcat.c
${CMAKE_CURRENT_SOURCE_DIR}/logcat_text.c
@@ -71,7 +75,6 @@ set(WIRETAP_C_MODULE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/ngsniffer.c
${CMAKE_CURRENT_SOURCE_DIR}/packetlogger.c
${CMAKE_CURRENT_SOURCE_DIR}/pcap-common.c
- ${CMAKE_CURRENT_SOURCE_DIR}/pcapng.c
${CMAKE_CURRENT_SOURCE_DIR}/peekclassic.c
${CMAKE_CURRENT_SOURCE_DIR}/peektagged.c
${CMAKE_CURRENT_SOURCE_DIR}/rfc7468.c
@@ -105,6 +108,8 @@ set(WIRETAP_MODULE_FILES
#
set(WIRETAP_NONGENERATED_C_FILES
${WIRETAP_C_MODULE_FILES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/pcapng.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libpcap.c
${CMAKE_CURRENT_SOURCE_DIR}/file_access.c
${CMAKE_CURRENT_SOURCE_DIR}/file_wrappers.c
${CMAKE_CURRENT_SOURCE_DIR}/merge.c