From ee1a4109cfc8fb314d151f59859a348765ba9dbf Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Mon, 5 Sep 2016 07:54:47 +0200 Subject: extcap: Add tool-specified helppage Allow the tool to provide a link to a helppage, displayed by clicking on help in the configuration dialog. The URL will be opened using an URL based service, therefore local as well as remote URLs are possible. Change-Id: I58b30244e97919d5cf6892faf96536ddc30fb5a7 Reviewed-on: https://code.wireshark.org/review/17549 Reviewed-by: Roland Knall --- extcap_parser.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'extcap_parser.c') diff --git a/extcap_parser.c b/extcap_parser.c index f2271399d9..f9e2c856ea 100644 --- a/extcap_parser.c +++ b/extcap_parser.c @@ -188,6 +188,8 @@ static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) { param_type = EXTCAP_PARAM_VALIDATION; } else if (g_ascii_strcasecmp(arg, "version") == 0) { param_type = EXTCAP_PARAM_VERSION; + } else if (g_ascii_strcasecmp(arg, "help") == 0) { + param_type = EXTCAP_PARAM_HELP; } else { param_type = EXTCAP_PARAM_UNKNOWN; } @@ -550,11 +552,7 @@ static extcap_interface * extcap_parse_interface_sentence(extcap_token_sentence if (sent == EXTCAP_SENTENCE_UNKNOWN) return NULL; - ri = g_new(extcap_interface, 1); - - ri->call = NULL; - ri->display = NULL; - ri->version = NULL; + ri = g_new0(extcap_interface, 1); ri->if_type = sent; @@ -580,6 +578,11 @@ static extcap_interface * extcap_parse_interface_sentence(extcap_token_sentence ri->version = g_strdup(param_value); } + if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_HELP))) + != NULL) { + ri->help = g_strdup(param_value); + } + return ri; } -- cgit v1.2.1