Ignore:
Timestamp:
08/30/13 13:30:41 (8 years ago)
Author:
Shane Alcock <salcock@…>
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:
bf1029a
Parents:
8780774
Message:

Fixed problems with decoding RadioTap? headers with libpacketdump on big endian
hosts

  • Moved byteswapX functions to a separate source file so that libpacketdump can also link against them.
  • bswap_* macros have been moved into lt_bswap.h so they can be used without having to include the entire libtrace_int.h header
  • Fixed endianness issues with the "fields" inside the RadioTap? header.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_helper.c

    rd57ae6f r8b49230  
    320320        va_end(va);
    321321}
    322 
    323 /* Byte swapping functions for various inttypes */
    324 uint64_t byteswap64(uint64_t num)
    325 {
    326         return (byteswap32((num&0xFFFFFFFF00000000ULL)>>32))
    327               |((uint64_t)byteswap32(num&0x00000000FFFFFFFFULL)<<32);
    328 }
    329 
    330 uint32_t byteswap32(uint32_t num)
    331 {
    332         return ((num&0x000000FFU)<<24)
    333                 | ((num&0x0000FF00U)<<8)
    334                 | ((num&0x00FF0000U)>>8)
    335                 | ((num&0xFF000000U)>>24);
    336 }
    337 
    338 uint16_t byteswap16(uint16_t num)
    339 {
    340         return ((num<<8)&0xFF00)|((num>>8)&0x00FF);
    341 }
    342 
Note: See TracChangeset for help on using the changeset viewer.