Changeset 91b72d3 for lib/format_dag24.c


Ignore:
Timestamp:
01/05/09 11:29:11 (12 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_dag24.c

    rc0dba7a r91b72d3  
    8282        uint64_t drops;
    8383};
     84
     85static void dag_probe_filename(const char *filename)
     86{
     87        struct stat statbuf;
     88        /* Can we stat the file? */
     89        if (stat(filename, &statbuf) != 0) {
     90                return 0;
     91        }
     92        /* Is it a character device? */
     93        if (!S_ISCHR(statbuf.st_mode)) {
     94                return 0;
     95        }
     96        /* Yeah, it's probably us. */
     97        return 1;
     98}
    8499
    85100static void dag_init_format_data(libtrace_t *libtrace) {
     
    407422        "$Id$",
    408423        TRACE_FORMAT_ERF,
     424        dag_probe_filename,             /* probe filename */
     425        NULL,                           /* probe magic */
    409426        dag_init_input,                 /* init_input */
    410427        dag_config_input,               /* config_input */
Note: See TracChangeset for help on using the changeset viewer.