[kismac] [binaervarianz] r100 - in KisMACng: . Resources/Nibs/English.lproj/MainMenu.nib Sources/Controller Sources/Core Sources/Preferences/PreferencePanes Sources/WaveDrivers Subprojects/KisMAC Installer Subprojects/KisMAC Installer/English.lproj/MainMenu.nib

  • From: svn@xxxxxxxxxxxxxxxx
  • To: kismac@xxxxxxxxxxxxx
  • Date: Tue, 14 Mar 2006 16:54:11 +0100

Author: gkruse
Date: 2006-03-14 16:54:10 +0100 (Tue, 14 Mar 2006)
New Revision: 100

Modified:
   KisMACng/CHANGES
   KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/info.nib
   KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/keyedobjects.nib
   KisMACng/Sources/Controller/GrowlController.h
   KisMACng/Sources/Controller/GrowlController.m
   KisMACng/Sources/Controller/InfoController.mm
   KisMACng/Sources/Controller/ScanController.h
   KisMACng/Sources/Controller/ScanController.m
   KisMACng/Sources/Core/WaveClient.h
   KisMACng/Sources/Core/WaveClient.m
   KisMACng/Sources/Core/WaveHelper.m
   KisMACng/Sources/Core/WaveNet.h
   KisMACng/Sources/Core/WaveNet.mm
   KisMACng/Sources/Core/WavePacket.mm
   KisMACng/Sources/Preferences/PreferencePanes/PrefsDriver.m
   KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.h
   KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m
   KisMACng/Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/classes.nib
   KisMACng/Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/info.nib
   KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/keyedobjects.nib
   KisMACng/Subprojects/KisMAC Installer/InstallController.h
   KisMACng/Subprojects/KisMAC Installer/InstallController.m
Log:
This is a big commit, a present for R100.  
       -Added Client IP Address detection.  I need to think about ways to 
detect the ip of the ap if possible.
              --Fixed bug in existing sourceIPAsString() where we were adding 
sizeof(WLFrame) to the value instead of to the pointer.
       -Fixed # 29 columns are no longer selected when resizing.
       -Moved the search catagory menu into the Search cell where it belongs
       -Better matching to vendors.db  (some macs in vendors.db are in the form 
xx:xx and we were not checking against these)
       -AE Passive mode forever now reads setting directly from the .kext.  
This should make sure our settings always reflect what is really set.
       -Add ae passive forever setting to installer for both install and remove.
       -Add Licence Info to growl controler files
       -Maybe other stuff I can't remember


M    Sources/WaveDrivers/WaveDriverAirportExtreme.h
M    Sources/WaveDrivers/WaveDriverAirportExtreme.m
M    Sources/Preferences/PreferencePanes/PrefsDriver.m
M    Sources/Controller/ScanController.m
M    Sources/Controller/GrowlController.h
M    Sources/Controller/InfoController.mm
M    Sources/Controller/GrowlController.m
M    Sources/Controller/ScanController.h
M    Sources/Core/WaveNet.mm
M    Sources/Core/WaveClient.h
M    Sources/Core/WaveClient.m
M    Sources/Core/WaveHelper.m
M    Sources/Core/WaveNet.h
M    Sources/Core/WavePacket.mm
M    Subprojects/KisMAC Installer/InstallController.h
M    Subprojects/KisMAC Installer/InstallController.m
M    Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/keyedobjects.nib
M    Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/info.nib
M    Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/classes.nib
M    CHANGES
M    Resources/Nibs/English.lproj/MainMenu.nib/info.nib
M    Resources/Nibs/English.lproj/MainMenu.nib/keyedobjects.nib


