Changeset 5876154


Ignore:
Timestamp:
06/23/14 23:36:31 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
10e183f
Parents:
8c42377 (diff), 5ba34eb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'MergingUpstream?' into develop

Files:
3 added
25 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    rfbd4ba6 rabf01b6  
    1919AC_CONFIG_MACRO_DIR([m4])
    2020AC_CONFIG_SRCDIR(lib/trace.c)
    21 AM_INIT_AUTOMAKE
     21AM_INIT_AUTOMAKE([subdir-objects])
    2222
    2323# Make sure we use the relatively silent automake output
     
    105105LIBWANDIO_LIBS=""
    106106
    107 # Set our C compiler flags based on the gcc version
    108 if test "$GCC" = "yes"; then
     107CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1"
     108CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1"
     109
     110# Check for -fvisibility
     111gl_VISIBILITY
     112
     113gcc_PACKED
     114gcc_DEPRECATED
     115gcc_UNUSED
     116gcc_PURE
     117gcc_FORMAT
    109118       
    110         gcc_version=`gcc -dumpversion`
    111 
    112         # This is probably not the most reliable way to test whether our
    113         # compiler supports visibility, but it's better than nothing
    114         #
    115         # According to the gcc wiki - http://gcc.gnu.org/wiki/Visibility -
    116         # visibility is supported in gcc 4.0 or later, so we just need to
    117         # check the major version number
    118 
    119         major=$(echo $gcc_version | cut -d'.' -f1)
    120 
    121         #major=${gcc_version%\.*\.*}
    122 
    123         if test "$major" -lt 4; then
    124                 vis=no
    125         else
    126                 vis=yes
    127         fi
    128        
    129         CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
    130         CXXFLAGS="$CXXFLAGS -Wall"
    131         LIBCFLAGS="$CFLAGS"
    132         LIBCFLAGS="$LIBCFLAGS -DLT_BUILDING_DLL=1"
    133         LIBCXXFLAGS="$CXXFLAGS"
    134         LIBCXXFLAGS="$CXXFLAGS -DLT_BUILDING_DLL=1"
    135        
    136         if test "$vis" = "yes"; then
    137                 LIBCFLAGS="$LIBCFLAGS -Wextra -fvisibility=hidden"
    138                 LIBCXXFLAGS="$CXXFLAGS -Wextra -fvisibility=hidden"
    139         fi
    140 fi
    141 
    142119# Check for libtool
    143120AC_PROG_LIBTOOL
  • lib/Makefile.am

    rd6a56b6 re3a639a  
    22include_HEADERS = libtrace.h dagformat.h lt_inttypes.h daglegacy.h rt_protocol.h erftypes.h 
    33
    4 AM_CFLAGS=@LIBCFLAGS@ -pthread
    5 AM_CXXFLAGS=@LIBCXXFLAGS@ -pthread
     4AM_CFLAGS=@LIBCFLAGS@ @CFLAG_VISIBILITY@ -pthread
     5AM_CXXFLAGS=@LIBCXXFLAGS@ @CFLAG_VISIBILITY@ -pthread
    66
    77extra_DIST = format_template.c
     
    6161endif
    6262
    63 INCLUDES= @ADD_INCLS@ -I../libwandio
     63AM_CPPFLAGS= @ADD_INCLS@ -I../libwandio
    6464libtrace_la_LIBADD = @LIBTRACE_LIBS@ @LTLIBOBJS@ $(DPDKLIBS)
    6565libtrace_la_LDFLAGS=-version-info @LIBTRACE_MAJOR@:@LIBTRACE_MINOR@:@LIBTRACE_MID@ @ADD_LDFLAGS@
  • lib/data-struct/message_queue.c

    rfac8c46 r5ba34eb  
    1616 *                see: man 7 pipe notes on atomic operations
    1717 */
    18 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
     18void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
    1919{
    2020        assert(message_len);
     
    4141 *         of messages.
    4242 */
    43 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
     43int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
    4444{
    4545        int ret;
     
    6666 *         of messages.
    6767 */
    68 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
     68int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
    6969{
    7070        int ret;
     
    9090 *         of messages.
    9191 */
    92 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
     92int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
    9393{
    9494        int ret;
     
    113113 * May be negative if threads blocking and waiting for a message.
    114114 */
    115 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
     115int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
    116116{
    117117        // This is only ok because we know int is atomic
     
    119119}
    120120
    121 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
     121void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
    122122{
    123123        mq->message_count = 0;
     
    131131 * @return a file descriptor for the queue, can be used with select() poll() etc.
    132132 */
    133 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
     133int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
    134134{
    135135        return mq->pipefd[0];
  • lib/data-struct/message_queue.h

    r8c42377 r5ba34eb  
    1313} libtrace_message_queue_t;
    1414
    15 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
    16 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
    17 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
    18 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
    19 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
    20 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
    21 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
     15void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
     16int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
     17int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
     18int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
     19int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
     20void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
     21int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
    2222
    2323#endif
  • lib/data-struct/sliding_window.c

    read9478 r5ba34eb  
    1414 *                              NOTE: this mainly applies to the blocking functions
    1515 */
    16 inline void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
     16void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
    1717        sw->size = size; // All of this size can be used
    1818        sw->start = 0;
     
    2727 * @param rb The ringbuffer to destroy
    2828 */
    29 inline void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
     29void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
    3030        sw->size = 0;
    3131        sw->start = 0;
     
    4646 * @return 1 if a object was written otherwise 0.
    4747 */
    48 inline int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
     48int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
    4949        uint64_t adjusted_number = number - sw->start_number;
    5050        if (adjusted_number < sw->size) {
     
    6262}
    6363
    64 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
     64uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
    6565        return sw->elements[sw->start] != NULL;
    6666}
     
    7474 * @return 1 if a object was received otherwise 0, in this case out remains unchanged
    7575 */
    76 inline int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
     76int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
    7777        if (sw->elements[sw->start]) {
    7878                *value = sw->elements[sw->start];
     
    8888}
    8989
    90 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
     90void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
    9191{
    9292        sw->start = 0;
  • lib/data-struct/sliding_window.h

    read9478 r5ba34eb  
    1818
    1919void libtrace_slidingwindow_init(libtrace_slidingwindow_t * sw, size_t size, uint64_t start_number);
    20 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
     20void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
    2121void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t * sw);
    2222
     
    3232int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number);
    3333
    34 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
     34uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
    3535/*
    3636void libtrace_slidingwindow_swrite(libtrace_slidingwindow_t * sw, void* value);
  • lib/format_linux.c

    rb13b939 re3a639a  
    12601260        struct tpacket2_hdr *header;
    12611261        int ret;
     1262        unsigned int snaplen;
    12621263       
    12631264        ring_release_frame(libtrace, packet);
     
    13101311
    13111312        packet->buffer = header;
     1313
     1314        /* If a snaplen was configured, automatically truncate the packet to
     1315         * the desired length.
     1316         */
     1317        snaplen=LIBTRACE_MIN(
     1318                        (int)LIBTRACE_PACKET_BUFSIZE-(int)sizeof(*header),
     1319                        (int)FORMAT(libtrace->format_data)->snaplen);
     1320       
     1321        TO_TP_HDR(packet->buffer)->tp_snaplen = LIBTRACE_MIN((unsigned int)snaplen, TO_TP_HDR(packet->buffer)->tp_len);
    13121322
    13131323        /* Move to next buffer */
  • lib/hash_toeplitz.c

    r8c42377 r5ba34eb  
    7070}
    7171
    72 inline void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional)
     72void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional)
    7373{
    7474        if (bidirectional) {
     
    8383 * n is bits
    8484 */
    85 inline uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result)
     85uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result)
    8686{
    8787        size_t byte;
     
    9797}
    9898
    99 inline uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n)
     99uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n)
    100100{
    101101        return toeplitz_hash(tc, data, 0, n, 0);
    102102}
    103103
    104 inline uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf) {
     104uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf) {
    105105        uint8_t proto;
    106106        uint16_t eth_type;
  • lib/hash_toeplitz.h

    r29bbef0 r5ba34eb  
    2828
    2929void toeplitz_hash_expand_key(toeplitz_conf_t *conf);
    30 inline uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result);
    31 inline uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n);
    32 inline void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional);
    33 inline uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf);
     30uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result);
     31uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n);
     32void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional);
     33uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf);
    3434void toeplitz_create_bikey(uint8_t *key);
    3535void toeplitz_create_unikey(uint8_t *key);
     
    4747#pragma pack(pop)   /* restore original alignment from stack */
    4848
    49 
    50 inline toeplitz_ipv4_only_t make_toeplitz_ipv4(uint8_t *src_ip4, uint8_t *dest_ip4);
    51 
    5249#endif
  • lib/libtrace.h.in

    r8c42377 red81f74  
    8080#if defined(LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN)
    8181#define __LITTLE_ENDIAN LITTLE_ENDIAN
    82 #endif
    83 
    84 #ifdef _MSC_VER
    85     /* define the following from MSVC's internal types */
    86     typedef             __int8  int8_t;
    87     typedef             __int16 int16_t;
    88     typedef             __int32 int32_t;
    89     typedef             __int64 int64_t;
    90     typedef unsigned    __int8  uint8_t;
    91     typedef unsigned    __int16 uint16_t;
    92     typedef unsigned    __int32 uint32_t;
    93     typedef unsigned    __int64 uint64_t;
    94     #ifdef LT_BUILDING_DLL
    95         #define DLLEXPORT __declspec(dllexport)
    96     #else
    97         #define DLLEXPORT __declspec(dllimport)
    98     #endif
    99     #define DLLLOCAL
    100     /* Windows pads bitfields out to to the size of their parent type
    101      * however gcc warns that this doesn't meet with the iso C specification
    102      * so produces warnings for this behaviour.  sigh.
    103      */
    104     #define LT_BITFIELD8        uint8_t
    105     #define LT_BITFIELD16       uint16_t
    106     #define LT_BITFIELD32       uint32_t
    107     #define LT_BITFIELD64       uint64_t
    108 #else
    109     #ifdef HAVE_STDINT_H
    110         #   include <stdint.h>
    111     #endif
    112     #if __GNUC__ >= 4
    113         #ifdef LT_BUILDING_DLL
    114                 #define DLLEXPORT __attribute__ ((visibility("default")))
    115                 #define DLLLOCAL __attribute__ ((visibility("hidden")))
    116         #else
    117                 #define DLLEXPORT
    118                 #define DLLLOCAL
    119         #endif
    120     #else
    121         #define DLLEXPORT
    122         #define DLLLOCAL
    123     #endif
    124     /* GCC warns if the bitfield type is not "unsigned int", however windows
    125      * generates incorrect code for this (see above), so we define these
    126      * macros.  How Hideous.  So much for C's portability.
    127      */
    128     #define LT_BITFIELD8        unsigned int
    129     #define LT_BITFIELD16       unsigned int
    130     #define LT_BITFIELD32       unsigned int
    131     #define LT_BITFIELD64       unsigned int
    13282#endif
    13383
     
    170120#endif
    171121
    172 /* Function does not depend on anything but its
    173  * parameters, used to hint gcc's optimisations
    174  */
    175 #if __GNUC__ >= 3
     122#ifdef _MSC_VER
     123    /* define the following from MSVC's internal types */
     124    typedef             __int8  int8_t;
     125    typedef             __int16 int16_t;
     126    typedef             __int32 int32_t;
     127    typedef             __int64 int64_t;
     128    typedef unsigned    __int8  uint8_t;
     129    typedef unsigned    __int16 uint16_t;
     130    typedef unsigned    __int32 uint32_t;
     131    typedef unsigned    __int64 uint64_t;
     132   
     133    /* Windows pads bitfields out to to the size of their parent type
     134     * however gcc warns that this doesn't meet with the iso C specification
     135     * so produces warnings for this behaviour.  sigh.
     136     */
     137    #define LT_BITFIELD8        uint8_t
     138    #define LT_BITFIELD16       uint16_t
     139    #define LT_BITFIELD32       uint32_t
     140    #define LT_BITFIELD64       uint64_t
     141#else
     142    #ifdef HAVE_STDINT_H
     143        #   include <stdint.h>
     144    #endif
     145    /* GCC warns if the bitfield type is not "unsigned int", however windows
     146     * generates incorrect code for this (see above), so we define these
     147     * macros.  How Hideous.  So much for C's portability.
     148     */
     149    #define LT_BITFIELD8        unsigned int
     150    #define LT_BITFIELD16       unsigned int
     151    #define LT_BITFIELD32       unsigned int
     152    #define LT_BITFIELD64       unsigned int
     153#endif
     154
     155/* Ensure these gcc optimisation attributes are defined consistently,
     156 * without requiring users to need to have access to the config.h
     157 * generated by running configure.
     158 */
     159
     160#define LT_USE_PACKED @HAVE_ATTRIBUTE_PACKED@
     161#define LT_USE_UNUSED @HAVE_ATTRIBUTE_UNUSED@
     162#define LT_USE_DEPRECATED @HAVE_ATTRIBUTE_DEPRECATED@
     163#define LT_USE_PURE @HAVE_ATTRIBUTE_PURE@
     164#define LT_USE_PRINTF @HAVE_ATTRIBUTE_FORMAT@
     165#define LT_USE_VISIBILITY @HAVE_VISIBILITY@
     166
     167#if LT_USE_PACKED
     168#  define PACKED __attribute__((packed))
     169#else
     170#  define PACKED
     171#endif
     172
     173#if LT_USE_UNUSED
     174#  define UNUSED __attribute__((unused))
     175#else
     176#  define UNUSED
     177#endif
     178
     179#if LT_USE_DEPRECATED
    176180#  define DEPRECATED __attribute__((deprecated))
    177 #  define SIMPLE_FUNCTION __attribute__((pure))
    178 #  define UNUSED __attribute__((unused))
    179 #  define PACKED __attribute__((packed))
    180 #  define PRINTF(formatpos,argpos) __attribute__((format(printf,formatpos,argpos)))
    181181#else
    182182#  define DEPRECATED
     183#endif
     184
     185#if LT_USE_PURE
     186#  define SIMPLE_FUNCTION __attribute__((pure))
     187#else
    183188#  define SIMPLE_FUNCTION
    184 #  define UNUSED
    185 #  define PACKED
    186 #  define PRINTF(formatpos,argpos)
    187189#endif
     190
     191#if LT_USE_PRINTF
     192#  define PRINTF(formatpos, argpos) __attribute__((format(printf,formatpos, argpos)))
     193#else
     194#  define PRINTF(formatpos, argpos)
     195#endif
     196
     197#ifdef _MSC_VER
     198    #ifdef LT_BUILDING_DLL
     199        #define DLLEXPORT __declspec(dllexport)
     200    #else
     201        #define DLLEXPORT __declspec(dllimport)
     202    #endif
     203    #define DLLLOCAL
     204#else
     205    #ifndef DLLEXPORT
     206        #if LT_USE_VISIBILITY && LT_BUILDING_DLL
     207            #define DLLEXPORT __attribute__ ((visibility("default")))
     208            #define DLLLOCAL __attribute__ ((visibility("hidden")))
     209        #else
     210            #define DLLEXPORT
     211            #define DLLLOCAL
     212        #endif
     213    #endif
     214#endif
     215
    188216       
    189217/** Opaque structure holding information about an output trace */
  • lib/libtrace_int.h

    r8c42377 r5ba34eb  
    351351
    352352void trace_fin_packet(libtrace_packet_t *packet);
    353 inline void libtrace_zero_thread(libtrace_thread_t * t);
    354 inline void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t);
     353void libtrace_zero_thread(libtrace_thread_t * t);
     354void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t);
    355355libtrace_thread_t * get_thread_table(libtrace_t *libtrace);
    356356int get_thread_table_num(libtrace_t *libtrace);
  • lib/protocols_ospf.c

    r8753bb8 r10f924c  
    3232 */
    3333
     34#include "libtrace_int.h"
    3435#include "libtrace.h"
    3536#include "protocols.h"
  • lib/protocols_transport.c

    rc909fad r10f924c  
    3333
    3434
     35#include "libtrace_int.h"
    3536#include "libtrace.h"
    3637#include "protocols.h"
  • lib/trace_parallel.c

    r85e87b5 r5ba34eb  
    140140}
    141141
    142 inline void libtrace_zero_thread(libtrace_thread_t * t) {
     142void libtrace_zero_thread(libtrace_thread_t * t) {
    143143        t->trace = NULL;
    144144        t->ret = NULL;
     
    828828 * results out every XXX seconds.
    829829 */
    830 inline void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t)
     830void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t)
    831831{
    832832        if (!t->recorded_first) {
  • libpacketdump/Makefile.am

    r8b49230 rbd119b3  
    172172dist_plugin_DATA = $(TXT_PROTOCOLS)
    173173
    174 INCLUDES= @ADD_INCLS@ -I../lib -I../libwandio
     174AM_CPPFLAGS= @ADD_INCLS@ -I../lib -I../libwandio
    175175
    176176# NOTE: You CANNOT add @LEXLIBS@ here, as they are statically compiled
     
    182182        @ADD_LDFLAGS@
    183183
    184 AM_CXXFLAGS=-g -Wall -DDIRNAME=\"$(plugindir)\" $(INCLUDES)
     184AM_CXXFLAGS=-g -Wall -DDIRNAME=\"$(plugindir)\" $(AM_CPPFLAGS)
    185185BUILT_SOURCES=parser.h
    186186AM_YFLAGS=-d
  • libwandio/Makefile.am

    r60f3c4c rbd119b3  
    33include_HEADERS=wandio.h
    44
    5 AM_CFLAGS=@LIBCFLAGS@
    6 AM_CXXFLAGS=@LIBCXXFLAGS@
     5AM_CFLAGS=@LIBCFLAGS@ @CFLAG_VISIBILITY@
     6AM_CXXFLAGS=@LIBCXXFLAGS@ @CFLAG_VISIBILITY@
    77
    88if HAVE_ZLIB
     
    2525
    2626libwandio_la_SOURCES=wandio.c ior-peek.c ior-stdio.c ior-thread.c \
    27                 iow-stdio.c iow-thread.c wandio.h \
     27                iow-stdio.c iow-thread.c wandio.h wandio_internal.h \
    2828                $(LIBTRACEIO_ZLIB) $(LIBTRACEIO_BZLIB) $(LIBTRACEIO_LZO)
    2929
    30 INCLUDES = @ADD_INCLS@
     30AM_CPPFLAGS = @ADD_INCLS@
    3131libwandio_la_LIBADD = @LIBWANDIO_LIBS@
    3232libwandio_la_LDFLAGS=-version-info 1:0:0 @ADD_LDFLAGS@
  • libwandio/ior-stdio.c

    r60f3c4c r10f924c  
    3434
    3535#define _GNU_SOURCE 1
     36#include "wandio_internal.h"
    3637#include "wandio.h"
    3738#include <sys/types.h>
  • libwandio/ior-thread.c

    r954577b9 r10f924c  
    3434
    3535#include "config.h"
     36#include "wandio_internal.h"
    3637#include "wandio.h"
    3738#include <sys/types.h>
  • libwandio/iow-lzo.c

    r4a2529b r2a7047c  
    4141
    4242#include <lzo/lzo1x.h>
     43#include "wandio_internal.h"
    4344#include "wandio.h"
    4445#include "config.h"
  • libwandio/iow-stdio.c

    r60f3c4c r10f924c  
    3434
    3535#define _GNU_SOURCE 1
     36#include "wandio_internal.h"
    3637#include "wandio.h"
    3738#include <sys/types.h>
  • libwandio/iow-thread.c

    r954577b9 r10f924c  
    3434#include "config.h"
    3535#include "wandio.h"
     36#include "wandio_internal.h"
    3637#include <sys/types.h>
    3738#include <sys/stat.h>
  • libwandio/wandio.c

    r808eeef r10f924c  
    3434
    3535#include "config.h"
     36#include "wandio_internal.h"
    3637#include "wandio.h"
    3738#include <stdlib.h>
  • libwandio/wandio.h

    r0acfd1e rc7021d9  
    3434#ifndef IO_H
    3535#define IO_H 1 /**< Guard Define */
    36 #include "config.h"
    3736#include <sys/types.h>
    3837#include <stdio.h>
     
    4039#include <stdbool.h>
    4140
    42 #if __GNUC__ >= 4
    43         #ifdef LT_BUILDING_DLL
    44                 #define DLLEXPORT __attribute__ ((visibility("default")))
    45                 #define DLLLOCAL __attribute__ ((visibility("hidden")))
    46         #else
    47                 #define DLLEXPORT
    48                 #define DLLLOCAL
    49         #endif
    50 #else
    51         #define DLLEXPORT
    52         #define DLLLOCAL
     41
     42#ifndef DLLEXPORT
     43        #if HAVE_VISIBILITY && LT_BUILDING_DLL
     44                #define DLLEXPORT __attribute__ ((visibility("default")))
     45                #define DLLLOCAL __attribute__ ((visibility("hidden")))
     46        #else
     47                #define DLLEXPORT
     48                #define DLLLOCAL
     49        #endif
    5350#endif
    5451
    55 #if __GNUC__ >= 3
    56 #  define DEPRECATED __attribute__((deprecated))
    57 #  define SIMPLE_FUNCTION __attribute__((pure))
    58 #  define UNUSED __attribute__((unused))
    59 #  define PACKED __attribute__((packed))
    60 #  define PRINTF(formatpos,argpos) __attribute__((format(printf,formatpos,argpos)))
    61 #else
    62 #  define DEPRECATED
    63 #  define SIMPLE_FUNCTION
    64 #  define UNUSED
    65 #  define PACKED
    66 #  define PRINTF(formatpos,argpos)
    67 #endif
    68 
     52// TODO: Use a proper check for these attribute rather than gcc version check
    6953
    7054/** @file
     
    330314/** @} */
    331315
    332 /** @name libtraceio options
    333  * @{ */
    334 extern int force_directio_read;
    335 extern int force_directio_write;
    336 extern uint64_t write_waits;
    337 extern uint64_t read_waits;
    338 extern unsigned int use_threads;
    339 extern unsigned int max_buffers;
    340 /* @} */
    341 
    342316#endif
  • test/do-tests.sh

    r47e927a r5692bc4  
    7777
    7878echo \* Testing time conversions
    79 do_test ./test-time
     79echo \* ERF
     80do_test ./test-time erf
     81echo \* pcapfile
     82do_test ./test-time pcapfile
     83echo \* pcapfilens
     84do_test ./test-time pcapfilens
     85echo \* legacyatm
     86do_test ./test-time legacyatm
     87echo \* legacypos
     88do_test ./test-time legacypos
     89echo \* legacyeth
     90do_test ./test-time legacyeth
     91echo \* pcap
     92do_test ./test-time pcap
     93echo \* rawerf
     94do_test ./test-time rawerf
     95echo \* tsh
     96do_test ./test-time tsh
    8097
    8198echo \* Testing directions
  • test/test-time.c

    rd5a27e8 r6a38a7e  
    5151struct libtrace_t *trace;
    5252
     53const char *lookup_uri(const char *type) {
     54        if (strchr(type,':'))
     55                return type;
     56        if (!strcmp(type,"erf"))
     57                return "erf:traces/100_packets.erf";
     58        if (!strcmp(type,"rawerf"))
     59                return "rawerf:traces/100_packets.erf";
     60        if (!strcmp(type,"pcap"))
     61                return "pcap:traces/100_packets.pcap";
     62        if (!strcmp(type,"wtf"))
     63                return "wtf:traces/wed.wtf";
     64        if (!strcmp(type,"rtclient"))
     65                return "rtclient:chasm";
     66        if (!strcmp(type,"pcapfile"))
     67                return "pcapfile:traces/100_packets.pcap";
     68        if (!strcmp(type,"pcapfilens"))
     69                return "pcapfile:traces/100_packetsns.pcap";
     70        if (!strcmp(type, "duck"))
     71                return "duck:traces/100_packets.duck";
     72        if (!strcmp(type, "legacyatm"))
     73                return "legacyatm:traces/legacyatm.gz";
     74        if (!strcmp(type, "legacypos"))
     75                return "legacypos:traces/legacypos.gz";
     76        if (!strcmp(type, "legacyeth"))
     77                return "legacyeth:traces/legacyeth.gz";
     78        if (!strcmp(type, "tsh"))
     79                return "tsh:traces/10_packets.tsh.gz";
     80        return type;
     81}
     82
    5383void iferr(libtrace_t *trace)
    5484{
     
    6191
    6292int main(int argc, char *argv[]) {
    63         char *uri = "erf:traces/100_packets.erf";
     93        char *uri = lookup_uri(argv[1]);
    6494        int psize = 0;
    6595        int error = 0;
     
    76106        for (;;) {
    77107                double ts;
     108                double tsdiff;
    78109                struct timeval tv;
    79110                if ((psize = trace_read_packet(trace, packet)) <0) {
     
    88119                tv=trace_get_timeval(packet);
    89120                ts=trace_get_seconds(packet);
    90                 assert((tv.tv_sec+tv.tv_usec/1000000.0)-ts<.000001);
     121                tsdiff = (tv.tv_sec+tv.tv_usec/1000000.0)-ts;
     122                assert(tsdiff > -0.001 && tsdiff < 0.001);
     123
    91124        }
    92125        trace_destroy_packet(packet);
Note: See TracChangeset for help on using the changeset viewer.