diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dfilter/dfilter-macro.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-http.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-isakmp.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-k12.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-pres.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-snmp.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-user_encap.c | 1 | ||||
-rw-r--r-- | epan/geoip_db.c | 1 | ||||
-rw-r--r-- | epan/oids.c | 2 | ||||
-rw-r--r-- | epan/uat-int.h | 3 | ||||
-rw-r--r-- | epan/uat.c | 2 | ||||
-rw-r--r-- | epan/uat.h | 20 | ||||
-rw-r--r-- | epan/uat_load.l | 7 |
15 files changed, 47 insertions, 7 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 9e90c7ed13..25a3b6d136 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -609,6 +609,7 @@ void dfilter_macro_init(void) { macro_copy, macro_update, macro_free, + NULL, uat_fields); fvt_cache = g_hash_table_new(g_str_hash,g_str_equal); diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 4e0560a127..6f8785bcb2 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -2480,6 +2480,7 @@ proto_register_http(void) header_fields_copy_cb, header_fields_update_cb, header_fields_free_cb, + NULL, custom_header_uat_fields ); diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index c12edb4df1..36f95deca8 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -4496,6 +4496,7 @@ proto_register_isakmp(void) NULL, ikev2_uat_data_update_cb, NULL, + NULL, ikev2_uat_flds); prefs_register_uat_preference(isakmp_module, diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index aeac736f4a..4e0ffa53a6 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -462,6 +462,7 @@ proto_register_k12(void) k12_copy_cb, k12_update_cb, k12_free_cb, + NULL, uat_k12_flds); k12_module = prefs_register_protocol(proto_k12, NULL); diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index 19f0d5e5d3..5897b66f72 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -3501,6 +3501,7 @@ void proto_register_mac_lte(void) lcid_drb_mapping_copy_cb, NULL, NULL, + NULL, lcid_drb_mapping_flds ); prefs_register_uat_preference(mac_lte_module, diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c index 72d0bf31e2..f64f4a88eb 100644 --- a/epan/dissectors/packet-pres.c +++ b/epan/dissectors/packet-pres.c @@ -1933,6 +1933,7 @@ void proto_register_pres(void) { pres_copy_cb, NULL, pres_free_cb, + NULL, users_flds); static module_t *pres_module; diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index 9af21cb2ee..75914ff045 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -3340,6 +3340,7 @@ proto_register_sccp(void) sccp_users_copy_cb, sccp_users_update_cb, sccp_users_free_cb, + NULL, users_flds ); /* Register the protocol name and description */ diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index ae373d6431..9522ead85f 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -3108,7 +3108,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { *err = NULL; if (! ue->user.userName.len) - g_string_append_printf(es,"no userName\n",num_ueas); + g_string_append_printf(es,"no userName\n"); for (i=0; i<num_ueas-1; i++) { snmp_ue_assoc_t* u = &(ueas[i]); @@ -3120,7 +3120,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { if (u->engine.len > 0 && memcmp( u->engine.data, ue->engine.data, u->engine.len ) == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { /* XXX: make a string for the engineId */ - g_string_append_printf(es,"duplicate key (userName='%s' engineId='???')\n",ue->user.userName.data); + g_string_append_printf(es,"duplicate key (userName='%s')\n",ue->user.userName.data); } } @@ -3142,6 +3142,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { return; } + UAT_LSTRING_CB_DEF(snmp_users,userName,snmp_ue_assoc_t,user.userName.data,user.userName.len) UAT_LSTRING_CB_DEF(snmp_users,authPassword,snmp_ue_assoc_t,user.authPassword.data,user.authPassword.len) UAT_LSTRING_CB_DEF(snmp_users,privPassword,snmp_ue_assoc_t,user.privPassword.data,user.privPassword.len) @@ -3510,7 +3511,7 @@ void proto_register_snmp(void) { "snmp.T_operation", HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 2025 "packet-snmp-template.c" +#line 2026 "packet-snmp-template.c" }; /* List of subtrees */ @@ -3550,7 +3551,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU_U, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 2041 "packet-snmp-template.c" +#line 2042 "packet-snmp-template.c" }; module_t *snmp_module; @@ -3575,6 +3576,7 @@ void proto_register_snmp(void) { snmp_users_copy_cb, snmp_users_update_cb, snmp_users_free_cb, + renew_ue_cache, users_fields); static uat_field_t specific_traps_flds[] = { @@ -3595,6 +3597,7 @@ void proto_register_snmp(void) { snmp_specific_trap_copy_cb, NULL, snmp_specific_trap_free_cb, + NULL, specific_traps_flds); /* Register protocol */ diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c index 6f3a0d13a1..070ef304c7 100644 --- a/epan/dissectors/packet-user_encap.c +++ b/epan/dissectors/packet-user_encap.c @@ -199,6 +199,7 @@ void proto_register_user_encap(void) user_copy_cb, NULL, user_free_cb, + NULL, user_flds ); prefs_register_uat_preference(module, diff --git a/epan/geoip_db.c b/epan/geoip_db.c index b7339e324b..a1903467a4 100644 --- a/epan/geoip_db.c +++ b/epan/geoip_db.c @@ -146,6 +146,7 @@ geoip_db_init(void) { geoip_db_path_copy_cb, NULL, geoip_db_path_free_cb, + NULL, geoip_db_paths_fields); uat_load(geoip_db_paths_uat, &geoip_load_error); diff --git a/epan/oids.c b/epan/oids.c index 31948d2df3..6d8854f2fa 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -524,6 +524,7 @@ static void register_mibs() { smi_mod_copy_cb, NULL, smi_mod_free_cb, + NULL, smi_fields); smi_paths_uat = uat_new("SMI Paths", @@ -537,6 +538,7 @@ static void register_mibs() { smi_mod_copy_cb, NULL, smi_mod_free_cb, + NULL, smi_paths_fields); diff --git a/epan/uat-int.h b/epan/uat-int.h index e5f60351e1..998b815fcc 100644 --- a/epan/uat-int.h +++ b/epan/uat-int.h @@ -57,7 +57,8 @@ struct _uat_t { uat_copy_cb_t copy_cb; uat_update_cb_t update_cb; uat_free_cb_t free_cb; - + uat_post_update_cb_t post_update_cb; + uat_field_t* fields; guint ncols; GArray* user_data; diff --git a/epan/uat.c b/epan/uat.c index 792e360efd..e93ed311d3 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -67,6 +67,7 @@ uat_t* uat_new(const char* name, uat_copy_cb_t copy_cb, uat_update_cb_t update_cb, uat_free_cb_t free_cb, + uat_post_update_cb_t post_update_cb, uat_field_t* flds_array) { /* Create new uat */ uat_t* uat = g_malloc(sizeof(uat_t)); @@ -91,6 +92,7 @@ uat_t* uat_new(const char* name, uat->copy_cb = copy_cb; uat->update_cb = update_cb; uat->free_cb = free_cb; + uat->post_update_cb = post_update_cb; uat->fields = flds_array; uat->user_data = g_array_new(FALSE,FALSE,(guint)uat->record_size); uat->changed = FALSE; diff --git a/epan/uat.h b/epan/uat.h index 13123c5e4e..d3cfdb21e1 100644 --- a/epan/uat.h +++ b/epan/uat.h @@ -59,7 +59,21 @@ typedef struct _uat_t uat_t; ********************************************/ /******** - * Callbacks for the entire table (these deal with entire records) + * Callbacks dealing with the entire table + ********/ + +/* + * Post-Update CB + * + * to be called after to the table has being edited + * Will be called once the user clicks the Apply or OK button + * optional + */ +typedef void (*uat_post_update_cb_t)(void); + + +/******** + * Callbacks dealing with records (these deal with entire records) ********/ /* @@ -84,7 +98,7 @@ typedef void (*uat_free_cb_t)(void*); /* * Update CB * - * to be called after all record fields has been updated + * to be called after any record fields had been updated * optional, record will be updated always if not given * update(record,&error) */ @@ -221,6 +235,7 @@ typedef struct _uat_field_t { * @param copy_cb A function that copies the data in the struct * @param update_cb Will be called when a record is updated * @param free_cb Will be called to destroy a struct in the dataset + * @param post_update_cb Will be called once the user clicks the Apply or OK button * @param flds_array A pointer to an array of uat_field_t structs * * @return A freshly-allocated and populated uat_t struct. @@ -236,6 +251,7 @@ uat_t* uat_new(const char* name, uat_copy_cb_t copy_cb, uat_update_cb_t update_cb, uat_free_cb_t free_cb, + uat_post_update_cb_t post_update_cb, uat_field_t* flds_array); /** Populate a uat using its file. diff --git a/epan/uat_load.l b/epan/uat_load.l index 4920c47490..ed74f64728 100644 --- a/epan/uat_load.l +++ b/epan/uat_load.l @@ -317,6 +317,9 @@ gboolean uat_load(uat_t* uat_in, char** err) { *err = NULL; return TRUE; } + + if (uat->post_update_cb) + uat->post_update_cb(); } gboolean uat_load_str(uat_t* uat_in, char* entry, char** err) { @@ -349,6 +352,10 @@ gboolean uat_load_str(uat_t* uat_in, char* entry, char** err) { *err = NULL; return TRUE; } + + if (uat->post_update_cb) + uat->post_update_cb(); + } /* |