Added an option to uat_new() to set if configuration shall be saved in the
selected profile. Don't save SMI Paths and SMI Modules in the profiles because reloading currently doesn't work (bug 2309). svn path=/trunk/; revision=24580
This commit is contained in:
parent
bde6848d5a
commit
fdc980e79d
|
@ -1932,6 +1932,7 @@ void proto_register_snmp(void) {
|
|||
assocs_uat = uat_new("SNMP Users",
|
||||
sizeof(snmp_ue_assoc_t),
|
||||
"snmp_users",
|
||||
TRUE,
|
||||
(void**)&ueas,
|
||||
&num_ueas,
|
||||
UAT_CAT_CRYPTO,
|
||||
|
|
|
@ -995,16 +995,6 @@ standard libpcap format.
|
|||
SCCP Users Table (sccp_users)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
SMI Modules (smi_modules)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
SMI Paths (smi_paths)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
SNMP Users (snmp_users)
|
||||
|
|
|
@ -603,6 +603,7 @@ void dfilter_macro_init(void) {
|
|||
dfilter_macro_uat = uat_new("Display Filter Macros",
|
||||
sizeof(dfilter_macro_t),
|
||||
DFILTER_MACRO_FILENAME,
|
||||
TRUE,
|
||||
(void*) ¯os,
|
||||
&num_macros,
|
||||
NULL,
|
||||
|
|
|
@ -452,6 +452,7 @@ proto_register_k12(void)
|
|||
k12_uat = uat_new("K12 Protocols",
|
||||
sizeof(k12_handles_t),
|
||||
"k12_protos",
|
||||
TRUE,
|
||||
(void**) &k12_handles,
|
||||
&nk12_handles,
|
||||
UAT_CAT_FFMT,
|
||||
|
|
|
@ -3190,6 +3190,7 @@ proto_register_sccp(void)
|
|||
uat_t* users_uat = uat_new("SCCP Users Table",
|
||||
sizeof(sccp_user_t),
|
||||
"sccp_users",
|
||||
TRUE,
|
||||
(void**) &sccp_users,
|
||||
&num_sccp_users,
|
||||
UAT_CAT_PORTS,
|
||||
|
|
|
@ -3387,6 +3387,7 @@ void proto_register_snmp(void) {
|
|||
assocs_uat = uat_new("SNMP Users",
|
||||
sizeof(snmp_ue_assoc_t),
|
||||
"snmp_users",
|
||||
TRUE,
|
||||
(void**)&ueas,
|
||||
&num_ueas,
|
||||
UAT_CAT_CRYPTO,
|
||||
|
|
|
@ -173,6 +173,7 @@ void proto_register_user_encap(void)
|
|||
encaps_uat = uat_new("User DLTs Table",
|
||||
sizeof(user_encap_t),
|
||||
"user_dlts",
|
||||
TRUE,
|
||||
(void**) &encaps,
|
||||
&num_encaps,
|
||||
UAT_CAT_FFMT,
|
||||
|
|
|
@ -480,6 +480,7 @@ void register_mibs(void) {
|
|||
smi_modules_uat = uat_new("SMI Modules",
|
||||
sizeof(smi_module_t),
|
||||
"smi_modules",
|
||||
FALSE,
|
||||
(void*)&smi_modules,
|
||||
&num_smi_modules,
|
||||
UAT_CAT_GENERAL,
|
||||
|
@ -492,6 +493,7 @@ void register_mibs(void) {
|
|||
smi_paths_uat = uat_new("SMI Paths",
|
||||
sizeof(smi_module_t),
|
||||
"smi_paths",
|
||||
FALSE,
|
||||
(void*)&smi_paths,
|
||||
&num_smi_paths,
|
||||
UAT_CAT_GENERAL,
|
||||
|
|
|
@ -49,6 +49,7 @@ struct _uat_t {
|
|||
const char* name;
|
||||
size_t record_size;
|
||||
const char* filename;
|
||||
gboolean from_profile;
|
||||
const char* help;
|
||||
const char* category;
|
||||
void** user_ptr;
|
||||
|
|
11
epan/uat.c
11
epan/uat.c
|
@ -56,6 +56,7 @@ void uat_init(void) {
|
|||
uat_t* uat_new(const char* name,
|
||||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
guint* numitems_ptr,
|
||||
const char* category,
|
||||
|
@ -77,6 +78,7 @@ uat_t* uat_new(const char* name,
|
|||
uat->name = g_strdup(name);
|
||||
uat->record_size = size;
|
||||
uat->filename = g_strdup(filename);
|
||||
uat->from_profile = from_profile;
|
||||
uat->user_ptr = data_ptr;
|
||||
uat->nrows_p = numitems_ptr;
|
||||
uat->copy_cb = copy_cb;
|
||||
|
@ -157,7 +159,7 @@ void uat_remove_record_idx(uat_t* uat, guint idx) {
|
|||
/* The returned filename was g_malloc()'d so the caller must free it */
|
||||
gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing) {
|
||||
|
||||
gchar* pers_fname = get_persconffile_path(uat->filename, TRUE, for_writing);
|
||||
gchar* pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing);
|
||||
|
||||
if (! for_writing ) {
|
||||
gchar* data_fname = get_datafile_path(uat->filename);
|
||||
|
@ -322,8 +324,11 @@ void uat_unload_all(void) {
|
|||
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
uat_clear(u);
|
||||
u->loaded = FALSE;
|
||||
/* Do not unload if not in profile */
|
||||
if (u->from_profile) {
|
||||
uat_clear(u);
|
||||
u->loaded = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -223,6 +223,7 @@ typedef struct _uat_field_t {
|
|||
uat_t* uat_new(const char* name,
|
||||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
guint* num_items,
|
||||
const char* category,
|
||||
|
|
Loading…
Reference in New Issue