Add an optional flag and a type for UUID parameters for stat taps.

For future use, with common code to parse the -z argument.

Change-Id: Ib2a11bd5c91b5ac48ced2cd2d112b97c301ff72a
Reviewed-on: https://code.wireshark.org/review/5307
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-11-14 11:25:04 -08:00
parent 42c6e57891
commit 4729e13df7
25 changed files with 28 additions and 24 deletions

View File

@ -40,6 +40,7 @@ typedef enum {
PARAM_UINT,
PARAM_STRING,
PARAM_ENUM,
PARAM_UUID,
PARAM_FILTER
} param_type;
@ -47,6 +48,7 @@ typedef struct _tap_param {
param_type type;
const char *title;
const enum_val_t *enum_vals;
gboolean optional;
} tap_param;
/*

View File

@ -185,7 +185,7 @@ gtk_afpstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param afp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg afp_stat_dlg = {

View File

@ -253,7 +253,7 @@ dhcpstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param bootp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg dhcp_stat_dlg = {

View File

@ -206,7 +206,7 @@ static void gtk_camelcounter_init(const char *opt_arg, void *userdata _U_)
}
static tap_param camel_counter_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg camel_counter_dlg = {

View File

@ -218,7 +218,7 @@ static void gtk_camelsrt_init(const char *opt_arg, void *userdata _U_)
}
static tap_param camel_srt_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg camel_srt_dlg = {

View File

@ -214,7 +214,7 @@ gtk_diameterstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param diameter_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg diameter_stat_dlg = {

View File

@ -190,7 +190,7 @@ gtk_fcstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param fc_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg fc_stat_dlg = {

View File

@ -209,7 +209,7 @@ gtk_gtpstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param gtp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg gtp_stat_dlg = {

View File

@ -50,7 +50,7 @@ void register_tap_listener_gtk_h225counter(void);
static void gtk_h225counter_init(const char *opt_arg, void *userdata);
static tap_param h225_counter_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg h225_counter_dlg = {

View File

@ -51,7 +51,7 @@ void register_tap_listener_gtk_h225rassrt(void);
static void gtk_h225rassrt_init(const char *opt_arg, void *userdata);
static tap_param h225_rassrt_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg h225_rassrt_dlg = {

View File

@ -223,7 +223,7 @@ gtk_ldapstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param ldap_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg ldap_stat_dlg = {

View File

@ -1405,7 +1405,7 @@ static void gtk_mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
static tap_param mac_lte_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg mac_lte_stat_dlg = {

View File

@ -209,7 +209,7 @@ gtk_megacostat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param megaco_srt_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg megaco_srt_dlg = {

View File

@ -296,7 +296,7 @@ gtk_mgcpstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param mgcp_srt_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg mgcp_srt_dlg = {

View File

@ -705,7 +705,7 @@ gtk_ncpstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param ncp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg ncp_stat_dlg = {

View File

@ -365,7 +365,7 @@ gtk_radiusstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param radius_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg radius_srt_dlg = {

View File

@ -1649,7 +1649,7 @@ static void gtk_rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
static tap_param rlc_lte_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg rlc_lte_stat_dlg = {

View File

@ -283,8 +283,8 @@ static const enum_val_t scsi_command_sets[] = {
};
static tap_param scsi_stat_params[] = {
{ PARAM_ENUM, "Command set", scsi_command_sets },
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_ENUM, "Command set", scsi_command_sets, FALSE },
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg scsi_stat_dlg = {

View File

@ -53,7 +53,7 @@ void register_tap_listener_sctpstat(void);
static void sctpstat_init(const char *opt_arg, void *userdata);
static tap_param sctp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg sctp_stat_dlg = {

View File

@ -675,7 +675,7 @@ gtk_sipstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param sip_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg sip_stat_dlg = {

View File

@ -198,7 +198,7 @@ gtk_smb2stat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param smb2_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg smb2_stat_dlg = {

View File

@ -227,7 +227,7 @@ gtk_smbstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param smb_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg smb_stat_dlg = {

View File

@ -541,7 +541,7 @@ init_gtk_tree(const char* opt_arg, void *userdata _U_)
}
static tap_param tree_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static void

View File

@ -180,6 +180,7 @@ tap_param_dlg_start_button_clicked(GtkWidget *item _U_, gpointer dialog_data)
break;
case PARAM_STRING:
case PARAM_UUID: /* XXX - do as multiple fixed-length boxes */
case PARAM_FILTER:
g_string_append(params,
gtk_entry_get_text(GTK_ENTRY(dlg_data->param_items[i])));
@ -377,6 +378,7 @@ tap_param_dlg_cb(GtkAction *action _U_, gpointer data)
case PARAM_STRING:
case PARAM_FILTER:
case PARAM_UUID:
dlg_set_activate(current_dlg->param_items[i], start_button);
break;
}

View File

@ -399,7 +399,7 @@ gtk_wspstat_init(const char *opt_arg, void *userdata _U_)
}
static tap_param wsp_stat_params[] = {
{ PARAM_FILTER, "Filter", NULL }
{ PARAM_FILTER, "Filter", NULL, TRUE }
};
static tap_param_dlg wsp_stat_dlg = {