aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-18 18:33:53 -0800
committerGuy Harris <guy@alum.mit.edu>2016-02-19 02:34:50 +0000
commit1e8905ca8e1db9231bc5381887850aa3eca7f735 (patch)
treeb445b379bc601311a64d4453bfc54be10e05aad9 /wiretap
parent7a5c04e243ff13b43618f8385f52c2186f753870 (diff)
Don't bother setting phdr->pkt_encap to wth->file_encap.
wtap_read() and wtap_seek_read() now do so before calling the read or seek-read routine, so there's no need to do so in those routines. Rename hcidump_process_packet() to hcidump_read_packet() while we're at it, as it doesn't just process an already-read packet, it does the reading as well as the processing. Change-Id: Ic13da6a2096e68550d80f2eff31f03d0edb58147 Reviewed-on: https://code.wireshark.org/review/13998 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/btsnoop.c1
-rw-r--r--wiretap/hcidump.c7
-rw-r--r--wiretap/packetlogger.c1
-rw-r--r--wiretap/pcap-common.c2
4 files changed, 3 insertions, 8 deletions
diff --git a/wiretap/btsnoop.c b/wiretap/btsnoop.c
index 5ecb42690a..c443723e9e 100644
--- a/wiretap/btsnoop.c
+++ b/wiretap/btsnoop.c
@@ -198,7 +198,6 @@ static gboolean btsnoop_read_record(wtap *wth, FILE_T fh,
ts -= KUnixTimeBase;
phdr->rec_type = REC_TYPE_PACKET;
- phdr->pkt_encap = wth->file_encap;
phdr->presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN;
phdr->ts.secs = (guint)(ts / 1000000);
phdr->ts.nsecs = (guint)((ts % 1000000) * 1000);
diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c
index 760456ed05..3e7ee66272 100644
--- a/wiretap/hcidump.c
+++ b/wiretap/hcidump.c
@@ -33,7 +33,7 @@ struct dump_hdr {
#define DUMP_HDR_SIZE (sizeof(struct dump_hdr))
-static gboolean hcidump_process_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
+static gboolean hcidump_read_packet(FILE_T fh, struct wtap_pkthdr *phdr,
Buffer *buf, int *err, gchar **err_info)
{
struct dump_hdr dh;
@@ -55,7 +55,6 @@ static gboolean hcidump_process_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr
}
phdr->rec_type = REC_TYPE_PACKET;
- phdr->pkt_encap = wth->file_encap;
phdr->presence_flags = WTAP_HAS_TS;
phdr->ts.secs = GUINT32_FROM_LE(dh.ts_sec);
phdr->ts.nsecs = GUINT32_FROM_LE(dh.ts_usec) * 1000;
@@ -72,7 +71,7 @@ static gboolean hcidump_read(wtap *wth, int *err, gchar **err_info,
{
*data_offset = file_tell(wth->fh);
- return hcidump_process_packet(wth, wth->fh, &wth->phdr, wth->frame_buffer,
+ return hcidump_read_packet(wth->fh, &wth->phdr, wth->frame_buffer,
err, err_info);
}
@@ -82,7 +81,7 @@ static gboolean hcidump_seek_read(wtap *wth, gint64 seek_off,
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
return FALSE;
- return hcidump_process_packet(wth, wth->random_fh, phdr, buf, err, err_info);
+ return hcidump_read_packet(wth->random_fh, phdr, buf, err, err_info);
}
wtap_open_return_val hcidump_open(wtap *wth, int *err, gchar **err_info)
diff --git a/wiretap/packetlogger.c b/wiretap/packetlogger.c
index bba8c4cbcc..6094b84cb7 100644
--- a/wiretap/packetlogger.c
+++ b/wiretap/packetlogger.c
@@ -195,7 +195,6 @@ packetlogger_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer
}
phdr->rec_type = REC_TYPE_PACKET;
- phdr->pkt_encap = wth->file_encap;
phdr->presence_flags = WTAP_HAS_TS;
phdr->len = pl_hdr.len - 8;
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index 76f74ce4d2..470ec39ceb 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -1540,8 +1540,6 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
int phdr_len = 0;
guint size;
- phdr->pkt_encap = wtap_encap;
-
switch (wtap_encap) {
case WTAP_ENCAP_ATM_PDUS: