Changeset 4abd50b


Ignore:
Timestamp:
07/07/06 10:47:27 (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:
404210e
Parents:
5bb5dd2
Message:

A few more fixes relating to the wag and dag changes made in the previous commit

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r5bb5dd2 r4abd50b  
    650650        packet->header = erfptr;
    651651        if (((dag_record_t *)packet->buffer)->flags.rxerror == 1) {
     652                /* rxerror means the payload is corrupt - drop it
     653                 * by tweaking rlen */
    652654                packet->payload = NULL;
     655                erfptr->rlen = htons(erf_get_framing_length(packet));
    653656        } else {
    654657                packet->payload = (char*)packet->buffer
     
    10101013static int erf_get_capture_length(const libtrace_packet_t *packet) {
    10111014        dag_record_t *erfptr = 0;
     1015        if (packet->payload == NULL)
     1016                return 0;
     1017       
    10121018        erfptr = (dag_record_t *)packet->header;
    10131019        return (ntohs(erfptr->rlen) - erf_get_framing_length(packet));
  • lib/format_wag.c

    r5bb5dd2 r4abd50b  
    466466
    467467static int wag_get_wire_length(const libtrace_packet_t *packet) {
     468        struct frame_t * wag_frame_data = (struct frame_t *)packet->header;
     469
     470       
     471        if (wag_frame_data->subtype == FRAME_SUBTYPE_DATA_RX) {
     472                struct frame_data_rx_t *wag_hdr =
     473                        (struct frame_data_rx_t *)packet->header;
     474                return ntohs(wag_hdr->rxinfo.length);
     475        }
     476
     477        if (wag_frame_data->subtype == FRAME_SUBTYPE_DATA_TX) {
     478                struct frame_data_tx_t *wag_hdr =
     479                       (struct frame_data_tx_t *)packet->header;
     480                return ntohs(wag_hdr->txinfo.length);
     481        }
     482       
     483        /* default option - not optimal as there tends to be an
     484         * extra 2 bytes floating around somewhere */
    468485        return ntohs(((struct frame_t *)packet->header)->size)
    469486                -sizeof(struct frame_data_rx_t);
     
    471488
    472489static int wag_get_framing_length(UNUSED const libtrace_packet_t *packet) {
     490        /* There's an extra two bytes floating around somewhere that
     491         * we can't account for! */
    473492        return sizeof(struct frame_data_rx_t);
    474493}
Note: See TracChangeset for help on using the changeset viewer.