Changes in / [e26bd1a:186a19e]


Ignore:
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r568a341 r21c7681  
    8282test/test-wireless
    8383test/test-write
     84test/*.dSYM/
    8485test/DPDK_source/
    8586test/DPDK_builds/
  • AUTHORS

    r6450950 r31da9bb  
    55 * Richard Sanger
    66
    7 Libtrace is currently maintained by Shane Alcock <salcock@waikato.ac.nz>.
     7Libtrace is currently maintained by the LibtraceTeam on Github:
     8https://github.com/LibtraceTeam.
    89
    9 However, we would also like to acknowledge a number of people who have 
     10However, we would also like to acknowledge a number of people who have
    1011generously contributed bug-fixes, extensions and other improvements over the
    1112years. It is contributions like these that help keep libtrace relevant and
     
    1516
    1617 * Matt Brown for getting us into Debian and keeping us up to date.
    17  * Brad Cowie for packaging libtrace4 for Debian and Ubuntu
    18  * Alistair King for reporting and suggesting fixes for numerous bugs, 
     18 * Brad Cowie for packaging libtrace4 for Debian and Ubuntu.
     19 * Alistair King for reporting and suggesting fixes for numerous bugs,
    1920   particularly in libwandio
    2021 * Simon Wadsworth for writing the original version of most of the OSPF code
     
    3637   code here and there
    3738
    38 Apologies to anyone that we've missed out or forgotten. If you're really
    39 offended, fire us an email and we'll add you to the list.
     39Apologies to anyone that we've missed out or forgotten. If you're really
     40offended, fire one of us an email and we'll make sure you are added to the
     41list.
  • README

    rd759ee1 re3fa533  
    1 libtrace 4.0.1
     1libtrace 4.0.2
    22
    33---------------------------------------------------------------------------
  • configure.in

    re26bd1a r9993cde  
    44# and in the README
    55
    6 AC_INIT([libtrace],[4.0.1],[contact@wand.net.nz],[libtrace])
     6AC_INIT([libtrace],[4.0.2],[contact@wand.net.nz],[libtrace])
    77
    88LIBTRACE_MAJOR=4
    99LIBTRACE_MID=0
    10 LIBTRACE_MINOR=1
     10LIBTRACE_MINOR=2
    1111
    1212# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
     
    126126
    127127# Fail if any of these functions are missing
    128 AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf vsnprintf)
     128AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf vsnprintf recvmmsg)
    129129
    130130AC_CHECK_SIZEOF([long int])
  • lib/format_ndag.c

    r7e09388 r9993cde  
    6666        int bufavail;
    6767
     68#if HAVE_RECVMMSG
    6869        struct mmsghdr mmsgbufs[RECV_BATCH_SIZE];
     70#else
     71        struct msghdr singlemsg;
     72#endif
     73
    6974} streamsock_t;
    7075
     
    488493                streamsock_t src = receiver->sources[i];
    489494                if (src.saved) {
    490                         for (j = 0; i < ENCAP_BUFFERS; j++) {
     495                        for (j = 0; j < ENCAP_BUFFERS; j++) {
    491496                                if (src.saved[j]) {
    492497                                        free(src.saved[j]);
     
    495500                        free(src.saved);
    496501                }
     502
     503#if HAVE_RECVMMSG
    497504                for (j = 0; j < RECV_BATCH_SIZE; j++) {
    498505                        if (src.mmsgbufs[j].msg_hdr.msg_iov) {
     
    500507                        }
    501508                }
     509#else
     510                free(src.singlemsg.msg_iov);
     511#endif
     512
    502513                close(src.sock);
    503514        }
     
    701712        }
    702713
     714#if HAVE_RECVMMSG
    703715        for (i = 0; i < RECV_BATCH_SIZE; i++) {
    704716                ssock->mmsgbufs[i].msg_hdr.msg_iov = (struct iovec *)
     
    711723                ssock->mmsgbufs[i].msg_len = 0;
    712724        }
     725#else
     726        ssock->singlemsg.msg_iov = (struct iovec *) malloc(sizeof(struct iovec));
     727#endif
    713728
    714729        ssock->nextread = NULL;;
     
    776791
    777792        int wind = ssock->nextwriteind;
    778         int i;
    779 
     793        int i = 1;
     794
     795#if HAVE_RECVMMSG
    780796        for (i = 0; i < required; i++) {
    781797                if (i >= RECV_BATCH_SIZE) {
     
    794810                wind ++;
    795811        }
    796 
     812#else
     813        assert(required > 0);
     814        ssock->singlemsg.msg_iov->iov_base = ssock->saved[wind];
     815        ssock->singlemsg.msg_iov->iov_len = ENCAP_BUFSIZE;
     816        ssock->singlemsg.msg_iovlen = 1;
     817#endif
    797818        return i;
    798819}
     
    872893                int *gottime, recvstream_t *rt) {
    873894
    874         int ret, ndagstat, i, avail;
     895        int ret, ndagstat, avail;
    875896        int toret = 0;
     897
     898#if HAVE_RECVMMSG
     899        int i;
     900#endif
    876901
    877902        if (ssock->sock == -1) {
     
    879904        }
    880905
     906#if HAVE_RECVMMSG
    881907        /* Plenty of full buffers, just use the packets in those */
    882908        if (ssock->bufavail < RECV_BATCH_SIZE / 2) {
    883909                return 1;
    884910        }
     911#else
     912        if (ssock->bufavail == 0) {
     913                return 1;
     914        }
     915#endif
    885916
    886917        avail = init_receivers(ssock, ssock->bufavail);
    887918
     919#if HAVE_RECVMMSG
    888920        ret = recvmmsg(ssock->sock, ssock->mmsgbufs, avail,
    889921                        MSG_DONTWAIT, NULL);
    890 
     922#else
     923        ret = recvmsg(ssock->sock, &(ssock->singlemsg), MSG_DONTWAIT);
     924#endif
    891925        if (ret < 0) {
    892926                /* Nothing to receive right now, but we should still
     
    922956                return toret;
    923957        }
     958
    924959        ssock->startidle = 0;
     960
     961#if HAVE_RECVMMSG
    925962        for (i = 0; i < ret; i++) {
    926963                ndagstat = check_ndag_received(ssock, ssock->nextwriteind,
     
    934971                }
    935972        }
     973#else
     974        ndagstat = check_ndag_received(ssock, ssock->nextwriteind, ret, rt);
     975        if (ndagstat <= 0) {
     976                toret = 0;
     977        } else {
     978                toret = 1;
     979        }
     980#endif
    936981
    937982        return toret;
  • lib/protocols_l3.c

    r5732e9b r6654714  
    682682        uint16_t ethertype;
    683683        uint32_t remaining;
    684         uint16_t *csum_ptr;
     684        char *csum_ptr;
    685685
    686686        uint8_t safety[65536];
     
    699699                        return NULL;
    700700
    701                 csum_ptr = &ip->ip_sum;
     701                csum_ptr = (char *)(&ip->ip_sum);
    702702
    703703                /* I hate memcpys, but this is the only truly safe way to
     
    716716                *csum = ntohs(*csum);
    717717               
    718                 return csum_ptr;
     718                return (uint16_t *)csum_ptr;
    719719        }
    720720
  • lib/protocols_transport.c

    r317e903 r6654714  
    448448        uint32_t sum = 0;
    449449        uint8_t proto = 0;
    450         uint16_t *csum_ptr = NULL;
     450        char *csum_ptr = NULL;
    451451        int plen = 0;
    452452
     
    483483                header = trace_get_payload_from_tcp(tcp, &remaining);
    484484               
    485                 csum_ptr = &tcp->check;
     485                csum_ptr = (char *)(&tcp->check);
    486486
    487487                memcpy(ptr, tcp, tcp->doff * 4);
     
    498498                header = trace_get_payload_from_udp(udp, &remaining);
    499499               
    500                 csum_ptr = &udp->check;
     500                csum_ptr = (char *)(&udp->check);
    501501                memcpy(ptr, udp, sizeof(libtrace_udp_t));
    502502
     
    514514                header = trace_get_payload_from_icmp(icmp, &remaining);
    515515               
    516                 csum_ptr = &icmp->checksum;
     516                csum_ptr = (char *)(&icmp->checksum);
    517517                memcpy(ptr, icmp, sizeof(libtrace_icmp_t));
    518518
     
    543543        //assert(0);
    544544       
    545         return csum_ptr;
     545        return (uint16_t *)csum_ptr;
    546546}
    547547
  • lib/trace_parallel.c

    rea75ec2 re8db2d4  
    16731673        int i;
    16741674        int ret = -1;
    1675         char name[16];
     1675        char name[24];
    16761676        sigset_t sig_before, sig_block_all;
    16771677        assert(libtrace);
  • libpacketdump/libpacketdump.h

    ree6e802 r6654714  
    4747#define DISPLAYS(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,htons(hdr->x))
    4848#define DISPLAYL(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,htonl(hdr->x))
    49 #define DISPLAYIP(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,inet_ntoa(*(struct in_addr*)&hdr->x))
     49#define DISPLAYIP(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,inet_ntoa(*(struct in_addr*)(void *)(&hdr->x)))
    5050
    5151
  • libpacketdump/link_15.c

    ree6e802 r6654714  
    6969       
    7070        /* Check for extended bitmasks */
    71         ptr = (uint32_t *) &(rtap->it_present);
     71        ptr = (uint32_t *) (char *)(&(rtap->it_present));
    7272       
    7373        if ( (rtap_pres) & (1 << TRACE_RADIOTAP_EXT) )
  • libpacketdump/ospf2_1001.c

    ree6e802 r1de522d  
    3333DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
    3434        unsigned char *link_ptr = NULL;
    35         libtrace_ospf_link_v2_t *link;
     35        libtrace_ospf_link_v2_t *link = NULL;
    3636        uint32_t link_len;
    3737        libtrace_ospf_router_lsa_v2_t *hdr;
     
    5858                return;
    5959        while (trace_get_next_ospf_link_v2(&link_ptr, &link, &len, &link_len) > 0) {
     60                if (!link) {
     61                        break;
     62                }
    6063                printf(" OSPF Router Link: Id %s ", inet_ntoa(link->link_id));
    6164                printf("Data %s\n", inet_ntoa(link->link_data));
  • libpacketdump/ospf2_4.c

    ree6e802 r1de522d  
    3434DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
    3535        libtrace_ospf_ls_update_t *update = (libtrace_ospf_ls_update_t *)packet;
    36         unsigned char *lsa_ptr;
    37         uint8_t lsa_type;
    38         libtrace_ospf_lsa_v2_t *lsa_hdr;
    39         unsigned char *lsa_body;
     36        unsigned char *lsa_ptr = NULL;
     37        uint8_t lsa_type = 0;
     38        libtrace_ospf_lsa_v2_t *lsa_hdr = NULL;
     39        unsigned char *lsa_body = NULL;
    4040        int i = 0;
    4141        int max_lsas = 0;
    4242        uint32_t rem = len;
    43         uint16_t lsa_length;
     43        uint16_t lsa_length = 0;
    4444
    4545
  • test/do-live-tests.sh

    red18a6e rccef50c  
    1919
    2020libdir=../lib/.libs:../libpacketdump/.libs
    21 export LD_LIBRARY_PATH="$libdir"
     21export LD_LIBRARY_PATH="$libdir:/usr/local/lib/"
    2222export DYLD_LIBRARY_PATH="${libdir}"
    2323
  • test/do-tests-parallel.sh

    r568a341 rccef50c  
    1414
    1515libdir=../lib/.libs:../libpacketdump/.libs
    16 export LD_LIBRARY_PATH="$libdir"
     16export LD_LIBRARY_PATH="$libdir:/usr/local/lib/"
    1717export DYLD_LIBRARY_PATH="${libdir}"
    1818
  • test/do-tests.sh

    r568a341 rccef50c  
    1414
    1515libdir=../lib/.libs:../libpacketdump/.libs
    16 export LD_LIBRARY_PATH="$libdir"
     16export LD_LIBRARY_PATH="$libdir:/usr/local/lib/"
    1717export DYLD_LIBRARY_PATH="${libdir}"
    1818echo SLL Decoder
Note: See TracChangeset for help on using the changeset viewer.