Built and linked tins at
v3.4 (tried master as well) from github (with C++ 11 support enabled), had all the dependencies and it built/installed cleanly.
When trying to link my program, all the calls to tins work, except for the call to get the ssid from my beacon frames:
src/packet_sniffer.cpp:(.text+0x916): undefined reference to `Tins::Dot11ManagementFrame::ssid() const'
The body of my callback is almost exactly like the AP sniffer in the examples:
const Dot11Beacon &beacon = pdu->rfind_pdu<Dot11Beacon>();
if (!beacon.from_ds() && beacon.to_ds())
{
address_type addr = beacon.addr2();
set<address_type>::iterator it = ssids.find(addr);
if (it == ssids.end())
{
try
{
string ssid = beacon.ssid();
ssids.insert(addr);
sink.consume(ssid);
BOOST_LOG_TRIVIAL(info) << "Encountered new SSID -> " << ssid;
}
catch (runtime_error&)
{
// ignore non-corforming beacons
}
}
}
My library appears to define the symbol for that method:
root@39632e5a69ef:/# objdump -t /usr/local/lib/libtins.so | grep ssid
00000000000907f0 g F .text 000000000000000e _ZN4Tins20Dot11ManagementFrame4ssidERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
0000000000048db0 g F .text 0000000000000005 _ZNK4Tins6Crypto4WPA214SupplicantData4ssidB5cxx11Ev
0000000000047900 g F .text 00000000000000eb _ZN4Tins6Crypto9get_bssidERKNS_9Dot11DataE
0000000000091aa0 g F .text 00000000000000ac _ZNK4Tins20Dot11ManagementFrame4ssidB5cxx11Ev
No problems compiling, and I'm specifying the library linking (clang version 3.8.0-2ubuntu3):
clang++ -o sniffer_app src/main.o src/packet_sniffer.o -ltins <other libs elided>
Any ideas as to what i may be doing wrong?
It's really confusing, as beacon.addr2() is a method on the management frame as well, and it resolves fine. Otherwise, id be looking for configuration errors.
Thanks in advance,
Rich