diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-07 13:54:46 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-07 13:54:46 +0000 |
commit | a65d590002f2d0886a10e7e8d707ceb4f1dc8832 (patch) | |
tree | 861cfce51141fa84f7b00a3f4acbf679d8f505f9 /rawshark.c | |
parent | 4fbc99e41141448c754d51ac76f2b3821fa94099 (diff) |
Store the packet encapsulation type as gint8. Saves 3 bytes per packet
svn path=/trunk/; revision=29767
Diffstat (limited to 'rawshark.c')
-rw-r--r-- | rawshark.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |