Ignore:
Timestamp:
02/07/19 14:07:07 (20 months ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
5cdb37d
Parents:
58c226e
git-author:
Jacob Van Walraven <jcv9@…> (02/07/19 14:00:51)
git-committer:
Jacob Van Walraven <jcv9@…> (02/07/19 14:07:07)
Message:

Structs mapped directly to a packet/file are now packed.
Replaced hardcoded value 27 with ERF_META_TYPE.
PCAPNG meta packets are still processed when DISCARD_META config is set in order to update the trace state, however the meta callback will not be called.
Removed INET_ADDRSTRLEN definitions and used ones provided by the standard headers.
Replaced %u, %lu in libpacketdump linktypes 21 and 23 with PRIu8, PRIu32 etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapng.h

    r0cc91ee r4e5a51f  
    109109        uint16_t minorversion;
    110110        uint64_t sectionlen;
    111 } pcapng_sec_t;
     111} PACKED pcapng_sec_t;
    112112
    113113typedef struct pcapng_interface_header_t {
     
    117117        uint16_t reserved;
    118118        uint32_t snaplen;
    119 } pcapng_int_t;
     119} PACKED pcapng_int_t;
    120120
    121121typedef struct pcapng_nrb_header_t {
    122122        uint32_t blocktype;
    123123        uint32_t blocklen;
    124 } pcapng_nrb_t;
     124} PACKED pcapng_nrb_t;
    125125
    126126typedef struct pcapng_enhanced_packet_t {
     
    132132        uint32_t caplen;
    133133        uint32_t wlen;
    134 } pcapng_epkt_t;
     134} PACKED pcapng_epkt_t;
    135135
    136136typedef struct pcapng_simple_packet_t {
     
    138138        uint32_t blocklen;
    139139        uint32_t wlen;
    140 } pcapng_spkt_t;
     140} PACKED pcapng_spkt_t;
    141141
    142142typedef struct pcapng_old_packet_t {
     
    149149        uint32_t caplen;
    150150        uint32_t wlen;
    151 } pcapng_opkt_t;
     151} PACKED pcapng_opkt_t;
    152152
    153153typedef struct pcapng_stats_header_t {
     
    157157        uint32_t timestamp_high;
    158158        uint32_t timestamp_low;
    159 } pcapng_stats_t;
     159} PACKED pcapng_stats_t;
    160160
    161161typedef struct pcapng_decryption_secrets_header_t {
     
    164164        uint32_t secrets_type;
    165165        uint32_t secrets_len;
    166 } pcapng_secrets_t;
     166} PACKED pcapng_secrets_t;
    167167
    168168typedef struct pcapng_custom_header_t {
     
    170170        uint32_t blocklen;
    171171        uint32_t pen;
    172 } pcapng_custom_t;
     172} PACKED pcapng_custom_t;
    173173
    174174typedef struct pcapng_interface_t pcapng_interface_t;
     
    228228        uint16_t optcode;
    229229        uint16_t optlen;
    230 };
     230} PACKED;
    231231
    232232struct pcapng_custom_optheader {
     
    234234        uint16_t optlen;
    235235        uint32_t pen;
    236 };
     236} PACKED;
    237237struct pcapng_nrb_record {
    238238        uint16_t recordtype;
    239239        uint16_t recordlen;
    240 };
     240} PACKED;
    241241struct pcapng_peeker {
    242242        uint32_t blocktype;
    243243        uint32_t blocklen;
    244 };
     244} PACKED;
    245245
    246246typedef struct pcapng_peeker pcapng_hdr_t;
Note: See TracChangeset for help on using the changeset viewer.