Changeset d6cd078 for lib


Ignore:
Timestamp:
05/04/10 16:08:24 (11 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:
22e626a
Parents:
2f062d8
Message:

The spec says that it's the IP header + first 16 bytes of transport, but lets just assume everyones
lazy and just captures the first 'n' bytes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_tsh.c

    rd026488 rd6cd078  
    153153        if ((numbytes=wandio_read(libtrace->io,
    154154                                buffer2,
    155                                 (size_t)sizeof(libtrace_ip_t)))
    156                         != sizeof(libtrace_ip_t)) {
     155                                (size_t)sizeof(libtrace_ip_t)+16))  /* 16 bytes of transport header */
     156                        != sizeof(libtrace_ip_t)+16) {
    157157                trace_set_err(libtrace,errno,"read(%s)",
    158158                                libtrace->uridata);
     
    160160        }
    161161
     162#if 0
    162163        /* IP Options aren't captured in the trace, so leave room
    163164         * for them, and put the transport header where it "should" be
     
    173174                return -1;
    174175        }
     176#endif
    175177       
    176178        if (tsh_prepare_packet(libtrace, packet, packet->buffer, packet->type,
     
    204206         * IP options, but we'll pretend we have them
    205207         */
     208#if 0
    206209        return 16+((libtrace_ip_t*)packet->payload)->ip_hl*4;
     210#else
     211        return 16+sizeof(libtrace_ip_t);
     212#endif
    207213}
    208214
    209215static int tsh_get_wire_length(const libtrace_packet_t *packet) {
    210         return ((libtrace_ip_t*)packet->payload)->ip_len;
     216        return ntohs(((libtrace_ip_t*)packet->payload)->ip_len);
    211217}
    212218
Note: See TracChangeset for help on using the changeset viewer.