Changeset 4abd50b for lib/format_wag.c


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.