Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 11cdaef..e983b4d 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -17,43 +17,50 @@ | |||
17 | 17 | ||
18 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> |
19 | 19 | ||
20 | // Standard | 20 | // Standard |
21 | 21 | ||
22 | #include <unistd.h> | 22 | #include <unistd.h> |
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | 24 | ||
25 | // Local | 25 | // Local |
26 | 26 | ||
27 | #include "wellenreiter.h" | 27 | #include "wellenreiter.h" |
28 | #include "scanlistitem.h" | 28 | #include "scanlistitem.h" |
29 | #include "logwindow.h" | ||
30 | #include "hexwindow.h" | ||
29 | 31 | ||
30 | #include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! | 32 | #include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! |
31 | #include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! | 33 | #include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! |
32 | #include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! | 34 | #include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! |
33 | 35 | ||
34 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 36 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) |
35 | : WellenreiterBase( parent, name, fl ) | 37 | : WellenreiterBase( parent, name, fl ) |
36 | { | 38 | { |
37 | 39 | ||
40 | logwindow->log( "(i) Wellenreiter has been started." ); | ||
41 | |||
38 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); | 42 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); |
39 | netview->setColumnWidthMode( 1, QListView::Manual ); | 43 | netview->setColumnWidthMode( 1, QListView::Manual ); |
40 | 44 | ||
41 | // | 45 | // |
42 | // setup socket for daemon communication and start poller | 46 | // setup socket for daemon communication and start poller |
43 | // | 47 | // |
44 | 48 | ||
45 | daemon_fd = commsock( GUIADDR, GUIPORT ); | 49 | daemon_fd = commsock( GUIADDR, GUIPORT ); |
46 | if ( daemon_fd == -1 ) | 50 | if ( daemon_fd == -1 ) |
51 | { | ||
52 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); | ||
47 | qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); | 53 | qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); |
54 | } | ||
48 | else | 55 | else |
49 | startTimer( 700 ); | 56 | startTimer( 700 ); |
50 | 57 | ||
51 | } | 58 | } |
52 | 59 | ||
53 | Wellenreiter::~Wellenreiter() | 60 | Wellenreiter::~Wellenreiter() |
54 | { | 61 | { |
55 | // no need to delete child widgets, Qt does it all for us | 62 | // no need to delete child widgets, Qt does it all for us |
56 | } | 63 | } |
57 | 64 | ||
58 | void Wellenreiter::handleMessage() | 65 | void Wellenreiter::handleMessage() |
59 | { | 66 | { |
@@ -68,28 +75,30 @@ void Wellenreiter::handleMessage() | |||
68 | 75 | ||
69 | /* | 76 | /* |
70 | typedef struct { | 77 | typedef struct { |
71 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc | 78 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc |
72 | int ssid_len; Length of SSID | 79 | int ssid_len; Length of SSID |
73 | int channel; Channel | 80 | int channel; Channel |
74 | int wep; 1 = WEP enabled ; 0 = disabled | 81 | int wep; 1 = WEP enabled ; 0 = disabled |
75 | char mac[64]; MAC address of Accesspoint | 82 | char mac[64]; MAC address of Accesspoint |
76 | char bssid[128]; BSSID of Accesspoint | 83 | char bssid[128]; BSSID of Accesspoint |
77 | } wl_network_t; | 84 | } wl_network_t; |
78 | */ | 85 | */ |
79 | 86 | ||
80 | qDebug( "Sniffer sent: '%s'", buffer ); | 87 | qDebug( "Sniffer sent: '%s'", (const char*) &buffer ); |
88 | hexwindow->log( (const char*) &buffer ); | ||
81 | 89 | ||
82 | if ( result == NETFOUND ) /* new network found */ | 90 | if ( result == NETFOUND ) /* new network found */ |
83 | { | 91 | { |
92 | logwindow->log( "(i) found new network" ); | ||
84 | qDebug( "Sniffer said: new network found." ); | 93 | qDebug( "Sniffer said: new network found." ); |
85 | wl_network_t n; | 94 | wl_network_t n; |
86 | get_network_found( &n, (char*) &buffer ); | 95 | get_network_found( &n, (char*) &buffer ); |
87 | 96 | ||
88 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); | 97 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); |
89 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); | 98 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); |
90 | 99 | ||
91 | //n.bssid[n.ssid_len] = "\0"; | 100 | //n.bssid[n.ssid_len] = "\0"; |
92 | 101 | ||
93 | QString type; | 102 | QString type; |
94 | 103 | ||
95 | if ( n.net_type == 1 ) | 104 | if ( n.net_type == 1 ) |