Some times plugin needs to let user associate some of its own config with a specific source. To this end, it will be much easier to let user specify said source by name. Something like: ncsource=wlan0:name=src1 my_plugin_item=src_name=src1,foo=bar Function below lets plugin find a source by name. Signed off by: Ilya A. Volynets-Evenbakh Other Kismet patches: http://www.total-knowledge.com/progs/kismet Index: packetsourcetracker.cc =================================================================== --- packetsourcetracker.cc (revision 2956) +++ packetsourcetracker.cc (working copy) @@ -2337,6 +2337,15 @@ return NULL; } +pst_packetsource *Packetsourcetracker::FindLivePacketSourceName(string name) { + for (unsigned int x = 0; x < packetsource_vec.size(); x++) { + if (packetsource_vec[x]->strong_source && packetsource_vec[x]->strong_source->FetchName() == name) + return packetsource_vec[x]; + } + + return NULL; +} + KisPacketSource *Packetsourcetracker::FindKisPacketSourceUUID(uuid in_uuid) { pst_packetsource *pst = FindLivePacketSourceUUID(in_uuid); Index: packetsourcetracker.h =================================================================== --- packetsourcetracker.h (revision 2956) +++ packetsourcetracker.h (working copy) @@ -223,6 +223,9 @@ pst_packetsource *FindLivePacketSourceUUID(uuid in_uuid); KisPacketSource *FindKisPacketSourceUUID(uuid in_uuid); + // Find source by name + pst_packetsource *FindLivePacketSourceName(string name); + // Actually load the configuration int LoadConfiguration();