Add an additional "title" attribute for UAT fields; that's what's
displayed to the user. svn path=/trunk/; revision=27462
This commit is contained in:
parent
14c8a5ba7d
commit
5742ede54c
|
@ -1935,12 +1935,12 @@ void proto_register_snmp(void) {
|
|||
};
|
||||
module_t *snmp_module;
|
||||
static uat_field_t users_fields[] = {
|
||||
UAT_FLD_BUFFER(snmp_users,engine_id,"Engine-id for this entry (empty = any)"),
|
||||
UAT_FLD_LSTRING(snmp_users,userName,"The username"),
|
||||
UAT_FLD_VS(snmp_users,auth_model,auth_types,"Algorithm to be used for authentication."),
|
||||
UAT_FLD_LSTRING(snmp_users,authPassword,"The password used for authenticating packets for this entry"),
|
||||
UAT_FLD_VS(snmp_users,priv_proto,priv_types,"Algorithm to be used for privacy."),
|
||||
UAT_FLD_LSTRING(snmp_users,privPassword,"The password used for encrypting packets for this entry"),
|
||||
UAT_FLD_BUFFER(snmp_users,engine_id,"Engine ID","Engine-id for this entry (empty = any)"),
|
||||
UAT_FLD_LSTRING(snmp_users,userName,"Username","The username"),
|
||||
UAT_FLD_VS(snmp_users,auth_model,"Authentication model",auth_types,"Algorithm to be used for authentication."),
|
||||
UAT_FLD_LSTRING(snmp_users,authPassword,"Password","The password used for authenticating packets for this entry"),
|
||||
UAT_FLD_VS(snmp_users,priv_proto,"Privacy protocol",priv_types,"Algorithm to be used for privacy."),
|
||||
UAT_FLD_LSTRING(snmp_users,privPassword,"Privacy password","The password used for encrypting packets for this entry"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
|
||||
|
|
|
@ -595,8 +595,8 @@ UAT_CSTRING_CB_DEF(macro,text,dfilter_macro_t)
|
|||
|
||||
void dfilter_macro_init(void) {
|
||||
static uat_field_t uat_fields[] = {
|
||||
UAT_FLD_CSTRING_OTHER(macro,name,macro_name_chk,"The name of the macro."),
|
||||
UAT_FLD_CSTRING_ISPRINT(macro,text,"The text this macro resolves to."),
|
||||
UAT_FLD_CSTRING_OTHER(macro,name,"Name",macro_name_chk,"The name of the macro."),
|
||||
UAT_FLD_CSTRING_ISPRINT(macro,text,"Text","The text this macro resolves to."),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
|
||||
|
|
|
@ -435,10 +435,10 @@ proto_register_k12(void)
|
|||
};
|
||||
|
||||
static uat_field_t uat_k12_flds[] = {
|
||||
UAT_FLD_CSTRING_ISPRINT(k12,match,
|
||||
UAT_FLD_CSTRING_ISPRINT(k12,match,"Match string",
|
||||
"A string that will be matched (a=A) against an .stk filename or the name of a port.\n"
|
||||
"The first match wins, the order of entries in the table is important!."),
|
||||
UAT_FLD_CSTRING_OTHER(k12,protos,protos_chk_cb,
|
||||
UAT_FLD_CSTRING_OTHER(k12,protos,"Protocol",protos_chk_cb,
|
||||
"The lowest layer protocol described by this .stk file (eg: mtp2).\n"
|
||||
"Use (sscop:sscf-nni) for sscf-nni (MTP3b) with sscop"),
|
||||
UAT_END_FIELDS
|
||||
|
|
|
@ -3208,10 +3208,10 @@ proto_register_sccp(void)
|
|||
|
||||
|
||||
static uat_field_t users_flds[] = {
|
||||
UAT_FLD_DEC(sccp_users,ni,"Network Indicator"),
|
||||
UAT_FLD_RANGE(sccp_users,called_pc,65535,"DPCs for which this protocol is to be used"),
|
||||
UAT_FLD_RANGE(sccp_users,called_ssn,65535,"Called SSNs for which this protocol is to be used"),
|
||||
UAT_FLD_VS(sccp_users,user,sccp_users_vals,"The User Protocol"),
|
||||
UAT_FLD_DEC(sccp_users,ni,"Network Indicator","Network Indicator"),
|
||||
UAT_FLD_RANGE(sccp_users,called_pc,"Called DPCs",65535,"DPCs for which this protocol is to be used"),
|
||||
UAT_FLD_RANGE(sccp_users,called_ssn,"Called SSNs",65535,"Called SSNs for which this protocol is to be used"),
|
||||
UAT_FLD_VS(sccp_users,user,"User protocol",sccp_users_vals,"The User Protocol"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Do not modify this file. */
|
||||
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
|
||||
/* packet-snmp.c */
|
||||
/* ../../tools/asn2wrs.py -b -p snmp -c snmp.cnf -s packet-snmp-template snmp.asn */
|
||||
/* ../../tools/asn2wrs.py -b -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . snmp.asn */
|
||||
|
||||
/* Input file: packet-snmp-template.c */
|
||||
|
||||
|
@ -3417,12 +3417,12 @@ void proto_register_snmp(void) {
|
|||
};
|
||||
module_t *snmp_module;
|
||||
static uat_field_t users_fields[] = {
|
||||
UAT_FLD_BUFFER(snmp_users,engine_id,"Engine-id for this entry (empty = any)"),
|
||||
UAT_FLD_LSTRING(snmp_users,userName,"The username"),
|
||||
UAT_FLD_VS(snmp_users,auth_model,auth_types,"Algorithm to be used for authentication."),
|
||||
UAT_FLD_LSTRING(snmp_users,authPassword,"The password used for authenticating packets for this entry"),
|
||||
UAT_FLD_VS(snmp_users,priv_proto,priv_types,"Algorithm to be used for privacy."),
|
||||
UAT_FLD_LSTRING(snmp_users,privPassword,"The password used for encrypting packets for this entry"),
|
||||
UAT_FLD_BUFFER(snmp_users,engine_id,"Engine ID","Engine-id for this entry (empty = any)"),
|
||||
UAT_FLD_LSTRING(snmp_users,userName,"Username","The username"),
|
||||
UAT_FLD_VS(snmp_users,auth_model,"Authentication model",auth_types,"Algorithm to be used for authentication."),
|
||||
UAT_FLD_LSTRING(snmp_users,authPassword,"Password","The password used for authenticating packets for this entry"),
|
||||
UAT_FLD_VS(snmp_users,priv_proto,"Privacy protocol",priv_types,"Algorithm to be used for privacy."),
|
||||
UAT_FLD_LSTRING(snmp_users,privPassword,"Privacy password","The password used for encrypting packets for this entry"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
|
||||
|
|
|
@ -155,12 +155,12 @@ void proto_register_user_encap(void)
|
|||
module_t *module;
|
||||
|
||||
static uat_field_t user_flds[] = {
|
||||
UAT_FLD_VS(user_encap,encap,user_dlts,"The DLT"),
|
||||
UAT_FLD_PROTO(user_encap,payload_proto,"Protocol to be used for the payload of this DLT"),
|
||||
UAT_FLD_DEC(user_encap,header_size,"Size of an eventual header that precedes the actual payload, 0 means none"),
|
||||
UAT_FLD_PROTO(user_encap,header_proto,"Protocol to be used for the header (empty = data)"),
|
||||
UAT_FLD_DEC(user_encap,trailer_size,"Size of an eventual trailer that follows the actual payload, 0 means none"),
|
||||
UAT_FLD_PROTO(user_encap,trailer_proto,"Protocol to be used for the trailer (empty = data)"),
|
||||
UAT_FLD_VS(user_encap,encap,"DLT",user_dlts,"The DLT"),
|
||||
UAT_FLD_PROTO(user_encap,payload_proto,"Payload protocol","Protocol to be used for the payload of this DLT"),
|
||||
UAT_FLD_DEC(user_encap,header_size,"Header size","Size of an eventual header that precedes the actual payload, 0 means none"),
|
||||
UAT_FLD_PROTO(user_encap,header_proto,"Header protocol","Protocol to be used for the header (empty = data)"),
|
||||
UAT_FLD_DEC(user_encap,trailer_size,"Trailer size","Size of an eventual trailer that follows the actual payload, 0 means none"),
|
||||
UAT_FLD_PROTO(user_encap,trailer_proto,"Trailer protocol","Protocol to be used for the trailer (empty = data)"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ void
|
|||
geoip_db_init(void) {
|
||||
guint i;
|
||||
static uat_field_t geoip_db_paths_fields[] = {
|
||||
UAT_FLD_CSTRING(geoip_mod, path, "The database path"),
|
||||
UAT_FLD_PATHNAME(geoip_mod, path, "Database pathname", "The database path"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
char* geoip_load_error = NULL;
|
||||
|
|
|
@ -494,11 +494,11 @@ void register_mibs(void) {
|
|||
GArray* hfa = g_array_new(FALSE,TRUE,sizeof(hf_register_info));
|
||||
GArray* etta = g_array_new(FALSE,TRUE,sizeof(gint*));
|
||||
static uat_field_t smi_fields[] = {
|
||||
UAT_FLD_CSTRING(smi_mod,name,"The module's name"),
|
||||
UAT_FLD_CSTRING(smi_mod,name,"Module name","The module's name"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
static uat_field_t smi_paths_fields[] = {
|
||||
UAT_FLD_CSTRING(smi_mod,name,"The directory name"),
|
||||
UAT_FLD_CSTRING(smi_mod,name,"Directory path","The directory name"),
|
||||
UAT_END_FIELDS
|
||||
};
|
||||
char* smi_load_error = NULL;
|
||||
|
|
|
@ -100,7 +100,7 @@ uat_t* uat_new(const char* name,
|
|||
uat->help = help;
|
||||
uat->category = category;
|
||||
|
||||
for (i=0;flds_array[i].name;i++) {
|
||||
for (i=0;flds_array[i].title;i++) {
|
||||
fld_data_t* f = g_malloc(sizeof(fld_data_t));
|
||||
|
||||
f->colnum = i+1;
|
||||
|
|
55
epan/uat.h
55
epan/uat.h
|
@ -178,6 +178,7 @@ typedef enum _uat_text_mode_t {
|
|||
*/
|
||||
typedef struct _uat_field_t {
|
||||
const char* name;
|
||||
const char* title;
|
||||
uat_text_mode_t mode;
|
||||
|
||||
struct {
|
||||
|
@ -199,7 +200,7 @@ typedef struct _uat_field_t {
|
|||
} uat_field_t;
|
||||
|
||||
#define FLDFILL NULL
|
||||
#define UAT_END_FIELDS {0,PT_TXTMOD_NONE,{0,0,0},{0,0,0},0,0,FLDFILL}
|
||||
#define UAT_END_FIELDS {NULL,NULL,PT_TXTMOD_NONE,{0,0,0},{0,0,0},0,0,FLDFILL}
|
||||
|
||||
|
||||
#define UAT_CAT_GENERAL "General"
|
||||
|
@ -331,14 +332,21 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
} else { \
|
||||
*out_ptr = ""; *out_len = 0; } }
|
||||
|
||||
#define UAT_FLD_CSTRING(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_str,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_CSTRING(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_str,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
#define UAT_FLD_CSTRING_ISPRINT(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_str_isprint,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_CSTRING_ISPRINT(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_str_isprint,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
#define UAT_FLD_CSTRING_OTHER(basename,field_name,chk,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{ chk ,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_CSTRING_OTHER(basename,field_name,title,chk,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{ chk ,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
/*
|
||||
* PATHNAME - for now, just a CSTRING, but we might want to have a
|
||||
* way to pop up a dialog to let you browse for a file name.
|
||||
*/
|
||||
#define UAT_FLD_PATHNAME(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_str,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
/*
|
||||
* LSTRING MACROS
|
||||
|
@ -355,8 +363,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
} else { \
|
||||
*out_ptr = ""; *out_len = 0; } }
|
||||
|
||||
#define UAT_FLD_LSTRING(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{0,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_LSTRING(basename,field_name,title, desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{0,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -375,8 +383,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_ptr = ((rec_t*)rec)->ptr_element ? ep_memdup(((rec_t*)rec)->ptr_element,((rec_t*)rec)->len_element) : ""; \
|
||||
*out_len = ((rec_t*)rec)->len_element; }
|
||||
|
||||
#define UAT_FLD_BUFFER(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_HEXBYTES,{0,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_BUFFER(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_HEXBYTES,{0,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -390,8 +398,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_ptr = ep_strdup_printf("%d",((rec_t*)rec)->field_name); \
|
||||
*out_len = strlen(*out_ptr); }
|
||||
|
||||
#define UAT_FLD_DEC(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_num_dec,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_DEC(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_num_dec,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -405,8 +413,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_ptr = ep_strdup_printf("%x",((rec_t*)rec)->field_name); \
|
||||
*out_len = strlen(*out_ptr); }
|
||||
|
||||
#define UAT_FLD_HEX(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_num_hex,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_HEX(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_num_hex,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -433,8 +441,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_len = strlen(*out_ptr); return; } } }
|
||||
|
||||
|
||||
#define UAT_FLD_VS(basename,field_name,enum,desc) \
|
||||
{#field_name, PT_TXTMOD_ENUM,{uat_fld_chk_enum,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{&(enum),&(enum),&(enum)},&(enum),desc,FLDFILL}
|
||||
#define UAT_FLD_VS(basename,field_name,title,enum,desc) \
|
||||
{#field_name, title, PT_TXTMOD_ENUM,{uat_fld_chk_enum,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{&(enum),&(enum),&(enum)},&(enum),desc,FLDFILL}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -458,8 +466,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_ptr = ""; *out_len = 0; } }
|
||||
|
||||
|
||||
#define UAT_FLD_PROTO(basename,field_name,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_proto,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
#define UAT_FLD_PROTO(basename,field_name,title,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_proto,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
|
||||
|
||||
/*
|
||||
* RANGE macros
|
||||
|
@ -477,13 +485,8 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out
|
|||
*out_ptr = ""; *out_len = 0; } }
|
||||
|
||||
|
||||
#define UAT_FLD_RANGE(basename,field_name,max,desc) \
|
||||
{#field_name, PT_TXTMOD_STRING,{uat_fld_chk_range,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},\
|
||||
#define UAT_FLD_RANGE(basename,field_name,title,max,desc) \
|
||||
{#field_name, title, PT_TXTMOD_STRING,{uat_fld_chk_range,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},\
|
||||
{GUINT_TO_POINTER(max),GUINT_TO_POINTER(max),GUINT_TO_POINTER(max)},0,desc,FLDFILL}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ comment #[^\n]*\n
|
|||
|
||||
<SEPARATOR>{newline} {
|
||||
linenum++;
|
||||
ERROR(("expecting field %s in previuos line",uat->fields[colnum].name));
|
||||
ERROR(("expecting field %s in previous line",uat->fields[colnum].name));
|
||||
BEGIN START_OF_LINE;
|
||||
}
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ static gboolean uat_dlg_cb(GtkWidget *win _U_, gpointer user_data) {
|
|||
text = (void*) unhexbytes(text, strlen(text), &len, &err);
|
||||
|
||||
if (err) {
|
||||
err = ep_strdup_printf("error in field '%s': %s",f[colnum].name,err);
|
||||
err = ep_strdup_printf("error in field '%s': %s",f[colnum].title,err);
|
||||
goto on_failure;
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ static gboolean uat_dlg_cb(GtkWidget *win _U_, gpointer user_data) {
|
|||
|
||||
if (f[colnum].cb.chk) {
|
||||
if (! f[colnum].cb.chk(dd->rec, text, len, f[colnum].cbdata.chk, f[colnum].fld_data, &err)) {
|
||||
err = ep_strdup_printf("error in field '%s': %s",f[colnum].name,err);
|
||||
err = ep_strdup_printf("error in column '%s': %s",f[colnum].title,err);
|
||||
goto on_failure;
|
||||
}
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ static void uat_edit_dialog(uat_t* uat, gint row) {
|
|||
|
||||
event_box = gtk_event_box_new();
|
||||
|
||||
label = gtk_label_new(f[colnum].name);
|
||||
label = gtk_label_new(f[colnum].title);
|
||||
if (f[colnum].desc != NULL)
|
||||
gtk_tooltips_set_tip(tooltips, event_box, f[colnum].desc, NULL);
|
||||
|
||||
|
@ -576,7 +576,7 @@ static void uat_del_dlg(uat_t* uat, int idx) {
|
|||
GtkWidget *label;
|
||||
char* text = fld_tostr(rec,&(f[colnum]));
|
||||
|
||||
label = gtk_label_new(f[colnum].name);
|
||||
label = gtk_label_new(f[colnum].title);
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, colnum+1, colnum + 2);
|
||||
|
||||
|
@ -856,7 +856,7 @@ static GtkWidget* uat_window(void* u) {
|
|||
gtk_box_pack_start(GTK_BOX(hbox), rep->scrolledwindow, TRUE, TRUE, 0);
|
||||
|
||||
for ( colnum = 0; colnum < uat->ncols; colnum++ ) {
|
||||
gtk_clist_set_column_title(GTK_CLIST(rep->clist), colnum, f[colnum].name);
|
||||
gtk_clist_set_column_title(GTK_CLIST(rep->clist), colnum, f[colnum].title);
|
||||
gtk_clist_set_column_auto_resize(GTK_CLIST(rep->clist), colnum, TRUE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue