diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-09-11 16:55:34 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-09-11 16:55:34 +0000 |
commit | 642467ad5ce08b28314cc2cb777b9d66a944d4ba (patch) | |
tree | fbc55d80c6f51c2fbac4a9350f4f14859eaf928f /epan/proto.c | |
parent | 266e1a3491de1ff790c326bbffe0d4827af0f24b (diff) |
I'm adding the "Expert Info" prototype now, as it seems to be in a state where others might have a look and probably already find it useful :-). Anyway, we can easily disable it at one or two places in the code if it get's in our way of a new release.
Please see: http://wiki.ethereal.com/Development/ExpertInfo for a complete overview of the intended feature and it's current state of implementation.
While I'm working on this, I've also added some more status result codes to the DCE/RPC and DCOM dissectors.
svn path=/trunk/; revision=15754
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c index 5deb8f1b18..a7996f4276 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -2465,6 +2465,32 @@ proto_item_get_len(proto_item *pi) return fi->length; } + +/** clear flags according to the mask and set new flag values */ +#define FI_REPLACE_FLAGS(fi, mask, flags_in) { \ + (fi->flags = (fi)->flags & ~(mask)); \ + (fi->flags = (fi)->flags | (flags_in)); \ +} + +gboolean +proto_item_set_expert_flags(proto_item *pi, int group, int severity) +{ + if(pi == NULL || pi->finfo == NULL) + return FALSE; + + /* only change things if severity is worse or at least equal than before */ + if(severity >= FI_GET_FLAG(pi->finfo, PI_SEVERITY_MASK)) { + FI_REPLACE_FLAGS(pi->finfo, PI_GROUP_MASK, group); + FI_REPLACE_FLAGS(pi->finfo, PI_SEVERITY_MASK, severity); + + return TRUE; + } + + return FALSE; +} + + + proto_tree* proto_tree_create_root(void) { |