[kismac] Re: Compile KisMAC from source: no go?

  • From: Derrick Brashear <shadow@xxxxxxxxxxxx>
  • To: kismac@xxxxxxxxxxxxx
  • Date: Fri, 19 Sep 2003 17:57:24 -0400

> Attached. Note the GPSController.m segment that uses serial gps
> receivers is if 0'd out.
>
As an ecartis admin I suppose I should have guessed this.

> -- Binary/unsupported file stripped by Ecartis --
> -- Type: application/octet-stream
> -- File: diff
>

diff -urtw src/ColoredRowOutlineView.m ../src/ColoredRowOutlineView.m
--- src/ColoredRowOutlineView.m Wed Sep 10 13:06:05 2003
+++ ../src/ColoredRowOutlineView.m      Fri Sep 19 14:06:45 2003
@@ -8,6 +8,8 @@
   That means that you can use this class in open source or commercial =20=

products, with the limitation that you must distribute the source code =20=

for this class, and any modifications you make. See http://www.gnu.org/ =20=

for more information.
   */

+#import <AppKit/AppKit.h>
+#import <AppKit/NSSound.h>
  #import "ColoredRowOutlineView.h"


@@ -16,11 +18,11 @@
  - (void)initialize
  {
      NSSize spacing =3D _intercellSpacing;
+    NSArray *columns =3D _tableColumns;
+    unsigned int i =3D 0;
      spacing.height =3D 0.0;
      [self setIntercellSpacing: spacing];

-    NSArray* columns =3D _tableColumns;
-    unsigned int i =3D 0;
      for ( i =3D 0; i < [columns count]; i ++ ) {
          //NSLog( @"drawsBackground: %d", [[[columns objectAtIndex: i] =20=

dataCell] drawsBackground] );
          id cell =3D [[columns objectAtIndex: i] dataCell];
diff -urtw src/ColoredRowTableView.m ../src/ColoredRowTableView.m
--- src/ColoredRowTableView.m   Wed Sep 10 13:06:05 2003
+++ ../src/ColoredRowTableView.m        Fri Sep 19 14:16:39 2003
@@ -8,6 +8,8 @@
   That means that you can use this class in open source or commercial =20=

products, with the limitation that you must distribute the source code =20=

for this class, and any modifications you make. See http://www.gnu.org/ =20=

for more information.
   */

+#import <AppKit/AppKit.h>
+#import <AppKit/NSSound.h>
  #import "ColoredRowTableView.h"


@@ -16,11 +18,11 @@
  - (void)initialize
  {
      NSSize spacing =3D _intercellSpacing;
+    NSArray *columns =3D _tableColumns;
+    unsigned int i =3D 0;
      spacing.height =3D 0.0;
      [self setIntercellSpacing: spacing];

-    NSArray* columns =3D _tableColumns;
-    unsigned int i =3D 0;
      for ( i =3D 0; i < [columns count]; i ++ ) {
          //NSLog( @"drawsBackground: %d", [[[columns objectAtIndex: i] =20=

dataCell] drawsBackground] );
          id cell =3D [[columns objectAtIndex: i] dataCell];
diff -urtw src/DownloadMapController.m ../src/DownloadMapController.m
--- src/DownloadMapController.m Wed Sep 10 13:06:02 2003
+++ ../src/DownloadMapController.m      Fri Sep 19 14:30:13 2003
@@ -2,7 +2,7 @@

          File:                   DownloadMapController.m
          Program:                KisMAC
-        Author:                 Michael Ro=E2=88=9A=C3=BCberg
+        Author:                 Michael Ro=E2=88=9A=C3=89=C2=AC=C3=BCberg=

                                  mick@xxxxxxxxxxxxxxxx
          Description:            KisMAC is a wireless stumbler for =20
MacOS X.

@@ -91,6 +91,15 @@
              =20
@"http://se.img.maps.yahoo.com/scripts/=20
gcis.dll?sizex=3D%d&sizey=3D%d&XgoSetLogicalScale=3D%d&_XgoPointWGS=3D%d%%=
2c%d&X=20
goPageName=3DXMLOUTDE&XgoAnswer=3DBitmap&_XgoScaleMode=3D0",
              [_width intValue], [_height intValue], scale, =20