Modified: KisMACng/CHANGES
===================================================================
--- KisMACng/CHANGES    2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/CHANGES    2006-03-14 15:54:10 UTC (rev 100)
@@ -1,3 +1,16 @@
+R100:  This is a big commit, a present for R100.  
+       -Added Client IP Address detection.  I need to think about ways to 
detect the ip of the ap if possible.
+              --Fixed bug in existing sourceIPAsString() where we were adding 
sizeof(WLFrame) to the value instead of to the pointer.
+       -Fixed # 29 columns are no longer selected when resizing.
+       -Moved the search catagory menu into the Search cell where it belongs
+       -Better matching to vendors.db  (some macs in vendors.db are in the 
form xx:xx and we were not checking against these)
+       -AE Passive mode forever now reads setting directly from the .kext.  
This should make sure our settings always reflect what is really set.
+       -Add ae passive forever setting to installer for both install and 
remove.
+       -Add Licence Info to growl controler files
+       -Maybe other stuff I can't remember
+
+R99: Default Map
+
 R98: ASCII values below 32 are not valid in XML.  Fixes Google Earth Export.  
Also use UTF-8 cString since that is what our encoding claims to be.
 
 R97: Add option to enable Airport Extreme Monitor Mode forever

Modified: KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/info.nib
===================================================================
--- KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/info.nib 2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/info.nib 2006-03-14 
15:54:10 UTC (rev 100)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>446 -10 612 460 0 0 1024 746 </string>
+       <string>655 131 612 460 0 0 1280 832 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1199</key>
@@ -13,11 +13,11 @@
                <key>1201</key>
                <string>333 265 731 429 0 0 1024 746 </string>
                <key>1202</key>
-               <string>128 252 767 484 0 0 1024 746 </string>
+               <string>256 314 767 484 0 0 1280 832 </string>
                <key>1290</key>
                <string>352 338 576 461 0 0 1280 832 </string>
                <key>1446</key>
-               <string>61 483 185 175 0 0 1024 746 </string>
+               <string>655 569 185 263 0 0 1280 832 </string>
                <key>29</key>
                <string>585 717 530 44 0 0 1280 832 </string>
                <key>501</key>
@@ -35,6 +35,7 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>29</integer>
+               <integer>1446</integer>
                <integer>21</integer>
        </array>
        <key>IBSystem Version</key>

Modified: KisMACng/Resources/Nibs/English.lproj/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: KisMACng/Sources/Controller/GrowlController.h
===================================================================
--- KisMACng/Sources/Controller/GrowlController.h       2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Sources/Controller/GrowlController.h       2006-03-14 15:54:10 UTC 
(rev 100)
@@ -1,4 +1,26 @@
-/* GrowlController */
+/*
+ File:                 GrowlController.h
+ Program:              KisMAC
+ Author:               themacuser at gmail dot com
+ mick@xxxxxxxxxxxxxxxx
+ Description:  KisMAC is a wireless stumbler for MacOS X.
+ 
+ This file is part of KisMAC.
+ 
+ KisMAC 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.
+ 
+ KisMAC 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 KisMAC; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 #import <Cocoa/Cocoa.h>
 #import <Growl/Growl.h>

Modified: KisMACng/Sources/Controller/GrowlController.m
===================================================================
--- KisMACng/Sources/Controller/GrowlController.m       2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Sources/Controller/GrowlController.m       2006-03-14 15:54:10 UTC 
(rev 100)
@@ -1,3 +1,27 @@
+/*
+ File:                 GrowlController.m
+ Program:              KisMAC
+ Author:               themacuser at gmail dot com
+ mick@xxxxxxxxxxxxxxxx
+ Description:  KisMAC is a wireless stumbler for MacOS X.
+ 
+ This file is part of KisMAC.
+ 
+ KisMAC 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.
+ 
+ KisMAC 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 KisMAC; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #import "GrowlController.h"
 
 @implementation GrowlController

Modified: KisMACng/Sources/Controller/InfoController.mm
===================================================================
--- KisMACng/Sources/Controller/InfoController.mm       2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Sources/Controller/InfoController.mm       2006-03-14 15:54:10 UTC 
(rev 100)
@@ -41,6 +41,7 @@
     indexAvgSignal,
     indexType,
     indexEncryption,
+//    indexIPAddress,
     indexEmptyLine3,
     indexPackets,
     indexDataPackets,
@@ -178,6 +179,13 @@
                     }
                 }
                  return @"";
+/*  FOR AP IP Detect -- Later
+            case indexIPAddress:
+                if ([_n getIP]) {
+                    NSLog(@"Has IP");
+                    return (col) ? NSLocalizedString(@"IP Address", "table 
description") : [NSString stringWithFormat:@"%@", [_n getIP]];
+                }
+*/  
             case indexEmptyLine3:
                  return @"";
             case indexPackets:
