diff options
-rw-r--r-- | epan/dissectors/packet-frame.c | 2 | ||||
-rw-r--r-- | epan/frame_data.h | 9 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | rawshark.c | 4 | ||||
-rw-r--r-- | tshark.c | 4 |
5 files changed, 16 insertions, 7 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index edb17f8814..433208ac57 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -326,7 +326,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tvb, pinfo, parent_tree)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN"); - col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %u", + col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d", pinfo->fd->lnk_t); call_dissector(data_handle,tvb, pinfo, parent_tree); } diff --git a/epan/frame_data.h b/epan/frame_data.h index 69b551b2e4..354f8d0e2f 100644 --- a/epan/frame_data.h +++ b/epan/frame_data.h @@ -44,7 +44,8 @@ typedef struct _frame_data { guint32 pkt_len; /* Packet length */ guint32 cap_len; /* Amount actually captured */ guint32 cum_bytes; /* Cumulative bytes into the capture */ - int lnk_t; /* Per-packet encapsulation/data-link type */ + gint64 file_off; /* File offset */ + gint8 lnk_t; /* Per-packet encapsulation/data-link type */ struct { unsigned int passed_dfilter : 1; /* 1 = display, 0 = no display */ unsigned int encoding : 2; /* Character encoding (ASCII, EBCDIC...) */ @@ -52,13 +53,15 @@ typedef struct _frame_data { unsigned int marked : 1; /* 1 = marked by user, 0 = normal */ unsigned int ref_time : 1; /* 1 = marked as a reference time frame, 0 = normal */ } flags; + void *color_filter; /* Per-packet matching color_filter_t object */ + nstime_t abs_ts; /* Absolute timestamp */ nstime_t rel_ts; /* Relative timestamp (yes, it can be negative) */ nstime_t del_dis_ts; /* Delta timestamp to previous displayed frame (yes, it can be negative) */ nstime_t del_cap_ts; /* Delta timestamp to previous captured frame (yes, it can be negative) */ - gint64 file_off; /* File offset */ - gchar **col_text; /* The column text for some columns, see colum_utils */ + + gchar **col_text; /* The column text for some columns, see colum_utils */ guint *col_text_len; /* The length of the column text strings in 'col_text' */ } frame_data; @@ -1259,7 +1259,9 @@ read_packet(capture_file *cf, dfilter_t *dfcode, fdata->pkt_len = phdr->len; fdata->cap_len = phdr->caplen; fdata->file_off = offset; - fdata->lnk_t = phdr->pkt_encap; + /* To save some memory, we coarcese it into a gint8 */ + g_assert(phdr->pkt_encap <= G_MAXINT8); + fdata->lnk_t = (gint8) phdr->pkt_encap; fdata->flags.encoding = CHAR_ASCII; fdata->flags.visited = 0; fdata->flags.marked = 0; diff --git a/rawshark.c b/rawshark.c index 3249e4f326..e22fc2999e 100644 --- a/rawshark.c +++ b/rawshark.c @@ -1019,7 +1019,9 @@ fill_in_fdata(frame_data *fdata, capture_file *cf, fdata->cum_bytes = cum_bytes; fdata->cap_len = phdr->caplen; fdata->file_off = offset; - fdata->lnk_t = phdr->pkt_encap; + /* To save some memory, we coarcese it into a gint8 */ + g_assert(phdr->pkt_encap <= G_MAXINT8); + fdata->lnk_t = (gint8) phdr->pkt_encap; fdata->abs_ts.secs = phdr->ts.secs; fdata->abs_ts.nsecs = phdr->ts.nsecs; fdata->flags.passed_dfilter = 0; @@ -2394,7 +2394,9 @@ fill_in_fdata(frame_data *fdata, capture_file *cf, fdata->cum_bytes = cum_bytes; fdata->cap_len = phdr->caplen; fdata->file_off = offset; - fdata->lnk_t = phdr->pkt_encap; + /* To save some memory, we coarcese it into a gint8 */ + g_assert(phdr->pkt_encap <= G_MAXINT8); + fdata->lnk_t = (gint8) phdr->pkt_encap; fdata->abs_ts.secs = phdr->ts.secs; fdata->abs_ts.nsecs = phdr->ts.nsecs; fdata->flags.passed_dfilter = 0; |