Changeset 5696294


Ignore:
Timestamp:
09/29/06 14:35:03 (15 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:
40d0efc
Parents:
742a332
Message:

Make some previously exported trace_get_wireless functions static, as they don't either aren't useful yet or aren't necessarily portable across drivers.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    ra7d1914 r5696294  
    14131413        libtrace_linktype_t linktype, uint64_t *tsft);
    14141414
    1415 /** Get the wireless flags
    1416  * @param link the wireless header
    1417  * @param linktype the linktype of the wireless header passed in
    1418  * @param[out] flags the wireless flags.
    1419  * @return true if the field was available, false if not.
    1420  */
    1421 DLLEXPORT bool trace_get_wireless_flags(void *link,
    1422         libtrace_linktype_t linktype, uint8_t *flags);
    1423 
    14241415/** Get the wireless rate
    14251416 * @param link the wireless header
     
    14411432        libtrace_linktype_t linktype, uint16_t *freq);
    14421433
    1443 /** Get the wireless channel flags
    1444  * @param link the wireless header
    1445  * @param linktype the linktype of the wireless header passed in
    1446  * @param[out] flags the channel flags
    1447  * @return true if the field was available, false if not.
    1448  */
    1449 DLLEXPORT bool trace_get_wireless_channel_flags(void *link,
    1450         libtrace_linktype_t linktype, uint16_t *flags);
    1451 
    1452 /** Get the wireless FHSS Hop Set
    1453  * @param link the wireless header
    1454  * @param linktype the linktype of the wireless header passed in
    1455  * @param[out] hopset the fhss hop set
    1456  * @return true if the field was available, false if not.
    1457  */
    1458 DLLEXPORT bool trace_get_wireless_fhss_hopset(void *link,
    1459         libtrace_linktype_t linktype, uint8_t *hopset);
    1460        
    1461 /** Get the wireless FHSS Hop Pattern
    1462  * @param link the wireless header
    1463  * @param linktype the linktype of the wireless header passed in
    1464  * @param[out] hoppattern the fhss hoppattern
    1465  * @return true if the field was available, false if not.
    1466  */
    1467 DLLEXPORT bool trace_get_wireless_fhss_hoppattern(void *link,
    1468         libtrace_linktype_t linktype, uint8_t *hoppattern);
    1469 
    14701434/** Get the wireless signal strength in dBm
    14711435 * @param link the wireless header
     
    15081472        libtrace_linktype_t linktype, uint8_t *strength);
    15091473
    1510 /** Get the wireless Barker code lock quality
    1511  * @param link the wireless header
    1512  * @param linktype the linktype of the wireless header passed in
    1513  * @param[out] quality the quality of the Barker Code lock.
    1514  * @return true if the field was available, false if not.
    1515  */
    1516 DLLEXPORT bool trace_get_wireless_lock_quality(void *link,
    1517         libtrace_linktype_t linktype, uint16_t *quality);
    1518 
    15191474/** Get the wireless transmit attenuation
    15201475 * @param link the wireless header
     
    15371492        libtrace_linktype_t linktype, uint16_t *attenuation);
    15381493
    1539 /** Get the wireless transmit power in dBm
    1540  * @param link the wireless header
    1541  * @param linktype the linktype of the wireless header passed in
    1542  * @param[out] txpower the transmit power as dB from a 1mW reference. This is the
    1543  * absolute power level measured at the antenna port.
     1494/** Get the wireless transmit power in dBm @param link the wireless header
     1495 * @param linktype the linktype of the wireless header passed in
     1496 * @param[out] txpower the transmit power as dB from a 1mW reference. This is the absolute power level measured at the antenna port. 
    15441497 * @return true if the field was available, false if not.
    15451498 */
    1546 DLLEXPORT bool trace_get_wireless_tx_power_dbm(void *link,
    1547         libtrace_linktype_t linktype, int8_t *txpower);
     1499DLLEXPORT bool trace_get_wireless_tx_power_dbm(void *link, libtrace_linktype_t
     1500                linktype, int8_t *txpower);
    15481501
    15491502/** Get the wireless antenna
  • lib/link_wireless.c

    r52c7cda r5696294  
    194194}
    195195
    196 DLLEXPORT bool trace_get_wireless_flags(void *link,
     196/*
     197 * This function isn't portable across drivers, so has been left static
     198 * for now. Maybe it will be included in the API later if it becomes useful
     199 * and we come up with a suitable abstraction.
     200 */
     201static
     202bool trace_get_wireless_flags(void *link,
    197203                libtrace_linktype_t linktype, uint8_t *flags)
    198204{
     
    271277}
    272278
    273 DLLEXPORT bool trace_get_wireless_channel_flags(void *link,
     279/*
     280 * This function isn't portable across drivers, so has been left static
     281 * for now. Maybe it will be included in the API later if it becomes useful
     282 * and we come up with a suitable abstraction.
     283 */
     284static
     285bool trace_get_wireless_channel_flags(void *link,
    274286                libtrace_linktype_t linktype, uint16_t *flags)
    275287{
     
    299311}
    300312
    301 DLLEXPORT bool trace_get_wireless_fhss_hopset(void *link,
     313/* Not sure that this function is useful for now - who uses FHSS?
     314 * This might get exported in the future if it becomes useful
     315 */
     316static
     317bool trace_get_wireless_fhss_hopset(void *link,
    302318                libtrace_linktype_t linktype, uint8_t *hopset)
    303319{
     
    326342}
    327343
    328 DLLEXPORT bool trace_get_wireless_fhss_hoppattern(void *link,
     344/* Not sure that this function is useful for now - who uses FHSS?
     345 * This might get exported in the future if it becomes useful
     346 */
     347static
     348bool trace_get_wireless_fhss_hoppattern(void *link,
    329349                libtrace_linktype_t linktype, uint8_t *hoppattern)
    330350{
     
    445465}
    446466
    447 DLLEXPORT bool trace_get_wireless_lock_quality(void *link,
     467/* Not sure if this function is useful. As the radiotap documentation says,
     468 * there's no set metric for defining the quality of the Barker Code Lock.
     469 * Maybe it will be exported later if it becomes useful.
     470 */
     471static
     472bool trace_get_wireless_lock_quality(void *link,
    448473                libtrace_linktype_t linktype, uint16_t *quality)
    449474{
  • test/test-wireless.c

    rfaffcfc r5696294  
    6464        int result;
    6565        uint64_t tsft;
    66         uint16_t freq, cflags, tmp16;
     66        uint16_t freq, tmp16;
    6767        uint32_t fcs;
    6868        uint8_t flags, rate, sdbm, ndbm, sdb, antenna, tmp8;
     
    7070        uint32_t total_fcs, expected_fcs = 3012874435;
    7171        uint16_t total_freq, expected_freq = 24170;
    72         uint16_t total_cflags, expected_cflags = 1600;
    7372       
    7473        void *l;
     
    9392         * existing */
    9493        assert(trace_get_wireless_tsft(l,lt,&tsft));
    95         assert(trace_get_wireless_flags(l,lt,&flags));
    9694        assert(trace_get_wireless_rate(l,lt,&rate));
    9795        assert(trace_get_wireless_freq(l,lt,&freq));
    98         assert(trace_get_wireless_channel_flags(l,lt,&cflags));
    9996        assert(trace_get_wireless_signal_strength_dbm(l,lt,(int8_t *)&sdbm));
    10097        assert(trace_get_wireless_noise_strength_dbm(l,lt,(int8_t *)&ndbm));
     
    105102        /* Check that the fields that do not exist in this trace are
    106103         * reported as not existing */
    107         assert(!trace_get_wireless_fhss_hopset(l,lt,&tmp8));
    108         assert(!trace_get_wireless_fhss_hoppattern(l,lt,&tmp8));
    109104        assert(!trace_get_wireless_noise_strength_db(l,lt,&tmp8));
    110         assert(!trace_get_wireless_lock_quality(l,lt,&tmp16));
    111105        assert(!trace_get_wireless_tx_attenuation(l,lt,&tmp16));
    112106        assert(!trace_get_wireless_tx_attenuation_db(l,lt,&tmp16));
     
    119113        total_fcs = fcs;
    120114        total_freq = freq;
    121         total_cflags = cflags;
    122115       
    123116        while((result = trace_read_packet(trace, packet)) > 0) {
     
    126119                if(trace_get_wireless_freq(l,lt,&freq))
    127120                        total_freq += freq;
    128                 if(trace_get_wireless_channel_flags(l,lt,&cflags))
    129                         total_cflags += cflags;
    130121        }
    131122
    132123        assert(total_fcs == expected_fcs);
    133124        assert(total_freq == expected_freq);
    134         assert(total_cflags == expected_cflags);
    135125
    136126        trace_destroy_packet(packet);
     
    150140
    151141        assert(!trace_get_wireless_tsft(l,lt,&tsft));
    152         assert(!trace_get_wireless_flags(l,lt,&flags));
    153142        assert(!trace_get_wireless_rate(l,lt,&rate));
    154143        assert(!trace_get_wireless_freq(l,lt,&freq));
    155         assert(!trace_get_wireless_channel_flags(l,lt,&cflags));
    156144        assert(!trace_get_wireless_signal_strength_dbm(l,lt,(int8_t *)&sdbm));
    157145        assert(!trace_get_wireless_noise_strength_dbm(l,lt,(int8_t *)&ndbm));
     
    159147        assert(!trace_get_wireless_antenna(l,lt,&antenna));
    160148        assert(!trace_get_wireless_fcs(l,lt,&fcs));
    161         assert(!trace_get_wireless_fhss_hopset(l,lt,&tmp8));
    162         assert(!trace_get_wireless_fhss_hoppattern(l,lt,&tmp8));
    163149        assert(!trace_get_wireless_noise_strength_db(l,lt,&tmp8));
    164         assert(!trace_get_wireless_lock_quality(l,lt,&tmp16));
    165150        assert(!trace_get_wireless_tx_attenuation(l,lt,&tmp16));
    166151        assert(!trace_get_wireless_tx_attenuation_db(l,lt,&tmp16));
Note: See TracChangeset for help on using the changeset viewer.