Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
version_info.h File Reference
#include <glib.h>
#include <wsutil/feature_list.h>

Go to the source code of this file.

Functions

WS_DLL_PUBLIC void ws_init_version_info (const char *appname, gather_feature_func gather_compile, gather_feature_func gather_runtime)
 Initialize version and build information for the application. Initialize information about the program for various purposes, including reporting the version and build information for the program, putting that information into crash dumps if possible, and giving the program name and version information into capture files written by the program if possible.
 
WS_DLL_PUBLIC const char * get_appname_and_version (void)
 Retrieve the application name and version string.
 
WS_DLL_PUBLIC void gather_pcre2_compile_info (feature_list l)
 Collect PCRE2 compile-time feature information.
 
WS_DLL_PUBLIC void gather_xxhash_compile_info (feature_list l)
 Collect XXH3/XXHash compile-time feature information.
 
WS_DLL_PUBLIC void gather_zlib_compile_info (feature_list l)
 Collect zlib compile-time feature information.
 
WS_DLL_PUBLIC void gather_zlib_ng_compile_info (feature_list l)
 Collect zlib-ng compile-time feature information.
 
WS_DLL_PUBLIC GString * get_compiled_version_info (gather_feature_func gather_compile)
 Retrieve compile-time version information for various libraries.
 
WS_DLL_PUBLIC void gather_pcre2_runtime_info (feature_list l)
 Collect PCRE2 runtime feature information.
 
WS_DLL_PUBLIC void gather_xxhash_runtime_info (feature_list l)
 Collect XXHash runtime feature information.
 
WS_DLL_PUBLIC void gather_zlib_runtime_info (feature_list l)
 Collect zlib runtime feature information.
 
WS_DLL_PUBLIC GString * get_runtime_version_info (gather_feature_func gather_runtime)
 Retrieve runtime version information for libraries and the operating system.
 
WS_DLL_PUBLIC const char * get_ws_vcs_version_info (void)
 Retrieve the Wireshark version string with VCS metadata.
 
WS_DLL_PUBLIC const char * get_ss_vcs_version_info (void)
 Retrieve the Stratoshark version string with VCS metadata.
 
WS_DLL_PUBLIC const char * get_ws_vcs_version_info_short (void)
 Retrieve a shortened Wireshark version string with VCS metadata.
 
WS_DLL_PUBLIC void get_ws_version_number (int *major, int *minor, int *micro)
 Retrieve the Wireshark version number as integers.
 
WS_DLL_PUBLIC void show_version (void)
 Display the program name and version to standard output.
 
WS_DLL_PUBLIC void show_help_header (const char *description)
 Display help header with program name, version, and description.
 
WS_DLL_PUBLIC const char * get_copyright_info (void)
 Retrieve the copyright information string.
 
WS_DLL_PUBLIC const char * get_license_info (void)
 Retrieve the application's license information string.
 
WS_DLL_PUBLIC const char * get_license_info_short (void)
 Retrieve a short summary of the application's license information.
 

Detailed Description

Declarations of routines to report version information for Wireshark programs

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ gather_pcre2_compile_info()

WS_DLL_PUBLIC void gather_pcre2_compile_info ( feature_list  l)

Collect PCRE2 compile-time feature information.

Populates the given feature_list with details about the PCRE2 library's compile-time capabilities, such as Unicode support, JIT availability, and other configuration flags.

Parameters
lFeature list to populate with PCRE2 compile information.

◆ gather_pcre2_runtime_info()

WS_DLL_PUBLIC void gather_pcre2_runtime_info ( feature_list  l)

Collect PCRE2 runtime feature information.

Populates the given feature_list with details about the PCRE2 library's runtime capabilities, such as available features, runtime configuration, and support for specific modes or extensions.

Parameters
lFeature list to populate with PCRE2 runtime information.

◆ gather_xxhash_compile_info()

WS_DLL_PUBLIC void gather_xxhash_compile_info ( feature_list  l)

Collect XXH3/XXHash compile-time feature information.

Populates the provided feature_list with details about the XXHash library's compile-time capabilities, such as algorithm variants, platform optimizations, and available hashing modes.

Parameters
lFeature list to populate with XXHash compile information.

◆ gather_xxhash_runtime_info()

WS_DLL_PUBLIC void gather_xxhash_runtime_info ( feature_list  l)

Collect XXHash runtime feature information.

Populates the given feature_list with details about the XXHash library's runtime capabilities, such as supported hashing algorithms, performance optimizations, and platform-specific features available at runtime.

Parameters
lFeature list to populate with XXHash runtime information.

◆ gather_zlib_compile_info()

WS_DLL_PUBLIC void gather_zlib_compile_info ( feature_list  l)

Collect zlib compile-time feature information.

Populates the provided feature_list with details about the zlib library's compile-time configuration, such as version, compression capabilities, and optional features like GZIP or raw deflate support.

Parameters
lFeature list to populate with zlib compile information.

◆ gather_zlib_ng_compile_info()

WS_DLL_PUBLIC void gather_zlib_ng_compile_info ( feature_list  l)

Collect zlib-ng compile-time feature information.

Populates the provided feature_list with details about the zlib-ng library's compile-time configuration, such as enabled compression strategies, API compatibility modes, and platform-specific optimizations.

Parameters
lFeature list to populate with zlib-ng compile information.

◆ gather_zlib_runtime_info()