@@ -213,6 +221,7 @@
         else if ([[aTableColumn identifier] isEqualToString:@"signal"]) return 
[NSString stringWithFormat:@"%i", [lWCl curSignal]];
         else if ([[aTableColumn identifier] isEqualToString:@"sent"]) return 
[lWCl sent];
         else if ([[aTableColumn identifier] isEqualToString:@"recieved"]) 
return [lWCl recieved];
+        else if ([[aTableColumn identifier] isEqualToString:@"ipa"]) return 
[lWCl getIPAddress];
         else return @"unknown column";
     } else if([aTableView isEqualTo:aShortTable]) {
         if ([[aTableColumn identifier] isEqualToString:@"key"]) col=1;
@@ -264,7 +273,7 @@
    return 0;
 }
 
-- (void)tableView:(NSTableView*)tableView 
mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn {
+- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn 
*)tableColumn {
     NSString *ident = [tableColumn identifier];
     
     if(![tableView isEqualTo:aClientTable]) return;

Modified: KisMACng/Sources/Controller/ScanController.h
===================================================================
--- KisMACng/Sources/Controller/ScanController.h        2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Sources/Controller/ScanController.h        2006-03-14 15:54:10 UTC 
(rev 100)
@@ -150,7 +150,7 @@
 - (IBAction)showNetHierarch:(id)sender;
 
 - (IBAction)changeSearchValue:(id)sender;
-- (IBAction)changeSearchType:(id)sender; 
+- (IBAction)changeSearchType:(id)sender;
 - (void)checkFilter:(id)sender;
 @end
 

Modified: KisMACng/Sources/Controller/ScanController.m
===================================================================
--- KisMACng/Sources/Controller/ScanController.m        2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Sources/Controller/ScanController.m        2006-03-14 15:54:10 UTC 
(rev 100)
@@ -271,7 +271,7 @@
     else [self selectNet:[_container netAtIndex:[_networkTable selectedRow]]];
 }
 
