Changeset 97e39a7


Ignore:
Timestamp:
04/14/06 14:13:07 (16 years ago)
Author:
Perry Lorier <perry@…>
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:
566e404
Parents:
6b0560b
Message:

Port new linux native capture type from libtrace 2.
Fail if we try and decode a pcap link type and we don't have pcap installed.

Location:
lib
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • lib/Makefile.am

    r4af54d1 r97e39a7  
    55libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h \
    66                format_erf.c format_pcap.c format_wag.c format_legacy.c format_rt.c\
    7                 format_helper.c format_helper.h \
     7                format_helper.c format_helper.h format_linux.c \
    88                parse_cmd.c parse_cmd.h libtrace_int.h lt_inttypes.h \
    99                linktypes.c protocols.c
  • lib/format_pcap.c

    r33e1501 r97e39a7  
    326326         */
    327327        linktype = rt_to_pcap_dlt(packet->type);
    328         /*
    329         if (packet->trace->format_data == NULL)
    330                 linktype = rt_to_pcap_dlt(packet->type);
    331         else
    332                 linktype = pcap_datalink(DATA(packet->trace)->input.pcap);
    333         */
    334328        return pcap_dlt_to_libtrace(linktype);
    335329}
  • lib/libtrace.h

    r95459ed5 r97e39a7  
    11901190        TRACE_FORMAT_LEGACY_ATM   =5,
    11911191        TRACE_FORMAT_LEGACY_POS   =6,
    1192         TRACE_FORMAT_LEGACY_ETH   =7
     1192        TRACE_FORMAT_LEGACY_ETH   =7,
     1193        TRACE_FORMAT_LINUX_NATIVE =8
    11931194};
    11941195
  • lib/libtrace_int.h

    r9e830d4 r97e39a7  
    208208         * if this function is not supported, this field may be NULL.
    209209         */
    210         int (*read_packet)(libtrace_t *libtrace, struct libtrace_packet_t *packet);
     210        int (*read_packet)(libtrace_t *libtrace, libtrace_packet_t *packet);
    211211        /** finalise a packet
    212212         * cleanup any resources used by a packet that can't be reused for
  • lib/linktypes.c

    r751531a r97e39a7  
    11#include "libtrace.h"
     2#include "config.h"
    23#ifdef HAVE_PCAP
    34#include <pcap.h>
     
    2829                case DLT_PFLOG: return TRACE_TYPE_PFLOG;
    2930#endif
     31#else
     32                default:
     33                                assert(!"No pcap support");
    3034#endif
    3135        }
  • lib/protocols.c

    rd8fc342 r97e39a7  
    185185                        return trace_get_payload_from_atm(link,type,remaining);
    186186        }
    187         fprintf(stderr,"Don't understand link layer type %i in trace_get_ip6()\n",
     187        fprintf(stderr,"Don't understand link layer type %i in trace_get_payload_from_link()\n",
    188188                linktype);
    189189        return NULL;
Note: See TracChangeset for help on using the changeset viewer.