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 /ui/text_import.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 'ui/text_import.c')
-rw-r--r-- | ui/text_import.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/text_import.c b/ui/text_import.c index 191e4547de..6c8c8d2fa6 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -157,7 +157,7 @@ static gboolean hdr_export_pdu = FALSE; static gchar* hdr_export_pdu_payload = NULL; static gboolean has_direction = FALSE; -static guint32 direction = 0; +static guint32 direction = PACK_FLAGS_RECEPTION_TYPE_UNSPECIFIED; /*--- Local data -----------------------------------------------------------------*/ @@ -627,16 +627,16 @@ parse_preamble (void) switch (packet_preamble[0]) { case 'i': case 'I': - direction = 0x00000001; + direction = PACK_FLAGS_DIRECTION_INBOUND; packet_preamble[0] = ' '; break; case 'o': case 'O': - direction = 0x00000002; + direction = PACK_FLAGS_DIRECTION_OUTBOUND; packet_preamble[0] = ' '; break; default: - direction = 0x00000000; + direction = PACK_FLAGS_DIRECTION_UNKNOWN; break; } i = 0; |