"Fossies" - the Fresh Open Source Software Archive

Member "tcpflow-1.6.1/src/scan_wifiviz.cpp" (19 Feb 2021, 1422 Bytes) of package /linux/misc/tcpflow-1.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "scan_wifiviz.cpp" see the Fossies "Dox" file reference documentation.

    1 /**
    2  * scan_wifiviz:
    3  * 
    4  * Use the wifipcap and do some basic visualizations
    5  */
    6 
    7 #include "config.h"
    8 #include <iostream>
    9 #include <sys/types.h>
   10 
   11 #include "bulk_extractor_i.h"
   12 #include "datalink_wifi.h"
   13 
   14 extern "C"
   15 void  scan_wifiviz(const class scanner_params &sp,const recursion_control_block &rcb)
   16 {
   17     if(sp.sp_version!=scanner_params::CURRENT_SP_VERSION){
   18     std::cout << "scan_timehistogram requires sp version "
   19           << scanner_params::CURRENT_SP_VERSION << "; "
   20           << "got version " << sp.sp_version << "\n";
   21     exit(1);
   22     }
   23 
   24     if(sp.phase==scanner_params::PHASE_STARTUP){
   25     sp.info->name  = "wifiviz";
   26     sp.info->flags = scanner_info::SCANNER_DISABLED;
   27     sp.info->author= "Simson Garfinkel";
   28     sp.info->packet_user = 0;
   29         sp.info->description = "Performs wifi isualization";
   30         sp.info->get_config("check_fcs",&TFCB::theTFCB.opt_check_fcs,"Require valid Frame Check Sum (FCS)");
   31     }
   32     if(sp.phase==scanner_params::PHASE_SHUTDOWN){
   33         if(sp.sxml){
   34             (*sp.sxml) << "<ssids>\n";
   35             for(TFCB::mac_ssid_map_t::const_iterator it=TFCB::theTFCB.mac_to_ssid.begin();
   36                 it!=TFCB::theTFCB.mac_to_ssid.end();it++){
   37                 (*sp.sxml) << "  <ssid mac='" << (*it).first.mac <<"' ssid='" << dfxml_writer::xmlescape((*it).first.ssid) << "' count='" <<
   38                     (*it).second << "'/>\n";
   39             }
   40             (*sp.sxml) << "</ssids>\n";
   41         }
   42     }
   43 }
   44