aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdoc/dfilter2pod.pl3
-rw-r--r--epan/dfilter/semcheck.c6
-rw-r--r--epan/ftypes/ftype-integer.c29
-rw-r--r--epan/ftypes/ftypes.h3
-rw-r--r--epan/proto.c181
-rw-r--r--gtk/main.c22
-rw-r--r--gtk/main.h3
-rw-r--r--gtk/menu.c5
-rw-r--r--packet-rpc.c16
9 files changed, 180 insertions, 88 deletions
diff --git a/doc/dfilter2pod.pl b/doc/dfilter2pod.pl
index ba59ecdeb4..333bc8f782 100755
--- a/doc/dfilter2pod.pl
+++ b/doc/dfilter2pod.pl
@@ -9,7 +9,7 @@
# will be replaced by the pod-formatted glossary
# STDOUT is the output
#
-# $Id: dfilter2pod.pl,v 1.3 2002/08/18 19:08:23 guy Exp $
+# $Id: dfilter2pod.pl,v 1.4 2002/12/19 02:58:45 guy Exp $
%ftenum_names = (
'FT_NONE', 'No value',
@@ -36,6 +36,7 @@
'FT_IPv4', 'IPv4 address',
'FT_IPv6', 'IPv6 address',
'FT_IPXNET', 'IPX network or server name',
+ 'FT_FRAMENUM', 'Frame number',
);
# Read all the data into memory
diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c
index 01d1268514..77566a4fe2 100644
--- a/epan/dfilter/semcheck.c
+++ b/epan/dfilter/semcheck.c
@@ -1,5 +1,5 @@
/*
- * $Id: semcheck.c,v 1.14 2002/11/28 01:46:14 guy Exp $
+ * $Id: semcheck.c,v 1.15 2002/12/19 02:58:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -64,6 +64,7 @@ compatible_ftypes(ftenum_t a, ftenum_t b)
return (b == FT_ETHER || b == FT_BYTES || b == FT_UINT_BYTES);
case FT_BOOLEAN:
+ case FT_FRAMENUM:
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -74,6 +75,7 @@ compatible_ftypes(ftenum_t a, ftenum_t b)
case FT_INT32:
switch (b) {
case FT_BOOLEAN:
+ case FT_FRAMENUM:
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -152,6 +154,7 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s)
return FALSE;
case FT_BOOLEAN:
+ case FT_FRAMENUM:
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -232,6 +235,7 @@ is_bytes_type(enum ftenum type)
case FT_STRINGZ:
case FT_UINT_STRING:
case FT_BOOLEAN:
+ case FT_FRAMENUM:
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c
index 3db2ed7105..145de88666 100644
--- a/epan/ftypes/ftype-integer.c
+++ b/epan/ftypes/ftype-integer.c
@@ -1,5 +1,5 @@
/*
- * $Id: ftype-integer.c,v 1.10 2002/08/28 20:41:00 jmayer Exp $
+ * $Id: ftype-integer.c,v 1.11 2002/12/19 02:58:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -467,6 +467,32 @@ ftype_register_integers(void)
NULL,
};
+ static ftype_t framenum_type = {
+ "FT_FRAMENUM",
+ "frame number",
+ 4,
+ int_fvalue_new,
+ NULL,
+ val_from_string,
+
+ NULL,
+ set_integer,
+ NULL,
+
+ NULL,
+ get_integer,
+ NULL,
+
+ cmp_eq,
+ cmp_ne,
+ u_cmp_gt,
+ u_cmp_ge,
+ u_cmp_lt,
+ u_cmp_le,
+
+ NULL,
+ NULL,
+ };
ftype_register(FT_UINT8, &uint8_type);
ftype_register(FT_UINT16, &uint16_type);
@@ -478,4 +504,5 @@ ftype_register_integers(void)
ftype_register(FT_INT32, &int32_type);
ftype_register(FT_BOOLEAN, &boolean_type);
ftype_register(FT_IPXNET, &ipxnet_type);
+ ftype_register(FT_FRAMENUM, &framenum_type);
}
diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h
index 3aa731d1ac..869123da64 100644
--- a/epan/ftypes/ftypes.h
+++ b/epan/ftypes/ftypes.h
@@ -1,7 +1,7 @@
/* ftypes.h
* Definitions for field types
*
- * $Id: ftypes.h,v 1.14 2002/08/28 20:41:00 jmayer Exp $
+ * $Id: ftypes.h,v 1.15 2002/12/19 02:58:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -58,6 +58,7 @@ enum ftenum {
FT_IPv4,
FT_IPv6,
FT_IPXNET,
+ FT_FRAMENUM, /* a UINT32, but if selected lets you go to frame with that numbe */
FT_NUM_TYPES /* last item number plus one */
};
diff --git a/epan/proto.c b/epan/proto.c
index 9a911793a9..823ed617f7 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.77 2002/11/28 01:46:12 guy Exp $
+ * $Id: proto.c,v 1.78 2002/12/19 02:58:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1554,6 +1554,7 @@ proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gi
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
+ case FT_FRAMENUM:
pi = proto_tree_add_pi(tree, hfindex, tvb, start, &length,
&new_fi);
proto_tree_set_uint(new_fi, value);
@@ -2254,9 +2255,9 @@ proto_register_field_init(header_field_info *hfinfo, int parent)
(hfinfo->type == FT_INT16) ||
(hfinfo->type == FT_INT24) ||
(hfinfo->type == FT_INT32) ||
- (hfinfo->type == FT_BOOLEAN) ));
+ (hfinfo->type == FT_BOOLEAN) ||
+ (hfinfo->type == FT_FRAMENUM) ));
- /* Require integral types to have a number base */
switch (hfinfo->type) {
case FT_UINT8:
@@ -2267,9 +2268,17 @@ proto_register_field_init(header_field_info *hfinfo, int parent)
case FT_INT16:
case FT_INT24:
case FT_INT32:
+ /* Require integral types (other than frame number, which is
+ always displayed in decimal) to have a number base */
g_assert(hfinfo->display != BASE_NONE);
break;
+ case FT_FRAMENUM:
+ /* Don't allow bitfields or value strings for frame numbers */
+ g_assert(hfinfo->bitmask == 0);
+ g_assert(hfinfo->strings == NULL);
+ break;
+
default:
break;
}
@@ -2360,6 +2369,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
+ case FT_FRAMENUM:
if (hfinfo->bitmask) {
if (hfinfo->strings) {
fill_label_enumerated_bitfield(fi, label_str);
@@ -2772,36 +2782,43 @@ hfinfo_uint_format(header_field_info *hfinfo)
char *format = NULL;
/* Pick the proper format string */
- switch(hfinfo->display) {
- case BASE_DEC:
- case BASE_BIN: /* I'm lazy */
- format = "%s: %u";
- break;
- case BASE_OCT: /* I'm lazy */
- format = "%s: %o";
- break;
- case BASE_HEX:
- switch(hfinfo->type) {
- case FT_UINT8:
- format = "%s: 0x%02x";
- break;
- case FT_UINT16:
- format = "%s: 0x%04x";
- break;
- case FT_UINT24:
- format = "%s: 0x%06x";
- break;
- case FT_UINT32:
- format = "%s: 0x%08x";
- break;
- default:
- g_assert_not_reached();
- ;
- }
- break;
- default:
- g_assert_not_reached();
- ;
+ if (hfinfo->type == FT_FRAMENUM) {
+ /*
+ * Frame numbers are always displayed in decimal.
+ */
+ format = "%s: %u";
+ } else {
+ switch(hfinfo->display) {
+ case BASE_DEC:
+ case BASE_BIN: /* I'm lazy */
+ format = "%s: %u";
+ break;
+ case BASE_OCT: /* I'm lazy */
+ format = "%s: %o";
+ break;
+ case BASE_HEX:
+ switch(hfinfo->type) {
+ case FT_UINT8:
+ format = "%s: 0x%02x";
+ break;
+ case FT_UINT16:
+ format = "%s: 0x%04x";
+ break;
+ case FT_UINT24:
+ format = "%s: 0x%06x";
+ break;
+ case FT_UINT32:
+ format = "%s: 0x%08x";
+ break;
+ default:
+ g_assert_not_reached();
+ ;
+ }
+ break;
+ default:
+ g_assert_not_reached();
+ ;
+ }
}
return format;
}
@@ -3163,50 +3180,58 @@ hfinfo_numeric_format(header_field_info *hfinfo)
char *format = NULL;
/* Pick the proper format string */
- switch(hfinfo->display) {
- case BASE_DEC:
- case BASE_OCT: /* I'm lazy */
- case BASE_BIN: /* I'm lazy */
- switch(hfinfo->type) {
- case FT_UINT8:
- case FT_UINT16:
- case FT_UINT24:
- case FT_UINT32:
- format = "%s == %u";
- break;
- case FT_INT8:
- case FT_INT16:
- case FT_INT24:
- case FT_INT32:
- format = "%s == %d";
- break;
- default:
- g_assert_not_reached();
- ;
- }
- break;
- case BASE_HEX:
- switch(hfinfo->type) {
- case FT_UINT8:
- format = "%s == 0x%02x";
- break;
- case FT_UINT16:
- format = "%s == 0x%04x";
- break;
- case FT_UINT24:
- format = "%s == 0x%06x";
- break;
- case FT_UINT32:
- format = "%s == 0x%08x";
- break;
- default:
- g_assert_not_reached();
- ;
- }
- break;
- default:
- g_assert_not_reached();
- ;
+ if (hfinfo->type == FT_FRAMENUM) {
+ /*
+ * Frame numbers are always displayed in decimal.
+ */
+ format = "%s == %u";
+ } else {
+ /* Pick the proper format string */
+ switch(hfinfo->display) {
+ case BASE_DEC:
+ case BASE_OCT: /* I'm lazy */
+ case BASE_BIN: /* I'm lazy */
+ switch(hfinfo->type) {
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ format = "%s == %u";
+ break;
+ case FT_INT8:
+ case FT_INT16:
+ case FT_INT24:
+ case FT_INT32:
+ format = "%s == %d";
+ break;
+ default:
+ g_assert_not_reached();
+ ;
+ }
+ break;
+ case BASE_HEX:
+ switch(hfinfo->type) {
+ case FT_UINT8:
+ format = "%s == 0x%02x";
+ break;
+ case FT_UINT16:
+ format = "%s == 0x%04x";
+ break;
+ case FT_UINT24:
+ format = "%s == 0x%06x";
+ break;
+ case FT_UINT32:
+ format = "%s == 0x%08x";
+ break;
+ default:
+ g_assert_not_reached();
+ ;
+ }
+ break;
+ default:
+ g_assert_not_reached();
+ ;
+ }
}
return format;
}
@@ -3226,6 +3251,7 @@ proto_can_match_selected(field_info *finfo)
switch(hfinfo->type) {
case FT_BOOLEAN:
+ case FT_FRAMENUM:
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -3301,6 +3327,7 @@ proto_alloc_dfilter_string(field_info *finfo, guint8 *pd)
case FT_INT16:
case FT_INT24:
case FT_INT32:
+ case FT_FRAMENUM:
/*
* 4 bytes for " == ".
* 11 bytes for:
diff --git a/gtk/main.c b/gtk/main.c
index 4bc4180e36..d472919398 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.278 2002/11/28 02:04:23 guy Exp $
+ * $Id: main.c,v 1.279 2002/12/19 02:58:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -126,6 +126,7 @@
#include "register.h"
#include "ringbuffer.h"
#include "ui_util.h"
+#include "../ui_util.h"
#include "image/clist_ascend.xpm"
#include "image/clist_descend.xpm"
#include "../tap.h"
@@ -215,6 +216,25 @@ set_fonts(PangoFontDescription *regular, PangoFontDescription *bold)
#endif
}
+/*
+ * Go to frame specified by currently selected protocol tree item.
+ */
+void
+goto_framenum_cb(GtkWidget *w _U_, gpointer data _U_)
+{
+ if (finfo_selected) {
+ header_field_info *hfinfo;
+ guint32 framenum;
+
+ hfinfo = finfo_selected->hfinfo;
+ g_assert(hfinfo);
+ if (hfinfo->type == FT_FRAMENUM) {
+ framenum = fvalue_get_integer(finfo_selected->value);
+ if (framenum != 0)
+ packet_list_set_selected_row(framenum - 1);
+ }
+ }
+}
/* Match selected byte pattern */
static void
diff --git a/gtk/main.h b/gtk/main.h
index 6a81c7114d..302af398e8 100644
--- a/gtk/main.h
+++ b/gtk/main.h
@@ -1,7 +1,7 @@
/* main.h
* Global defines, etc.
*
- * $Id: main.h,v 1.29 2002/11/03 17:38:33 oabad Exp $
+ * $Id: main.h,v 1.30 2002/12/19 02:58:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -63,6 +63,7 @@ extern GtkStyle *item_style;
#endif
void about_ethereal( GtkWidget *, gpointer);
+void goto_framenum_cb(GtkWidget *, gpointer);
void match_selected_cb_replace_ptree( GtkWidget *, gpointer);
void match_selected_cb_and_ptree( GtkWidget *, gpointer);
void match_selected_cb_or_ptree( GtkWidget *, gpointer);
diff --git a/gtk/menu.c b/gtk/menu.c
index 6c0624fbb0..1dc68fea01 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -1,7 +1,7 @@
/* menu.c
* Menu routines
*
- * $Id: menu.c,v 1.79 2002/11/17 11:43:40 sahlberg Exp $
+ * $Id: menu.c,v 1.80 2002/12/19 02:58:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -311,7 +311,8 @@ static GtkItemFactoryEntry tree_view_menu_items[] =
ITEM_FACTORY_ENTRY("/Display Filters...", NULL, dfilter_dialog_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/<separator>", NULL, NULL, 0, "<Separator>", NULL),
- ITEM_FACTORY_ENTRY("/Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/_Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL),
+ ITEM_FACTORY_ENTRY("/_Go To Specified Frame", NULL, goto_framenum_cb, 0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Protocol Properties...", NULL, properties_cb,
0, NULL, NULL),
ITEM_FACTORY_ENTRY("/Match", NULL, NULL, 0, "<Branch>", NULL),
diff --git a/packet-rpc.c b/packet-rpc.c
index eccec2de77..dcfa6a209e 100644
--- a/packet-rpc.c
+++ b/packet-rpc.c
@@ -2,7 +2,7 @@
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.112 2002/12/06 21:01:37 sahlberg Exp $
+ * $Id: packet-rpc.c,v 1.113 2002/12/19 02:58:43 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -144,6 +144,8 @@ static const value_string rpc_authdes_namekind[] = {
/* the protocol number */
static int proto_rpc = -1;
+static int hf_rpc_reqframe = -1;
+static int hf_rpc_repframe = -1;
static int hf_rpc_lastfrag = -1;
static int hf_rpc_fraglen = -1;
static int hf_rpc_xid = -1;
@@ -1881,7 +1883,8 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if(rpc_call && rpc_call->rep_num){
- proto_tree_add_text(rpc_tree, tvb, 0, 0,
+ proto_tree_add_uint_format(rpc_tree, hf_rpc_repframe,
+ tvb, 0, 0, rpc_call->rep_num,
"The reply to this request is in frame %u",
rpc_call->rep_num);
}
@@ -1980,7 +1983,8 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Indicate the frame to which this is a reply. */
if(rpc_call && rpc_call->req_num){
- proto_tree_add_text(rpc_tree, tvb, 0, 0,
+ proto_tree_add_uint_format(rpc_tree, hf_rpc_reqframe,
+ tvb, 0, 0, rpc_call->req_num,
"This is a reply to a request in frame %u",
rpc_call->req_num);
ns.secs= pinfo->fd->abs_secs-rpc_call->req_time.secs;
@@ -2932,6 +2936,12 @@ void
proto_register_rpc(void)
{
static hf_register_info hf[] = {
+ { &hf_rpc_reqframe, {
+ "Request Frame", "rpc.reqframe", FT_FRAMENUM, BASE_NONE,
+ NULL, 0, "Request Frame", HFILL }},
+ { &hf_rpc_repframe, {
+ "Reply Frame", "rpc.repframe", FT_FRAMENUM, BASE_NONE,
+ NULL, 0, "Reply Frame", HFILL }},
{ &hf_rpc_lastfrag, {
"Last Fragment", "rpc.lastfrag", FT_BOOLEAN, 32,
&yesno, RPC_RM_LASTFRAG, "Last Fragment", HFILL }},