summaryrefslogtreecommitdiff
path: root/examples/opienet/miniwellenreiter
authormickeyl <mickeyl>2005-05-19 12:03:37 (UTC)
committer mickeyl <mickeyl>2005-05-19 12:03:37 (UTC)
commit743204c7f71fe785a1876d95c5d880cfdff44592 (patch) (unidiff)
tree62d207b30da8b3c4589e2a9b9a3fba640aa4f421 /examples/opienet/miniwellenreiter
parent50cc0698e54f1f69591cc89be34ffcb7e309380a (diff)
downloadopie-743204c7f71fe785a1876d95c5d880cfdff44592.zip
opie-743204c7f71fe785a1876d95c5d880cfdff44592.tar.gz
opie-743204c7f71fe785a1876d95c5d880cfdff44592.tar.bz2
print out OPacketCapturer version
Diffstat (limited to 'examples/opienet/miniwellenreiter') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opienet/miniwellenreiter/miniwellenreiter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index ba9d2ca..284b35a 100644
--- a/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -49,27 +49,27 @@ public:
49 { 49 {
50 if ( it.current()->isWireless() ) 50 if ( it.current()->isWireless() )
51 { 51 {
52 printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), 52 printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(),
53 (const char*) it.current()->macAddress().toString(), 53 (const char*) it.current()->macAddress().toString(),
54 (const char*) it.current()->ipV4Address().toString() ); 54 (const char*) it.current()->ipV4Address().toString() );
55 } 55 }
56 ++it; 56 ++it;
57 } 57 }
58 exit( -1 ); 58 exit( -1 );
59 } 59 }
60 60
61 printf( "*******************************************************************\n" ); 61 printf( "************************************************************************\n" );
62 printf( "* Wellenreiter mini edition 1.0.0 (C) 2003 Michael 'Mickey' Lauer *\n" ); 62 printf( "* Wellenreiter mini edition 1.0.0 (C) 2003-2005 Michael 'Mickey' Lauer *\n" );
63 printf( "*******************************************************************\n" ); 63 printf( "************************************************************************\n" );
64 printf( "\n\n" ); 64 printf( "\n\n" );
65 65
66 QString interface( argv[1] ); 66 QString interface( argv[1] );
67 QString driver( argv[2] ); 67 QString driver( argv[2] );
68 68
69 printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); 69 printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver );
70 70
71 // sanity checks before downcasting 71 // sanity checks before downcasting
72 ONetworkInterface* iface = net->interface( interface ); 72 ONetworkInterface* iface = net->interface( interface );
73 if ( !iface ) 73 if ( !iface )
74 { 74 {
75 printf( "Interface '%s' doesn't exist. Exiting.\n", (const char*) interface ); 75 printf( "Interface '%s' doesn't exist. Exiting.\n", (const char*) interface );
@@ -115,24 +115,25 @@ public:
115 else 115 else
116 { 116 {
117 printf( "Unknown driver. Exiting\n" ); 117 printf( "Unknown driver. Exiting\n" );
118 exit( -1 ); 118 exit( -1 );
119 } 119 }
120 120
121 // enable monitoring mode 121 // enable monitoring mode
122 printf( "Enabling monitor mode...\n" ); 122 printf( "Enabling monitor mode...\n" );
123 wiface->setMode( "monitor" ); 123 wiface->setMode( "monitor" );
124 124
125 // open a packet capturer 125 // open a packet capturer
126 cap = new OPacketCapturer(); 126 cap = new OPacketCapturer();
127 printf( "OPacketCapturer using libpcap %s", (const char*) cap->version() );
127 cap->open( interface ); 128 cap->open( interface );
128 if ( !cap->isOpen() ) 129 if ( !cap->isOpen() )
129 { 130 {
130 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); 131 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) );
131 exit( -1 ); 132 exit( -1 );
132 } 133 }
133 134
134 // set capturer to non-blocking mode 135 // set capturer to non-blocking mode
135 cap->setBlocking( false ); 136 cap->setBlocking( false );
136 137
137 // start channel hopper 138 // start channel hopper
138 //wiface->setChannelHopping( 1000 ); 139 //wiface->setChannelHopping( 1000 );