aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-29 19:21:20 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-29 19:21:20 +0000
commitd99fdfda639e78feffa3d9a1a6c758ae90539442 (patch)
tree87b591d02048464feebc32f8cf1dc784c7229b17 /dumpcap.c
parent5ac6474c945133a8415fb3be917859e5d42b6256 (diff)
Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.
XXX, people are not aware that expression of this macros might be evaluated multiple times, like: - BSWAP16(tvb_get_letohs(tvb, off)) : \ + GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \ Should be tvb_get_ntohs() called? svn path=/trunk/; revision=53653
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 8965b015e8..90961fc826 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -70,7 +70,6 @@
#include <errno.h>
#include <wsutil/crash_info.h>
-#include <wsutil/pint.h>
#ifndef HAVE_GETOPT
#include "wsutil/wsgetopt.h"
@@ -1694,10 +1693,10 @@ cap_pipe_adjust_header(gboolean byte_swapped, struct pcap_hdr *hdr, struct pcapr
{
if (byte_swapped) {
/* Byte-swap the record header fields. */
- rechdr->ts_sec = BSWAP32(rechdr->ts_sec);
- rechdr->ts_usec = BSWAP32(rechdr->ts_usec);
- rechdr->incl_len = BSWAP32(rechdr->incl_len);
- rechdr->orig_len = BSWAP32(rechdr->orig_len);
+ rechdr->ts_sec = GUINT32_SWAP_LE_BE(rechdr->ts_sec);
+ rechdr->ts_usec = GUINT32_SWAP_LE_BE(rechdr->ts_usec);
+ rechdr->incl_len = GUINT32_SWAP_LE_BE(rechdr->incl_len);
+ rechdr->orig_len = GUINT32_SWAP_LE_BE(rechdr->orig_len);
}
/* In file format version 2.3, the "incl_len" and "orig_len" fields were
@@ -2278,10 +2277,10 @@ cap_pipe_open_live(char *pipename,
if (pcap_opts->cap_pipe_byte_swapped) {
/* Byte-swap the header fields about which we care. */
- hdr->version_major = BSWAP16(hdr->version_major);
- hdr->version_minor = BSWAP16(hdr->version_minor);
- hdr->snaplen = BSWAP32(hdr->snaplen);
- hdr->network = BSWAP32(hdr->network);
+ hdr->version_major = GUINT16_SWAP_LE_BE(hdr->version_major);
+ hdr->version_minor = GUINT16_SWAP_LE_BE(hdr->version_minor);
+ hdr->snaplen = GUINT32_SWAP_LE_BE(hdr->snaplen);
+ hdr->network = GUINT32_SWAP_LE_BE(hdr->network);
}
pcap_opts->linktype = hdr->network;