Changeset 4631115


Ignore:
Timestamp:
02/13/15 13:23:34 (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:
de74f88
Parents:
0b01fea (diff), 92d5f15 (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 'master' into develop.

Update to include fixes/features etc from the 3.0.22 release.

Conflicts:

README
lib/format_dag25.c
lib/format_dpdk.c
lib/format_linux.c
lib/trace.c
test/Makefile

Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • README

    r9e429e8 r4631115  
    44Libtrace functions might not function correctly breaking the supplied tools.
    55
    6 libtrace 3.0.21
     6libtrace 3.0.22
    77
    88---------------------------------------------------------------------------
    9 Copyright (c) 2007-2014 The University of Waikato, Hamilton, New Zealand.
     9Copyright (c) 2007-2015 The University of Waikato, Hamilton, New Zealand.
    1010All rights reserved.
    1111
  • configure.in

    rd7fd648 r4631115  
    44# and in the README
    55
    6 AC_INIT([libtrace],[3.0.21],[contact@wand.net.nz],[libtrace])
     6AC_INIT([libtrace],[3.0.22],[contact@wand.net.nz],[libtrace])
    77
    88LIBTRACE_MAJOR=3
    99LIBTRACE_MID=0
    10 LIBTRACE_MINOR=21
     10LIBTRACE_MINOR=22
    1111
    1212# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
     
    430430if test "$ac_cv_search_dlopen" != "none required"; then
    431431        LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_dlopen"
     432        if test "$dpdk_found" = 1; then
     433                LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,$ac_cv_search_dlopen"
     434        fi
    432435fi
    433436
  • lib/Makefile.am

    r6cf3ca0 r4631115  
    5454                protocols_pktmeta.c protocols_l2.c protocols_l3.c \
    5555                protocols_transport.c protocols.h protocols_ospf.c \
     56                protocols_application.c \
    5657                $(DAGSOURCE) format_erf.h \
    5758                $(BPFJITSOURCE) \
  • lib/format_dag25.c

    rcb39d35 r4631115  
    108108/* "Global" data that is stored for each DAG output trace */
    109109struct dag_format_data_out_t {
     110        /* String containing the DAG device name */
     111        char *device_name;
    110112        /* The DAG device being used for writing */
    111113        struct dag_dev_t *device;
     
    159161        } duck;
    160162
     163        /* String containing the DAG device name */
     164        char *device_name;
    161165        /* Boolean flag indicating whether the trace is currently attached */
    162166        int stream_attached;
     
    226230        FORMAT_DATA_OUT->stream_attached = 0;
    227231        FORMAT_DATA_OUT->device = NULL;
     232        FORMAT_DATA_OUT->device_name = NULL;
    228233        FORMAT_DATA_OUT->dagstream = 0;
    229234        FORMAT_DATA_OUT->waiting = 0;
     
    251256        memset(&stream_data, 0, sizeof(stream_data));
    252257        libtrace_list_push_back(FORMAT_DATA->per_stream, &stream_data);
     258        FORMAT_DATA->device_name = NULL;
    253259}
    254260
     
    415421static int dag_init_output(libtrace_out_t *libtrace)
    416422{
    417         char *dag_dev_name = NULL;
    418423        char *scan = NULL;
    419424        struct dag_dev_t *dag_device = NULL;
     
    438443         * If no stream is specified, we will write using stream 1 */
    439444        if ((scan = strchr(libtrace->uridata,',')) == NULL) {
    440                 dag_dev_name = strdup(libtrace->uridata);
     445                FORMAT_DATA_OUT->device_name = strdup(libtrace->uridata);
    441446        } else {
    442                 dag_dev_name = (char *)strndup(libtrace->uridata,
     447                FORMAT_DATA_OUT->device_name =
     448                                (char *)strndup(libtrace->uridata,
    443449                                (size_t)(scan - libtrace->uridata));
    444450                stream = atoi(++scan);
     
    447453
    448454        /* See if our DAG device is already open */
    449         dag_device = dag_find_open_device(dag_dev_name);
     455        dag_device = dag_find_open_device(FORMAT_DATA_OUT->device_name);
    450456
    451457        if (dag_device == NULL) {
    452458                /* Device not yet opened - open it ourselves */
    453                 dag_device = dag_open_output_device(libtrace, dag_dev_name);
    454         } else {
    455                 /* Otherwise, just use the existing one */
    456                 free(dag_dev_name);
    457                 dag_dev_name = NULL;
     459                dag_device = dag_open_output_device(libtrace,
     460                                FORMAT_DATA_OUT->device_name);
    458461        }
    459462
    460463        /* Make sure we have successfully opened a DAG device */
    461464        if (dag_device == NULL) {
    462                 if (dag_dev_name) {
    463                         free(dag_dev_name);
     465                if (FORMAT_DATA_OUT->device_name) {
     466                        free(FORMAT_DATA_OUT->device_name);
     467                        FORMAT_DATA_OUT->device_name = NULL;
    464468                }
    465469                pthread_mutex_unlock(&open_dag_mutex);
     
    474478/* Creates and initialises a DAG input trace */
    475479static int dag_init_input(libtrace_t *libtrace) {
    476         char *dag_dev_name = NULL;
    477480        char *scan = NULL;
    478481        int stream = 0;
     
    492495         * one thread
    493496         */
    494         if ((scan = strchr(libtrace->uridata, ',')) == NULL) {
    495                 dag_dev_name = strdup(libtrace->uridata);
     497        if ((scan = strchr(libtrace->uridata,',')) == NULL) {
     498                FORMAT_DATA->device_name = strdup(libtrace->uridata);
    496499        } else {
    497                 dag_dev_name = (char *)strndup(libtrace->uridata,
    498                                                (size_t)(scan -
    499                                                         libtrace->uridata));
     500                FORMAT_DATA->device_name = (char *)strndup(libtrace->uridata,
     501                                (size_t)(scan - libtrace->uridata));
    500502                stream = atoi(++scan);
    501503        }
     
    504506
    505507        /* See if our DAG device is already open */
    506         dag_device = dag_find_open_device(dag_dev_name);
     508        dag_device = dag_find_open_device(FORMAT_DATA->device_name);
    507509
    508510        if (dag_device == NULL) {
    509511                /* Device not yet opened - open it ourselves */
    510                 dag_device = dag_open_device(libtrace, dag_dev_name);
    511         } else {
    512                 /* Otherwise, just use the existing one */
    513                 free(dag_dev_name);
    514                 dag_dev_name = NULL;
     512                dag_device=dag_open_device(libtrace, FORMAT_DATA->device_name);
    515513        }
    516514
    517515        /* Make sure we have successfully opened a DAG device */
    518516        if (dag_device == NULL) {
    519                 if (dag_dev_name)
    520                         free(dag_dev_name);
    521                 dag_dev_name = NULL;
     517                if (FORMAT_DATA->device_name)
     518                        free(FORMAT_DATA->device_name);
     519                FORMAT_DATA->device_name = NULL;
    522520                pthread_mutex_unlock(&open_dag_mutex);
    523521                return -1;
     
    806804        libtrace_list_deinit(FORMAT_DATA->per_stream);
    807805
     806        if (FORMAT_DATA->device_name)
     807                free(FORMAT_DATA->device_name);
    808808        free(libtrace->format_data);
    809809        pthread_mutex_unlock(&open_dag_mutex);
     
    841841        if (FORMAT_DATA_OUT->device->ref_count == 0)
    842842                dag_close_device(FORMAT_DATA_OUT->device);
     843        if (FORMAT_DATA_OUT->device_name)
     844                free(FORMAT_DATA_OUT->device_name);
    843845        free(libtrace->format_data);
    844846        pthread_mutex_unlock(&open_dag_mutex);
     
    846848}
    847849
    848 /* DUCK reporting is broken at the moment! */
    849 #if 0
     850#ifdef DAGIOC_CARD_DUCK
     851#define LIBTRACE_DUCK_IOCTL DAGIOC_CARD_DUCK
     852#define LIBTRACE_DUCK_VERSION TRACE_RT_DUCK_5_0
     853#else
     854#ifdef DAGIOCDUCK
     855#define LIBTRACE_DUCK_IOCTL DAGIOCDUCK
     856#define LIBTRACE_DUCK_VERSION TRACE_RT_DUCK_2_5
     857#else
     858#warning "DAG appears to be missing DUCK support"
     859#endif
     860#endif
     861
    850862/* Extracts DUCK information from the DAG card and produces a DUCK packet */
    851 static int dag_get_duckinfo(libtrace_t *libtrace, libtrace_packet_t *packet)
    852 {
     863static int dag_get_duckinfo(libtrace_t *libtrace,
     864                                libtrace_packet_t *packet) {
     865
     866        if (DUCK.duck_freq == 0)
     867                return 0;
     868
     869#ifndef LIBTRACE_DUCK_IOCTL
     870        trace_set_err(libtrace, errno,
     871                "Requested DUCK information but unable to determine the correct ioctl for DUCK");
     872        DUCK.duck_freq = 0;
     873        return -1;
     874#endif
     875
     876        if (DUCK.last_pkt - DUCK.last_duck < DUCK.duck_freq)
     877                return 0;
     878
    853879        /* Allocate memory for the DUCK data */
    854880        if (packet->buf_control == TRACE_CTRL_EXTERNAL ||
     
    864890
    865891        /* DUCK doesn't have a format header */
    866         packet->header = 0;
    867         packet->payload = packet->buffer;
    868 
    869         /* No need to check if we can get DUCK or not - we're modern
    870          * enough so just grab the DUCK info */
    871         if ((ioctl(FORMAT_DATA->device->fd, DAGIOCDUCK,
    872                    (duckinf_t *)packet->payload) < 0)) {
    873                 trace_set_err(libtrace, errno, "Error using DAGIOCDUCK");
    874                 return -1;
    875         }
    876 
    877         packet->type = TRACE_RT_DUCK_2_5;
    878 
    879         /* Set the packet's tracce to point at a DUCK trace, so that the
     892        packet->header = 0;
     893        packet->payload = packet->buffer;
     894
     895        /* No need to check if we can get DUCK or not - we're modern
     896         * enough so just grab the DUCK info */
     897        if ((ioctl(FORMAT_DATA->device->fd, LIBTRACE_DUCK_IOCTL,
     898                                        (duckinf_t *)packet->payload) < 0)) {
     899                trace_set_err(libtrace, errno, "Error using DUCK ioctl");
     900                DUCK.duck_freq = 0;
     901                return -1;
     902        }
     903
     904        packet->type = LIBTRACE_DUCK_VERSION;
     905
     906        /* Set the packet's trace to point at a DUCK trace, so that the
    880907         * DUCK format functions will be called on the packet rather than the
    881908         * DAG ones */
    882         if (!DUCK.dummy_duck)
    883                 DUCK.dummy_duck = trace_create_dead("rt:localhost:3434");
    884         packet->trace = DUCK.dummy_duck;
    885         return sizeof(duckinf_t);
    886 
    887         return 0;
    888 }
    889 #endif
     909        if (!DUCK.dummy_duck)
     910                DUCK.dummy_duck = trace_create_dead("duck:dummy");
     911        packet->trace = DUCK.dummy_duck;
     912        DUCK.last_duck = DUCK.last_pkt;
     913        return sizeof(duckinf_t);
     914}
    890915
    891916/* Determines the amount of data available to read from the DAG card */
     
    12021227        maxwait.tv_usec = 250000;
    12031228
    1204         /* TODO: Support DUCK reporting */
     1229        /* Check if we're due for a DUCK report */
     1230        size = dag_get_duckinfo(libtrace, packet);
     1231
     1232        if (size != 0)
     1233                return size;
    12051234
    12061235        /* Don't let anyone try to free our DAG memory hole! */
     
    12941323        int numbytes;
    12951324        uint32_t flags = 0;
    1296         struct timeval minwait;
    1297 
     1325        struct timeval minwait, tv;
     1326       
    12981327        minwait.tv_sec = 0;
    12991328        minwait.tv_usec = 10000;
    13001329
     1330        /* Check if we're meant to provide a DUCK update */
     1331        numbytes = dag_get_duckinfo(libtrace, packet);
     1332        if (numbytes < 0) {
     1333                event.type = TRACE_EVENT_TERMINATE;
     1334                return event;
     1335        } else if (numbytes > 0) {
     1336                event.type = TRACE_EVENT_PACKET;
     1337                return event;
     1338        }
     1339       
    13011340        if (dag_set_stream_poll(FORMAT_DATA_FIRST->device->fd,
    13021341                                FORMAT_DATA_FIRST->dagstream, 0, &minwait,
     
    13691408                }
    13701409
     1410                /* Update the DUCK timer */
     1411                tv = trace_get_timeval(packet);
     1412                DUCK.last_pkt = tv.tv_sec;
     1413               
    13711414                if (libtrace->snaplen > 0) {
    13721415                        trace_set_capture_length(packet, libtrace->snaplen);
  • lib/format_dpdk.c

    r12ae766 r4631115  
     1
    12/*
    23 * This file is part of libtrace
     
    7677 * code (that we still attempt to support).
    7778 *
    78  * Currently 1.5 to 1.7 is supported.
     79 * DPDK v1.7.1 is recommended.
     80 * However 1.5 to 1.8 are likely supported.
    7981 */
    8082#include <rte_eal.h>
     
    118120#else
    119121#       define DPDK_USE_PMD_INIT 0
     122#endif
     123
     124/* 1.7.0-rc3 :
     125 *
     126 * Since 1.7.0-rc3 rte_eal_pci_probe is called as part of rte_eal_init.
     127 * Somewhere between 1.7 and 1.8 calling it twice broke so we should not call
     128 * it twice.
     129 */
     130#if RTE_VERSION < RTE_VERSION_NUM(1, 7, 0, 3)
     131#       define DPDK_USE_PCI_PROBE 1
     132#else
     133#       define DPDK_USE_PCI_PROBE 0
     134#endif
     135
     136/* 1.8.0-rc1 :
     137 * LOG LEVEL is a command line option which overrides what
     138 * we previously set it to.
     139 */
     140#if RTE_VERSION >= RTE_VERSION_NUM(1, 8, 0, 1)
     141#       define DPDK_USE_LOG_LEVEL 1
     142#else
     143#       define DPDK_USE_LOG_LEVEL 0
    120144#endif
    121145
     
    390414    int matches;
    391415    assert(str);
    392     matches = sscanf(str, "%4"SCNx16":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld", &addr->domain, &addr->bus, &addr->devid, &addr->function, core);
     416    matches = sscanf(str, "%4"SCNx16":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld",
     417                     &addr->domain, &addr->bus, &addr->devid, &addr->function, core);
    393418    if (matches >= 4) {
    394         return 0;
     419        return 0;
    395420    } else {
    396         return -1;
     421        return -1;
    397422    }
    398423}
     
    584609     * port that already in use.
    585610     */
    586     char* argv[] = {"libtrace", "-c", cpu_number, "-n", "1", "--proc-type", "auto",
    587                 "--file-prefix", mem_map, "-m", "980", NULL};
     611    char* argv[] = {"libtrace",
     612                    "-c", cpu_number,
     613                    "-n", "1",
     614                    "--proc-type", "auto",
     615                    "--file-prefix", mem_map,
     616                    "-m", "256",
     617#if DPDK_USE_LOG_LEVEL
     618#       if DEBUG
     619                    "--log-level", "8", /* RTE_LOG_DEBUG */
     620#       else
     621                    "--log-level", "5", /* RTE_LOG_WARNING */
     622#       endif
     623#endif
     624                    NULL};
    588625    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    589626
     
    709746
    710747#if DPDK_USE_BLACKLIST
    711     /* Black list all ports besides the one that we want to use */
     748    /* Blacklist all ports besides the one that we want to use */
    712749        if ((ret = blacklist_devices(format_data, &use_addr)) < 0) {
    713750                snprintf(err, errlen, "Intel DPDK - Whitelisting PCI device failed,"
     
    717754#endif
    718755
     756#if DPDK_USE_PCI_PROBE
    719757    /* This loads DPDK drivers against all ports that are not blacklisted */
    720758        if ((ret = rte_eal_pci_probe()) < 0) {
     
    723761        return -1;
    724762    }
     763#endif
    725764
    726765    format_data->nb_ports = rte_eth_dev_count();
     
    18431882
    18441883#if GET_MAC_CRC_CHECKSUM
     1884<<<<<<< HEAD
    18451885                /* Add back in the CRC sum */
    18461886                pkts[i]->pkt.pkt_len += ETHER_CRC_LEN;
    18471887                pkts[i]->pkt.data_len += ETHER_CRC_LEN;
    18481888                hdr->flags |= INCLUDES_CHECKSUM;
     1889=======
     1890    /* Add back in the CRC sum */
     1891    rte_pktmbuf_pkt_len(pkt) += ETHER_CRC_LEN;
     1892    rte_pktmbuf_data_len(pkt) += ETHER_CRC_LEN;
     1893    hdr->flags |= INCLUDES_CHECKSUM;
     1894>>>>>>> master
    18491895#endif
    18501896
  • lib/format_duck.c

    rb13b939 r4631115  
    216216                duck_size = sizeof(duck2_5_t);
    217217                packet->type = TRACE_RT_DUCK_2_5;
     218        } else if (DATA(libtrace)->dag_version == TRACE_RT_DUCK_5_0) {
     219                duck_size = sizeof(duck5_0_t);
     220                packet->type = TRACE_RT_DUCK_5_0;
    218221        } else {
    219222                trace_set_err(libtrace, TRACE_ERR_BAD_PACKET,
     
    252255
    253256        if (packet->type != TRACE_RT_DUCK_2_4
    254                         && packet->type != TRACE_RT_DUCK_2_5) {
     257                        && packet->type != TRACE_RT_DUCK_2_5 &&
     258                        packet->type != TRACE_RT_DUCK_5_0) {
    255259                trace_set_err_out(libtrace, TRACE_ERR_BAD_PACKET,
    256260                                "Only DUCK packets may be written to a DUCK file");
     
    287291                case TRACE_RT_DUCK_2_5:
    288292                        return sizeof(duck2_5_t);
     293                case TRACE_RT_DUCK_5_0:
     294                        return sizeof(duck5_0_t);
    289295                default:
    290296                        trace_set_err(packet->trace,TRACE_ERR_BAD_PACKET,
  • lib/format_rt.c

    r4cc6e74 r4631115  
    430430                case TRACE_RT_DUCK_2_4:
    431431                case TRACE_RT_DUCK_2_5:
     432                case TRACE_RT_DUCK_5_0:
    432433                        if (!RT_INFO->dummy_duck) {
    433434                                RT_INFO->dummy_duck = trace_create_dead("duck:dummy");
  • lib/libtrace.h.in

    r97d170d r4631115  
    402402        TRACE_RT_CLIENTDROP     =17,/**< Reliable client was lost */
    403403        TRACE_RT_METADATA       =18,/**< Packet contains server meta-data */
     404        TRACE_RT_DUCK_5_0       =19,/**< Dag 5.0 Duck */
    404405
    405406        /** Not actually used - all DATA types begin from this value */
     
    832833} PACKED libtrace_pppoe_t;
    833834
     835/** Libtrace local definition of GRE (Generalised Routing Protocol) header
     836 * RFC2890
     837 */
     838typedef struct libtrace_gre_t
     839{
     840    uint16_t flags;         /**< Flags and version */
     841    uint16_t ethertype;     /**< Payload ethertype */
     842    uint16_t checksum;      /**< Optional checksum */
     843    uint16_t reserved1;     /**< Optional reserved */
     844    uint16_t key;           /**< Optional key (or Tenant Network ID) */
     845    uint16_t seq;           /**< Optional sequence number */
     846} PACKED libtrace_gre_t;
     847
     848#define LIBTRACE_GRE_FLAG_CHECKSUM 0x8000
     849#define LIBTRACE_GRE_FLAG_KEY      0x2000
     850#define LIBTRACE_GRE_FLAG_SEQ      0x1000
     851#define LIBTRACE_GRE_FLAG_VERMASK  0x0007
     852
     853/** Libtrace local definition of VXLAN Header
     854 * (draft-mahalingam-dutt-dcops-vxlan)
     855 */
     856typedef struct libtrace_vxlan_t
     857{
     858    uint8_t flags;          /**< Flags */
     859    uint8_t reserved1[3];   /**< Reserved */
     860    uint8_t vni[3];         /**< VXLAN Network Identifier (VNI) */
     861    uint8_t reserved2;
     862} PACKED libtrace_vxlan_t;
     863
    834864/** 802.11 header */
    835865typedef struct libtrace_80211_t {
     
    20942124DLLEXPORT void *trace_get_payload_from_icmp6(libtrace_icmp6_t *icmp,
    20952125                uint32_t *remaining);
     2126
     2127/** Gets a pointer to the payload following a GRE header
     2128 * @param         gre       A pointer to the beginning of the GRE header.
     2129 * @param[in,out] remaining Updated with the number of captured bytes remaining.
     2130 *
     2131 * @return A pointer to the GRE payload, or NULL if the GRE header is truncated.
     2132 *
     2133 * When calling this function, remaining must contain the number of captured
     2134 * bytes remaining in the packet starting from the GRE header (including the
     2135 * GRE header itself). remaining will be updated to contain the number of
     2136 * bytes remaining after the GRE header has been skipped.
     2137 *
     2138 * If the GRE header is complete but there are zero bytes of payload after
     2139 * the header, a pointer to where the payload would be is returned and
     2140 * remaining will be set to 0.  If the GRE header is incomplete, NULL will be
     2141 * returned and remaining will be set to 0. Therefore, it is important to check
     2142 * the value of remaining after calling this function.
     2143 */
     2144DLLEXPORT void *trace_get_payload_from_gre(libtrace_gre_t *gre,
     2145                uint32_t *remaining);
     2146
     2147/** Gets a pointer to the payload following a VXLAN header
     2148 * @param         udp       A pointer to the beginning of the UDP header.
     2149 * @param[in,out] remaining Updated with the number of captured bytes remaining.
     2150 *
     2151 * @return A pointer to the beginning of the VXLAN header, or NULL if the UDP
     2152 * header is truncated, or this is not a VXLAN packet.
     2153 *
     2154 */
     2155DLLEXPORT libtrace_vxlan_t *trace_get_vxlan_from_udp(libtrace_udp_t *udp,
     2156                uint32_t *remaining);
     2157
     2158/** Gets a pointer to the payload following a VXLAN header
     2159 * @param         vxlan       A pointer to the beginning of the VXLAN header.
     2160 * @param[in,out] remaining Updated with the number of captured bytes remaining.
     2161 *
     2162 * @return A pointer to the VXLAN payload, or NULL if the VXLAN header is
     2163 * truncated.
     2164 *
     2165 * When calling this function, remaining must contain the number of captured
     2166 * bytes remaining in the packet starting from the VXLAN header (including the
     2167 * VXLAN header itself). remaining will be updated to contain the number of
     2168 * bytes remaining after the VXLAN header has been skipped.
     2169 *
     2170 * If the VXLAN header is complete but there are zero bytes of payload after
     2171 * the header, a pointer to where the payload would be is returned and
     2172 * remaining will be set to 0.  If the VXLAN header is incomplete, NULL will be
     2173 * returned and remaining will be set to 0. Therefore, it is important to check
     2174 * the value of remaining after calling this function.
     2175 */
     2176DLLEXPORT void *trace_get_payload_from_vxlan(libtrace_vxlan_t *vxlan,
     2177                uint32_t *remaining);
    20962178
    20972179/** Get a pointer to the TCP header (if present)
  • lib/protocols_transport.c

    re0bea4e5 r3fc3267  
    553553        return csum_ptr;
    554554}
     555
     556DLLEXPORT void *trace_get_payload_from_gre(libtrace_gre_t *gre,
     557        uint32_t *remaining)
     558{
     559    uint32_t size = 4; /* GRE is 4 bytes long by default */
     560    if (remaining && *remaining < size) {
     561        *remaining = 0;
     562        return NULL;
     563    }
     564
     565    if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_CHECKSUM) != 0) {
     566        size += 4;  /* An extra 4 bytes. */
     567    }
     568
     569    if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_KEY) != 0) {
     570        size += 4;  /* An extra 4 bytes. */
     571    }
     572
     573    if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_SEQ) != 0) {
     574        size += 4;  /* An extra 4 bytes. */
     575    }
     576
     577    if (remaining) {
     578        if (*remaining < size) {
     579            *remaining = 0;
     580            return NULL;
     581        }
     582        *remaining -= size;
     583    }
     584    return (char*)gre+size;
     585}
  • lib/rt_protocol.h

    r81c0b9e rc5ac872  
    249249} PACKED duck2_5_t;
    250250
     251typedef struct duck5_0 {
     252        int64_t         Phase_Correction;
     253        uint64_t        Last_Ticks;
     254        uint64_t        Last_TSC;
     255        /* XXX Stat_Start and Stat_End are time_t in dagioctl.h, which means
     256         * they could in theory be 32 or 64 bit depending on the architecture
     257         * when capturing. I'm going to assume 5.0 era DAG captures are taking
     258         * place on a 64 bit arch, rather than have to deal with the varying
     259         * sizes (especially given nobody really uses DUCK these days).
     260         */
     261        uint64_t        Stat_Start, Stat_End;
     262        uint32_t        Crystal_Freq;
     263        uint32_t        Synth_Freq;
     264        uint32_t        Resyncs;
     265        uint32_t        Bad_Pulses;
     266        uint32_t        Worst_Freq_Err, Worst_Phase_Err;
     267        uint32_t        Health_Thresh;
     268        uint32_t        Pulses, Single_Pulses_Missing, Longest_Pulse_Missing;
     269        uint32_t        Health, Sickness;
     270        int32_t         Freq_Err, Phase_Err;
     271        uint32_t        Set_Duck_Field;
     272} PACKED duck5_0_t;
     273
    251274/*
    252275typedef struct rt_duck_2_4 {
  • lib/trace.c

    r0b01fea r4631115  
    109109
    110110volatile int libtrace_halt = 0;
    111 
    112111/* Set once pstart is called used for backwards compatibility reasons */
    113112int libtrace_parallel = 0;
  • test/Makefile

    rf051c1b r4631115  
    99CFLAGS += $(INCLUDE)
    1010libdir = $(PREFIX)/lib/.libs:$(PREFIX)/libpacketdump/.libs
    11 LDLIBS = -L$(PREFIX)/lib/.libs -L$(PREFIX)/libpacketdump/.libs -ltrace -lpacketdump 
     11LDLIBS = -L$(PREFIX)/lib/.libs -L$(PREFIX)/libpacketdump/.libs -ltrace -lpacketdump
    1212
    1313BINS_DATASTRUCT = test-datastruct-vector test-datastruct-deque \
     
    1818
    1919BINS = test-pcap-bpf test-event test-time test-dir test-wireless test-errors \
    20         test-plen test-autodetect test-ports test-fragment test-live test-live-snaplen \
    21         $(BINS_DATASTRUCT) $(BINS_PARALLEL)
     20        test-plen test-autodetect test-ports test-fragment test-live \
     21        test-live-snaplen test-vxlan $(BINS_DATASTRUCT) $(BINS_PARALLEL)
    2222
    2323.PHONY: all clean distclean install depend test
  • test/do-tests.sh

    r95b6218 r3fc3267  
    230230do_test ./test-autodetect traces/5_packets.erf.xz
    231231
     232echo " * VXLan decode"
     233do_test ./test-vxlan
     234
    232235echo
    233236echo "Tests passed: $OK"
  • tools/tracestats/tracesummary

    r3bfeb7d r065cab9  
    1818                --filter 'port domain' \
    1919                --filter 'icmp[icmptype]=icmp-echoreply' \
    20                 $@
     20                "$@"
Note: See TracChangeset for help on using the changeset viewer.