Wireshark  4.3.0
The Wireshark network protocol analyzer
version_info.h
Go to the documentation of this file.
1 
13 #ifndef __WS_VERSION_INFO_H__
14 #define __WS_VERSION_INFO_H__
15 
16 #include <glib.h>
17 #include <wsutil/feature_list.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif /* __cplusplus */
22 
23 /*
24  * Initialize information about the program for various purposes, including
25  * reporting the version and build information for the program, putting
26  * that information into crash dumps if possible, and giving the program
27  * name and version information into capture files written by the program
28  * if possible.
29  *
30  * "appname" is a string that appears at the beginning of the information;
31  * it should be the application name. "(Wireshark)" will be added if
32  * the program isn't Wireshark.
33  *
34  * "gather_compile" is called (if non-null) to add any additional build-time
35  * information.
36  *
37  * "gather_runtime" is called (if non-null) to add any additional
38  * run-time information; this is required in order to, for example,
39  * put the libcap information into the string, as we currently
40  * don't use libcap in TShark.
41  */
42 WS_DLL_PUBLIC
43 void ws_init_version_info(const char *appname,
44  gather_feature_func gather_compile,
45  gather_feature_func gather_runtime);
46 
47 /*
48  * Get a string giving the application name, as provided to
49  * ws_init_version_info(), followed by a string giving the
50  * application version.
51  */
52 WS_DLL_PUBLIC
53 const char *get_appname_and_version(void);
54 
55 WS_DLL_PUBLIC
56 void
57 gather_pcre2_compile_info(feature_list l);
58 
59 WS_DLL_PUBLIC
60 void
61 gather_zlib_compile_info(feature_list l);
62 
63 /*
64  * Get various library compile-time versions, put them in a GString,
65  * and return the GString.
66  *
67  * "gather_compile" is called (if non-null) to add any additional build-time
68  * information.
69  */
70 WS_DLL_PUBLIC
71 GString *get_compiled_version_info(gather_feature_func gather_compile);
72 
73 WS_DLL_PUBLIC
74 void
75 gather_pcre2_runtime_info(feature_list l);
76 
77 WS_DLL_PUBLIC
78 void
79 gather_zlib_runtime_info(feature_list l);
80 
81 /*
82  * Get various library run-time versions, and the OS version, put them in
83  * a GString, and return the GString.
84  *
85  * "gather_runtime" is called (if non-null) to add any additional
86  * run-time information; this is required in order to, for example,
87  * put the libcap information into the string, as we currently
88  * don't use libcap in TShark.
89  */
90 WS_DLL_PUBLIC
91 GString *get_runtime_version_info(gather_feature_func gather_runtime);
92 
93 /*
94  * Return a version number string for Wireshark, including, for builds
95  * from a tree checked out from Wireshark's version control system,
96  * something identifying what version was checked out.
97  */
98 WS_DLL_PUBLIC
99 const char *get_ws_vcs_version_info(void);
100 
101 /*
102  * Return a version number string for Logray, including, for builds
103  * from a tree checked out from Logray's version control system,
104  * something identifying what version was checked out.
105  */
106 WS_DLL_PUBLIC
107 const char *get_lr_vcs_version_info(void);
108 
109 /*
110  * Shorter version of get_ws_vcs_version_info().
111  */
112 WS_DLL_PUBLIC
113 const char *get_ws_vcs_version_info_short(void);
114 
115 /*
116  * Return version number as integers.
117  */
118 WS_DLL_PUBLIC
119 void get_ws_version_number(int *major, int *minor, int *micro);
120 
121 /*
122  * Show the program name and version number information on the standard
123  * output; this is used for command-line "show the version" options.
124  */
125 WS_DLL_PUBLIC
126 void show_version(void);
127 
128 /*
129  * Show the program name and version number information, a supplied
130  * description string, and a "See {URL} for more information" message.
131  * This is used for command-line "help" options.
132  */
133 WS_DLL_PUBLIC
134 void show_help_header(const char *description);
135 
136 WS_DLL_PUBLIC
137 const char *get_copyright_info(void);
138 
139 WS_DLL_PUBLIC
140 const char *get_license_info(void);
141 
142 WS_DLL_PUBLIC
143 const char *get_license_info_short(void);
144 
145 #ifdef __cplusplus
146 }
147 #endif /* __cplusplus */
148 
149 #endif /* __WS_VERSION_INFO_H__ */