From 7477431325e4b9d294ef361c83d3a66dbd3ee7d9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 31 May 2021 04:39:59 -0700 Subject: [PATCH] wiretap: un-export some routines. wtap_file_get_shb_for_new_file() and wtap_file_get_nrb_for_new_file() are intended to be used only internally to libwiretap and by libwiretap plugins. --- debian/libwiretap0.symbols | 2 -- wiretap/wtap-int.h | 42 ++++++++++++++++++++++++++++++++++++- wiretap/wtap.h | 43 -------------------------------------- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/debian/libwiretap0.symbols b/debian/libwiretap0.symbols index eecf527fff..c5e0520270 100644 --- a/debian/libwiretap0.symbols +++ b/debian/libwiretap0.symbols @@ -95,10 +95,8 @@ libwiretap.so.0 libwiretap0 #MINVER# wtap_file_encap@Base 1.9.1 wtap_file_get_idb_info@Base 1.9.1 wtap_file_get_nrb@Base 2.1.2 - wtap_file_get_nrb_for_new_file@Base 1.99.9 wtap_file_get_num_shbs@Base 3.3.0 wtap_file_get_shb@Base 1.99.9 - wtap_file_get_shb_for_new_file@Base 1.99.9 wtap_file_size@Base 1.9.1 wtap_file_tsprec@Base 1.99.0 wtap_file_type_subtype@Base 1.12.0~rc1 diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 173135a95e..62c6ffb578 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -127,7 +127,6 @@ WS_DLL_PUBLIC gboolean wtap_dump_file_write(wtap_dumper *wdh, const void *buf, WS_DLL_PUBLIC gint64 wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err); WS_DLL_PUBLIC gint64 wtap_dump_file_tell(wtap_dumper *wdh, int *err); - extern gint wtap_num_file_types; #include @@ -363,6 +362,47 @@ struct backwards_compatibiliity_lua_name { WS_DLL_PUBLIC const GArray *get_backwards_compatibility_lua_table(void); +/** + * @brief Gets new section header block for new file, based on existing info. + * @details Creates a new wtap_block_t section header block and only + * copies appropriate members of the SHB for a new file. In + * particular, the comment string is copied, and any custom options + * which should be copied are copied. The os, hardware, and + * application strings are *not* copied. + * + * @note Use wtap_free_shb() to free the returned section header. + * + * @param wth The wiretap session. + * @return The new section header, which must be wtap_free_shb'd. + */ +GArray* wtap_file_get_shb_for_new_file(wtap *wth); + +/** + * @brief Generate an IDB, given a wiretap handle for the file, + * using the file's encapsulation type, snapshot length, + * and time stamp resolution, and add it to the interface + * data for a file. + * @note This requires that the encapsulation type and time stamp + * resolution not be per-packet; it will terminate the process + * if either of them are. + * + * @param wth The wiretap handle for the file. + */ +WS_DLL_PUBLIC +void wtap_add_generated_idb(wtap *wth); + +/** + * @brief Gets new name resolution info for new file, based on existing info. + * @details Creates a new wtap_block_t of name resolution info and only + * copies appropriate members for a new file. + * + * @note Use wtap_free_nrb() to free the returned pointer. + * + * @param wth The wiretap session. + * @return The new name resolution info, which must be freed. + */ +GArray* wtap_file_get_nrb_for_new_file(wtap *wth); + #endif /* __WTAP_INT_H__ */ /* diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 3727634850..e79aa5ff84 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1824,22 +1824,6 @@ guint wtap_file_get_num_shbs(wtap *wth); WS_DLL_PUBLIC wtap_block_t wtap_file_get_shb(wtap *wth, guint shb_num); -/** - * @brief Gets new section header block for new file, based on existing info. - * @details Creates a new wtap_block_t section header block and only - * copies appropriate members of the SHB for a new file. In - * particular, the comment string is copied, and any custom options - * which should be copied are copied. The os, hardware, and - * application strings are *not* copied. - * - * @note Use wtap_free_shb() to free the returned section header. - * - * @param wth The wiretap session. - * @return The new section header, which must be wtap_free_shb'd. - */ -WS_DLL_PUBLIC -GArray* wtap_file_get_shb_for_new_file(wtap *wth); - /** * @brief Sets or replaces the section header comment. * @details The passed-in comment string is set to be the comment @@ -1853,20 +1837,6 @@ GArray* wtap_file_get_shb_for_new_file(wtap *wth); WS_DLL_PUBLIC void wtap_write_shb_comment(wtap *wth, gchar *comment); -/** - * @brief Generate an IDB, given a wiretap handle for the file, - * using the file's encapsulation type, snapshot length, - * and time stamp resolution, and add it to the interface - * data for a file. - * @note This requires that the encapsulation type and time stamp - * resolution not be per-packet; it will terminate the process - * if either of them are. - * - * @param wth The wiretap handle for the file. - */ -WS_DLL_PUBLIC -void wtap_add_generated_idb(wtap *wth); - /** * @brief Gets existing interface descriptions. * @details Returns a new struct containing a pointer to the existing @@ -1938,19 +1908,6 @@ gchar *wtap_get_debug_if_descr(const wtap_block_t if_descr, WS_DLL_PUBLIC wtap_block_t wtap_file_get_nrb(wtap *wth); -/** - * @brief Gets new name resolution info for new file, based on existing info. - * @details Creates a new wtap_block_t of name resolution info and only - * copies appropriate members for a new file. - * - * @note Use wtap_free_nrb() to free the returned pointer. - * - * @param wth The wiretap session. - * @return The new name resolution info, which must be freed. - */ -WS_DLL_PUBLIC -GArray* wtap_file_get_nrb_for_new_file(wtap *wth); - /*** close the file descriptors for the current file ***/ WS_DLL_PUBLIC void wtap_fdclose(wtap *wth);