aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-11 22:25:33 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-11 22:25:33 +0000
commitd0c5e2c547cea72b6c9dbb9100ae9f6967dd0e2d (patch)
tree921a697c78e514c52d1a5ff85ed6f3e0b880dca0
parent0cf90c83a65ebc927011d54241f9d751693bb584 (diff)
Frame numbers are unsigned, and they start at 1; 0 is what's used for
"unknown" for frame numbers. Note that in epan/frame_data.h, and make the frame number in experts unsigned, and use 0 for "unknown", and display it as an unsigned number - and, if it's 0, don't display it at all. Fix the signature of "expert_dlg_draw()" to match what a tap's draw routine's signature is expected to be. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15760 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--epan/expert.c4
-rw-r--r--epan/expert.h2
-rw-r--r--epan/frame_data.h3
-rw-r--r--file.c2
-rw-r--r--gtk/expert_dlg.c11
5 files changed, 15 insertions, 7 deletions
diff --git a/epan/expert.c b/epan/expert.c
index dfa585f7e2..8691d7e15f 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -77,7 +77,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
/* if this packet isn't loaded because of a read filter, don't output anything */
- if(pinfo->fd->num == -1) {
+ if(pinfo->fd->num == 0) {
return;
}
@@ -87,7 +87,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
formatted[sizeof(formatted) - 1] = '\0';
ei = se_alloc(sizeof(expert_info_t));
- ei->packet_num = pinfo ? pinfo->fd->num : -1;
+ ei->packet_num = pinfo ? pinfo->fd->num : 0;
ei->group = group;
ei->severity = severity;
ei->protocol = se_strdup(pinfo->current_proto);
diff --git a/epan/expert.h b/epan/expert.h
index 5860121fba..c44a80fab4 100644
--- a/epan/expert.h
+++ b/epan/expert.h
@@ -30,7 +30,7 @@
/** only for internal and display use */
typedef struct expert_info_s {
- int packet_num;
+ guint32 packet_num;
int group;
int severity;
gchar * protocol;
diff --git a/epan/frame_data.h b/epan/frame_data.h
index db6d5034a4..3b61c06e3e 100644
--- a/epan/frame_data.h
+++ b/epan/frame_data.h
@@ -44,6 +44,9 @@ typedef struct _color_t /* {
/* XXX - some of this stuff is used only while a packet is being dissected;
should we keep that stuff in the "packet_info" structure, instead, to
save memory? */
+/* The frame number is the ordinal number of the frame in the capture, so
+ it's 1-origin. In various contexts, 0 as a frame number means "frame
+ number unknown". */
typedef struct _frame_data {
struct _frame_data *next; /* Next element in list */
struct _frame_data *prev; /* Previous element in list */
diff --git a/file.c b/file.c
index 8b6619b97c..80a2c9f829 100644
--- a/file.c
+++ b/file.c
@@ -875,7 +875,7 @@ read_packet(capture_file *cf, long offset)
/* Allocate the next list entry, and add it to the list. */
fdata = g_mem_chunk_alloc(cf->plist_chunk);
- fdata->num = -1;
+ fdata->num = 0;
fdata->next = NULL;
fdata->prev = NULL;
fdata->pfd = NULL;
diff --git a/gtk/expert_dlg.c b/gtk/expert_dlg.c
index 3a60b391bf..3e7154878b 100644
--- a/gtk/expert_dlg.c
+++ b/gtk/expert_dlg.c
@@ -162,8 +162,9 @@ int expert_dlg_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, co
}
void
-expert_dlg_draw(expert_tapdata_t *etd)
+expert_dlg_draw(void *data)
{
+ expert_tapdata_t *etd = data;
int row;
char *strp;
expert_info_t *ei;
@@ -192,8 +193,12 @@ expert_dlg_draw(expert_tapdata_t *etd)
gtk_clist_set_row_data(etd->table, row, ei);
/* packet number */
- strp=se_strdup_printf("%d", ei->packet_num);
- gtk_clist_set_text(etd->table, row, 0, strp);
+ if(ei->packet_num) {
+ strp=se_strdup_printf("%u", ei->packet_num);
+ gtk_clist_set_text(etd->table, row, 0, strp);
+ } else {
+ gtk_clist_set_text(etd->table, row, 0, "-");
+ }
/* severity */
strp=se_strdup(val_to_str(ei->severity, expert_severity_vals, "Unknown severity (%u)"));