Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 41ffdcc..d1dd73a 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -101,27 +101,24 @@ Wellenreiter::~Wellenreiter() | |||
101 | 101 | ||
102 | delete manufacturerdb; | 102 | delete manufacturerdb; |
103 | delete pcap; | 103 | delete pcap; |
104 | } | 104 | } |
105 | 105 | ||
106 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 106 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
107 | { | 107 | { |
108 | configwindow = cw; | 108 | configwindow = cw; |
109 | } | 109 | } |
110 | 110 | ||
111 | void Wellenreiter::receivePacket(OPacket* p) | 111 | void Wellenreiter::receivePacket(OPacket* p) |
112 | { | 112 | { |
113 | logwindow->log( "(d) Received data from daemon" ); | ||
114 | //TODO | ||
115 | |||
116 | // check if we received a beacon frame | 113 | // check if we received a beacon frame |
117 | // static_cast is justified here | 114 | // static_cast is justified here |
118 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); | 115 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); |
119 | if ( !beacon ) return; | 116 | if ( !beacon ) return; |
120 | QString type; | 117 | QString type; |
121 | 118 | ||
122 | //FIXME: Can stations in ESS mode can be distinguished from APs? | 119 | //FIXME: Can stations in ESS mode can be distinguished from APs? |
123 | //FIXME: Apparently yes, but not by listening to beacons, because | 120 | //FIXME: Apparently yes, but not by listening to beacons, because |
124 | //FIXME: they simply don't send beacons in infrastructure mode. | 121 | //FIXME: they simply don't send beacons in infrastructure mode. |
125 | //FIXME: so we also have to listen to data packets | 122 | //FIXME: so we also have to listen to data packets |
126 | 123 | ||
127 | if ( beacon->canIBSS() ) | 124 | if ( beacon->canIBSS() ) |
@@ -154,37 +151,28 @@ void Wellenreiter::startStopClicked() | |||
154 | #endif | 151 | #endif |
155 | 152 | ||
156 | // get interface name from config window | 153 | // get interface name from config window |
157 | const QString& interface = configwindow->interfaceName->currentText(); | 154 | const QString& interface = configwindow->interfaceName->currentText(); |
158 | ONetwork* net = ONetwork::instance(); | 155 | ONetwork* net = ONetwork::instance(); |
159 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 156 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
160 | 157 | ||
161 | // switch off monitor mode | 158 | // switch off monitor mode |
162 | iface->setMonitorMode( false ); | 159 | iface->setMonitorMode( false ); |
163 | // switch off promisc flag | 160 | // switch off promisc flag |
164 | iface->setPromiscuousMode( false ); | 161 | iface->setPromiscuousMode( false ); |
165 | 162 | ||
166 | //TODO: Display "please wait..." (use owait?) | 163 | system( "cardctl reset; sleep 1; dhclient; udhcpc" ); //FIXME: Use OProcess |
167 | |||
168 | /* | ||
169 | |||
170 | QString cmdline; | ||
171 | cmdline.sprintf( "ifdown %s; sleep 1; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); | ||
172 | system( cmdline ); //FIXME: Use OProcess | ||
173 | |||
174 | */ | ||
175 | 164 | ||
176 | // message the user | 165 | // message the user |
177 | 166 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | |
178 | //QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | ||
179 | } | 167 | } |
180 | 168 | ||
181 | else | 169 | else |
182 | { | 170 | { |
183 | // get configuration from config window | 171 | // get configuration from config window |
184 | 172 | ||
185 | const QString& interface = configwindow->interfaceName->currentText(); | 173 | const QString& interface = configwindow->interfaceName->currentText(); |
186 | const int cardtype = configwindow->daemonDeviceType(); | 174 | const int cardtype = configwindow->daemonDeviceType(); |
187 | const int interval = configwindow->daemonHopInterval(); | 175 | const int interval = configwindow->daemonHopInterval(); |
188 | 176 | ||
189 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 177 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
190 | { | 178 | { |