Changeset 1028
- Timestamp:
- 09/29/06 14:35:03 (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
lib/libtrace.h.in (modified) (4 diffs)
-
lib/link_wireless.c (modified) (5 diffs)
-
test/test-wireless.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/libtrace.h.in
r1026 r1028 1413 1413 libtrace_linktype_t linktype, uint64_t *tsft); 1414 1414 1415 /** Get the wireless flags1416 * @param link the wireless header1417 * @param linktype the linktype of the wireless header passed in1418 * @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 1424 1415 /** Get the wireless rate 1425 1416 * @param link the wireless header … … 1441 1432 libtrace_linktype_t linktype, uint16_t *freq); 1442 1433 1443 /** Get the wireless channel flags1444 * @param link the wireless header1445 * @param linktype the linktype of the wireless header passed in1446 * @param[out] flags the channel flags1447 * @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 Set1453 * @param link the wireless header1454 * @param linktype the linktype of the wireless header passed in1455 * @param[out] hopset the fhss hop set1456 * @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 Pattern1462 * @param link the wireless header1463 * @param linktype the linktype of the wireless header passed in1464 * @param[out] hoppattern the fhss hoppattern1465 * @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 1470 1434 /** Get the wireless signal strength in dBm 1471 1435 * @param link the wireless header … … 1508 1472 libtrace_linktype_t linktype, uint8_t *strength); 1509 1473 1510 /** Get the wireless Barker code lock quality1511 * @param link the wireless header1512 * @param linktype the linktype of the wireless header passed in1513 * @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 1519 1474 /** Get the wireless transmit attenuation 1520 1475 * @param link the wireless header … … 1537 1492 libtrace_linktype_t linktype, uint16_t *attenuation); 1538 1493 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. 1544 1497 * @return true if the field was available, false if not. 1545 1498 */ 1546 DLLEXPORT bool trace_get_wireless_tx_power_dbm(void *link, 1547 libtrace_linktype_tlinktype, int8_t *txpower);1499 DLLEXPORT bool trace_get_wireless_tx_power_dbm(void *link, libtrace_linktype_t 1500 linktype, int8_t *txpower); 1548 1501 1549 1502 /** Get the wireless antenna -
trunk/lib/link_wireless.c
r1015 r1028 194 194 } 195 195 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 */ 201 static 202 bool trace_get_wireless_flags(void *link, 197 203 libtrace_linktype_t linktype, uint8_t *flags) 198 204 { … … 271 277 } 272 278 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 */ 284 static 285 bool trace_get_wireless_channel_flags(void *link, 274 286 libtrace_linktype_t linktype, uint16_t *flags) 275 287 { … … 299 311 } 300 312 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 */ 316 static 317 bool trace_get_wireless_fhss_hopset(void *link, 302 318 libtrace_linktype_t linktype, uint8_t *hopset) 303 319 { … … 326 342 } 327 343 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 */ 347 static 348 bool trace_get_wireless_fhss_hoppattern(void *link, 329 349 libtrace_linktype_t linktype, uint8_t *hoppattern) 330 350 { … … 445 465 } 446 466 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 */ 471 static 472 bool trace_get_wireless_lock_quality(void *link, 448 473 libtrace_linktype_t linktype, uint16_t *quality) 449 474 { -
trunk/test/test-wireless.c
r987 r1028 64 64 int result; 65 65 uint64_t tsft; 66 uint16_t freq, cflags,tmp16;66 uint16_t freq, tmp16; 67 67 uint32_t fcs; 68 68 uint8_t flags, rate, sdbm, ndbm, sdb, antenna, tmp8; … … 70 70 uint32_t total_fcs, expected_fcs = 3012874435; 71 71 uint16_t total_freq, expected_freq = 24170; 72 uint16_t total_cflags, expected_cflags = 1600;73 72 74 73 void *l; … … 93 92 * existing */ 94 93 assert(trace_get_wireless_tsft(l,lt,&tsft)); 95 assert(trace_get_wireless_flags(l,lt,&flags));96 94 assert(trace_get_wireless_rate(l,lt,&rate)); 97 95 assert(trace_get_wireless_freq(l,lt,&freq)); 98 assert(trace_get_wireless_channel_flags(l,lt,&cflags));99 96 assert(trace_get_wireless_signal_strength_dbm(l,lt,(int8_t *)&sdbm)); 100 97 assert(trace_get_wireless_noise_strength_dbm(l,lt,(int8_t *)&ndbm)); … … 105 102 /* Check that the fields that do not exist in this trace are 106 103 * reported as not existing */ 107 assert(!trace_get_wireless_fhss_hopset(l,lt,&tmp8));108 assert(!trace_get_wireless_fhss_hoppattern(l,lt,&tmp8));109 104 assert(!trace_get_wireless_noise_strength_db(l,lt,&tmp8)); 110 assert(!trace_get_wireless_lock_quality(l,lt,&tmp16));111 105 assert(!trace_get_wireless_tx_attenuation(l,lt,&tmp16)); 112 106 assert(!trace_get_wireless_tx_attenuation_db(l,lt,&tmp16)); … … 119 113 total_fcs = fcs; 120 114 total_freq = freq; 121 total_cflags = cflags;122 115 123 116 while((result = trace_read_packet(trace, packet)) > 0) { … … 126 119 if(trace_get_wireless_freq(l,lt,&freq)) 127 120 total_freq += freq; 128 if(trace_get_wireless_channel_flags(l,lt,&cflags))129 total_cflags += cflags;130 121 } 131 122 132 123 assert(total_fcs == expected_fcs); 133 124 assert(total_freq == expected_freq); 134 assert(total_cflags == expected_cflags);135 125 136 126 trace_destroy_packet(packet); … … 150 140 151 141 assert(!trace_get_wireless_tsft(l,lt,&tsft)); 152 assert(!trace_get_wireless_flags(l,lt,&flags));153 142 assert(!trace_get_wireless_rate(l,lt,&rate)); 154 143 assert(!trace_get_wireless_freq(l,lt,&freq)); 155 assert(!trace_get_wireless_channel_flags(l,lt,&cflags));156 144 assert(!trace_get_wireless_signal_strength_dbm(l,lt,(int8_t *)&sdbm)); 157 145 assert(!trace_get_wireless_noise_strength_dbm(l,lt,(int8_t *)&ndbm)); … … 159 147 assert(!trace_get_wireless_antenna(l,lt,&antenna)); 160 148 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));163 149 assert(!trace_get_wireless_noise_strength_db(l,lt,&tmp8)); 164 assert(!trace_get_wireless_lock_quality(l,lt,&tmp16));165 150 assert(!trace_get_wireless_tx_attenuation(l,lt,&tmp16)); 166 151 assert(!trace_get_wireless_tx_attenuation_db(l,lt,&tmp16));
Note: See TracChangeset
for help on using the changeset viewer.
