Skip to content

Commit

Permalink
sharkd: Prefer version_info.h instead of version.h
Browse files Browse the repository at this point in the history
  • Loading branch information
randstr authored and Wireshark GitLab Utility committed Jul 4, 2021
1 parent 3a3fda2 commit 47d2afd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
11 changes: 0 additions & 11 deletions sharkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,17 +780,6 @@ sharkd_set_user_comment(frame_data *fd, const gchar *new_comment)
return 0;
}

#include "version.h"
const char *sharkd_version(void)
{
/* based on get_ws_vcs_version_info(), but shorter */
#ifdef VCSVERSION
return VCSVERSION;
#else
return VERSION;
#endif
}

/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
Expand Down
1 change: 0 additions & 1 deletion sharkd.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ int sharkd_dissect_columns(frame_data *fdata, guint32 frame_ref_num, guint32 pre
int sharkd_dissect_request(guint32 framenum, guint32 frame_ref_num, guint32 prev_dis_num, sharkd_dissect_func_t cb, guint32 dissect_flags, void *data);
const char *sharkd_get_user_comment(const frame_data *fd);
int sharkd_set_user_comment(frame_data *fd, const gchar *new_comment);
const char *sharkd_version(void);

/* sharkd_daemon.c */
int sharkd_init(int argc, char **argv);
Expand Down
3 changes: 2 additions & 1 deletion sharkd_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <ui/rtp_stream.h>
#include <ui/tap-rtp-common.h>
#include <ui/tap-rtp-analysis.h>
#include <version_info.h>
#include <epan/to_str.h>

#include <epan/addr_resolv.h>
Expand Down Expand Up @@ -987,7 +988,7 @@ sharkd_session_process_info(void)
sharkd_json_value_string(NULL, ftype_name((ftenum_t) i));
sharkd_json_array_close();

sharkd_json_value_string("version", sharkd_version());
sharkd_json_value_string("version", get_ws_vcs_version_info_short());

sharkd_json_array_open("nstat");
i = 0;
Expand Down
10 changes: 10 additions & 0 deletions version_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,16 @@ get_ws_vcs_version_info(void)
#endif
}

const char *
get_ws_vcs_version_info_short(void)
{
#ifdef VCSVERSION
return VCSVERSION;
#else
return VERSION;
#endif
}

void
get_ws_version_number(int *major, int *minor, int *micro)
{
Expand Down
5 changes: 5 additions & 0 deletions version_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ GString *get_runtime_version_info(void (*additional_info)(GString *));
*/
const char *get_ws_vcs_version_info(void);

/*
* Shorter version of get_ws_vcs_version_info().
*/
const char *get_ws_vcs_version_info_short(void);

/*
* Return version number as integers.
*/
Expand Down

0 comments on commit 47d2afd

Please sign in to comment.