Changeset dd2eaee for lib/trace.c


Ignore:
Timestamp:
04/21/06 23:06:02 (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:
088533a
Parents:
0c222cc
Message:

Add new pcapfile: uri for natively reading pcap files (without libpcap)
Add initialiser so we don't need to rely on gccisms for initialisation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r0c222cc rdd2eaee  
    198198}
    199199
     200void erf_constructor();
     201void legacy_constructor();
     202void linuxnative_constructor();
     203void pcap_constructor();
     204void pcapfile_constructor();
     205void rt_constructor();
     206void wag_constructor();
     207
     208/* call all the constructors if they haven't yet all been called */
     209void trace_init(void)
     210{
     211        if (!formats_list) {
     212                erf_constructor();
     213                legacy_constructor();
     214                linuxnative_constructor();
     215#ifdef HAVE_PCAP
     216                pcap_constructor();
     217#endif
     218                pcapfile_constructor();
     219                rt_constructor();
     220                wag_constructor();
     221        }
     222}
     223
    200224/* Prints help information for libtrace
    201225 *
     
    205229DLLEXPORT void trace_help() {
    206230        struct libtrace_format_t *tmp;
     231        trace_init();
    207232        printf("libtrace %s\n",PACKAGE_VERSION);
    208233        for(tmp=formats_list;tmp;tmp=tmp->next) {
     
    227252        return format;
    228253}
     254
    229255
    230256/* Create a trace file from a URI
     
    259285        struct libtrace_format_t *tmp;
    260286
     287        trace_init();
     288
    261289        assert(uri && "Passing NULL to trace_create makes me a very sad program");
    262290       
     
    384412        const char *uridata = 0;
    385413        struct libtrace_format_t *tmp;
     414
     415        trace_init();
    386416
    387417        libtrace->err.err_num = TRACE_ERR_NOERROR;
Note: See TracChangeset for help on using the changeset viewer.