diff --git a/epan/epan.c b/epan/epan.c index 9eb597164c..74ddfe5001 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -32,6 +32,7 @@ #include +#include #include #include @@ -96,6 +97,12 @@ epan_get_version(void) { return VERSION; } +void +epan_get_version_number(int *major, int *minor, int *micro) +{ + get_ws_version_number(major, minor, micro); +} + #if defined(_WIN32) // Libgcrypt prints all log messages to stderr by default. This is noisier // than we would like on Windows. In particular slow_gatherer tends to print diff --git a/epan/epan.h b/epan/epan.h index a667325ff2..39ecf72fc1 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -158,6 +158,8 @@ WS_DLL_PUBLIC void epan_free(epan_t *session); WS_DLL_PUBLIC const gchar* epan_get_version(void); +WS_DLL_PUBLIC void epan_get_version_number(int *major, int *minor, int *micro); + /** * Set/unset the tree to always be visible when epan_dissect_init() is called. * This state change sticks until cleared, rather than being done per function call. diff --git a/ws_version_info.c b/ws_version_info.c index 6d47b16bcc..7e5fed027d 100644 --- a/ws_version_info.c +++ b/ws_version_info.c @@ -383,6 +383,17 @@ get_ws_vcs_version_info(void) #endif } +void +get_ws_version_number(int *major, int *minor, int *micro) +{ + if (major) + *major = VERSION_MAJOR; + if (minor) + *minor = VERSION_MINOR; + if (micro) + *micro = VERSION_MICRO; +} + /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * diff --git a/ws_version_info.h b/ws_version_info.h index ec5b1da621..6877704cfd 100644 --- a/ws_version_info.h +++ b/ws_version_info.h @@ -66,6 +66,11 @@ void show_version(const gchar *prog_name, GString *comp_info_str, GString *runti */ const char *get_ws_vcs_version_info(void); +/* + * Return version number as integers. + */ +void get_ws_version_number(int *major, int *minor, int *micro); + #ifdef __cplusplus } #endif /* __cplusplus */