Changeset 0e9b9f8


Ignore:
Timestamp:
05/23/06 17:13:39 (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:
64444f9
Parents:
d8d1ff7
Message:

DAG 2.5 deprecated a few functions so decided to explicitly call the stream functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r5b4404a r0e9b9f8  
    115115                unsigned curr;
    116116                unsigned offset;
     117                unsigned int dagstream;
    117118        } dag;
    118119#endif
     
    165166                return -1;
    166167        }
     168
     169        DAG.dagstream = 0;
     170       
    167171        if (S_ISCHR(buf.st_mode)) {
    168172                /* DEVICE */
     
    452456#ifdef HAVE_DAG
    453457static int dag_pause_input(libtrace_t *libtrace) {
     458#if DAG_VERSION_2_4
    454459        dag_stop(INPUT.fd);
     460#else
     461        if (dag_stop_stream(INPUT.fd, DAG.dagstream) < 0) {
     462                trace_set_err(libtrace, errno, "Could not stop DAG stream");
     463                return -1;
     464        }
     465        if (dag_detach_stream(INPUT.fd, DAG.dagstream) < 0) {
     466                trace_set_err(libtrace, errno, "Could not detach DAG stream");
     467                return -1;
     468        }
     469#endif
    455470        return 0; /* success */
    456471}
     
    458473static int dag_fin_input(libtrace_t *libtrace) {
    459474        /* dag pause input implicitly called to cleanup before this */
     475       
    460476        dag_close(INPUT.fd);
    461477        if (DUCK.dummy_duck)
     
    642658
    643659static int dag_start_input(libtrace_t *libtrace) {
     660#if DAG_VERSION_2_4
    644661        if(dag_start(INPUT.fd) < 0) {
    645662                trace_set_err(libtrace,errno,"Cannot start DAG %s",
     
    647664                return -1;
    648665        }
     666#else
     667        if (dag_attach_stream(INPUT.fd, DAG.dagstream, 0, 0) < 0) {
     668                trace_set_err(libtrace, errno, "Cannot attach DAG stream");
     669                return -1;
     670        }
     671        if (dag_start_stream(INPUT.fd, DAG.dagstream) < 0) {
     672                trace_set_err(libtrace, errno, "Cannot start DAG stream");
     673                return -1;
     674        }
     675#endif
    649676        /* dags appear to have a bug where if you call dag_start after
    650677         * calling dag_stop, and at least one packet has arrived, bad things
Note: See TracChangeset for help on using the changeset viewer.