((int)(floor(_wp._long * 10000.0))), ((int)(floor(_wp._lat * =20
10000.0)))];
      } else if ([[_server titleOfSelectedItem] =20
isEqualToString:@"Expedia (United States)"]) {
+        int sockd;
+        struct sockaddr_in serv_name;
+        char buf[2024];
+        int status;
+        struct hostent *hp;
+        u_long ip;
+        int bytesread;
+        NSString *s;
+        CFHTTPMessageRef myMessage;
          scale =3D 6 - [[_scale titleOfSelectedItem] intValue];
          req =3D [NSString stringWithFormat:
              =20
@"http://www.expedia.com/pub/=20
agent.dll?qscr=3Dmrdt&CenP=3D%f,%f&Lang=3D0409USA&Alti=3D%d&MapS=3D0&Size=3D=
%d,%d&Of=20
fs=3D0.000000,0",
@@ -127,14 +136,6 @@
              @"The Expedia server requires a complete browser system in =
=20
order to send maps. KisMAC can provide this, however you will need at =20=

least a MacOS X 10.2.6 installation, with Safari 1.0 or higher =20
installed!");
              return;
          NS_ENDHANDLER*/
-        int sockd;
-        struct sockaddr_in serv_name;
-        char buf[2024];
-        int status;
-        struct hostent *hp;
-        u_long ip;
-        int bytesread;
-        NSString *s;

          sockd =3D socket(AF_INET, SOCK_STREAM, 0);
          if (sockd =3D=3D -1) {
@@ -175,7 +176,7 @@
              s =3D [s stringByAppendingString:[NSString =20
stringWithCString:buf length:bytesread]];
          //}

-        CFHTTPMessageRef myMessage =3D =20
CFHTTPMessageCreateEmpty(kCFAllocatorDefault, FALSE);
+        myMessage =3D CFHTTPMessageCreateEmpty(kCFAllocatorDefault, =20
FALSE);
          if (!CFHTTPMessageAppendBytes(myMessage, [s cString], [s =20
length])) {
              error =3D @"CFTTPResponse Parsing error";
              close(sockd);
diff -urtw src/GPSController.m ../src/GPSController.m
--- src/GPSController.m Wed Sep 10 13:06:03 2003
+++ ../src/GPSController.m      Fri Sep 19 01:14:18 2003
@@ -30,10 +30,14 @@
  #include <stdio.h>
  #include <fcntl.h>
  #include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
  #include <sys/uio.h>
  #include <sys/vnode.h>
  #include <sys/ioctl.h>
  #include <unistd.h>
+#include <netdb.h>
  #include <string.h>
  #include <errno.h>

@@ -294,11 +298,67 @@
      _gpsShallRun =3D NO;

      if ([_gpsLock lockBeforeDate:[NSDate =20
dateWithTimeIntervalSinceNow:10]]) {
+        int sockd;
+        struct sockaddr_in serv_name;
+        char buf[2024];
+        int status;
+        struct hostent *hp;
+        u_long ip;
+
          _gpsThreadUp =3D YES;
          _gpsShallRun =3D YES;
          [_lastUpdate release];
          _lastUpdate =3D nil;

+        sockd =3D socket(AF_INET, SOCK_STREAM, 0);
+        if (sockd =3D=3D -1) {
+          NSLog(@"Socket creation failed!");
+          goto err;
+        }
+
+        hp =3D gethostbyname("localhost");
+        if (hp =3D=3D NULL) {
+          NSLog(@"Could not resolve localhost");
+          goto err;
+        }
+        ip =3D *(int *)hp->h_addr_list[0];
+
+        /* server address */
+        serv_name.sin_family =3D AF_INET;
+        serv_name.sin_addr.s_addr =3D ip;
+        serv_name.sin_port =3D htons(2947);
+
+        NSLog(@"Connecting to gpsd (%s, =20
%x)",inet_ntoa(serv_name.sin_addr),ip
+              );
+
+        /* connect to the server */
+        status =3D connect(sockd, (struct sockaddr*)&serv_name, =20
sizeof(serv_name))
+          ;
+        if (status =3D=3D -1) {
+          NSLog(@"Could not connect to localhost");
+          goto err;
+        }
+
+        NSLog(@"GPS started successfully\n");
+        // enable raw mode and parse ourselves, quick hack
+        write(sockd, "R\r", 2);
+        while (_gpsShallRun) {
+          [self gps_parse:sockd];
+          //actually once a sec should be enough, but sometimes we =20
dont get any information. so do it more often.
+          [NSThread sleepUntilDate:[NSDate =20
dateWithTimeIntervalSinceNow:0.1]];
+        }
+        close(sockd);
+    err:
+        [_gpsLock unlock];
+        _gpsThreadUp =3D NO;
+    } else {
+        NSLog(@"GPS LOCKING FAILURE!");
+    }
+
+    [subpool release];
+    return;
+
+#if 0
          //NSLog(@"Starting GPS device");
          if((fd =3D open([_gpsDevice cString], O_RDWR | O_NOCTTY | =20
O_NONBLOCK )) < 0) {
              NSLog(@"error: unable to open gps device: %s", =20
strerror(errno));
@@ -383,6 +443,7 @@

      [subpool release];
      return;
+#endif
  }

  #pragma mark -
diff -urtw src/NetView.m ../src/NetView.m
--- src/NetView.m       Wed Sep 10 13:06:03 2003
+++ ../src/NetView.m    Fri Sep 19 14:19:34 2003
@@ -25,7 +25,8 @@

  #import "NetView.h"
  #import "WaveHelper.h"
-
+#import <AppKit/AppKit.h>
+#import <AppKit/NSSound.h>
  @implementation NetView

  - (id)initWithFrame:(NSRect)frame {
@@ -100,9 +101,9 @@
          }

          if ([[_name stringByTrimmingCharactersInSet:[NSCharacterSet =20=

whitespaceCharacterSet]] length] > 0) {
+            NSSize size =3D [_name sizeWithAttributes:attrs];
              [attrs setObject:textFont forKey:NSFontAttributeName];

-            NSSize size =3D [_name sizeWithAttributes:attrs];
              size.height+=3D5;
              size.width+=3D10;

Only in ../src: NetView.m~
diff -urtw src/RC4.h ../src/RC4.h
--- src/RC4.h   Wed Sep 10 13:06:04 2003
+++ ../src/RC4.h        Fri Sep 19 16:57:01 2003
@@ -22,9 +22,13 @@
      along with KisMAC; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  =20
02111-1307  USA
  */
+#ifdef __cplusplus
+extern "C" {
+#endif
  #ifndef __RC4_H
  #define __RC4_H

+
  #define IV_SIZE 3

  #define N 256
@@ -48,4 +52,6 @@
  void setupIdentity(void);

  #endif
-
+#ifdef __cplusplus
+}
+#endif
Only in ../src: RC4.h~
diff -urtw src/RC4.mm ../src/RC4.mm
--- src/RC4.mm  Wed Sep 10 13:06:04 2003
+++ ../src/RC4.mm       Fri Sep 19 16:57:25 2003
@@ -27,6 +27,11 @@
  #include <stdio.h>
  #include <string.h>
  #include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
  #include "RC4.h"

  #define Q 255
@@ -36,6 +41,7 @@

  unsigned char Identity[N];

+
  void RC4init(RC4 *that) {
    memcpy(that->S, Identity, sizeof(unsigned char) * N);
    that->i =3D that->j =3D 0;
@@ -135,4 +141,6 @@
    int a;
    for(a =3D 0; a < N; a++) Identity[a] =3D a;
  }
-
\ No newline at end of file
+#ifdef __cplusplus
+}
+#endif
Only in ../src: RC4.mm~
diff -urtw src/ScanController.m ../src/ScanController.m
--- src/ScanController.m        Wed Sep 10 13:06:04 2003
+++ ../src/ScanController.m     Fri Sep 19 14:22:02 2003
@@ -23,6 +23,7 @@
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  =20
02111-1307  USA
  */
  #import "ScanController.h"
+#import <AppKit/AppKit.h>
  #import <sys/sysctl.h>
  #import "WaveHelper.h"
  #import "GPSController.h"
@@ -112,15 +113,14 @@

  -(void)awakeFromNib {
      static BOOL alreadyAwake =3D NO;
+    NSUserDefaults *sets;
+    NSString *md5;

      if(!alreadyAwake)
          alreadyAwake =3D YES;
      else
          return;

-    NSUserDefaults *sets;
-    NSString *md5;
-
      sets=3D[NSUserDefaults standardUserDefaults];

      [WaveHelper setMainWindow:aWindow];
@@ -515,9 +515,9 @@
      else [self selectNet:[aNets objectForKey:[aNetKeys =20
objectAtIndex:[LogTable selectedRow]]]];
  }
  - (void)tableView:(NSTableView*)tableView =20
mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn {
+    NSString *ident =3D [tableColumn identifier];
      if(![tableView isEqualTo:LogTable]) return;

-    NSString *ident =3D [tableColumn identifier];
      if ((aLastSorted) && ([aLastSorted isEqualToString:ident])) {
          if (aAscending) aAscending=3DNO;
          else {
Only in ../src: ScanController.m~
--- src/WaveCracker.h   Wed Sep 10 13:06:05 2003
+++ ../src/WaveCracker.h        Fri Sep 19 17:03:03 2003
@@ -53,10 +53,16 @@

  typedef UInt8 WirelessKey[13]; // For use with WirelessEncrypt

+#ifdef __cplusplus
+extern "C" {
+#endif
  extern WIErr WirelessEncrypt(
          CFStringRef inNetworkPassword,
          WirelessKey *wepKey,
          const UInt32 use104bits);
+#ifdef __cplusplus
+}
+#endif


  typedef unsigned long int UNS_32_BITS;
Only in ../src: WaveCracker.h~
diff -urtw src/WaveHelper.m ../src/WaveHelper.m
--- src/WaveHelper.m    Wed Sep 10 13:06:05 2003
+++ ../src/WaveHelper.m Fri Sep 19 01:10:02 2003
@@ -221,6 +221,8 @@

                  if (x=3D=3D10)  {
                      NSLog(@"KisMAC could not load the Viha Driver, =20
because there was an active instance of AirPortUserClient! This means =20=

there is a program accessing the airport.");
+                    [[NSUserDefaults standardUserDefaults] =20
setInteger:1 forKey:@"SupressAirPortActiveWarning"];
+#if 0
                      if ([[NSUserDefaults standardUserDefaults] =20
setInteger:1 forKey:@"SupressAirPortActiveWarning"]=3D=3D0) {
                          x =3D NSRunCriticalAlertPanel(@"WARNING! Do =
you =20
really want to load the Viha driver?.",@"KisMAC detected, that there is =20=

most likely still some kind of a program, which accesses your airport =20=

driver (such as a signal meter, internet connect, another stumbler or a =20=

preference pane). If you continue, your Airport Connection might not =20
come back when you quit KisMAC.\n\n Please note: There are certain =20
systems, which seem to access the driver all the time. There is no =20
known reason for this behavior. You will have to override this warning, =20=

if you want to use KisMAC on such a system.",@"OK",@"Cancel",@"Don't =20
bother me!");

@@ -232,6 +234,7 @@
                              [[NSUserDefaults standardUserDefaults] =20
setInteger:1 forKey:@"SupressAirPortActiveWarning"];
                          }
                      }
+#endif
                  }

                  [self runScript:@"viha_driver.sh" =20
withArguments:[NSArray arrayWithObject:@"start"]];
diff -urtw src/WayPointView.m ../src/WayPointView.m
--- src/WayPointView.m  Wed Sep 10 13:06:05 2003
+++ ../src/WayPointView.m       Fri Sep 19 14:25:08 2003
@@ -25,6 +25,8 @@

  #import "WayPointView.h"
  #import "WaveHelper.h"
+#import <AppKit/AppKit.h>
+#import <AppKit/NSSound.h>

  @implementation WayPointView

@@ -117,10 +119,11 @@
              q.size.width-=3D2;
          }

+
      } else if (_mode > 0) {
+        NSAffineTransform *t4 =3D [NSAffineTransform transform];
          [[WaveHelper intToColor:[[NSUserDefaults standardUserDefaults] =
=20
objectForKey:@"WayPointColor"]] set];

-        NSAffineTransform *t4 =3D [NSAffineTransform transform];
          [t4 translateXBy:-_frame.size.width*0.5 =20
yBy:-_frame.size.height*0.5];
          //[_way1 transformUsingAffineTransform: t4];

diff -urtw src/md5.h ../src/md5.h
--- src/md5.h   Wed Sep 10 13:06:03 2003
+++ ../src/md5.h        Fri Sep 19 17:00:42 2003
@@ -1,3 +1,7 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
  #ifndef MD5_H
  #define MD5_H

@@ -25,3 +29,6 @@
  typedef struct MD5Context MD5_CTX;

  #endif /* !MD5_H */
+#ifdef __cplusplus
+}
+#endif


Other related posts: