aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-07-08 01:00:46 +0000
committerGuy Harris <guy@alum.mit.edu>2012-07-08 01:00:46 +0000
commit659cf0527ae9e16da3670e224f22b942b0c0a4a3 (patch)
treea6ac5357f9edc209679c8192f54da09f4fd5ad72
parent1b1fbd24e72bb8cce69867f33f41ade6f3354384 (diff)
UATs could be put into "categories". The categories were defined only
implicitly by the #define name and string they were defined to; not all UATs neatly fit into any of the categories, so some of them were put into categories that weren't obviously correct for them, and one - the display filter macro UAT - wasn't put into any category at all (which caused crashes when editing them, as the GUI code that handled UAT changes from a dialog assumed the category field was non-null). The category was, in practice, used only to decide, in the aforementioned GUI code, whether the packet summary pane needed to be updated or not. It also offered no option of "don't update the packet summary pane *and* don't redissect anything", which is what would be appropriate for the display filter macro UAT. Replace the category with a set of fields indicating what the UAT affects; we currently offer "dissection", which applies to most UATs (any UAT in libwireshark presumably affects dissection at a minimum) and "the set of named fields that exist". Changing any UAT that affects dissection requires a redissection; changing any UAT that affects the set of named fields that exist requires a redissection *and* rebuilding the packet summary pane. Perhaps we also need "filtering", so that if you change a display filter macro, we re-filter, in case the display is currently filtered with a display filter that uses a macro that changed. svn path=/trunk/; revision=43603
-rw-r--r--asn1/c1222/packet-c1222-template.c2
-rw-r--r--asn1/ess/packet-ess-template.c2
-rw-r--r--asn1/ldap/packet-ldap-template.c4
-rw-r--r--asn1/pres/packet-pres-template.c2
-rw-r--r--asn1/snmp/packet-snmp-template.c4
-rw-r--r--epan/dfilter/dfilter-macro.c2
-rw-r--r--epan/dissectors/packet-ber.c2
-rw-r--r--epan/dissectors/packet-bootp.c2
-rw-r--r--epan/dissectors/packet-c1222.c2
-rw-r--r--epan/dissectors/packet-dmp.c2
-rw-r--r--epan/dissectors/packet-dtls.c2
-rw-r--r--epan/dissectors/packet-ess.c2
-rw-r--r--epan/dissectors/packet-http.c4
-rw-r--r--epan/dissectors/packet-ieee80211.c2
-rw-r--r--epan/dissectors/packet-ieee802154.c2
-rw-r--r--epan/dissectors/packet-imf.c4
-rw-r--r--epan/dissectors/packet-ipsec.c34
-rw-r--r--epan/dissectors/packet-isakmp.c4
-rw-r--r--epan/dissectors/packet-k12.c4
-rw-r--r--epan/dissectors/packet-ldap.c6
-rw-r--r--epan/dissectors/packet-mac-lte.c2
-rw-r--r--epan/dissectors/packet-pres.c2
-rw-r--r--epan/dissectors/packet-reload.c6
-rw-r--r--epan/dissectors/packet-sccp.c7
-rw-r--r--epan/dissectors/packet-snmp.c4
-rw-r--r--epan/dissectors/packet-ssl.c2
-rw-r--r--epan/dissectors/packet-user_encap.c4
-rw-r--r--epan/dissectors/packet-vcdu.c2
-rw-r--r--epan/dissectors/packet-zbee-security.c2
-rw-r--r--epan/geoip_db.c6
-rw-r--r--epan/oids.c96
-rw-r--r--epan/uat-int.h2
-rw-r--r--epan/uat.c4
-rw-r--r--epan/uat.h17
-rw-r--r--plugins/stats_tree/pinfo_stats_tree.c2
-rw-r--r--ui/gtk/uat_gui.c11
36 files changed, 144 insertions, 113 deletions
diff --git a/asn1/c1222/packet-c1222-template.c b/asn1/c1222/packet-c1222-template.c
index 4c3d91d9a8..f4765f244b 100644
--- a/asn1/c1222/packet-c1222-template.c
+++ b/asn1/c1222/packet-c1222-template.c
@@ -1314,7 +1314,7 @@ void proto_register_c1222(void) {
TRUE, /* from_profile */
(void*)&c1222_uat_data, /* data_ptr */
&num_c1222_uat_data, /* numitems_ptr */
- UAT_CAT_CRYPTO, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
NULL, /* copy callback */
c1222_uat_data_update_cb, /* update callback */
diff --git a/asn1/ess/packet-ess-template.c b/asn1/ess/packet-ess-template.c
index e1cccfe3fb..68dbc76ad0 100644
--- a/asn1/ess/packet-ess-template.c
+++ b/asn1/ess/packet-ess-template.c
@@ -173,7 +173,7 @@ void proto_register_ess(void) {
TRUE,
(void*) &ess_category_attributes,
&num_ess_category_attributes,
- UAT_CAT_PORTS,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChEssCategoryAttributes",
ess_copy_cb,
NULL,
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 66f7092559..983e9a1501 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -2283,7 +2283,9 @@ void proto_register_ldap(void) {
TRUE,
(void*) &attribute_types,
&num_attribute_types,
- UAT_CAT_FIELDS,
+ /* specifies named fields, so affects dissection
+ and the set of named fields */
+ UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
NULL,
attribute_types_copy_cb,
attribute_types_update_cb,
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index b2be9b12f4..9ae69ddf7d 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -417,7 +417,7 @@ void proto_register_pres(void) {
TRUE,
(void*) &pres_users,
&num_pres_users,
- UAT_CAT_PORTS,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChPresContextList",
pres_copy_cb,
NULL,
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 498e483374..7af883917a 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -2236,7 +2236,7 @@ void proto_register_snmp(void) {
TRUE,
(void*)&ueas,
&num_ueas,
- UAT_CAT_CRYPTO,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChSNMPUsersSection",
snmp_users_copy_cb,
snmp_users_update_cb,
@@ -2257,7 +2257,7 @@ void proto_register_snmp(void) {
TRUE,
(void*) &specific_traps,
&num_specific_traps,
- UAT_CAT_GENERAL,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChSNMPEnterpriseSpecificTrapTypes",
snmp_specific_trap_copy_cb,
NULL,
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index 39b83fb127..78a9ad3e87 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -615,7 +615,7 @@ void dfilter_macro_init(void) {
TRUE,
(void*) &macros,
&num_macros,
- NULL,
+ 0, /* doesn't affect anything that requires a GUI update */
"ChDisplayFilterMacrosSection",
macro_copy,
macro_update,
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index b9dd02a349..b77b59d185 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -4937,7 +4937,7 @@ proto_register_ber(void)
FALSE,
(void*) &oid_users,
&num_oid_users,
- UAT_CAT_GENERAL,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChObjectIdentifiers",
oid_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 247c1da9da..252f0cefd7 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -6440,7 +6440,7 @@ proto_register_bootp(void)
TRUE, /* from_profile */
(void*) &uat_bootp_records, /* data_ptr */
&num_bootp_records_uat, /* numitems_ptr */
- UAT_CAT_GENERAL, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
uat_bootp_record_copy_cb, /* copy callback */
uat_bootp_record_update_cb, /* update callback */
diff --git a/epan/dissectors/packet-c1222.c b/epan/dissectors/packet-c1222.c
index 12f91bf0b5..8132b235f5 100644
--- a/epan/dissectors/packet-c1222.c
+++ b/epan/dissectors/packet-c1222.c
@@ -1887,7 +1887,7 @@ void proto_register_c1222(void) {
TRUE, /* from_profile */
(void*)&c1222_uat_data, /* data_ptr */
&num_c1222_uat_data, /* numitems_ptr */
- UAT_CAT_CRYPTO, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
NULL, /* copy callback */
c1222_uat_data_update_cb, /* update callback */
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index 6485f69aba..a9c81642fd 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -4975,7 +4975,7 @@ void proto_register_dmp (void)
TRUE,
(void*) &dmp_security_classes,
&num_dmp_security_classes,
- UAT_CAT_FFMT,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChDMPSecurityClassifications",
dmp_class_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 108d5ea25a..81055996af 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -2695,7 +2695,7 @@ proto_register_dtls(void)
TRUE, /* from_profile */
(void*) &dtlskeylist_uats, /* data_ptr */
&ndtlsdecrypt, /* numitems_ptr */
- UAT_CAT_FFMT, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChK12ProtocolsSection", /* TODO, need revision - help */
dtlsdecrypt_copy_cb,
NULL, /* dtlsdecrypt_update_cb? */
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index 51d5abc813..080a61833b 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -1482,7 +1482,7 @@ void proto_register_ess(void) {
TRUE,
(void*) &ess_category_attributes,
&num_ess_category_attributes,
- UAT_CAT_PORTS,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChEssCategoryAttributes",
ess_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index f6a2dbf5c5..73b92323c0 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2783,7 +2783,9 @@ proto_register_http(void)
TRUE,
(void*) &header_fields,
&num_header_fields,
- UAT_CAT_FIELDS,
+ /* specifies named fields, so affects dissection
+ and the set of named fields */
+ UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
NULL,
header_fields_copy_cb,
header_fields_update_cb,
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 22646707eb..0af4e5705b 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -16574,7 +16574,7 @@ proto_register_ieee80211 (void)
TRUE, /* from_profile */
(void*) &uat_wep_key_records, /* data_ptr */
&num_wepkeys_uat, /* numitems_ptr */
- UAT_CAT_CRYPTO, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
uat_wep_key_record_copy_cb, /* copy callback */
uat_wep_key_record_update_cb, /* update callback */
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index f692000003..b3f29d8584 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -2726,7 +2726,7 @@ void proto_register_ieee802154(void)
TRUE, /* from_profile */
(void*) &static_addrs, /* data_ptr */
&num_static_addrs, /* numitems_ptr */
- UAT_CAT_GENERAL, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */
NULL, /* copy callback */
addr_uat_update_cb, /* update callback */
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index bbb9adb366..a166adda60 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -1216,7 +1216,9 @@ proto_register_imf(void)
TRUE,
(void*) &header_fields,
&num_header_fields,
- UAT_CAT_FIELDS,
+ /* specifies named fields, so affects dissection
+ and the set of named fields */
+ UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
NULL,
header_fields_copy_cb,
header_fields_update_cb,
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index ba7600c1b8..a897a8938c 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -2112,25 +2112,25 @@ proto_register_ipsec(void)
"Attempt to Check ESP Authentication based on the SAD described hereafter.",
&g_esp_enable_authentication_check);
- esp_uat = uat_new("ESP SAs",
- sizeof(uat_esp_sa_record_t), /* record size */
- "esp_sa", /* filename */
- TRUE, /* from_profile */
- (void*) &uat_esp_sa_records, /* data_ptr */
- &num_sa_uat, /* numitems_ptr */
- UAT_CAT_CRYPTO, /* category */
- NULL, /* help */
+ esp_uat = uat_new("ESP SAs",
+ sizeof(uat_esp_sa_record_t), /* record size */
+ "esp_sa", /* filename */
+ TRUE, /* from_profile */
+ (void*) &uat_esp_sa_records, /* data_ptr */
+ &num_sa_uat, /* numitems_ptr */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
+ NULL, /* help */
uat_esp_sa_record_copy_cb, /* copy callback */
- NULL, /* update callback */
+ NULL, /* update callback */
uat_esp_sa_record_free_cb, /* free callback */
- NULL, /* post update callback */
- esp_uat_flds); /* UAT field definitions */
-
- prefs_register_uat_preference(esp_module,
- "sa_table",
- "ESP SAs",
- "Preconfigured ESP Security Associations",
- esp_uat);
+ NULL, /* post update callback */
+ esp_uat_flds); /* UAT field definitions */
+
+ prefs_register_uat_preference(esp_module,
+ "sa_table",
+ "ESP SAs",
+ "Preconfigured ESP Security Associations",
+ esp_uat);
#endif
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index 36b19312ef..2beaa362b8 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -6104,7 +6104,7 @@ proto_register_isakmp(void)
TRUE,
(void*)&ikev1_uat_data,
&num_ikev1_uat_data,
- UAT_CAT_CRYPTO,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChIKEv1DecryptionSection",
NULL,
ikev1_uat_data_update_cb,
@@ -6124,7 +6124,7 @@ proto_register_isakmp(void)
TRUE,
(void*)&ikev2_uat_data,
&num_ikev2_uat_data,
- UAT_CAT_CRYPTO,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChIKEv2DecryptionSection",
NULL,
ikev2_uat_data_update_cb,
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 3aee1e594b..52037eaaab 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -455,9 +455,9 @@ proto_register_k12(void)
sizeof(k12_handles_t),
"k12_protos", /* filename */
TRUE, /* from_profile */
- (void*) &k12_handles, /* data_ptr */
+ (void*) &k12_handles, /* data_ptr */
&nk12_handles, /* numitems_ptr */
- UAT_CAT_FFMT, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChK12ProtocolsSection", /* help */
k12_copy_cb,
k12_update_cb,
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 35093ffe46..07c5860c3a 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -5889,7 +5889,9 @@ void proto_register_ldap(void) {
TRUE,
(void*) &attribute_types,
&num_attribute_types,
- UAT_CAT_FIELDS,
+ /* specifies named fields, so affects dissection
+ and the set of named fields */
+ UAT_AFFECTS_DISSECTION|UAT_AFFECTS_FIELDS,
NULL,
attribute_types_copy_cb,
attribute_types_update_cb,
@@ -6004,7 +6006,7 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
-#line 2385 "../../asn1/ldap/packet-ldap-template.c"
+#line 2387 "../../asn1/ldap/packet-ldap-template.c"
}
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 3d0ea73ada..2942ffb8b9 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -5692,7 +5692,7 @@ void proto_register_mac_lte(void)
TRUE,
(void*) &lcid_drb_mappings,
&num_lcid_drb_mappings,
- UAT_CAT_FFMT,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"", /* TODO: is this ref to help manual? */
lcid_drb_mapping_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 24de4f028b..2044ee652c 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -1928,7 +1928,7 @@ void proto_register_pres(void) {
TRUE,
(void*) &pres_users,
&num_pres_users,
- UAT_CAT_PORTS,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChPresContextList",
pres_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index 9e48fe7fa1..60d1a0c394 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -5886,11 +5886,11 @@ proto_register_reload(void)
reloadkindids_uat =
uat_new("Kind-ID Table",
sizeof(kind_t),
- "reload_kindids", /* filename */
+ "reload_kindids", /* filename */
TRUE, /* from_profile */
(void*) &kindidlist_uats, /* data_ptr */
- &nreloadkinds, /* numitems_ptr */
- UAT_CAT_GENERAL, /* category */
+ &nreloadkinds, /* numitems_ptr */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* Help section (currently a wiki page) */
uat_kindid_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 005a55ee60..8bb9ec4aa3 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -4002,9 +4002,10 @@ 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, "ChSccpUsers",
- sccp_users_copy_cb, sccp_users_update_cb,
- sccp_users_free_cb, NULL, users_flds );
+ &num_sccp_users, UAT_AFFECTS_DISSECTION,
+ "ChSccpUsers", sccp_users_copy_cb,
+ sccp_users_update_cb, sccp_users_free_cb,
+ NULL, users_flds );
/* Register the protocol name and description */
proto_sccp = proto_register_protocol("Signalling Connection Control Part",
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 8d2fb1d23a..8cf7663acb 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -3749,7 +3749,7 @@ void proto_register_snmp(void) {
TRUE,
(void*)&ueas,
&num_ueas,
- UAT_CAT_CRYPTO,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChSNMPUsersSection",
snmp_users_copy_cb,
snmp_users_update_cb,
@@ -3770,7 +3770,7 @@ void proto_register_snmp(void) {
TRUE,
(void*) &specific_traps,
&num_specific_traps,
- UAT_CAT_GENERAL,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChSNMPEnterpriseSpecificTrapTypes",
snmp_specific_trap_copy_cb,
NULL,
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index fd41c32d04..5d7a4007a6 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -5683,7 +5683,7 @@ proto_register_ssl(void)
TRUE, /* from_profile */
(void*) &sslkeylist_uats, /* data_ptr */
&nssldecrypt, /* numitems_ptr */
- UAT_CAT_FFMT, /* category */
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* Help section (currently a wiki page) */
ssldecrypt_copy_cb,
ssldecrypt_update_cb,
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index 4698686c2f..e4393108fa 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -223,12 +223,12 @@ void proto_register_user_encap(void)
TRUE,
(void*) &encaps,
&num_encaps,
- UAT_CAT_FFMT,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChUserDLTsSection",
user_copy_cb,
NULL,
user_free_cb,
- NULL,
+ NULL,
user_flds );
prefs_register_uat_preference(module,
diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c
index eae1d0e2f1..93019288cb 100644
--- a/epan/dissectors/packet-vcdu.c
+++ b/epan/dissectors/packet-vcdu.c
@@ -616,7 +616,7 @@ proto_register_vcdu(void)
TRUE,
(void*)&uat_bitchannels,
&num_channels_uat,
- UAT_CAT_GENERAL,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL,
NULL,
vcdu_uat_data_update_cb,
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index bb84f65d59..55838ecb68 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -274,7 +274,7 @@ void zbee_security_register(module_t *zbee_prefs, int proto)
TRUE,
(void*) &uat_key_records,
&num_uat_key_records,
- UAT_CAT_FFMT,
+ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* TODO: ptr to help manual? */
uat_key_record_copy_cb,
uat_key_record_update_cb,
diff --git a/epan/geoip_db.c b/epan/geoip_db.c
index 98bca94dec..fd9fb4d89f 100644
--- a/epan/geoip_db.c
+++ b/epan/geoip_db.c
@@ -154,12 +154,14 @@ geoip_db_pref_init(module_t *nameres)
FALSE,
(void*)&geoip_db_paths,
&num_geoip_db_paths,
- UAT_CAT_GENERAL,
+ /* affects dissection of packets (as the GeoIP database is
+ used when dissecting), but not set of named fields */
+ UAT_AFFECTS_DISSECTION,
"ChGeoIPDbPaths",
geoip_db_path_copy_cb,
NULL,
geoip_db_path_free_cb,
- NULL,
+ NULL,
geoip_db_paths_fields);
prefs_register_uat_preference(nameres,
diff --git a/epan/oids.c b/epan/oids.c
index 058174b3a7..13b284398e 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -740,47 +740,61 @@ void oid_pref_init(module_t *nameres)
"Some errors can be ignored. If unsure, set to false.",
&suppress_smi_errors);
- smi_paths_uat = uat_new("SMI Paths",
- sizeof(smi_module_t),
- "smi_paths",
- FALSE,
- (void*)&smi_paths,
- &num_smi_paths,
- UAT_CAT_GENERAL,
- "ChSNMPSMIPaths",
- smi_mod_copy_cb,
- NULL,
- smi_mod_free_cb,
- restart_needed_warning,
- smi_paths_fields);
-
- prefs_register_uat_preference(nameres,
- "smi_paths",
- "SMI (MIB and PIB) paths",
- "Search paths for SMI (MIB and PIB) modules. You must\n"
- "restart Wireshark for these changes to take effect.",
- smi_paths_uat);
-
- smi_modules_uat = uat_new("SMI Modules",
- sizeof(smi_module_t),
- "smi_modules",
- FALSE,
- (void*)&smi_modules,
- &num_smi_modules,
- UAT_CAT_GENERAL,
- "ChSNMPSMIModules",
- smi_mod_copy_cb,
- NULL,
- smi_mod_free_cb,
- restart_needed_warning,
- smi_fields);
-
- prefs_register_uat_preference(nameres,
- "smi_modules",
- "SMI (MIB and PIB) modules",
- "List of enabled SMI (MIB and PIB) modules. You must\n"
- "restart Wireshark for these changes to take effect.",
- smi_modules_uat);
+ smi_paths_uat = uat_new("SMI Paths",
+ sizeof(smi_module_t),
+ "smi_paths",
+ FALSE,
+ (void*)&smi_paths,
+ &num_smi_paths,
+ /* affects dissection of packets (as the MIBs and PIBs affect the
+ interpretation of e.g. SNMP variable bindings), but not set of
+ named fields
+
+ XXX - if named fields are generated from the MIBs and PIBs
+ for particular variable bindings, this *does* affect the set
+ of named fields! */
+ UAT_AFFECTS_DISSECTION,
+ "ChSNMPSMIPaths",
+ smi_mod_copy_cb,
+ NULL,
+ smi_mod_free_cb,
+ restart_needed_warning,
+ smi_paths_fields);
+
+ prefs_register_uat_preference(nameres,
+ "smi_paths",
+ "SMI (MIB and PIB) paths",
+ "Search paths for SMI (MIB and PIB) modules. You must\n"
+ "restart Wireshark for these changes to take effect.",
+ smi_paths_uat);
+
+ smi_modules_uat = uat_new("SMI Modules",
+ sizeof(smi_module_t),
+ "smi_modules",
+ FALSE,
+ (void*)&smi_modules,
+ &num_smi_modules,
+ /* affects dissection of packets (as the MIBs and PIBs affect the
+ interpretation of e.g. SNMP variable bindings), but not set of
+ named fields
+
+ XXX - if named fields are generated from the MIBs and PIBs
+ for particular variable bindings, would this affect the set
+ of named fields? */
+ UAT_AFFECTS_DISSECTION,
+ "ChSNMPSMIModules",
+ smi_mod_copy_cb,
+ NULL,
+ smi_mod_free_cb,
+ restart_needed_warning,
+ smi_fields);
+
+ prefs_register_uat_preference(nameres,
+ "smi_modules",
+ "SMI (MIB and PIB) modules",
+ "List of enabled SMI (MIB and PIB) modules. You must\n"
+ "restart Wireshark for these changes to take effect.",
+ smi_modules_uat);
#else
prefs_register_static_text_preference(nameres, "load_smi_modules_static",
diff --git a/epan/uat-int.h b/epan/uat-int.h
index a1a95a122f..fb1ceab431 100644
--- a/epan/uat-int.h
+++ b/epan/uat-int.h
@@ -51,7 +51,7 @@ struct _uat_t {
const char* filename;
gboolean from_profile;
const char* help;
- const char* category;
+ guint flags;
void** user_ptr;
guint* nrows_p;
uat_copy_cb_t copy_cb;
diff --git a/epan/uat.c b/epan/uat.c
index 689b7b0af1..2ecef502a0 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -62,7 +62,7 @@ uat_t* uat_new(const char* name,
gboolean from_profile,
void** data_ptr,
guint* numitems_ptr,
- const char* category,
+ guint flags,
const char* help,
uat_copy_cb_t copy_cb,
uat_update_cb_t update_cb,
@@ -101,7 +101,7 @@ uat_t* uat_new(const char* name,
uat->rep = NULL;
uat->free_rep = NULL;
uat->help = help;
- uat->category = category;
+ uat->flags = flags;
for (i=0;flds_array[i].title;i++) {
fld_data_t* f = g_malloc(sizeof(fld_data_t));
diff --git a/epan/uat.h b/epan/uat.h
index 9d45f08cda..7488ca61be 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -221,12 +221,13 @@ typedef struct _uat_field_t {
#define FLDFILL NULL
#define UAT_END_FIELDS {NULL,NULL,PT_TXTMOD_NONE,{0,0,0},{0,0,0},0,0,FLDFILL}
-
-#define UAT_CAT_GENERAL "General"
-#define UAT_CAT_PORTS "Port Assignments"
-#define UAT_CAT_CRYPTO "Decryption"
-#define UAT_CAT_FFMT "File Formats"
-#define UAT_CAT_FIELDS "Header Fields"
+/*
+ * Flags to indicate what the settings in this UAT affect.
+ * This is used when UATs are changed interactively, to indicate what needs
+ * to be redone when the UAT is changed.
+ */
+#define UAT_AFFECTS_DISSECTION 0x00000001 /* affects packet dissection */
+#define UAT_AFFECTS_FIELDS 0x00000002 /* affects what named fields exist */
/** Create a new uat
*
@@ -236,7 +237,7 @@ typedef struct _uat_field_t {
* @param from_profile TRUE if profile directory to be used
* @param data_ptr A pointer to a null terminated array of pointers to the data
* @param num_items_ptr
- * @param category
+ * @param flags flags indicating what this UAT affects
* @param help A pointer to help text
* @param copy_cb A function that copies the data in the struct
* @param update_cb Will be called when a record is updated
@@ -252,7 +253,7 @@ uat_t* uat_new(const char* name,
gboolean from_profile,
void** data_ptr,
guint* num_items_ptr,
- const char* category,
+ guint flags,
const char* help,
uat_copy_cb_t copy_cb,
uat_update_cb_t update_cb,
diff --git a/plugins/stats_tree/pinfo_stats_tree.c b/plugins/stats_tree/pinfo_stats_tree.c
index 4d9aa351e3..853beb468d 100644
--- a/plugins/stats_tree/pinfo_stats_tree.c
+++ b/plugins/stats_tree/pinfo_stats_tree.c
@@ -221,7 +221,7 @@ void register_pinfo_stat_trees(void) {
TRUE, /* from_profile */
(void*) &uat_plen_records, /* data_ptr */
&num_plen_uat, /* numitems_ptr */
- UAT_CAT_GENERAL, /* category */
+ 0, /* not a dissector, so affects neither dissection nor fields */
NULL, /* help */
uat_plen_record_copy_cb, /* copy callback */
NULL, /* update callback */
diff --git a/ui/gtk/uat_gui.c b/ui/gtk/uat_gui.c
index 4a2152d61f..0f8ff9729b 100644
--- a/ui/gtk/uat_gui.c
+++ b/ui/gtk/uat_gui.c
@@ -716,11 +716,16 @@ static void uat_down_cb(GtkButton *button _U_, gpointer u) {
}
static void uat_apply_changes(uat_t *uat) {
- if(uat->category && strcmp(uat->category, UAT_CAT_FIELDS) == 0) {
+ if(uat->flags & UAT_AFFECTS_FIELDS) {
/* Recreate list with new fields and redissect packets */
new_packet_list_recreate ();
- } else if(cfile.state != FILE_CLOSED) {
- redissect_packets ();
+ } else {
+ if(uat->flags & UAT_AFFECTS_DISSECTION) {
+ /* Just redissect packets if we have any */
+ if(cfile.state != FILE_CLOSED) {
+ redissect_packets ();
+ }
+ }
}
}