Changeset 1008250 for lib/format_linux.c


Ignore:
Timestamp:
09/05/07 11:26:58 (14 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
27bd348
Parents:
9c6005f
Message:
  • Add support for PACKET_LOOPBACK as "outgoing" not "incoming"
  • Add support for setting the interface (but only to incoming or outgoing)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r708f9ae r1008250  
    342342        switch (((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype) {
    343343                case PACKET_OUTGOING:
     344                case PACKET_LOOPBACK;
    344345                        return TRACE_DIR_OUTGOING;
    345346                default:
    346347                        return TRACE_DIR_INCOMING;
     348        }
     349}
     350
     351static libtrace_direction_t linuxnative_set_direction(
     352                const libtrace_packet_t *packet,
     353                libtrace_direction_t direction) {
     354
     355        switch (direction) {
     356                case TRACE_DIR_OUTGOING:
     357                        ((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype = PACKET_OUTGOING;
     358                        return TRACE_DIR_OUTGOING;
     359                case TRACE_DIR_INCOMING:
     360                        ((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype = PACKET_INCOMING;
     361                        return TRACE_DIR_INCOMING;
     362                default:
     363                        return -1;
    347364        }
    348365}
     
    401418        linuxnative_get_link_type,      /* get_link_type */
    402419        linuxnative_get_direction,      /* get_direction */
    403         NULL,                           /* set_direction */
     420        linuxnative_set_direction,      /* set_direction */
    404421        NULL,                           /* get_erf_timestamp */
    405422        linuxnative_get_timeval,        /* get_timeval */
Note: See TracChangeset for help on using the changeset viewer.