-- (void)tableView:(NSTableView*)tableView 
mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn {
+- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn 
*)tableColumn {
     NSString *ident = [tableColumn identifier];
     
     if(![tableView isEqualTo:_networkTable]) return;
@@ -442,7 +442,14 @@
 }
 
 - (IBAction)changeSearchType:(id)sender {
-       [_container setFilterType:[sender titleOfSelectedItem]];
+    int ndx;
+       [_container setFilterType:[sender title]];
+    NSMenu * searchMenu = [sender menu];
+    for (ndx=0; ndx < [searchMenu numberOfItems]; ndx++) {
+        [[searchMenu itemAtIndex:ndx] setState:0];
+    }
+    //[searchMenu release];
+    [sender setState:1];
        [_networkTable reloadData];
        [(NSView*)_mappingView setNeedsDisplay:YES];
        [self tableViewSelectionDidChange:nil];

Modified: KisMACng/Sources/Core/WaveClient.h
===================================================================
--- KisMACng/Sources/Core/WaveClient.h  2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WaveClient.h  2006-03-14 15:54:10 UTC (rev 100)
@@ -29,6 +29,7 @@
 
 @interface WaveClient : NSObject {
     NSString *_ID, *_vendor;
+    NSString * _IPAddress;
     NSDate *_date;
     int _curSignal;
     float _recievedBytes;
@@ -53,6 +54,7 @@
 - (NSString *)sent;
 - (NSString *)vendor;
 - (NSString *)date;
+- (NSString *)getIPAddress;
 
 - (float)recievedBytes;
 - (float)sentBytes;

Modified: KisMACng/Sources/Core/WaveClient.m
===================================================================
--- KisMACng/Sources/Core/WaveClient.m  2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WaveClient.m  2006-03-14 15:54:10 UTC (rev 100)
@@ -39,6 +39,7 @@
         
         _ID     = [[coder decodeObjectForKey:@"aID"] retain];
         _date   = [[coder decodeObjectForKey:@"aDate"] retain];
+        _IPAddress = [[coder decodeObjectForKey:@"aIPA"] retain];
         
         //WPA stuff
         _sNonce = [[coder decodeObjectForKey:@"sNonce"] retain];
@@ -69,6 +70,7 @@
        
        _ID     = [[dict objectForKey:@"ID"] retain];
        _date   = [[dict objectForKey:@"date"] retain];
+    _IPAddress = [[dict objectForKey:@"IPAddress"] retain];
        
        //WPA stuff
        _sNonce = [[dict objectForKey:@"wpaSNonce"] retain];
@@ -95,6 +97,7 @@
        
        [dict setObject:_ID forKey:@"ID"];
        if (_date) [dict setObject:_date forKey:@"date"];
+    if (_IPAddress) [dict setObject:_IPAddress forKey:@"IPAddress"];
        
        if (_sNonce) [dict setObject:_sNonce forKey:@"wpaSNonce"];
        if (_aNonce) [dict setObject:_aNonce forKey:@"wpaANonce"];
@@ -170,6 +173,11 @@
     _recievedBytes+=[w length];
     _changed = YES;
     
+    if ([w destinationIPAsString] != nil && ![[w destinationIPAsString] 
isEqualToString:@"0.0.0.0"] ) {
+        _IPAddress = [[w destinationIPAsString] retain];
+     //   NSLog(@"Incoming Packet Client dest IP Found: %@", [w 
destinationIPAsString]);
+    }
+    
     if (![w toDS]) [self wpaHandler:w]; //dont store it in the AP client
 }
 
@@ -189,6 +197,10 @@
     _curSignal=[w signal];
     _sentBytes+=[w length];    
     _changed = YES;
+    if ([w sourceIPAsString] != nil  && ![[w sourceIPAsString] 
isEqualToString:@"0.0.0.0"] ) {
+        _IPAddress = [[w sourceIPAsString] retain];
+        //NSLog(@"Outgoing Packet Client source IP Found: %@", [w 
sourceIPAsString]);
+    }
     
     if (![w fromDS]) [self wpaHandler:w]; //dont store it in the AP client
 }
@@ -219,6 +231,11 @@
     else return [NSString stringWithFormat:@"%@", _date]; //return [_date 
descriptionWithCalendarFormat:@"%H:%M %d-%m-%y" timeZone:nil locale:nil];
 }
 
+- (NSString *)getIPAddress{
+    if (_IPAddress == Nil) return @"unknown";
+    return _IPAddress;
+}
+
 #pragma mark -
 
 - (float)recievedBytes {

Modified: KisMACng/Sources/Core/WaveHelper.m
===================================================================
--- KisMACng/Sources/Core/WaveHelper.m  2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WaveHelper.m  2006-03-14 15:54:10 UTC (rev 100)
@@ -155,7 +155,10 @@
         aVendor = [_vendors objectForKey:[MAC substringToIndex:11]];
         if (aVendor == nil) {
             aVendor = [_vendors objectForKey:[MAC substringToIndex:8]];
-            if (aVendor == nil) return @"unknown";
+            if (aVendor == nil) {
+                aVendor = [_vendors objectForKey:[MAC substringToIndex:5]];
+                if (aVendor == nil) return @"unknown";
+            }
         }
     }
     return aVendor;

Modified: KisMACng/Sources/Core/WaveNet.h
===================================================================
--- KisMACng/Sources/Core/WaveNet.h     2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WaveNet.h     2006-03-14 15:54:10 UTC (rev 100)
@@ -81,6 +81,7 @@
     NSString *_SSID;
        NSArray  *_SSIDs;
     NSString* _BSSID;
