Changeset 5d233a5


Ignore:
Timestamp:
08/21/06 23:18:19 (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:
8e6ac85
Parents:
37168af
Message:

Convert pcapfile over to using byteswap{16,32}.
Fix typos in previous commit

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r37168af r5d233a5  
    380380         * rt to do it for us
    381381         */
    382         linktype = rt_to_pcap_dlt(packet->type);
     382        int linktype = rt_to_pcap_dlt(packet->type);
    383383        return pcap_dlt_to_libtrace(linktype);
    384384}
  • lib/format_pcapfile.c

    rc0cd256 r5d233a5  
    8080                return num;
    8181        if (DATA(libtrace)->header.magic_number == 0xd4c3b2a1)
    82                 return ((num<<8)&0xFF00)|((num>>8)&0x00FF);
     82                return byteswap16(num);
     83
    8384        return num;
    8485}
     
    9293                return num;
    9394        if (DATA(libtrace)->header.magic_number == 0xd4c3b2a1)
    94                 return
    95                            ((num&0x000000FF)<<24)
    96                         || ((num&0x0000FF00)<<8)
    97                         || ((num&0x00FF0000)>>8)
    98                         || ((num&0xFF000000)>>24);
     95                return byteswap32(num);
     96
    9997        return num;
    10098}
     
    154152}
    155153
    156 static int pcapfile_read_packet(libtrace_t *libtrace, libtrace_packet_t *packet) {
     154static int pcapfile_read_packet(libtrace_t *libtrace, libtrace_packet_t *packet)
     155{
    157156        int err;
    158157
Note: See TracChangeset for help on using the changeset viewer.