Ignore:
Timestamp:
12/03/08 13:24:55 (4 years ago)
Author:
perry
Message:

Rewrite the libtrace io subsystem to use the new wandio abstraction layer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/format_pcapfile.c

    r1370 r1391  
    5858 
    5959struct pcapfile_format_data_t { 
    60         libtrace_io_t *file; 
     60        io_t *file; 
    6161        struct { 
    6262                int real_time; 
     
    6666 
    6767struct pcapfile_format_data_out_t { 
    68         libtrace_io_t *file; 
     68        iow_t *file; 
    6969        int level; 
    7070        int flag; 
     
    133133                        return -1; 
    134134 
    135                 err=libtrace_io_read(DATA(libtrace)->file, 
     135                err=wandio_read(DATA(libtrace)->file, 
    136136                                &DATA(libtrace)->header, 
    137137                                sizeof(DATA(libtrace)->header)); 
     
    190190{ 
    191191        if (DATA(libtrace)->file) 
    192                 libtrace_io_close(DATA(libtrace)->file); 
     192                wandio_destroy(DATA(libtrace)->file); 
    193193        free(libtrace->format_data); 
    194194        return 0; /* success */ 
     
    198198{ 
    199199        if (DATA(libtrace)->file) 
    200                 libtrace_io_close(DATA(libtrace)->file); 
     200                wandio_wdestroy(DATAOUT(libtrace)->file); 
    201201        free(libtrace->format_data); 
    202202        libtrace->format_data=NULL; 
     
    269269        flags |= TRACE_PREP_OWN_BUFFER; 
    270270         
    271         err=libtrace_io_read(DATA(libtrace)->file, 
     271        err=wandio_read(DATA(libtrace)->file, 
    272272                        packet->buffer, 
    273273                        sizeof(libtrace_pcapfile_pkt_hdr_t)); 
     
    284284        } 
    285285 
    286         err=libtrace_io_read(DATA(libtrace)->file, 
     286        err=wandio_read(DATA(libtrace)->file, 
    287287                        (char*)packet->buffer+sizeof(libtrace_pcapfile_pkt_hdr_t), 
    288288                        (size_t)swapl(libtrace,((libtrace_pcapfile_pkt_hdr_t*)packet->buffer)->caplen) 
     
    362362                        libtrace_to_pcap_linktype(linktype); 
    363363 
    364                 libtrace_io_write(DATAOUT(out)->file,  
     364                wandio_wwrite(DATAOUT(out)->file,  
    365365                                &pcaphdr, sizeof(pcaphdr)); 
    366366        } 
     
    384384 
    385385 
    386         numbytes=libtrace_io_write(DATAOUT(out)->file, 
     386        numbytes=wandio_wwrite(DATAOUT(out)->file, 
    387387                        &hdr, sizeof(hdr)); 
    388388 
     
    390390                return -1; 
    391391 
    392         ret=libtrace_io_write(DATAOUT(out)->file, 
     392        ret=wandio_wwrite(DATAOUT(out)->file, 
    393393                        ptr, 
    394394                        remaining); 
Note: See TracChangeset for help on using the changeset viewer.