Changeset 8dd1830 for lib


Ignore:
Timestamp:
05/09/05 19:20:50 (16 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:
7b4d443
Parents:
828ca90
Message:
  • Define IFNAMSIZ if it's undefined
  • Use structure copy
  • Support BE machines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r75fc3da r8dd1830  
    209209#ifndef PF_RULESET_NAME_SIZE
    210210#define PF_RULESET_NAME_SIZE 16
     211#endif
     212
     213#ifndef IFNAMSIZ
     214#define IFNAMSIZ 16
    211215#endif
    212216
     
    12791283                        pcapptr = (struct pcap_pkthdr *)packet->buffer;
    12801284                        // ick. FIXME
    1281                         tv.tv_sec = pcapptr->ts.tv_sec;
    1282                         tv.tv_usec = pcapptr->ts.tv_usec;
     1285                        tv = pcapptr->ts;
    12831286                        break;
    12841287#endif
     
    12911294                        // FIXME: This isn't portable to big-endian machines
    12921295                        ts = trace_get_erf_timestamp(packet);
    1293                         tv.tv_sec = ts >> 32;           
     1296#if __BYTE_ORDER == __BIG_ENDIAN
     1297                        tv.tv_sec = ts & 0xFFFFFFFF;
     1298#elif __BYTE_ORDER == __LITTLE_ENDIAN
     1299                        tv.tv_sec = ts >> 32;
     1300#else
     1301#error "What on earth are you running this on?"
     1302#endif
    12941303                        ts = (1000000 * (ts & 0xffffffffULL));
    12951304                        ts += (ts & 0x80000000ULL) << 1;
Note: See TracChangeset for help on using the changeset viewer.