Changeset 91b72d3 for lib/format_linux.c


Ignore:
Timestamp:
01/05/09 11:29:11 (13 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:
ad36006
Parents:
9d0049cf
Message:

Try to autoguess the tracetype if the format uri specify is not present

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r1f44884 r91b72d3  
    3333#include "format_helper.h"
    3434#include "config.h"
    35 #include "stdlib.h"
     35#include <stdlib.h>
    3636
    3737#ifdef HAVE_INTTYPES_H
     
    5050#include <sys/ioctl.h>
    5151#include <errno.h>
     52#include <unistd.h>
    5253
    5354#include <assert.h>
     
    8586#define FORMAT(x) ((struct libtrace_format_data_t*)(x))
    8687#define DATAOUT(x) ((struct libtrace_linuxnative_format_data_t*)((x)->format_data))
     88
     89static int linuxnative_probe_filename(const char *filename)
     90{
     91        int sock;
     92
     93        /* Is this an interface? */
     94        return (if_nametoindex(filename) != 0);
     95}
    8796
    8897static int linuxnative_init_input(libtrace_t *libtrace)
     
    614623        "$Id$",
    615624        TRACE_FORMAT_LINUX_NATIVE,
     625        linuxnative_probe_filename,     /* probe filename */
     626        NULL,                           /* probe magic */
    616627        linuxnative_init_input,         /* init_input */
    617628        linuxnative_config_input,       /* config_input */
Note: See TracChangeset for help on using the changeset viewer.