forked from osmocom/wireshark
Add support for dissecting non-packet records.
Add a dissector table indexed by the file type, and, for the file-type-specific records, have the frame dissector skip the usual pseudo-header processing, as the pseudo-header has a file-type-specific record subtype in it, and call the dissector for that file type's records. Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9 Reviewed-on: https://code.wireshark.org/review/1782 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
6dffc3b7e3
commit
318cf8a678
|
@ -149,6 +149,7 @@ static const value_string packet_word_reception_types[] = {
|
|||
};
|
||||
|
||||
dissector_table_t wtap_encap_dissector_table;
|
||||
static dissector_table_t wtap_fts_rec_dissector_table;;
|
||||
|
||||
/*
|
||||
* Routine used to register frame end routine. The routine should only
|
||||
|
@ -182,58 +183,73 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|||
|
||||
tree=parent_tree;
|
||||
|
||||
pinfo->current_proto = "Frame";
|
||||
switch (pinfo->phdr->rec_type) {
|
||||
|
||||
if (pinfo->pseudo_header != NULL) {
|
||||
switch (pinfo->fd->lnk_t) {
|
||||
case REC_TYPE_PACKET:
|
||||
pinfo->current_proto = "Frame";
|
||||
if (pinfo->pseudo_header != NULL) {
|
||||
switch (pinfo->fd->lnk_t) {
|
||||
|
||||
case WTAP_ENCAP_WFLEET_HDLC:
|
||||
case WTAP_ENCAP_CHDLC_WITH_PHDR:
|
||||
case WTAP_ENCAP_PPP_WITH_PHDR:
|
||||
case WTAP_ENCAP_SDLC:
|
||||
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
case WTAP_ENCAP_WFLEET_HDLC:
|
||||
case WTAP_ENCAP_CHDLC_WITH_PHDR:
|
||||
case WTAP_ENCAP_PPP_WITH_PHDR:
|
||||
case WTAP_ENCAP_SDLC:
|
||||
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_BLUETOOTH_HCI:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->bthci.sent;
|
||||
break;
|
||||
case WTAP_ENCAP_BLUETOOTH_HCI:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->bthci.sent;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_LAPB:
|
||||
case WTAP_ENCAP_FRELAY_WITH_PHDR:
|
||||
pinfo->p2p_dir =
|
||||
(pinfo->pseudo_header->x25.flags & FROM_DCE) ?
|
||||
P2P_DIR_RECV : P2P_DIR_SENT;
|
||||
break;
|
||||
case WTAP_ENCAP_LAPB:
|
||||
case WTAP_ENCAP_FRELAY_WITH_PHDR:
|
||||
pinfo->p2p_dir =
|
||||
(pinfo->pseudo_header->x25.flags & FROM_DCE) ?
|
||||
P2P_DIR_RECV : P2P_DIR_SENT;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_ISDN:
|
||||
case WTAP_ENCAP_V5_EF:
|
||||
case WTAP_ENCAP_DPNSS:
|
||||
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
case WTAP_ENCAP_ISDN:
|
||||
case WTAP_ENCAP_V5_EF:
|
||||
case WTAP_ENCAP_DPNSS:
|
||||
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_LINUX_LAPD:
|
||||
pinfo->p2p_dir = (pinfo->pseudo_header->lapd.pkttype == 3 ||
|
||||
pinfo->pseudo_header->lapd.pkttype == 4) ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
case WTAP_ENCAP_LINUX_LAPD:
|
||||
pinfo->p2p_dir = (pinfo->pseudo_header->lapd.pkttype == 3 ||
|
||||
pinfo->pseudo_header->lapd.pkttype == 4) ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_MTP2_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->mtp2.sent ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
pinfo->link_number = pinfo->pseudo_header->mtp2.link_number;
|
||||
pinfo->annex_a_used = pinfo->pseudo_header->mtp2.annex_a_used;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_GSM_UM:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->gsm_um.uplink ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
case WTAP_ENCAP_MTP2_WITH_PHDR:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->mtp2.sent ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
pinfo->link_number = pinfo->pseudo_header->mtp2.link_number;
|
||||
pinfo->annex_a_used = pinfo->pseudo_header->mtp2.annex_a_used;
|
||||
break;
|
||||
|
||||
case WTAP_ENCAP_GSM_UM:
|
||||
pinfo->p2p_dir = pinfo->pseudo_header->gsm_um.uplink ?
|
||||
P2P_DIR_SENT : P2P_DIR_RECV;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case REC_TYPE_FT_SPECIFIC_EVENT:
|
||||
pinfo->current_proto = "Event";
|
||||
break;
|
||||
|
||||
case REC_TYPE_FT_SPECIFIC_REPORT:
|
||||
pinfo->current_proto = "Report";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
if(pinfo->pkt_comment){
|
||||
|
@ -324,7 +340,8 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|||
proto_tree_add_boolean(flags_tree, hf_frame_pack_symbol_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
||||
}
|
||||
|
||||
proto_tree_add_int(fh_tree, hf_frame_wtap_encap, tvb, 0, 0, pinfo->fd->lnk_t);
|
||||
if (pinfo->phdr->rec_type == REC_TYPE_PACKET)
|
||||
proto_tree_add_int(fh_tree, hf_frame_wtap_encap, tvb, 0, 0, pinfo->fd->lnk_t);
|
||||
|
||||
if (pinfo->fd->flags.has_ts) {
|
||||
proto_tree_add_time(fh_tree, hf_frame_arrival_time, tvb,
|
||||
|
@ -482,17 +499,34 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|||
*/
|
||||
__try {
|
||||
#endif
|
||||
if ((force_docsis_encap) && (docsis_handle)) {
|
||||
call_dissector(docsis_handle, tvb, pinfo, parent_tree);
|
||||
} else {
|
||||
if (!dissector_try_uint(wtap_encap_dissector_table, pinfo->fd->lnk_t,
|
||||
switch (pinfo->phdr->rec_type) {
|
||||
|
||||
case REC_TYPE_PACKET:
|
||||
if ((force_docsis_encap) && (docsis_handle)) {
|
||||
call_dissector(docsis_handle, tvb, pinfo, parent_tree);
|
||||
} else {
|
||||
if (!dissector_try_uint(wtap_encap_dissector_table, pinfo->fd->lnk_t,
|
||||
tvb, pinfo, parent_tree)) {
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
|
||||
col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
|
||||
pinfo->fd->lnk_t);
|
||||
call_dissector(data_handle,tvb, pinfo, parent_tree);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case REC_TYPE_FT_SPECIFIC_EVENT:
|
||||
case REC_TYPE_FT_SPECIFIC_REPORT:
|
||||
if (!dissector_try_uint(wtap_fts_rec_dissector_table, pinfo->file_type_subtype,
|
||||
tvb, pinfo, parent_tree)) {
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
|
||||
col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
|
||||
pinfo->fd->lnk_t);
|
||||
pinfo->file_type_subtype);
|
||||
call_dissector(data_handle,tvb, pinfo, parent_tree);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
} __except(EXCEPTION_EXECUTE_HANDLER /* handle all exceptions */) {
|
||||
|
@ -816,6 +850,8 @@ proto_register_frame(void)
|
|||
|
||||
wtap_encap_dissector_table = register_dissector_table("wtap_encap",
|
||||
"Wiretap encapsulation type", FT_UINT32, BASE_DEC);
|
||||
wtap_fts_rec_dissector_table = register_dissector_table("wtap_fts_rec",
|
||||
"Wiretap file type for file-type-specific records", FT_UINT32, BASE_DEC);
|
||||
|
||||
proto_frame = proto_register_protocol("Frame", "Frame", "frame");
|
||||
proto_pkt_comment = proto_register_protocol("Packet comments", "Pkt_Comment", "pkt_comment");
|
||||
|
|
14
epan/epan.c
14
epan/epan.c
|
@ -325,14 +325,15 @@ epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols)
|
|||
}
|
||||
|
||||
void
|
||||
epan_dissect_run(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
||||
tvbuff_t *tvb, frame_data *fd, column_info *cinfo)
|
||||
epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb, frame_data *fd,
|
||||
column_info *cinfo)
|
||||
{
|
||||
#ifdef HAVE_LUA
|
||||
wslua_prime_dfilter(edt); /* done before entering wmem scope */
|
||||
#endif
|
||||
wmem_enter_packet_scope();
|
||||
dissect_record(edt, phdr, tvb, fd, cinfo);
|
||||
dissect_record(edt, file_type_subtype, phdr, tvb, fd, cinfo);
|
||||
|
||||
/* free all memory allocated */
|
||||
ep_free_all();
|
||||
|
@ -340,12 +341,13 @@ epan_dissect_run(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|||
}
|
||||
|
||||
void
|
||||
epan_dissect_run_with_taps(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
||||
tvbuff_t *tvb, frame_data *fd, column_info *cinfo)
|
||||
epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb, frame_data *fd,
|
||||
column_info *cinfo)
|
||||
{
|
||||
wmem_enter_packet_scope();
|
||||
tap_queue_init(edt);
|
||||
dissect_record(edt, phdr, tvb, fd, cinfo);
|
||||
dissect_record(edt, file_type_subtype, phdr, tvb, fd, cinfo);
|
||||
tap_push_tapped_queue(edt);
|
||||
|
||||
/* free all memory allocated */
|
||||
|
|
10
epan/epan.h
10
epan/epan.h
|
@ -179,13 +179,15 @@ epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols);
|
|||
/** run a single packet dissection */
|
||||
WS_DLL_PUBLIC
|
||||
void
|
||||
epan_dissect_run(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
||||
tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
|
||||
epan_dissect_run(epan_dissect_t *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb, frame_data *fd,
|
||||
struct epan_column_info *cinfo);
|
||||
|
||||
WS_DLL_PUBLIC
|
||||
void
|
||||
epan_dissect_run_with_taps(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
||||
tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo);
|
||||
epan_dissect_run_with_taps(epan_dissect_t *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb, frame_data *fd,
|
||||
struct epan_column_info *cinfo);
|
||||
|
||||
/** run a single file packet dissection */
|
||||
WS_DLL_PUBLIC
|
||||
|
|
|
@ -420,9 +420,36 @@ final_registration_all_protocols(void)
|
|||
|
||||
/* Creates the top-most tvbuff and calls dissect_frame() */
|
||||
void
|
||||
dissect_record(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
||||
tvbuff_t *tvb, frame_data *fd, column_info *cinfo)
|
||||
dissect_record(epan_dissect_t *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb, frame_data *fd, column_info *cinfo)
|
||||
{
|
||||
const char *record_type;
|
||||
|
||||
switch (phdr->rec_type) {
|
||||
|
||||
case REC_TYPE_PACKET:
|
||||
record_type = "Frame";
|
||||
break;
|
||||
|
||||
case REC_TYPE_FT_SPECIFIC_EVENT:
|
||||
record_type = "Event";
|
||||
break;
|
||||
|
||||
case REC_TYPE_FT_SPECIFIC_REPORT:
|
||||
record_type = "Report";
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* XXX - if we add record types that shouldn't be
|
||||
* dissected and displayed, but that need to at
|
||||
* least be processed somewhere, we need to somehow
|
||||
* indicate that to our caller.
|
||||
*/
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
if (cinfo != NULL)
|
||||
col_init(cinfo, edt->session);
|
||||
edt->pi.epan = edt->session;
|
||||
|
@ -430,6 +457,7 @@ dissect_record(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|||
edt->pi.current_proto = "<Missing Protocol Name>";
|
||||
edt->pi.cinfo = cinfo;
|
||||
edt->pi.fd = fd;
|
||||
edt->pi.file_type_subtype = file_type_subtype;
|
||||
edt->pi.phdr = phdr;
|
||||
edt->pi.pseudo_header = &phdr->pseudo_header;
|
||||
edt->pi.dl_src.type = AT_NONE;
|
||||
|
@ -456,15 +484,11 @@ dissect_record(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|||
else if (fd->flags.has_phdr_comment)
|
||||
edt->pi.pkt_comment = phdr->opt_comment;
|
||||
|
||||
if (phdr->rec_type != REC_TYPE_PACKET) {
|
||||
/* XXX = process these */
|
||||
}
|
||||
|
||||
EP_CHECK_CANARY(("before dissecting frame %d",fd->num));
|
||||
EP_CHECK_CANARY(("before dissecting record %d",fd->num));
|
||||
|
||||
TRY {
|
||||
/* Add this tvbuffer into the data_src list */
|
||||
add_new_data_source(&edt->pi, edt->tvb, "Frame");
|
||||
add_new_data_source(&edt->pi, edt->tvb, record_type);
|
||||
|
||||
/* Even though dissect_frame() catches all the exceptions a
|
||||
* sub-dissector can throw, dissect_frame() itself may throw
|
||||
|
@ -478,11 +502,12 @@ dissect_record(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|||
}
|
||||
CATCH2(FragmentBoundsError, ReportedBoundsError) {
|
||||
proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0,
|
||||
"[Malformed Frame: Packet Length]" );
|
||||
"[Malformed %s: Packet Length]",
|
||||
record_type);
|
||||
}
|
||||
ENDTRY;
|
||||
|
||||
EP_CHECK_CANARY(("after dissecting frame %d",fd->num));
|
||||
EP_CHECK_CANARY(("after dissecting record %d",fd->num));
|
||||
|
||||
fd->flags.visited = 1;
|
||||
}
|
||||
|
@ -499,6 +524,7 @@ dissect_file(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|||
edt->pi.current_proto = "<Missing Filetype Name>";
|
||||
edt->pi.cinfo = cinfo;
|
||||
edt->pi.fd = fd;
|
||||
edt->pi.file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_UNKNOWN; /* not a capture file, so not relevant */
|
||||
edt->pi.phdr = phdr;
|
||||
edt->pi.pseudo_header = &phdr->pseudo_header;
|
||||
edt->pi.dl_src.type = AT_NONE;
|
||||
|
|
|
@ -556,7 +556,7 @@ WS_DLL_PUBLIC void mark_frame_as_depended_upon(packet_info *pinfo, guint32 frame
|
|||
/*
|
||||
* Dissectors should never modify the record data.
|
||||
*/
|
||||
extern void dissect_record(struct epan_dissect *edt,
|
||||
extern void dissect_record(struct epan_dissect *edt, int file_type_subtype,
|
||||
struct wtap_pkthdr *phdr, tvbuff_t *tvb,
|
||||
frame_data *fd, column_info *cinfo);
|
||||
|
||||
|
|
|
@ -51,7 +51,8 @@ typedef struct _packet_info {
|
|||
struct epan_column_info *cinfo; /**< Column formatting information */
|
||||
frame_data *fd;
|
||||
union wtap_pseudo_header *pseudo_header;
|
||||
struct wtap_pkthdr *phdr;
|
||||
int file_type_subtype; /**< Capture file type/subtype */
|
||||
struct wtap_pkthdr *phdr; /**< Record metadata */
|
||||
GSList *data_src; /**< Frame data sources */
|
||||
address dl_src; /**< link-layer source address */
|
||||
address dl_dst; /**< link-layer destination address */
|
||||
|
|
32
file.c
32
file.c
|
@ -1176,7 +1176,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
|
|||
}
|
||||
|
||||
/* Dissect the frame. */
|
||||
epan_dissect_run_with_taps(edt, phdr, frame_tvbuff_new(fdata, buf), fdata, cinfo);
|
||||
epan_dissect_run_with_taps(edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, buf), fdata, cinfo);
|
||||
|
||||
/* If we don't have a display filter, set "passed_dfilter" to 1. */
|
||||
if (dfcode != NULL) {
|
||||
|
@ -1263,7 +1263,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode, epan_dissect_t *edt,
|
|||
|
||||
epan_dissect_init(&rf_edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&rf_edt, cf->rfcode);
|
||||
epan_dissect_run(&rf_edt, phdr, frame_tvbuff_new(&fdlocal, buf), &fdlocal, NULL);
|
||||
epan_dissect_run(&rf_edt, cf->cd_t, phdr, frame_tvbuff_new(&fdlocal, buf), &fdlocal, NULL);
|
||||
passed = dfilter_apply_edt(cf->rfcode, &rf_edt);
|
||||
epan_dissect_cleanup(&rf_edt);
|
||||
}
|
||||
|
@ -2361,13 +2361,13 @@ typedef struct {
|
|||
} retap_callback_args_t;
|
||||
|
||||
static gboolean
|
||||
retap_packet(capture_file *cf _U_, frame_data *fdata,
|
||||
retap_packet(capture_file *cf, frame_data *fdata,
|
||||
struct wtap_pkthdr *phdr, const guint8 *pd,
|
||||
void *argsp)
|
||||
{
|
||||
retap_callback_args_t *args = (retap_callback_args_t *)argsp;
|
||||
|
||||
epan_dissect_run_with_taps(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, args->cinfo);
|
||||
epan_dissect_run_with_taps(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, args->cinfo);
|
||||
epan_dissect_reset(&args->edt);
|
||||
|
||||
return TRUE;
|
||||
|
@ -2469,10 +2469,10 @@ print_packet(capture_file *cf, frame_data *fdata,
|
|||
information. */
|
||||
if (args->print_args->print_summary) {
|
||||
col_custom_prime_edt(&args->edt, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
|
||||
} else
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
|
||||
if (args->print_formfeed) {
|
||||
if (!new_page(args->print_args->stream))
|
||||
|
@ -2776,14 +2776,14 @@ typedef struct {
|
|||
} write_packet_callback_args_t;
|
||||
|
||||
static gboolean
|
||||
write_pdml_packet(capture_file *cf _U_, frame_data *fdata,
|
||||
write_pdml_packet(capture_file *cf, frame_data *fdata,
|
||||
struct wtap_pkthdr *phdr, const guint8 *pd,
|
||||
void *argsp)
|
||||
{
|
||||
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
|
||||
|
||||
/* Create the protocol tree, but don't fill in the column information. */
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
|
||||
/* Write out the information in that tree. */
|
||||
proto_tree_write_pdml(&args->edt, args->fh);
|
||||
|
@ -2857,7 +2857,7 @@ write_psml_packet(capture_file *cf, frame_data *fdata,
|
|||
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
|
||||
|
||||
col_custom_prime_edt(&args->edt, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
|
||||
|
||||
/* Write out the information in that tree. */
|
||||
|
@ -2939,7 +2939,7 @@ write_csv_packet(capture_file *cf, frame_data *fdata,
|
|||
|
||||
/* Fill in the column information */
|
||||
col_custom_prime_edt(&args->edt, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
|
||||
|
||||
/* Write out the information in that tree. */
|
||||
|
@ -3011,13 +3011,13 @@ cf_write_csv_packets(capture_file *cf, print_args_t *print_args)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
write_carrays_packet(capture_file *cf _U_, frame_data *fdata,
|
||||
write_carrays_packet(capture_file *cf, frame_data *fdata,
|
||||
struct wtap_pkthdr *phdr,
|
||||
const guint8 *pd, void *argsp)
|
||||
{
|
||||
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
|
||||
|
||||
epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
proto_tree_write_carrays(fdata->num, args->fh, &args->edt);
|
||||
epan_dissect_reset(&args->edt);
|
||||
|
||||
|
@ -3117,7 +3117,7 @@ match_protocol_tree(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
/* Construct the protocol tree, including the displayed text */
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, TRUE);
|
||||
/* We don't need the column information */
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
/* Iterate through all the nodes, seeing if they have text that matches. */
|
||||
mdata->cf = cf;
|
||||
|
@ -3221,7 +3221,7 @@ match_summary_line(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
/* Don't bother constructing the protocol tree */
|
||||
epan_dissect_init(&edt, cf->epan, FALSE, FALSE);
|
||||
/* Get the column information */
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata,
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata,
|
||||
&cf->cinfo);
|
||||
|
||||
/* Find the Info column */
|
||||
|
@ -3529,7 +3529,7 @@ match_dfilter(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
result = dfilter_apply_edt(sfcode, &edt) ? MR_MATCHED : MR_NOTMATCHED;
|
||||
epan_dissect_cleanup(&edt);
|
||||
return result;
|
||||
|
@ -3862,7 +3862,7 @@ cf_select_packet(capture_file *cf, int row)
|
|||
cf->edt = epan_dissect_new(cf->epan, TRUE, TRUE);
|
||||
|
||||
tap_build_interesting(cf->edt);
|
||||
epan_dissect_run(cf->edt, &cf->phdr, frame_tvbuff_new_buffer(cf->current_frame, &cf->buf),
|
||||
epan_dissect_run(cf->edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(cf->current_frame, &cf->buf),
|
||||
cf->current_frame, NULL);
|
||||
|
||||
dfilter_macro_build_ftv_cache(cf->edt->tree);
|
||||
|
|
|
@ -154,7 +154,7 @@ process_record(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
|
|||
epan_dissect_init(&edt, cfile.epan, TRUE, FALSE);
|
||||
/* Don't fake protocols. We need them for the protocol hierarchy */
|
||||
epan_dissect_fake_protocols(&edt, FALSE);
|
||||
epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(frame, &buf), frame, cinfo);
|
||||
epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(frame, &buf), frame, cinfo);
|
||||
|
||||
/* Get stats from this protocol tree */
|
||||
process_tree(edt.tree, ps, frame->pkt_len);
|
||||
|
|
|
@ -1116,7 +1116,7 @@ process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset,
|
|||
/* We only need the columns if we're printing packet info but we're
|
||||
*not* verbose; in verbose mode, we print the protocol tree, not
|
||||
the protocol summary. */
|
||||
epan_dissect_run_with_taps(edt, whdr, frame_tvbuff_new(&fdata, pd), &fdata, &cf->cinfo);
|
||||
epan_dissect_run_with_taps(edt, cf->cd_t, whdr, frame_tvbuff_new(&fdata, pd), &fdata, &cf->cinfo);
|
||||
|
||||
frame_data_set_after_dissect(&fdata, &cum_bytes);
|
||||
prev_dis_frame = fdata;
|
||||
|
|
6
tshark.c
6
tshark.c
|
@ -2918,7 +2918,7 @@ process_packet_first_pass(capture_file *cf, epan_dissect_t *edt,
|
|||
ref = &ref_frame;
|
||||
}
|
||||
|
||||
epan_dissect_run(edt, whdr, frame_tvbuff_new(&fdlocal, pd), &fdlocal, NULL);
|
||||
epan_dissect_run(edt, cf->cd_t, whdr, frame_tvbuff_new(&fdlocal, pd), &fdlocal, NULL);
|
||||
|
||||
/* Run the read filter if we have one. */
|
||||
if (cf->rfcode)
|
||||
|
@ -3001,7 +3001,7 @@ process_packet_second_pass(capture_file *cf, epan_dissect_t *edt, frame_data *fd
|
|||
ref = &ref_frame;
|
||||
}
|
||||
|
||||
epan_dissect_run_with_taps(edt, phdr, frame_tvbuff_new_buffer(fdata, buf), fdata, cinfo);
|
||||
epan_dissect_run_with_taps(edt, cf->cd_t, phdr, frame_tvbuff_new_buffer(fdata, buf), fdata, cinfo);
|
||||
|
||||
/* Run the read/display filter if we have one. */
|
||||
if (cf->dfcode)
|
||||
|
@ -3534,7 +3534,7 @@ process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset, struct wtap
|
|||
ref = &ref_frame;
|
||||
}
|
||||
|
||||
epan_dissect_run_with_taps(edt, whdr, frame_tvbuff_new(&fdata, pd), &fdata, cinfo);
|
||||
epan_dissect_run_with_taps(edt, cf->cd_t, whdr, frame_tvbuff_new(&fdata, pd), &fdata, cinfo);
|
||||
|
||||
/* Run the filter if we have it. */
|
||||
if (cf->dfcode)
|
||||
|
|
|
@ -3714,8 +3714,8 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
return; /* error reading the record */
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf),
|
||||
fdata, NULL);
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr,
|
||||
frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
/* if it is not an iax2 packet, show an error dialog */
|
||||
if (!dfilter_apply_edt(sfcode, &edt)) {
|
||||
|
|
|
@ -549,8 +549,8 @@ get_ip_address_list_from_packet_list_row(gpointer data)
|
|||
epan_dissect_init(&edt, cfile.epan, FALSE, FALSE);
|
||||
col_custom_prime_edt(&edt, &cfile.cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf),
|
||||
fdata, &cfile.cinfo);
|
||||
epan_dissect_run(&edt, cfile.cd_t, &cfile.phdr,
|
||||
frame_tvbuff_new_buffer(fdata, &cfile.buf), fdata, &cfile.cinfo);
|
||||
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
|
||||
|
||||
/* First check selected column */
|
||||
|
@ -590,7 +590,8 @@ get_filter_from_packet_list_row_and_column(gpointer data)
|
|||
epan_dissect_init(&edt, cfile.epan, have_custom_cols(&cfile.cinfo), FALSE);
|
||||
col_custom_prime_edt(&edt, &cfile.cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf),
|
||||
epan_dissect_run(&edt, cfile.cd_t, &cfile.phdr,
|
||||
frame_tvbuff_new_buffer(fdata, &cfile.buf),
|
||||
fdata, &cfile.cinfo);
|
||||
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
|
||||
|
||||
|
|
|
@ -1158,7 +1158,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
|
|||
* XXX - need to catch an OutOfMemoryError exception and
|
||||
* attempt to recover from it.
|
||||
*/
|
||||
epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo);
|
||||
epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo);
|
||||
|
||||
if (dissect_color)
|
||||
fdata->color_filter = color_filters_colorize_packet(&edt);
|
||||
|
|
|
@ -195,7 +195,7 @@ redissect_packet_window(gpointer object, gpointer user_data _U_)
|
|||
proto_tree_draw(NULL, DataPtr->tree_view);
|
||||
epan_dissect_cleanup(&(DataPtr->edt));
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
add_byte_views(&(DataPtr->edt), DataPtr->tree_view, DataPtr->bv_nb_ptr);
|
||||
proto_tree_draw(DataPtr->edt.tree, DataPtr->tree_view);
|
||||
|
||||
|
@ -270,7 +270,7 @@ finfo_window_refresh(struct FieldinfoWinData *DataPtr)
|
|||
if (old_finfo->hfinfo)
|
||||
proto_tree_prime_hfid(edt.tree, old_finfo->hfinfo->id);
|
||||
*/
|
||||
epan_dissect_run(&edt, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
epan_dissect_run(&edt, cfile.cd_t, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
|
||||
/* Try to find finfo which looks like old_finfo.
|
||||
* We might not found one, if protocol requires specific magic values, etc... */
|
||||
|
@ -743,7 +743,7 @@ edit_pkt_tree_row_activated_cb(GtkTreeView *tree_view, GtkTreePath *path, GtkTre
|
|||
proto_tree_draw(NULL, DataPtr->tree_view);
|
||||
epan_dissect_cleanup(&(DataPtr->edt));
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
add_byte_views(&(DataPtr->edt), DataPtr->tree_view, DataPtr->bv_nb_ptr);
|
||||
proto_tree_draw(DataPtr->edt.tree, DataPtr->tree_view);
|
||||
}
|
||||
|
@ -977,7 +977,8 @@ void new_packet_window(GtkWidget *w _U_, gboolean reference, gboolean editable _
|
|||
memcpy(DataPtr->pd, buffer_start_ptr(&cfile.buf), DataPtr->frame->cap_len);
|
||||
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd),
|
||||
epan_dissect_run(&(DataPtr->edt), cfile.cd_t, &DataPtr->phdr,
|
||||
frame_tvbuff_new(DataPtr->frame, DataPtr->pd),
|
||||
DataPtr->frame, &cfile.cinfo);
|
||||
epan_dissect_fill_in_columns(&(DataPtr->edt), FALSE, TRUE);
|
||||
|
||||
|
|
|
@ -917,7 +917,7 @@ static rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, struct segment
|
|||
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
rel_ts = edt.pi.rel_ts;
|
||||
epan_dissect_cleanup(&edt);
|
||||
remove_tap_listener(&th);
|
||||
|
|
|
@ -3949,7 +3949,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
return; /* error reading the record */
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
/* if it is not an rtp packet, show the rtpstream dialog */
|
||||
if (!dfilter_apply_edt(sfcode, &edt)) {
|
||||
|
|
|
@ -980,7 +980,7 @@ sctp_analyse_cb(struct sctp_analyse *u_data, gboolean ext)
|
|||
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
/* if it is not an sctp packet, show the dialog */
|
||||
if (!dfilter_apply_edt(sfcode, &edt)) {
|
||||
|
|
|
@ -661,7 +661,7 @@ QString &PacketList::getFilterFromRowAndColumn()
|
|||
epan_dissect_init(&edt, cap_file_->epan, have_custom_cols(&cap_file_->cinfo), FALSE);
|
||||
col_custom_prime_edt(&edt, &cap_file_->cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cap_file_->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_->buf), fdata, &cap_file_->cinfo);
|
||||
epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_->buf), fdata, &cap_file_->cinfo);
|
||||
epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
|
||||
|
||||
if ((cap_file_->cinfo.col_custom_occurrence[ctx_column_]) ||
|
||||
|
|
|
@ -262,7 +262,7 @@ QVariant PacketListModel::data(const QModelIndex &index, int role) const
|
|||
if (dissect_columns)
|
||||
col_custom_prime_edt(&edt, cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo);
|
||||
epan_dissect_run(&edt, cap_file_->cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo);
|
||||
|
||||
if (enable_color_)
|
||||
fdata->color_filter = color_filters_colorize_packet(&edt);
|
||||
|
|
|
@ -319,7 +319,7 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
|
|||
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
rel_ts = edt.pi.rel_ts;
|
||||
epan_dissect_cleanup(&edt);
|
||||
remove_tap_listener(&th);
|
||||
|
|
Loading…
Reference in New Issue