summaryrefslogtreecommitdiff
path: root/extcap_parser.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2014-09-19 19:34:07 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2014-10-06 09:51:56 +0000
commit9c1225f73511b59dd74273545fac401d711cea36 (patch)
tree03b12e1443a273cd91e83a66a24f8092a87ce880 /extcap_parser.c
parent07844512004aacc0a9ecc01ade01081f59a24c64 (diff)
downloadwireshark-9c1225f73511b59dd74273545fac401d711cea36.tar.gz
Modify multicheck to accept parent parameter.
This makes it possible for multicheck to become a tree-like structure. Example: arg {number=4}{call=--devices}{display=Devices}{tooltip=Device selector}{type=multicheck} value {arg=4}{value=dev1}{display=Parent Device}{enabled=t}{default=t} value {arg=4}{value=dev2}{display=Child Device}{parent=dev1}{enabled=t} value {arg=4}{value=dev3}{display=Another Parent Device}{enabled=t} value {arg=4}{value=dev4}{display=Non-clickable Child Device}{parent=dev3} value {arg=4}{value=dev5}{display=Non-clickable Child of Child}{parent=dev4} Change-Id: I59dd7208ca0ec90cccfc49ae049559cdc6c69a4b Reviewed-on: https://code.wireshark.org/review/4192 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@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 29c9b9de9a..3e239702e3 100644
--- a/extcap_parser.c
+++ b/extcap_parser.c
@@ -342,6 +342,8 @@ extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) {
tv->param_type = EXTCAP_PARAM_NAME;
} else if (g_ascii_strcasecmp(tv->arg, "enabled") == 0) {
tv->param_type = EXTCAP_PARAM_ENABLED;
+ } else if (g_ascii_strcasecmp(tv->arg, "parent") == 0) {
+ tv->param_type = EXTCAP_PARAM_PARENT;
} else {
tv->param_type = EXTCAP_PARAM_UNKNOWN;
}
@@ -681,6 +683,7 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
value->enabled = FALSE;
value->is_default = FALSE;
value->arg_num = tint;
+ value->parent = NULL;
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_VALUE))
== NULL) {
@@ -698,6 +701,11 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
}
value->display = g_strdup(v->value);
+ if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_PARENT))
+ != NULL) {
+ value->parent = g_strdup(v->value);
+ }
+
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_DEFAULT))
!= NULL) {
/* printf("found default value\n"); */