Changeset 90e8d92 for lib


Ignore:
Timestamp:
12/06/12 11:46:41 (8 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:
5b825b3
Parents:
6ba84d9
Message:
  • Added support to format_rt for reading ring: captures
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_rt.c

    r528eb6e r90e8d92  
    105105        libtrace_t *dummy_pcap;
    106106        libtrace_t *dummy_linux;
     107        libtrace_t *dummy_ring;
    107108        libtrace_t *dummy_bpf;
    108109};
     
    199200        RT_INFO->dummy_pcap = NULL;
    200201        RT_INFO->dummy_linux = NULL;
     202        RT_INFO->dummy_ring = NULL;
    201203        RT_INFO->dummy_bpf = NULL;
    202204        RT_INFO->pkt_buffer = NULL;
     
    292294        if (RT_INFO->dummy_linux)
    293295                trace_destroy_dead(RT_INFO->dummy_linux);
     296       
     297        if (RT_INFO->dummy_ring)
     298                trace_destroy_dead(RT_INFO->dummy_ring);
    294299
    295300        if (RT_INFO->dummy_bpf)
     
    447452                        packet->trace = RT_INFO->dummy_linux;
    448453                        break;
     454                case TRACE_RT_DATA_LINUX_RING:
     455                        if (!RT_INFO->dummy_ring) {
     456                                RT_INFO->dummy_ring = trace_create_dead("ring:");
     457                                /* This may fail on a non-Linux machine */
     458                                if (trace_is_err(RT_INFO->dummy_ring)) {
     459                                        trace_perror(RT_INFO->dummy_ring, "Creating dead int trace");
     460                                        return -1;
     461                                }
     462                        }
     463                        packet->trace = RT_INFO->dummy_ring;
     464                        break;
    449465                case TRACE_RT_STATUS:
    450466                case TRACE_RT_METADATA:
Note: See TracChangeset for help on using the changeset viewer.