WS_DLL_PUBLIC void gather_zlib_runtime_info ( feature_list  l)

Collect zlib runtime feature information.

Populates the given feature_list with details about the zlib library's runtime capabilities, such as the loaded version, available compression features, and any platform-specific runtime behaviors.

Parameters
lFeature list to populate with zlib runtime information.

◆ get_appname_and_version()

WS_DLL_PUBLIC const char * get_appname_and_version ( void  )

Retrieve the application name and version string.

Returns a string containing the application name (as set by ws_init_version_info()) followed by the application version. Useful for display in logs, diagnostics, or user-facing interfaces.

Returns
A constant string with the application name and version.

◆ get_compiled_version_info()

WS_DLL_PUBLIC GString * get_compiled_version_info ( gather_feature_func  gather_compile)

Retrieve compile-time version information for various libraries.

Constructs and returns a GString containing compile-time version details for linked libraries. If gather_compile is non-NULL, it is invoked to append additional build-time information to the string.

Parameters
gather_compileOptional callback to add extra compile-time features.
Returns
A newly allocated GString with version info.

◆ get_copyright_info()

WS_DLL_PUBLIC const char * get_copyright_info ( void  )

Retrieve the copyright information string.

Returns a constant string containing copyright details for the application, including ownership and licensing terms. This may be displayed in version dialogs, help messages, or about boxes.

Returns
A constant string with copyright information.

◆ get_license_info()

WS_DLL_PUBLIC const char * get_license_info ( void  )

Retrieve the application's license information string.

Returns a constant string describing the licensing terms under which the application is distributed. This may include references to open-source licenses such as GPL, MIT, or others, and is suitable for display in help messages, about dialogs, or documentation.

Returns
A constant string with license information.

◆ get_license_info_short()

WS_DLL_PUBLIC const char * get_license_info_short ( void  )

Retrieve a short summary of the application's license information.

Returns a concise string describing the application's licensing terms, suitable for brief displays such as command-line output or about dialogs.

Returns
A constant string with abbreviated license information.

◆ get_runtime_version_info()

WS_DLL_PUBLIC GString * get_runtime_version_info ( gather_feature_func  gather_runtime)

Retrieve runtime version information for libraries and the operating system.

Constructs and returns a GString containing runtime version details for various linked libraries and the host OS. If gather_runtime is non-NULL, it is invoked to append additional runtime-specific information, such as libcap details, which may not be included by default (e.g., in TShark).

Parameters
gather_runtimeOptional callback to add extra runtime features.
Returns
A newly allocated GString with runtime version info.

◆ get_ss_vcs_version_info()

WS_DLL_PUBLIC const char * get_ss_vcs_version_info ( void  )

Retrieve the Stratoshark version string with VCS metadata.

Returns a string containing the Stratoshark version number. For builds from a source tree checked out via version control, the string includes additional metadata identifying the specific version or commit.

Returns
A constant string with the Stratoshark version and VCS details.

◆ get_ws_vcs_version_info()

WS_DLL_PUBLIC const char * get_ws_vcs_version_info ( void  )

Retrieve the Wireshark version string with VCS metadata.

Returns a string containing the Wireshark version number. For builds from a source tree checked out via version control, the string includes additional metadata identifying the specific version or commit.

Returns
A constant string with the Wireshark version and VCS details.

◆ get_ws_vcs_version_info_short()

WS_DLL_PUBLIC const char * get_ws_vcs_version_info_short ( void  )

Retrieve a shortened Wireshark version string with VCS metadata.

Returns a concise version string for Wireshark, including minimal version control metadata. This is a trimmed-down alternative to get_ws_vcs_version_info().

Returns
A constant string with abbreviated Wireshark version and VCS info.

◆ get_ws_version_number()

WS_DLL_PUBLIC void get_ws_version_number ( int *  major,
int *  minor,
int *  micro 
)

Retrieve the Wireshark version number as integers.

Populates the provided pointers with the major, minor, and micro components of the Wireshark version number.

Parameters
majorPointer to receive the major version number.
minorPointer to receive the minor version number.
microPointer to receive the micro version number.

◆ show_help_header()

WS_DLL_PUBLIC void show_help_header ( const char *  description)

Display help header with program name, version, and description.

Prints the application name and version number, followed by a user-supplied description string and a standard message directing users to a URL for additional information. Typically used in response to command-line help options (e.g., --help).

Parameters
descriptionA brief description of the program or its functionality.

◆ show_version()

WS_DLL_PUBLIC void show_version ( void  )

Display the program name and version to standard output.

Prints the application name and version number, typically used in response to command-line options requesting version information (e.g., --version).

◆ ws_init_version_info()

WS_DLL_PUBLIC void ws_init_version_info ( const char *  appname,
gather_feature_func  gather_compile,
gather_feature_func  gather_runtime 
)

Initialize version and build information for the application. Initialize information about the program for various purposes, including reporting the version and build information for the program, putting that information into crash dumps if possible, and giving the program name and version information into capture files written by the program if possible.

Parameters
appnameA string that appears at the beginning of the information; it should be the application name. If the program isn't Wireshark, "(Wireshark)" will be added.
gather_compileOptional callback (if non-null) called to add build-time information.
gather_runtimeOptional callback (if non-null) called to add run-time information; this is required in order to, for example, put the libcap information into the string, as we currently don't use libcap in TShark.