aboutsummaryrefslogtreecommitdiffstats
path: root/epan/expert.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-08-31 22:56:38 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-08-31 22:56:38 +0000
commitd4499eb9a7a19865af8ca214f70e605004e21ec7 (patch)
treea22d751bd4fc4161d1ddd6894fc4b6031140000b /epan/expert.c
parentb1719dd68f41de467407706a697ef653715e8430 (diff)
move value_strings from expert_dialogs into expert.c to remove duplicates
keep the highest severity level of the current file (experimental) svn path=/trunk/; revision=19104
Diffstat (limited to 'epan/expert.c')
-rw-r--r--epan/expert.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/epan/expert.c b/epan/expert.c
index edc27b37c2..037331bf38 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -36,6 +36,30 @@
static int expert_tap = -1;
+static int highest_severity = 0;
+
+
+const value_string expert_group_vals[] = {
+ { PI_CHECKSUM, "Checksum" },
+ { PI_SEQUENCE, "Sequence" },
+ { PI_RESPONSE_CODE, "Response" },
+ { PI_REQUEST_CODE, "Request" },
+ { PI_UNDECODED, "Undecoded" },
+ { PI_MALFORMED, "Malformed" },
+ { PI_REASSEMBLE, "Reassemble" },
+/* { PI_SECURITY, "Security" },*/
+ { 0, NULL }
+};
+
+const value_string expert_severity_vals[] = {
+ { PI_ERROR, "Error" },
+ { PI_WARN, "Warn" },
+ { PI_NOTE, "Note" },
+ { PI_CHAT, "Chat" },
+ { 0, "Ok" },
+ { 0, NULL }
+};
+
void
@@ -44,8 +68,11 @@ expert_init(void)
if(expert_tap == -1) {
expert_tap = register_tap("expert");
}
+
+ highest_severity = 0;
}
+
void
expert_cleanup(void)
{
@@ -53,6 +80,13 @@ expert_cleanup(void)
}
+int
+expert_get_highest_severity(void)
+{
+ return highest_severity;
+}
+
+
/* set's the PI_ flags to a protocol item
* (and it's parent items till the toplevel) */
static void
@@ -81,6 +115,10 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
return;
}
+ if(severity > highest_severity) {
+ highest_severity = severity;
+ }
+
/* XXX - use currently nonexistant se_vsnprintf instead */
ret = g_vsnprintf(formatted, sizeof(formatted), format, ap);
if ((ret == -1) || (ret >= sizeof(formatted)))
@@ -92,7 +130,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
ei->severity = severity;
ei->protocol = ep_strdup(pinfo->current_proto);
ei->summary = ep_strdup(formatted);
- ei->pitem = NULL;
+ ei->pitem = NULL;
/* if we have a proto_item (not a faked item), set expert attributes to it */
if(pi != NULL && pi->finfo != NULL) {