aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/proto.c27
-rw-r--r--epan/proto.h2
-rw-r--r--gtk/rtp_analysis.c2
-rw-r--r--gtk/sctp_assoc_analyse.c2
-rw-r--r--proto_hier_stats.c7
5 files changed, 16 insertions, 24 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 6602b14a2d..e45a77e963 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -2442,7 +2442,7 @@ proto_register_protocol(char *name, char *short_name, char *filter_name)
hfinfo->name = name;
hfinfo->abbrev = filter_name;
hfinfo->type = FT_PROTOCOL;
- hfinfo->strings = NULL;
+ hfinfo->strings = protocol;
hfinfo->bitmask = 0;
hfinfo->bitshift = 0;
hfinfo->blurb = "";
@@ -2515,27 +2515,17 @@ proto_get_next_protocol_field(void **cookie)
return &ptr->hfinfo;
}
-/*
- * Find the protocol list entry for a protocol given its field ID.
- */
-static gint
-compare_proto_id(gconstpointer proto_arg, gconstpointer id_arg)
-{
- const protocol_t *protocol = proto_arg;
- const int *id_ptr = id_arg;
-
- return (protocol->proto_id == *id_ptr) ? 0 : 1;
-}
-
protocol_t *
find_protocol_by_id(int proto_id)
{
- GList *list_entry;
+ header_field_info *hfinfo;
- list_entry = g_list_find_custom(protocols, &proto_id, compare_proto_id);
- if (list_entry == NULL)
+ if(proto_id<0)
return NULL;
- return list_entry->data;
+
+ PROTO_REGISTRAR_GET_NTH(proto_id, hfinfo);
+ DISSECTOR_ASSERT(hfinfo->type==FT_PROTOCOL);
+ return (protocol_t *)hfinfo->strings;
}
static gint compare_filter_name(gconstpointer proto_arg,
@@ -2668,7 +2658,7 @@ proto_register_field_init(header_field_info *hfinfo, int parent)
DISSECTOR_ASSERT(hfinfo->name);
DISSECTOR_ASSERT(hfinfo->abbrev);
- /* These types of fields are allowed to have value_strings or true_false_strings */
+ /* These types of fields are allowed to have value_strings, true_false_strings or a protocol_t struct*/
DISSECTOR_ASSERT((hfinfo->strings == NULL) || (
(hfinfo->type == FT_UINT8) ||
(hfinfo->type == FT_UINT16) ||
@@ -2679,6 +2669,7 @@ proto_register_field_init(header_field_info *hfinfo, int parent)
(hfinfo->type == FT_INT24) ||
(hfinfo->type == FT_INT32) ||
(hfinfo->type == FT_BOOLEAN) ||
+ (hfinfo->type == FT_PROTOCOL) ||
(hfinfo->type == FT_FRAMENUM) ));
switch (hfinfo->type) {
diff --git a/epan/proto.h b/epan/proto.h
index b91cc77b0e..db01f62935 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -147,7 +147,7 @@ struct _header_field_info {
char *abbrev; /**< abbreviated name of this field */
enum ftenum type; /**< field type, one of FT_ (from ftypes.h) */
int display; /**< one of BASE_, or number of field bits for FT_BOOLEAN */
- const void *strings; /**< _value_string (or true_false_string for FT_BOOLEAN), typically converted by VALS() or TFS() */
+ const void *strings; /**< _value_string (or true_false_string for FT_BOOLEAN), typically converted by VALS() or TFS() If this is an FT_PROTOCOL then it points to the associated protocol_t structure*/
guint32 bitmask; /**< FT_BOOLEAN only: bitmask of interesting bits */
char *blurb; /**< Brief description of field. */
diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c
index b1f4ab43ae..a488468e3b 100644
--- a/gtk/rtp_analysis.c
+++ b/gtk/rtp_analysis.c
@@ -3549,7 +3549,7 @@ void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_)
}
edt = epan_dissect_new(TRUE, FALSE);
epan_dissect_prime_dfilter(edt, sfcode);
- epan_dissect_run(edt, &cf->pseudo_header, cf->pd, fdata, &cf->cinfo);
+ epan_dissect_run(edt, &cf->pseudo_header, cf->pd, fdata, NULL);
frame_matched = dfilter_apply_edt(sfcode, edt);
/* if it is not an rtp frame, show the rtpstream dialog */
diff --git a/gtk/sctp_assoc_analyse.c b/gtk/sctp_assoc_analyse.c
index 6a76e603fd..87411bdf5a 100644
--- a/gtk/sctp_assoc_analyse.c
+++ b/gtk/sctp_assoc_analyse.c
@@ -742,7 +742,7 @@ void sctp_analyse_cb(struct sctp_analyse* u_data)
edt = epan_dissect_new(TRUE, FALSE);
epan_dissect_prime_dfilter(edt, sfcode);
- epan_dissect_run(edt, &cf->pseudo_header, cf->pd, fdata, &cf->cinfo);
+ epan_dissect_run(edt, &cf->pseudo_header, cf->pd, fdata, NULL);
frame_matched = dfilter_apply_edt(sfcode, edt);
/* if it is not an sctp frame, show the dialog */
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index 8974e52ac1..995a5c30f7 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -145,7 +145,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
return FALSE; /* failure */
}
- /* Dissect the frame */
+ /* Dissect the frame tree not visible */
edt = epan_dissect_new(TRUE, FALSE);
epan_dissect_run(edt, &phdr, pd, frame, cinfo);
@@ -253,8 +253,9 @@ ph_stats_new(void)
ps->first_time = cur_time;
ps->last_time = cur_time;
}
-
- if (!process_frame(frame, &cfile.cinfo, ps)) {
+
+ /* we don't care about colinfo */
+ if (!process_frame(frame, NULL, ps)) {
/*
* Give up, and set "stop_flag" so we
* just abort rather than popping up