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 = "";
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,
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) ||
(hfinfo->type == FT_INT24) ||
(hfinfo->type == FT_INT32) ||
(hfinfo->type == FT_BOOLEAN) ||
+ (hfinfo->type == FT_PROTOCOL) ||
(hfinfo->type == FT_FRAMENUM) ));
switch (hfinfo->type) {
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. */
}
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 */
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 */
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);
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