Ignore:
Timestamp:
01/07/19 10:35:07 (22 months ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
51276bd
Parents:
979ab1a0
git-author:
Jacob Van Walraven <jcv9@…> (12/14/18 09:31:48)
git-committer:
Jacob Van Walraven <jcv9@…> (01/07/19 10:35:07)
Message:

Added can_write functions to each output format, Fixed pcapng_get_header_type incorrectly flipping type bytes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_int.c

    rd439067 r9a6bdbc  
    5656#ifdef HAVE_NETPACKET_PACKET_H
    5757
     58static bool linuxnative_can_write(libtrace_packet_t *packet) {
     59        /* Get the linktype */
     60        libtrace_linktype_t ltype = trace_get_link_type(packet);
     61
     62        if (ltype == TRACE_TYPE_NONDATA) {
     63                return false;
     64        }
     65
     66        return true;
     67}
    5868
    5969static int linuxnative_start_input(libtrace_t *libtrace)
     
    336346                libtrace_packet_t *packet)
    337347{
     348        /* Check linuxnative can write this type of packet */
     349        if (!linuxnative_can_write(packet)) {
     350                return 0;
     351        }
     352
    338353        struct sockaddr_ll hdr;
    339354        int ret = 0;
    340 
    341         if (trace_get_link_type(packet) == TRACE_TYPE_NONDATA)
    342                 return 0;
    343355
    344356        hdr.sll_family = AF_PACKET;
Note: See TracChangeset for help on using the changeset viewer.