+    NSString* _IPAddress;
     NSString* _vendor;
     NSString* _password;
     NSString* aComment;
@@ -143,6 +144,7 @@
 - (NSDate*)lastSeenDate;
 - (NSString *)firstDate;
 - (NSDate *)firstSeenDate;
+- (NSString *)getIP;
 - (NSString*)data;
 - (NSString*)getVendor;
 - (NSString*)rates;

Modified: KisMACng/Sources/Core/WaveNet.mm
===================================================================
--- KisMACng/Sources/Core/WaveNet.mm    2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WaveNet.mm    2006-03-14 15:54:10 UTC (rev 100)
@@ -1115,6 +1115,12 @@
 - (NSDate *)firstSeenDate {
     return aFirstDate;
 }
+- (NSString *)getIP {
+    if (_IPAddress) {
+        return _IPAddress;
+    }
+    return nil;
+}
 - (NSString *)data {
     return [WaveHelper bytesToString: _bytes];
 }
@@ -1495,8 +1501,27 @@
 int dateSort(WaveClient* w1, WaveClient* w2, int ascend) {
     return ascend * [[w1 rawDate] compare:[w2 rawDate]];
 }
+int ipSort(WaveClient* w1, WaveClient* w2, int ascend) {
+    //we break the ips into sections and sort 
+    int i, ndx = 0;
+    NSArray *ip1 = [[w1 getIPAddress] componentsSeparatedByString:@"."];
+    NSArray *ip2 = [[w2 getIPAddress] componentsSeparatedByString:@"."];
+    if ([ip1 count] < 4) {
+        return ascend * NSOrderedDescending;
+    }
+    else if ([ip2 count] < 4) {
+        return ascend * NSOrderedAscending;
+    }
+    while(ndx < 4){
+        i = compValues([[ip1 objectAtIndex:ndx] intValue], [[ip2 
objectAtIndex:ndx]intValue]);
+        if (i == NSOrderedSame) {
+            ndx++;
+        }
+        else break;
+    }
+    return ascend * i;
+}
 
