Changeset f0c639b for test


Ignore:
Timestamp:
03/26/07 11:47:31 (14 years ago)
Author:
Scott Raynel <smr26@…>
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:
38f9537
Parents:
be22b51
Message:
  • Remove trace_get_wireless_fcs as it is no longer part of the Radiotap standard.
  • Update trace_get_wire_length to account for the presence (or absence) of FCS bytes at the end of wireless frames. (only pcap and pcapfile for now)
  • Update radiotap libpacketdump decoder to no longer output non-standard FCS field.
  • Update test-wireless to ensure new length functions work correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-wireless.c

    rd5a27e8 rf0c639b  
    6565        uint64_t tsft;
    6666        uint16_t freq, tmp16;
    67         uint32_t fcs;
    6867        uint8_t flags, rate, sdbm, ndbm, sdb, antenna, tmp8;
    6968       
    70         uint32_t total_fcs, expected_fcs = 3012874435;
    7169        uint16_t total_freq, expected_freq = 24170;
    7270       
     
    9896        assert(trace_get_wireless_signal_strength_db(l,lt,&sdb));
    9997        assert(trace_get_wireless_antenna(l,lt,&antenna));
    100         assert(trace_get_wireless_fcs(l,lt,&fcs));
    10198
    10299        /* Check that the fields that do not exist in this trace are
     
    111108         * TODO: Check all fields :)
    112109         */
    113         total_fcs = fcs;
    114110        total_freq = freq;
    115111       
    116112        while((result = trace_read_packet(trace, packet)) > 0) {
    117                 if(trace_get_wireless_fcs(l,lt,&fcs))
    118                         total_fcs += fcs;
     113                /* This trace has no FCS at the end of packets, so ensure
     114                 * that wire-length is 4 bytes greater than capture length */
     115                int caplen = trace_get_capture_length(packet);
     116                int wirelen = trace_get_wire_length(packet);
     117                assert(wirelen == caplen + 4);
    119118                if(trace_get_wireless_freq(l,lt,&freq))
    120119                        total_freq += freq;
    121120        }
    122121
    123         assert(total_fcs == expected_fcs);
    124122        assert(total_freq == expected_freq);
    125123
     
    146144        assert(!trace_get_wireless_signal_strength_db(l,lt,&sdb));
    147145        assert(!trace_get_wireless_antenna(l,lt,&antenna));
    148         assert(!trace_get_wireless_fcs(l,lt,&fcs));
    149146        assert(!trace_get_wireless_noise_strength_db(l,lt,&tmp8));
    150147        assert(!trace_get_wireless_tx_attenuation(l,lt,&tmp16));
Note: See TracChangeset for help on using the changeset viewer.