From 448426777d9e35826898791d03b4bc71335427ff Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 10 Dec 2002 01:24:42 +0000 Subject: towards an alpha version --- (limited to 'noncore/net/wellenreiter') diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README new file mode 100644 index 0000000..4ed5c28 --- a/dev/null +++ b/noncore/net/wellenreiter/README @@ -0,0 +1,37 @@ +/*************************************************************************/ +/* W e l l e n r e i t e r I I */ +/* =============================== */ +/* */ +/* Version: Opie-ALPHA */ +/*************************************************************************/ + +Release Notes for Opie-ALPHA Version December 2002 +-------------------------------------------------- + += Supported Devices = + +* low-level orinoco_cs-based (including prism2 and spectrum_cs) + += Build = + +To compile Wellenreiter within the Opie build environment, add the +following directories to $OPIEDIR/Makefile, e.g. to 'NONAPPS=' + +noncore/net/wellenreiter/libwellenreiter \ +noncore/net/wellenreiter/daemon \ +noncore/net/wellenreiter/contrib/orinoco_hopper \ +noncore/net/wellenreiter/gui + +./configure and rebuild. + += Run = + +1. Place card in monitor mode: iwpriv 2 1 +2. Start $OPIEDIR/bin/orinoco_hopper +3. Start Wellenreiter + += Credits = + +Sniffer: Max Moser +Communication and Protocol: Martin J. Muench +GUI: Michael Lauer diff --git a/noncore/net/wellenreiter/config.in b/noncore/net/wellenreiter/config.in index d6b48d8..3c33b68 100644 --- a/noncore/net/wellenreiter/config.in +++ b/noncore/net/wellenreiter/config.in @@ -1,4 +1,4 @@ -# config #WELLENREITER +# config WELLENREITER # boolean "wellenreiter" # default "y" -# depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE +# depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBPCAP diff --git a/noncore/net/wellenreiter/contrib/.cvsignore b/noncore/net/wellenreiter/contrib/.cvsignore new file mode 100644 index 0000000..0e45b67 --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/.cvsignore @@ -0,0 +1,4 @@ +*.o +*~ +moc_* +Makefile.* diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore b/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore new file mode 100644 index 0000000..0e45b67 --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore @@ -0,0 +1,4 @@ +*.o +*~ +moc_* +Makefile.* diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in b/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in new file mode 100644 index 0000000..c542a59 --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in @@ -0,0 +1,101 @@ +############################################################################# + +####### Compiler, tools and options + +CXX = $(SYSCONF_CXX) $(QT_CXX_MT) +CXXFLAGS= $(SYSCONF_CXXFLAGS) +CC = $(SYSCONF_CC) $(QT_C_MT) +CFLAGS = $(SYSCONF_CFLAGS) +INCPATH = +LFLAGS = $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) +LIBS = $(SUBLIBS) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP) +MOC = $(SYSCONF_MOC) +UIC = $(SYSCONF_UIC) + +####### Target + +DESTDIR = $(OPIEDIR)/bin/ +VER_MAJ = 1 +VER_MIN = 0 +VER_PATCH = 0 +TARGET = orinoco_hopper +TARGET1 = lib$(TARGET).so.$(VER_MAJ) + +####### Files + +HEADERS = +SOURCES = orinoco_hopper.c +OBJECTS = orinoco_hopper.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = + + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(DESTDIR)$(TARGET) + +$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) + $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake orinoco_hopper.pro + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) + -rm -f *~ core + -rm -f allmoc.cpp + +####### Extension Modules + +listpromodules: + @echo + +listallmodules: + @echo + +listaddonpromodules: + @echo + +listaddonentmodules: + @echo + + +REQUIRES= + +####### Sub-libraries + + +###### Combined headers + + + +####### Compile + +orinoco_hopper.o: orinoco_hopper.c + + diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c new file mode 100644 index 0000000..78f0299 --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c @@ -0,0 +1,118 @@ +/* orinoco_hopper.c + * orinoco wireless nic channel scanning utility + * + * By Snax + * Copyright (c) 2002 Snax + * + * This program 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. + * + * This program 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. + * + * For a copy of the GNU General Public License write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SIOCIWFIRSTPRIV +#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE +#endif + +void changeChannel(int); +int setChannel( unsigned char channel ); + +int max = 11; +int mode = 2; +char dev[32]; + +void changeChannel(int x) { + static int chan = 0; + chan = (chan % max) + 1; + setChannel(chan); +} + +int setChannel( unsigned char channel ) +{ + int result = 0; + int fd; + struct iwreq ireq; //for Orinoco + int *ptr; + + /* get a socket */ + fd = socket(AF_INET, SOCK_STREAM, 0); + + if ( fd == -1 ) { + return -1; + } + ptr = (int *) ireq.u.name; + ptr[0] = mode; + ptr[1] = channel; + strcpy(ireq.ifr_ifrn.ifrn_name, dev); + result = ioctl( fd, SIOCIWFIRSTPRIV + 0x8, &ireq); + close(fd); + return result; +} + +void usage(char *cmd) { + fprintf(stderr, + "Usage: %s [-p] [-i ] [-n]\n -n = international channels\n -p = keep prism headers\n", cmd); + exit(1); +} + +int main (int argc, char *argv[]) +{ + struct itimerval tval; + int ms, r; + + //this will be the channel scanning interval, currently 0.2 sec + struct timeval interval = {0, 200000}; + + if (argc < 2) usage(argv[0]); + strncpy(dev, argv[1], 32); + dev[31] = 0; + + while (1) { + r = getopt(argc,argv,"i:np"); + if (r < 0) break; + switch (r) { + case 'n': + max = 14; + break; + case 'p': + mode = 1; + break; + case 'i': + ms = atoi(optarg); + interval.tv_sec = ms / 1000; + interval.tv_usec = (ms % 1000) * 1000; + break; + default: + usage(argv[0]); + } + } + + //this sets up the kchannel scanning stuff + signal(SIGALRM, changeChannel); + tval.it_interval = interval; + tval.it_value = interval; + setitimer(ITIMER_REAL, &tval, NULL); + while (1) pause(); + + return 0; +} + diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o new file mode 100644 index 0000000..dd90c62 --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o Binary files differ diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro new file mode 100644 index 0000000..a85520c --- a/dev/null +++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro @@ -0,0 +1,11 @@ +DESTDIR = $(OPIEDIR)/bin +TEMPLATE = app +CONFIG = warn_on debug +#CONFIG = warn_on release +HEADERS = +SOURCES = orinoco_hopper.c +INCLUDEPATH += +DEPENDPATH += +LIBS += +INTERFACES = +TARGET = orinoco_hopper diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui new file mode 100644 index 0000000..8f38252 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -0,0 +1,307 @@ + +Form1 + + QWidget + + name + Form1 + + + geometry + + 0 + 0 + 226 + 300 + + + + caption + Form1 + + + + margin + 11 + + + spacing + 6 + + + QGroupBox + + name + GroupBox1 + + + title + Sniffer Options + + + + margin + 11 + + + spacing + 6 + + + QLayoutWidget + + name + Layout1 + + + + margin + 0 + + + spacing + 6 + + + QSpinBox + + name + hopInterval + + + suffix + ms + + + maxValue + 2000 + + + minValue + 100 + + + lineStep + 100 + + + + QLabel + + name + TextLabel3 + + + text + Hop Interval + + + + QComboBox + + + text + <select> + + + + + text + eth0 + + + + + text + eth1 + + + + + text + wlan0 + + + + + text + wlan1 + + + + + text + wifi0 + + + + + text + wifi1 + + + + name + interfaceName + + + + QLabel + + name + TextLabel1 + + + text + Interface Name + + + + QComboBox + + + text + <select> + + + + + text + cisco + + + + + text + orinoco + + + + + text + prism + + + + + text + <manual> + + + + name + deviceType + + + + QLabel + + name + TextLabel2 + + + text + Device Type + + + + + + + + QGroupBox + + name + GroupBox8 + + + title + Advanced Options + + + QCheckBox + + name + additionalInfo + + + geometry + + 11 + 19 + 147 + 19 + + + + text + Gather Additional Info + + + + QCheckBox + + name + activeScanning + + + geometry + + 11 + 44 + 175 + 19 + + + + text + Active Scanning (caution!) + + + + + QGroupBox + + name + GroupBox3 + + + title + GUI Options + + + + margin + 11 + + + spacing + 6 + + + QCheckBox + + name + groupNetworks + + + text + Group Detected Networks + + + + QCheckBox + + name + enableActivity + + + text + Enable Activity Display + + + + + + + diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 8f14bc1..a047433 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -7,5 +7,5 @@ SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cp INCLUDEPATH += $(OPIEDIR)/include ../daemon DEPENDPATH += $(OPIEDIR)/include ../daemon LIBS += -lqpe -lopie -lwellenreiter -INTERFACES = wellenreitertemplate.ui +INTERFACES = configbase.ui TARGET = wellenreiter diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 6d62fa8..3453d18 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -20,7 +20,9 @@ // Standard #include +#include #include +#include #include // Local @@ -131,23 +133,31 @@ bool Wellenreiter::hasMessage() tv.tv_sec = 0; tv.tv_usec = 10; int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv ); - return FD_ISSET( daemon_fd, &rfds ); + + if ( result == 0 ) + { + return false; + } + else if ( result == -1 ) + { + qDebug( "selected returned: %s", strerror( errno ) ); + return false; + } + else + return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor } void Wellenreiter::timerEvent( QTimerEvent* e ) { qDebug( "checking for message..." ); - - int result = hasMessage(); - qDebug( "hasMessage() returned %d", result ); - - if ( result ) + if ( hasMessage() ) { + qDebug( "got message" ); handleMessage(); } else { - qDebug( "no message :(" ); + qDebug( "no message..." ); } } diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc index 6b0fffb..84caf12 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc @@ -94,7 +94,8 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack return; } - + printf( "cap_ESS is %d, cap_IBSS is %d\n", pinfoptr->cap_ESS, pinfoptr->cap_IBSS ); + /* Here should be the infos to the gui issued */ if (pinfoptr->cap_ESS == 1 &&pinfoptr->cap_IBSS ==0) { diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control index da83359..83bfd0e 100644 --- a/noncore/net/wellenreiter/opie-wellenreiter.control +++ b/noncore/net/wellenreiter/opie-wellenreiter.control @@ -1,4 +1,4 @@ -Files: bin/wellenreiter bin/wellenreiterd pics/wellenreiter $QTDIR/lib/libwellenreiter.* +Files: bin/wellenreiter bin/wellenreiterd bin/orinoco_hopper pics/wellenreiter $QTDIR/lib/libwellenreiter.* Priority: optional Section: opie/applications Maintainer: Michael Lauer -- cgit v0.9.0.2