diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-02-13 10:42:29 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-02-13 18:43:27 +0000 |
commit | b5036134c27b55e26dec584a8cc7a9ac844b136c (patch) | |
tree | 8090d3ba4e3c62d43ed1984a9403478d7afc8468 /wiretap/pcapng.c | |
parent | bf4fe342e3506ab756eeb2620633e0035826606b (diff) |
Add macros for the pack_flags field.
Add macros to extract the direction, reception type, and FCS length
fields of the pack_flags field, and add definitions for different
directions and reception types.
Add a macro to construct a pack_flags field value from subfields; this
is for use by non-pcapng file readers (the pack_flags field is just a
copy of the EPB flags option, so that's not needed for pcapng).
Move some #defines for that field from packet-frame.c to wtap.h, and
rename them to match the new macros.
Use the macros rather than rolling our own code.
Fix a variable name in text2pcap.c that apparently had the wrong name,
given the value that was being tested.
Change-Id: Ia788ca4e9f5fabd8d24e6ead5ff1817509f54827
Reviewed-on: https://code.wireshark.org/review/32010
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/pcapng.c')
-rw-r--r-- | wiretap/pcapng.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index bd101b4722..7eaafcdd79 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -1400,9 +1400,9 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta wblock->rec->rec_header.packet_header.pack_flags = GUINT32_SWAP_LE_BE(wblock->rec->rec_header.packet_header.pack_flags); memcpy(option_content, &wblock->rec->rec_header.packet_header.pack_flags, sizeof(guint32)); } - if (wblock->rec->rec_header.packet_header.pack_flags & 0x000001E0) { + if (PACK_FLAGS_FCS_LENGTH(wblock->rec->rec_header.packet_header.pack_flags) != 0) { /* The FCS length is present */ - fcslen = (wblock->rec->rec_header.packet_header.pack_flags & 0x000001E0) >> 5; + fcslen = PACK_FLAGS_FCS_LENGTH(wblock->rec->rec_header.packet_header.pack_flags); } pcapng_debug("pcapng_read_packet_block: pack_flags %u (ignored)", wblock->rec->rec_header.packet_header.pack_flags); break; |