Kismet Wireless

Kismet Forums

 

Posted by:rogerB
Subject:what replaced 'filter_tracker_bssid.nuke();'
Date:19:28:45 23/07/2007

<<--snip-->>
> > That '.nuke' service of the STL 'map' seems to have disappeared. What is the current mechanism to terminate and cleanup from BSSID filtering?
>
> I'm confused about what you're asking - I've never seen 'nuke' used w/ stl, and that's not strictly a STL object, either, it's a combo made of several STL items.
>
> -m

That could be a corruption of my source archive. I mention STL beause it would appear that including <map> :-> "/usr/include/c++/3.3/map" :-> "#include <bits/stl_map.h>"

Anyway; in kismet_server.cc (line 999) I added the following to filter a single BSSID after locking on that channel:
---------------
fprintf(stderr, "%s\n", status);


string rpt_bssid = ""; // RPT
if (cmdvec.size() == 4) { // RPT bssid included
rpt_bssid = cmdvec[3].c_str(); // RPT get string form
if (rpt_bssid.length() >6){ // 0.0.0.0 at least
lock_linked_filter =1; // My note that filter is linked to lock
string filter_bit = "BSSID("; //Need to find the BSSID storage
filter_bit += rpt_bssid + ") ";
filter_tracker = 1;
ConfigFile::ParseFilterLine(filter_bit,
&filter_tracker_bssid,
&filter_tracker_source,
&filter_tracker_dest,
&filter_tracker_bssid_invert,
&filter_tracker_source_invert,
&filter_tracker_dest_invert);
}
}

------------------
So, below at about 1030 or so I added code to remove the filter:

------------------
snprintf(status, 1024, "Allowing source '%s' to hop channels",
meta->name.c_str());
if (!silent || NetWriteStatus(status) == 0)
fprintf(stderr, "%s\n", status);

// RPT following lines need to clear out tracking
if (lock_linked_filter >0) {
out_error += "BSSID filtering removed";
tcps->SendToClient(cc->client_fd, error_ref, (void *) &out_error);
filter_tracker_bssid.nuke();
filter_tracker = 0;
}
--------------------
In this block, I want to turn off the BSSID filter. My client may lock and unlock may times on different channels and BSSIDS. I don't want old filter values in the map.

Maybe I modified 'macmap' before. WoW, I just went back in the archive to look at macaddr.h; and I find that I added another function 'nuke()'. I haven't done C++ in 15 years, it gets fuzzy. I will post that change and see how things compile....

Just FYI macaddr.h:484 I added:
-----

// RPT
void nuke() {
singleton_map.erase (singleton_map.begin(), singleton_map.end());
vec_offset_map.erase(vec_offset_map.begin(), vec_offset_map.end());
mask_vec.erase (mask_vec.begin(), mask_vec.end());
return ;
}

-----

Would you recommend a better way that I do this?


I messaged you about added feature back in 2005, but you were just beginning newcore and it may have drifted past.


R


Reply to this message