diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-07-08 01:00:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-07-08 01:00:46 +0000 |
commit | 659cf0527ae9e16da3670e224f22b942b0c0a4a3 (patch) | |
tree | a6ac5357f9edc209679c8192f54da09f4fd5ad72 /epan/uat.h | |
parent | 1b1fbd24e72bb8cce69867f33f41ade6f3354384 (diff) | |
download | wireshark-659cf0527ae9e16da3670e224f22b942b0c0a4a3.tar.gz |
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
Diffstat (limited to 'epan/uat.h')
-rw-r--r-- | epan/uat.h | 17 |
1 files changed, 9 insertions, 8 deletions
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, |