Ignore:
Timestamp:
05/11/06 11:40:21 (15 years ago)
Author:
Shane Alcock <salcock@…>
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:
83445f0
Parents:
3fcb8b4
Message:

Fixed segmentation faults when trace_destroy is called on a trace that wasn't successfully created
libdl is now checked for and only linked against if available (BSD's don't have a libdl)
Fixed the libpacketdump .so's to use libtrace's generic protocol headers as well as trace_ether_ntoa
Added missing check for strlcpy
Added a couple of #defines to various tools that needed them under FreeBSD
Removed some needless #includes from the libpacketdump .so's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/link_2.cc

    r1851624 r4e65f42  
    1 #include <netinet/ether.h>
    21#include <netinet/in.h>
    32#include <stdio.h>
    43#include <inttypes.h>
    54#include <dlfcn.h>
    6 #include <map>
     5#include "libtrace.h"
    76#include "libpacketdump.h"
    87
     
    109void decode(int link_type,char *packet,int len)
    1110{
     11        char ether_buf[18] = {0, };
    1212        printf(" Ethernet:");
    1313        if (len>=6)
    14                 printf(" Dest: %s",ether_ntoa((struct ether_addr*)packet));
     14                printf(" Dest: %s",trace_ether_ntoa((uint8_t *)packet,
     15                                        ether_buf));
    1516        else {
    1617                printf("[|Truncated]\n");
     
    1819        }
    1920        if (len>=12)
    20                 printf(" Source: %s",ether_ntoa((struct ether_addr*)(packet+6)));
     21                printf(" Source: %s",trace_ether_ntoa((uint8_t*)(packet+6),
     22                                        ether_buf));
    2123        else {
    2224                printf("[|Truncated]\n");
Note: See TracChangeset for help on using the changeset viewer.