aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_parser.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2018-04-20 14:59:14 +0200
committerRoland Knall <rknall@gmail.com>2018-05-08 10:31:38 +0000
commit0af6ba1a53b604dc294c08c6dfc4dde17b4ea506 (patch)
tree0732809821a94b3f94ab0957fa2887e5221feb3c /extcap_parser.c
parent02a67d4e1e0828f1df17992330d9c4e02db95de5 (diff)
extcap: Group arguments
Group arguments together to better present them, as well as to have the possibility to better facilitate settings categories. The order of tabs is defined by the numbering of arguments and their appearance. If no tab can be found or no group has been defined for the argument, a default tab will be added. Change-Id: I032881193e09d4ad5d65c9f73fede87695acdace Reviewed-on: https://code.wireshark.org/review/27054 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap_parser.c')
-rw-r--r--extcap_parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/extcap_parser.c b/extcap_parser.c
index 75d248abf1..411e2522be 100644
--- a/extcap_parser.c
+++ b/extcap_parser.c
@@ -169,6 +169,8 @@ static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) {
param_type = EXTCAP_PARAM_FILE_MUSTEXIST;
} else if (g_ascii_strcasecmp(arg, "fileext") == 0) {
param_type = EXTCAP_PARAM_FILE_EXTENSION;
+ } else if (g_ascii_strcasecmp(arg, "group") == 0) {
+ param_type = EXTCAP_PARAM_GROUP;
} else if (g_ascii_strcasecmp(arg, "name") == 0) {
param_type = EXTCAP_PARAM_NAME;
} else if (g_ascii_strcasecmp(arg, "enabled") == 0) {
@@ -251,6 +253,7 @@ void extcap_free_arg(extcap_arg *a) {
g_free(a->placeholder);
g_free(a->fileextension);
g_free(a->regexp);
+ g_free(a->group);
g_free(a->device_name);
if (a->range_start != NULL)
@@ -462,6 +465,11 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence
target_arg->regexp = g_strdup(param_value);
}
+ if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_GROUP)))
+ != NULL) {
+ target_arg->group = g_strdup(param_value);
+ }
+
if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_REQUIRED)))
!= NULL) {
target_arg->is_required = g_regex_match_simple(EXTCAP_BOOLEAN_REGEX, param_value, G_REGEX_CASELESS, (GRegexMatchFlags)0);