summaryrefslogtreecommitdiff
path: root/extcap_parser.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2016-09-05 07:54:47 +0200
committerRoland Knall <rknall@gmail.com>2016-09-07 09:09:30 +0000
commitee1a4109cfc8fb314d151f59859a348765ba9dbf (patch)
tree36f0efeb8e85e339824ce3d63841f87385ab971b /extcap_parser.c
parent859cf86c8d25b7ead113821ece4e9dec853e70d6 (diff)
downloadwireshark-ee1a4109cfc8fb314d151f59859a348765ba9dbf.tar.gz
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 <rknall@gmail.com>
Diffstat (limited to 'extcap_parser.c')
-rw-r--r--extcap_parser.c13
1 files changed, 8 insertions, 5 deletions
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;
}