-
 typedef int (*SORTFUNC)(id, id, void *);
 
 - (void) sortByColumn:(NSString*)ident order:(bool)ascend {
@@ -1512,6 +1537,7 @@
     else if ([ident isEqualToString:@"recieved"]) sf=(SORTFUNC)recievedSort;
     else if ([ident isEqualToString:@"sent"])   sf = (SORTFUNC)sentSort;
     else if ([ident isEqualToString:@"lastseen"]) sf=(SORTFUNC)dateSort;
+    else if ([ident isEqualToString:@"ipa"])      sf=(SORTFUNC)ipSort;
     else {
         NSLog(@"Unknown sorting column. This is a bug and should never 
happen.");
         return;

Modified: KisMACng/Sources/Core/WavePacket.mm
===================================================================
--- KisMACng/Sources/Core/WavePacket.mm 2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Core/WavePacket.mm 2006-03-14 15:54:10 UTC (rev 100)
@@ -738,7 +738,7 @@
     int frameLength = [self bodyLength];
     
     if (isValidPacket(_rawFrame+sizeof(WLFrame), frameLength) == 4) 
-        return [NSString stringWithFormat:@"%u.%u.%u.%u", 
_rawFrame[20]+sizeof(WLFrame), _rawFrame[21]+sizeof(WLFrame), 
_rawFrame[22]+sizeof(WLFrame), _rawFrame[23]+sizeof(WLFrame)];
+        return [NSString stringWithFormat:@"%u.%u.%u.%u", 
_rawFrame[20+sizeof(WLFrame)], _rawFrame[21+sizeof(WLFrame)], 
_rawFrame[22+sizeof(WLFrame)], _rawFrame[23+sizeof(WLFrame)]];
     else
         return nil;
 }

Modified: KisMACng/Sources/Preferences/PreferencePanes/PrefsDriver.m
===================================================================
--- KisMACng/Sources/Preferences/PreferencePanes/PrefsDriver.m  2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Sources/Preferences/PreferencePanes/PrefsDriver.m  2006-03-14 
15:54:10 UTC (rev 100)
@@ -75,7 +75,7 @@
     int val, startCorrect = 0;
     
     [_frequence     setFloatValue:  [[controller objectForKey:@"frequence"   ] 
floatValue]];
-    [_aeForever     setState:       [[controller objectForKey:@"aeForever"   ] 
intValue]]; 
+    [_aeForever     setState:       [WaveDriverAirportExtreme 
getMonitorMode]]; 
 
     if ([_driverTable numberOfSelectedRows]) {
         d = [self getCurrentSettings];
@@ -157,7 +157,6 @@
     unsigned int x, y;
     
     [controller setObject:[NSNumber numberWithFloat: [_frequence     
floatValue]]    forKey:@"frequence"];
-    [controller setObject:[NSNumber numberWithInt:[_aeForever state]] 
forKey:@"aeForever"];
 
     if (i < 0) return YES;
     d = [[self getCurrentSettings] mutableCopy];

Modified: KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.h
===================================================================
--- KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.h     2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.h     2006-03-14 
15:54:10 UTC (rev 100)
@@ -32,4 +32,5 @@
        UInt8 _channel;
 }
 
++ (BOOL)getMonitorMode;
 @end

Modified: KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m
===================================================================
--- KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m     2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Sources/WaveDrivers/WaveDriverAirportExtreme.m     2006-03-14 
15:54:10 UTC (rev 100)
@@ -83,6 +83,11 @@
        [NSThread sleep:1.0];
 }
 
++ (BOOL)getMonitorMode {
+    NSDictionary *dict= [NSPropertyListSerialization 
propertyListFromData:[NSData dataWithContentsOfFile:optionsFile] 
mutabilityOption:kCFPropertyListMutableContainers format:NULL 
errorDescription:Nil];
+       return [[dict valueForKeyPath:@"IOKitPersonalities.Broadcom 
PCI.APMonitorMode"] boolValue];
+}
+
 // return 0 for success, 1 for error, 2 for self handled error
 + (int) initBackend {
        BOOL ret;
@@ -303,7 +308,7 @@
                f->signal = af->ssi_noise;
                f->channel = af->channel;
                
-               f->length = f->dataLen = header.caplen - headerLength - 
sizeof(avs_80211_1_header) - 4; //we dont want the fcs
+               f->length = f->dataLen = header.caplen - headerLength - 
sizeof(avs_80211_1_header) - 4; //we dont want the fcs or do we?
         //NSLog(@"Got packet!!! hLen %u signal: %d  noise: %d channel %u 
length: %u\n", headerLength, af->ssi_signal, af->ssi_noise, f->channel, 
f->dataLen );
                memcpy(frame + sizeof(WLFrame), data + 
sizeof(avs_80211_1_header) + headerLength, f->dataLen);
         

Modified: KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/classes.nib        2006-03-09 20:51:19 UTC 
(rev 99)
+++ KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/classes.nib        2006-03-14 15:54:10 UTC 
(rev 100)
@@ -6,6 +6,7 @@
             CLASS = InstallController; 
             LANGUAGE = ObjC; 
             OUTLETS = {
+                "_aeForeverCheckBox" = NSButton; 
                 "_configureView" = NSView; 
                 "_confirmConfigureView" = NSView; 
                 "_installDirectoryView" = NSView; 

Modified: KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/info.nib
===================================================================
--- KisMACng/Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/info.nib   
2006-03-09 20:51:19 UTC (rev 99)
+++ KisMACng/Subprojects/KisMAC Installer/English.lproj/MainMenu.nib/info.nib   
2006-03-14 15:54:10 UTC (rev 100)
@@ -7,32 +7,32 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>217</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>226</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>229</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>246</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>259</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>272</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>280</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>288</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>29</key>
                <string>80 706 258 44 0 0 1280 832 </string>
                <key>297</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>304</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
                <key>316</key>
-               <string>394 381 492 372 0 0 1280 832 </string>
+               <string>394 370 492 372 0 0 1280 832 </string>
        </dict>
        <key>IBFramework Version</key>
-       <string>437.0</string>
+       <string>443.0</string>
        <key>IBLockedObjects</key>
        <array>
                <integer>212</integer>
@@ -51,21 +51,11 @@
        <integer>2</integer>
        <key>IBOpenObjects</key>
        <array>
-               <integer>226</integer>
                <integer>316</integer>
-               <integer>217</integer>
-               <integer>272</integer>
-               <integer>259</integer>
-               <integer>246</integer>
-               <integer>21</integer>
-               <integer>280</integer>
-               <integer>297</integer>
-               <integer>229</integer>
                <integer>29</integer>
-               <integer>304</integer>
-               <integer>288</integer>
+               <integer>226</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>8A428</string>
+       <string>8H14</string>
 </dict>
 </plist>

Modified: KisMACng/Subprojects/KisMAC 
Installer/English.lproj/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: KisMACng/Subprojects/KisMAC Installer/InstallController.h
===================================================================
--- KisMACng/Subprojects/KisMAC Installer/InstallController.h   2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Subprojects/KisMAC Installer/InstallController.h   2006-03-14 
15:54:10 UTC (rev 100)
@@ -70,7 +70,8 @@
     IBOutlet NSView     *_configureView;
     
     IBOutlet NSView     *_confirmConfigureView;
-        IBOutlet NSPopUpButton  *_selectedDriver;
+    IBOutlet NSPopUpButton  *_selectedDriver;
+    IBOutlet NSButton   *_aeForeverCheckBox;
         
     IBOutlet NSView     *_installDoneView;
        IBOutlet NSTextField    *_installationStatus;

Modified: KisMACng/Subprojects/KisMAC Installer/InstallController.m
===================================================================
--- KisMACng/Subprojects/KisMAC Installer/InstallController.m   2006-03-09 
20:51:19 UTC (rev 99)
+++ KisMACng/Subprojects/KisMAC Installer/InstallController.m   2006-03-14 
15:54:10 UTC (rev 100)
@@ -25,7 +25,10 @@
 #import "InstallController.h"
 #import "BLAuthentication.h"
 #import <Carbon/Carbon.h>
+#include <unistd.h>
 
+#define optionsFile 
@"/System/Library/Extensions/AppleAirPort2.kext/Contents/Info.plist"
+
 struct identStruct {
     UInt16 vendor;
     UInt16 device;
@@ -116,7 +119,7 @@
 - (BOOL)findKisMACPrefs {
     return [self 
findFile:@"~/Library/Preferences/de.binaervarianz.kismac.plist"];
 }
-- (BOOL)findTAR {
+- (BOOL)findTar {
        return [self findFile:@"/usr/bin/tar"];
 }
 
@@ -176,6 +179,21 @@
     return [a executeCommandSynced:[NSString 
stringWithFormat:@"%@/permissions.sh", [[NSBundle mainBundle] resourcePath]] 
withArgs:[NSArray arrayWithObject:targetDir]];
 }
 
+- (void)setMonitorMode:(BOOL)enable {
+    sleep(1);
+       [[BLAuthentication sharedInstance] executeCommand:@"/usr/bin/chgrp" 
withArgs:[NSArray arrayWithObjects:@"admin", optionsFile, nil]];
+       [[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0664", optionsFile, nil]];
+    
+    sleep(1);
+       NSDictionary *dict= [NSPropertyListSerialization 
propertyListFromData:[NSData dataWithContentsOfFile:optionsFile] 
mutabilityOption:kCFPropertyListMutableContainers format:NULL 
errorDescription:Nil];
+       [dict setValue:[NSNumber numberWithBool:enable] 
forKeyPath:@"IOKitPersonalities.Broadcom PCI.APMonitorMode"];
+       [[NSPropertyListSerialization dataFromPropertyList:dict 
format:kCFPropertyListXMLFormat_v1_0 errorDescription:nil] 
writeToFile:optionsFile atomically:NO];
+    
+       [[BLAuthentication sharedInstance] executeCommand:@"/bin/chmod" 
withArgs:[NSArray arrayWithObjects:@"0644", optionsFile, nil]];
+       [[BLAuthentication sharedInstance] executeCommand:@"/usr/bin/chgrp" 
withArgs:[NSArray arrayWithObjects:@"wheel", optionsFile, nil]];
+    sleep(1);
+}
+
 - (BOOL)removeWirelessDriverPatch {
     BLAuthentication *a;
     
@@ -333,6 +351,9 @@
     if ([self isServiceAvailable:"AirPortPCI"]) {
         [_selectedDriver addItemWithTitle:@"Apple Airport Extreme Card, active 
mode"];
         [[_selectedDriver lastItem] setTag: 2];
+        [_selectedDriver addItemWithTitle:@"Apple Airport Extreme Card, 
passive mode"];
+        [[_selectedDriver lastItem] setTag: 8];
+
     }
     
     ids = [NSArray arrayWithObjects:@"pccard156,3", @"pccardb,7300", 
@"pccard156,2", @"pccard126,8000", @"pccard105,7", @"pccard89,1", 
@"pccard124,1110", @"pccard138,2", @"pccard268,1", @"pccard250,2", 
@"pccard26f,30b", @"pccard274,1612", @"pccard274,1613", @"pccard274,3301", 
@"pccard28a,2", @"pccard2d2,1", @"pccardd601,2", @"pccardd601,5", nil];
@@ -365,6 +386,10 @@
     int i;
     
     if ([[_selectedDriver selectedItem] tag] == 0) return;
+    if ([_aeForeverCheckBox state]) {
+        [self setMonitorMode:YES];
+        NSLog(@"Enable AE forever!");
+    }
     
     md = [NSMutableDictionary dictionary];
     
@@ -397,6 +422,10 @@
         [md setObject:@"PrismGT based Card" forKey:@"deviceName"];
         [md setObject:@"WaveDriverPrismGT" forKey:@"driverID"];
         break;
+    case 8:
+        [md setObject:@"Apple Airport Extreme card" forKey:@"deviceName"];
+        [md setObject:@"WaveDriverAirportExtreme" forKey:@"driverID"];
+        break;
     }    
     
     [md setObject:@"../DumpLog %y-%m-%d %H:%M" forKey:@"dumpDestination"];
@@ -645,9 +674,13 @@
 
 -(void)performRemoval:(id)nilObject {
     NSAutoreleasePool *pool;
-    
     pool = [[NSAutoreleasePool alloc] init];
     
+    NSDictionary *dict= [NSPropertyListSerialization 
propertyListFromData:[NSData dataWithContentsOfFile:optionsFile] 
+                                                         
mutabilityOption:kCFPropertyListMutableContainers
+                                                                   format:NULL 
errorDescription:Nil];
+    
+    
     [_installStatus setStringValue:@"Removing Preferences..."];
     [self removePreferences];
     [_progBar incrementBy:1.0];
@@ -661,6 +694,12 @@
         [self removeWirelessDriverPatch];
         [_progBar incrementBy:1.0];
     }
+        
+       if ([[dict valueForKeyPath:@"IOKitPersonalities.Broadcom 
PCI.APMonitorMode"] boolValue]) {
+        [_installStatus setStringValue:@"Restoring Airport Extreme Monitor 
Mode to Normal"];
+        [self setMonitorMode:NO];
+    }
+
     
     [_installStatus setStringValue:@"Removal complete..."];
     [_progBar setDoubleValue:[_progBar maxValue]];


Other related posts:

  • » [kismac] [binaervarianz] r100 - in KisMACng: . Resources/Nibs/English.lproj/MainMenu.nib Sources/Controller Sources/Core Sources/Preferences/PreferencePanes Sources/WaveDrivers Subprojects/KisMAC Installer Subprojects/KisMAC Installer/English.lproj/MainMenu.nib