Ignore:
Timestamp:
08/21/06 23:18:19 (7 years ago)
Author:
perry
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/format_pcapfile.c

    r922 r931  
    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.