aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_parser.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-29 14:50:55 +0100
committerAnders Broman <a.broman58@gmail.com>2015-12-30 08:10:54 +0000
commit0921c8214ef225fe2b84c5ace0113ea1e931c70c (patch)
tree42c2c029f3eed5a1b21e017dbe10124dac80dab6 /extcap_parser.c
parentb1239859664fa2ffe71d1ddbd6416c5b7f87bd5d (diff)
extcap: Add Required and cleanup
An option may now use the "required=true" argument (see sshdump.c) which will ensure, that the capture can only be started via the dialog, if the option has been provided. To ensure, that this is working properly, multiselect has been moved to a separate source file. Renamed one method so it may not interfere with a future save functionality, and cleaned up the interface to use only default buttons and roles ONLY the Qt interface is being supported. Change-Id: Ie1c9a63c1bba2e557d55b1de6f4775d8b9fce515 Reviewed-on: https://code.wireshark.org/review/12912 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@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 4228bc5bd3..154e4aa068 100644
--- a/extcap_parser.c
+++ b/extcap_parser.c
@@ -345,6 +345,8 @@ extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) {
tv->param_type = EXTCAP_PARAM_ENABLED;
} else if (g_ascii_strcasecmp(tv->arg, "parent") == 0) {
tv->param_type = EXTCAP_PARAM_PARENT;
+ } else if (g_ascii_strcasecmp(tv->arg, "required") == 0) {
+ tv->param_type = EXTCAP_PARAM_REQUIRED;
} else {
tv->param_type = EXTCAP_PARAM_UNKNOWN;
}
@@ -475,6 +477,7 @@ extcap_arg *extcap_new_arg(void) {
r->range_end = NULL;
r->default_complex = NULL;
r->fileexists = FALSE;
+ r->is_required = FALSE;
r->values = NULL;
/*r->next_arg = NULL; */
@@ -591,6 +594,11 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
target_arg->fileexists = (v->value[0] == 't' || v->value[0] == 'T');
}
+ if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_REQUIRED))
+ != NULL) {
+ target_arg->is_required = (v->value[0] == 't' || v->value[0] == 'T');
+ }
+
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_TYPE))
== NULL) {
/* printf("no type in ARG sentence\n"); */