main.cpp

来自「AirFart监听 802.11流量」· C++ 代码 · 共 72 行

CPP
72
字号
/*   This file is part of AirFart.   AirFart is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   AirFart is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with AirFart; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include "main.h"int main( int argc, char** argv ){	Stats *stats = new Stats();	g_thread_init(NULL);	gdk_threads_init();		// This initializes the GTK stuff and removes any	// any GTK parameters from argv so getopts() doesn't	// barf because of unknown options	gtk_init( &argc, &argv);	// This parses the command line options for airfart		getopts( argc, argv);	// make sure they have root permissions	if( getuid() != 0 )	{		printf( "You aren't root. You must be root to run Airfart!\n" );		return -1;	}	printf( "Starting Airfart...\n" );	// Decide to not use the GUI if commandline parameter (--nogui) was passed		if ( ! use_gui )	{		stats->unset_use_gui();  // Tell the stats object not to send messages to GUI	}	else	{		gdk_threads_enter();		gtk_timeout_add( 500, (GtkFunction) deactivate, NULL);		gdk_threads_leave();		#ifdef DEBUG_GUI			gdk_threads_enter();			gtk_timeout_add( 1500, (GtkFunction) test_gui, NULL);			gdk_threads_leave();		#else			frame_sniffer *sniffer = new frame_sniffer();			sniffer->set_stats_collector( stats );			printf( "Launching sniffer thread...\n" );			sniffer->start_sniffing();		#endif				start_gui();	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?