Changeset e3a639a for lib


Ignore:
Timestamp:
06/23/14 20:13:58 (7 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:
ed81f74
Parents:
8c42377 (diff), a63a913 (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 remote-tracking branch 'upsteam/develop' into develop

Conflicts:

lib/Makefile.am
lib/libtrace_int.h

Location:
lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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/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/libtrace.h.in

    r8c42377 re3a639a  
    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
     166#if LT_USE_PACKED
     167#  define PACKED __attribute__((packed))
     168#else
     169#  define PACKED
     170#endif
     171
     172#if LT_USE_UNUSED
     173#  define UNUSED __attribute__((unused))
     174#else
     175#  define UNUSED
     176#endif
     177
     178#if LT_USE_DEPRECATED
    176179#  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)))
    181180#else
    182181#  define DEPRECATED
     182#endif
     183
     184#if LT_USE_PURE
     185#  define SIMPLE_FUNCTION __attribute__((pure))
     186#else
    183187#  define SIMPLE_FUNCTION
    184 #  define UNUSED
    185 #  define PACKED
    186 #  define PRINTF(formatpos,argpos)
    187188#endif
     189
     190#if LT_USE_PRINTF
     191#  define PRINTF(formatpos, argpos) __attribute__((format(printf,formatpos, argpos)))
     192#else
     193#  define PRINTF(formatpos, argpos)
     194#endif
     195
     196#ifdef _MSC_VER
     197    #ifdef LT_BUILDING_DLL
     198        #define DLLEXPORT __declspec(dllexport)
     199    #else
     200        #define DLLEXPORT __declspec(dllimport)
     201    #endif
     202    #define DLLLOCAL
     203#else
     204    #ifndef DLLEXPORT
     205        #if HAVE_VISIBILITY && LT_BUILDING_DLL
     206            #define DLLEXPORT __attribute__ ((visibility("default")))
     207            #define DLLLOCAL __attribute__ ((visibility("hidden")))
     208        #else
     209            #define DLLEXPORT
     210            #define DLLLOCAL
     211        #endif
     212    #endif
     213#endif
     214
    188215       
    189216/** Opaque structure holding information about an output trace */
  • 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"
Note: See TracChangeset for help on using the changeset viewer.