2021-11-30 13:01:36 +00:00
|
|
|
/** @file
|
|
|
|
*
|
2014-06-22 01:02:27 +00:00
|
|
|
* Declarations of routines to report version information for Wireshark
|
|
|
|
* programs
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2014-06-22 01:02:27 +00:00
|
|
|
*/
|
|
|
|
|
2016-04-19 07:03:08 +00:00
|
|
|
#ifndef __WS_VERSION_INFO_H__
|
|
|
|
#define __WS_VERSION_INFO_H__
|
2014-06-22 01:02:27 +00:00
|
|
|
|
2016-04-19 07:03:08 +00:00
|
|
|
#include <glib.h>
|
2022-02-24 13:27:08 +00:00
|
|
|
#include <wsutil/feature_list.h>
|
2014-06-22 01:02:27 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2018-12-13 02:16:15 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* "appname" is a string that appears at the beginning of the information;
|
2022-02-24 13:27:08 +00:00
|
|
|
* it should be the application name. "(Wireshark)" will be added if
|
2018-12-13 02:16:15 +00:00
|
|
|
* the program isn't Wireshark.
|
|
|
|
*
|
2022-02-24 13:27:08 +00:00
|
|
|
* "gather_compile" is called (if non-null) to add any additional build-time
|
|
|
|
* information.
|
2018-12-13 02:16:15 +00:00
|
|
|
*
|
2022-02-24 13:27:08 +00:00
|
|
|
* "gather_runtime" is called (if non-null) to add any additional
|
2018-12-13 02:16:15 +00:00
|
|
|
* run-time information; this is required in order to, for example,
|
2022-02-24 13:27:08 +00:00
|
|
|
* put the libcap information into the string, as we currently
|
2018-12-13 02:16:15 +00:00
|
|
|
* don't use libcap in TShark.
|
|
|
|
*/
|
|
|
|
void ws_init_version_info(const char *appname,
|
2022-02-24 13:27:08 +00:00
|
|
|
gather_feature_func gather_compile,
|
|
|
|
gather_feature_func gather_runtime);
|
2018-12-13 02:16:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a string giving the application name, as provided to
|
|
|
|
* ws_init_version_info(), followed by a string giving the
|
|
|
|
* application version.
|
|
|
|
*/
|
|
|
|
const char *get_appname_and_version(void);
|
|
|
|
|
2014-12-31 03:36:26 +00:00
|
|
|
/*
|
2014-12-31 06:28:25 +00:00
|
|
|
* Get various library compile-time versions, put them in a GString,
|
|
|
|
* and return the GString.
|
2014-12-31 03:36:26 +00:00
|
|
|
*
|
2022-02-24 13:27:08 +00:00
|
|
|
* "gather_compile" is called (if non-null) to add any additional build-time
|
|
|
|
* information.
|
2014-12-31 03:36:26 +00:00
|
|
|
*/
|
2022-02-24 13:27:08 +00:00
|
|
|
GString *get_compiled_version_info(gather_feature_func gather_compile);
|
2014-12-31 03:36:26 +00:00
|
|
|
|
|
|
|
/*
|
2014-12-31 06:28:25 +00:00
|
|
|
* Get various library run-time versions, and the OS version, put them in
|
|
|
|
* a GString, and return the GString.
|
|
|
|
*
|
2022-02-24 13:27:08 +00:00
|
|
|
* "gather_runtime" is called (if non-null) to add any additional
|
|
|
|
* run-time information; this is required in order to, for example,
|
|
|
|
* put the libcap information into the string, as we currently
|
2018-04-15 01:41:05 +00:00
|
|
|
* don't use libcap in TShark.
|
2014-12-31 03:36:26 +00:00
|
|
|
*/
|
2022-02-24 13:27:08 +00:00
|
|
|
GString *get_runtime_version_info(gather_feature_func gather_runtime);
|
2014-12-31 03:36:26 +00:00
|
|
|
|
2014-06-22 01:02:27 +00:00
|
|
|
/*
|
|
|
|
* Return a version number string for Wireshark, including, for builds
|
|
|
|
* from a tree checked out from Wireshark's version control system,
|
|
|
|
* something identifying what version was checked out.
|
|
|
|
*/
|
2016-04-19 07:03:08 +00:00
|
|
|
const char *get_ws_vcs_version_info(void);
|
2014-06-22 01:02:27 +00:00
|
|
|
|
2021-07-03 12:15:15 +00:00
|
|
|
/*
|
|
|
|
* Shorter version of get_ws_vcs_version_info().
|
|
|
|
*/
|
|
|
|
const char *get_ws_vcs_version_info_short(void);
|
|
|
|
|
2017-09-03 14:03:31 +00:00
|
|
|
/*
|
|
|
|
* Return version number as integers.
|
|
|
|
*/
|
|
|
|
void get_ws_version_number(int *major, int *minor, int *micro);
|
|
|
|
|
2018-12-13 02:16:15 +00:00
|
|
|
/*
|
|
|
|
* Show the program name and version number information on the standard
|
|
|
|
* output; this is used for command-line "show the version" options.
|
|
|
|
*/
|
|
|
|
void show_version(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Show the program name and version number information, a supplied
|
|
|
|
* description string, and a "See {URL} for more information" message.
|
|
|
|
* This is used for command-line "help" options.
|
|
|
|
*/
|
|
|
|
void show_help_header(const char *description);
|
|
|
|
|
2014-06-22 01:02:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2016-04-19 07:03:08 +00:00
|
|
|
#endif /* __WS_VERSION_INFO_H__ */
|