Changeset 8013711 for lib/format_erf.c


Ignore:
Timestamp:
11/01/05 13:34:32 (16 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:
77509e9
Parents:
d18312c
Message:

Fixed rt_protocol.h so that it is no longer dependent on libfifo.
Updated format for rt protocol header - it is now 1 byte for a
packet type, 1 byte reserved and then 2 bytes to specify
any messages.
Updated various formats to use the new rt protocol header correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r78f750e r8013711  
    486486        memcpy(packet->buffer, erfptr, size);
    487487       
    488         packet->status = 0;
     488        packet->status.type = RT_DATA;
     489        packet->status.message = 0;
    489490        packet->size = size;
    490491        DAG.offset += size;
     
    526527                return -1;
    527528        }
    528         packet->status = 0;
     529        packet->status.type = RT_DATA;
     530        packet->status.message = 0;
    529531        packet->size = rlen;
    530532        return rlen;
     
    565567                return -1;
    566568        }
    567         packet->status = 0;
     569        packet->status.type = RT_DATA;
     570        packet->status.message = 0;
    568571        packet->size = rlen;
    569572        return rlen;
     
    619622                // Read status byte
    620623                if (tracefifo_out_read(libtrace->fifo,
    621                                 &packet->status, sizeof(uint32_t)) == 0) {
     624                                &packet->status, sizeof(rt_status_t)) == 0) {
    622625                        read_required = 1;
    623626                        continue;
    624627                }
    625                 tracefifo_out_update(libtrace->fifo,sizeof(uint32_t));
     628                tracefifo_out_update(libtrace->fifo,sizeof(rt_status_t));
    626629
    627630                // read in the ERF header
     
    633636                }
    634637               
    635                 if (packet->status >= S_MESSAGE_ONLY) {
     638                if (packet->status.type == RT_MSG) {
    636639                        // Need to skip this packet as it is a message packet
    637640                        tracefifo_out_update(libtrace->fifo, dag_record_size);
    638                         tracefifo_ack_update(libtrace->fifo, dag_record_size + sizeof(uint32_t));
     641                        tracefifo_ack_update(libtrace->fifo, dag_record_size + sizeof(rt_status_t));
    639642                        continue;
    640643                }
     
    653656                tracefifo_out_update(libtrace->fifo,size);
    654657
    655                 tracefifo_ack_update(libtrace->fifo,size + sizeof(uint32_t));
     658                tracefifo_ack_update(libtrace->fifo,size + sizeof(rt_status_t));
    656659
    657660                packet->size = numbytes;
Note: See TracChangeset for help on using the changeset viewer.