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_4.cc

    r950d54a 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>
    75#include "libpacketdump.h"
     6#include "libtrace.h"
    87
    98struct ieee_802_11_header {
     
    3635void decode(int link_type,char *packet,int len)
    3736{
     37        char ether_buf[18] = {0, };
    3838        printf(" 802.11:");
    3939        struct ieee_802_11_header *hdr = (struct ieee_802_11_header *)packet;
    4040
    41         printf(" %s",ether_ntoa((struct ether_addr*)(hdr->mac1)));
    42         printf(" %s",ether_ntoa((struct ether_addr*)(hdr->mac2)));
    43         printf(" %s",ether_ntoa((struct ether_addr*)(hdr->mac3)));
     41        printf(" %s",trace_ether_ntoa((uint8_t*)(hdr->mac1), ether_buf));
     42        printf(" %s",trace_ether_ntoa((uint8_t*)(hdr->mac2), ether_buf));
     43        printf(" %s",trace_ether_ntoa((uint8_t*)(hdr->mac3), ether_buf));
    4444
    4545        struct ieee_802_11_payload *pld = (struct ieee_802_11_payload *) ((int)packet + sizeof(struct ieee_802_11_header) - 2);
Note: See TracChangeset for help on using the changeset viewer.