summaryrefslogtreecommitdiff
path: root/libopie2/opienet
authormickeyl <mickeyl>2003-12-01 22:44:38 (UTC)
committer mickeyl <mickeyl>2003-12-01 22:44:38 (UTC)
commit7a7683d435cfbb4fa2d6ed99fd4a94d388402aec (patch) (unidiff)
tree1a34de131d935f34dd2622e3606ba664a7783e24 /libopie2/opienet
parenta4a47fca8badeca2b1aae51b39295ccdc8782c4f (diff)
downloadopie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.zip
opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.gz
opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.bz2
slowly start to refactor & cleanup libopie2 before merging it with libopie1
Diffstat (limited to 'libopie2/opienet') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/dhcp.h3
-rw-r--r--libopie2/opienet/libopienet2.control4
-rw-r--r--libopie2/opienet/odebugmapper.cpp8
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp67
-rw-r--r--libopie2/opienet/omanufacturerdb.h43
-rw-r--r--libopie2/opienet/onetutils.cpp2
-rw-r--r--libopie2/opienet/onetwork.cpp6
-rw-r--r--libopie2/opienet/onetwork.h5
-rw-r--r--libopie2/opienet/opcap.cpp5
-rw-r--r--libopie2/opienet/opcap.h5
-rw-r--r--libopie2/opienet/opienet.pro2
-rw-r--r--libopie2/opienet/ostation.cpp3
-rw-r--r--libopie2/opienet/ostation.h3
-rw-r--r--libopie2/opienet/udp_ports.h2
14 files changed, 88 insertions, 70 deletions
diff --git a/libopie2/opienet/dhcp.h b/libopie2/opienet/dhcp.h
index 3f2f775..368e375 100644
--- a/libopie2/opienet/dhcp.h
+++ b/libopie2/opienet/dhcp.h
@@ -197,4 +197,5 @@ struct dhcp_packet {
197 #define FQDN_FQDN 8 197 #define FQDN_FQDN 8
198 #define FQDN_SUBOPTION_COUNT 8 198 #define FQDN_SUBOPTION_COUNT 8
199 199
200#endif \ No newline at end of file 200#endif
201
diff --git a/libopie2/opienet/libopienet2.control b/libopie2/opienet/libopienet2.control
index 65d8464..8eb0704 100644
--- a/libopie2/opienet/libopienet2.control
+++ b/libopie2/opienet/libopienet2.control
@@ -4,8 +4,8 @@ Priority: optional
4Section: opie/system 4Section: opie/system
5Maintainer: Opie Team <opie@handhelds.org> 5Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 1.8.1-$SUB_VERSION.2 7Version: 1.8.2-$SUB_VERSION.2
8Depends: libqpe1, libopiecore2 (1.8.1) 8Depends: libopiecore2 (1.8.2)
9Provides: libopienet2 9Provides: libopienet2
10Description: Opie library 2.0 NET 10Description: Opie library 2.0 NET
11 11
diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp
index d62b3ba..7e4ab2b 100644
--- a/libopie2/opienet/odebugmapper.cpp
+++ b/libopie2/opienet/odebugmapper.cpp
@@ -3,11 +3,13 @@
3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */ 4 */
5 5
6#include <opie2/odebug.h>
7
6#include "odebugmapper.h" 8#include "odebugmapper.h"
7 9
8DebugMapper::DebugMapper() 10DebugMapper::DebugMapper()
9{ 11{
10 qDebug( "DebugMapper::DebugMapper()" ); 12 odebug << "DebugMapper::DebugMapper()" << oendl;
11 13
12 14
13 _map.insert( 0x8902, new QString("SIOCSPGRP") ); 15 _map.insert( 0x8902, new QString("SIOCSPGRP") );
@@ -191,7 +193,7 @@ DebugMapper::DebugMapper()
191 193
192DebugMapper::~DebugMapper() 194DebugMapper::~DebugMapper()
193{ 195{
194 qDebug( "DebugMapper::~DebugMapper()" ); 196 odebug << "DebugMapper::~DebugMapper()" << oendl;
195} 197}
196 198
197 199
@@ -201,7 +203,7 @@ const QString& DebugMapper::map( int value ) const
201 203
202 if ( !result ) 204 if ( !result )
203 { 205 {
204 qDebug( "DebugMapper::map() - value not found." ); 206 owarn << "DebugMapper::map() - value " << value << " is not found." << oendl;
205 return QString::null; 207 return QString::null;
206 } 208 }
207 else 209 else
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index c3c213c..bcce11f 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -1,20 +1,38 @@
1/********************************************************************** 1/*
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2                 This file is part of the Opie Project
3** 3              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4** This file is part of Opie Environment. 4 =.
5** 5 .=l.
6** This file may be distributed and/or modified under the terms of the 6           .>+-=
7** GNU General Public License version 2 as published by the Free Software 7 _;:,     .>    :=|. This program is free software; you can
8** Foundation and appearing in the file LICENSE.GPL included in the 8.> <`_,   >  .   <= redistribute it and/or modify it under
9** packaging of this file. 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10** 10.="- .-=="i,     .._ License as published by the Free Software
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12     ._= =}       : or (at your option) any later version.
13** 13    .%`+i>       _;_.
14**********************************************************************/ 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
15 30
16#include "omanufacturerdb.h" 31#include "omanufacturerdb.h"
17 32
33/* OPIE CORE */
34#include <opie2/odebug.h>
35
18/* QT */ 36/* QT */
19#include <qstring.h> 37#include <qstring.h>
20#include <qfile.h> 38#include <qfile.h>
@@ -26,7 +44,7 @@ OManufacturerDB* OManufacturerDB::instance()
26{ 44{
27 if ( !OManufacturerDB::_instance ) 45 if ( !OManufacturerDB::_instance )
28 { 46 {
29 qDebug( "OManufacturerDB::instance(): creating OManufacturerDB..." ); 47 odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl;
30 _instance = new OManufacturerDB(); 48 _instance = new OManufacturerDB();
31 } 49 }
32 return _instance; 50 return _instance;
@@ -36,15 +54,15 @@ OManufacturerDB* OManufacturerDB::instance()
36OManufacturerDB::OManufacturerDB() 54OManufacturerDB::OManufacturerDB()
37{ 55{
38 QString filename( "/etc/manufacturers" ); 56 QString filename( "/etc/manufacturers" );
39 qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); 57 odebug << "OManufacturerDB: trying to read " << filename << oendl;
40 if ( !QFile::exists( filename ) ) 58 if ( !QFile::exists( filename ) )
41 { 59 {
42 filename = "/opt/QtPalmtop/etc/manufacturers"; 60 filename = "/opt/QtPalmtop/etc/manufacturers";
43 qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); 61 odebug << "OManufacturerDB: trying to read " << filename << oendl;
44 if ( !QFile::exists( filename ) ) 62 if ( !QFile::exists( filename ) )
45 { 63 {
46 filename = "/usr/share/wellenreiter/manufacturers"; 64 filename = "/usr/share/wellenreiter/manufacturers";
47 qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); 65 odebug << "OManufacturerDB: trying to read " << filename << oendl;
48 } 66 }
49 } 67 }
50 68
@@ -52,11 +70,11 @@ OManufacturerDB::OManufacturerDB()
52 bool hasFile = file.open( IO_ReadOnly ); 70 bool hasFile = file.open( IO_ReadOnly );
53 if (!hasFile) 71 if (!hasFile)
54 { 72 {
55 qWarning( "OManufacturerDB: no valid manufacturer list found.", (const char*) filename ); 73 owarn << "OManufacturerDB: no valid manufacturer list found." << oendl;
56 } 74 }
57 else 75 else
58 { 76 {
59 qDebug( "OManufacturerDB: found manufacturer list in '%s'...", (const char*) filename ); 77 odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl;
60 QTextStream s( &file ); 78 QTextStream s( &file );
61 QString addr; 79 QString addr;
62 QString manu; 80 QString manu;
@@ -81,18 +99,13 @@ OManufacturerDB::OManufacturerDB()
81 { 99 {
82 s.skipWhiteSpace(); 100 s.skipWhiteSpace();
83 extManu = s.readLine(); 101 extManu = s.readLine();
84 #ifdef DEBUG 102 odebug << "OManufacturerDB: read " << extManu << " as extended manufacturer string" << oendl;
85 qDebug( "OManufacturerDB: read '%s' as extended manufacturer string", (const char*) extManu );
86 #endif
87 manufacturersExt.insert( addr, extManu ); 103 manufacturersExt.insert( addr, extManu );
88 } 104 }
89 else 105 else
90 s.readLine(); 106 s.readLine();
91 #ifdef DEBUG 107 odebug << "OManufacturerDB: read tuple " << addr << ", " << manu << oendl;
92 qDebug( "ManufacturerDB: read tuple %s, %s", (const char*) addr, (const char*) manu );
93 #endif
94 manufacturers.insert( addr, manu ); 108 manufacturers.insert( addr, manu );
95
96 } 109 }
97 } 110 }
98 111
diff --git a/libopie2/opienet/omanufacturerdb.h b/libopie2/opienet/omanufacturerdb.h
index 651f624..c2712e5 100644
--- a/libopie2/opienet/omanufacturerdb.h
+++ b/libopie2/opienet/omanufacturerdb.h
@@ -1,17 +1,32 @@
1/********************************************************************** 1/*
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2                 This file is part of the Opie Project
3** 3              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4** This file is part of Opie Environment. 4 =.
5** 5 .=l.
6** This file may be distributed and/or modified under the terms of the 6           .>+-=
7** GNU General Public License version 2 as published by the Free Software 7 _;:,     .>    :=|. This program is free software; you can
8** Foundation and appearing in the file LICENSE.GPL included in the 8.> <`_,   >  .   <= redistribute it and/or modify it under
9** packaging of this file. 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10** 10.="- .-=="i,     .._ License as published by the Free Software
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12     ._= =}       : or (at your option) any later version.
13** 13    .%`+i>       _;_.
14**********************************************************************/ 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
15 30
16#ifndef OMANUFACTURERDB_H 31#ifndef OMANUFACTURERDB_H
17#define OMANUFACTURERDB_H 32#define OMANUFACTURERDB_H
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index e3eb327..48cfa43 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -1,7 +1,7 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 4              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 95c813f..6a9280f 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -1,9 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 by the Wellenreiter team: 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4 Martin J. Muench <mjm@remote-exploit.org>
5 Max Moser <mmo@remote-exploit.org
6 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
7 =. 4 =.
8 .=l. 5 .=l.
9           .>+-= 6           .>+-=
@@ -950,6 +947,7 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
950 offset += we->len; 947 offset += we->len;
951 we = (struct iw_event*) &buffer[offset]; 948 we = (struct iw_event*) &buffer[offset];
952 } 949 }
950 return stations;
953 951
954 return stations; 952 return stations;
955 953
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index eb6c86e..bc9e299 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -1,9 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 by the Wellenreiter team: 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4 Martin J. Muench <mjm@remote-exploit.org>
5 Max Moser <mmo@remote-exploit.org
6 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
7 =. 4 =.
8 .=l. 5 .=l.
9           .>+-= 6           .>+-=
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 6331b2d..635224c 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -1,9 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 by the Wellenreiter team: 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4 Martin J. Muench <mjm@remote-exploit.org>
5 Max Moser <mmo@remote-exploit.org
6 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
7 =. 4 =.
8 .=l. 5 .=l.
9           .>+-= 6           .>+-=
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index 54b256b..497fd6b 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -1,9 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 by the Wellenreiter team: 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4 Martin J. Muench <mjm@remote-exploit.org>
5 Max Moser <mmo@remote-exploit.org
6 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
7 =. 4 =.
8 .=l. 5 .=l.
9           .>+-= 6           .>+-=
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro
index 386c2db..2027481 100644
--- a/libopie2/opienet/opienet.pro
+++ b/libopie2/opienet/opienet.pro
@@ -19,7 +19,7 @@ SOURCES = odebugmapper.cpp \
19 ostation.cpp 19 ostation.cpp
20INTERFACES = 20INTERFACES =
21TARGET = opienet2 21TARGET = opienet2
22VERSION = 1.8.1 22VERSION = 1.8.2
23INCLUDEPATH += $(OPIEDIR)/include 23INCLUDEPATH += $(OPIEDIR)/include
24DEPENDPATH += $(OPIEDIR)/include 24DEPENDPATH += $(OPIEDIR)/include
25LIBS += -lpcap 25LIBS += -lpcap
diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp
index ba1e4f6..c363f0c 100644
--- a/libopie2/opienet/ostation.cpp
+++ b/libopie2/opienet/ostation.cpp
@@ -1,7 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 =. 4 =.
6 .=l. 5 .=l.
7           .>+-= 6           .>+-=
diff --git a/libopie2/opienet/ostation.h b/libopie2/opienet/ostation.h
index a6956c9..1e7366d 100644
--- a/libopie2/opienet/ostation.h
+++ b/libopie2/opienet/ostation.h
@@ -1,7 +1,6 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 =. 4 =.
6 .=l. 5 .=l.
7           .>+-= 6           .>+-=
diff --git a/libopie2/opienet/udp_ports.h b/libopie2/opienet/udp_ports.h
index 5e92497..3fb1c85 100644
--- a/libopie2/opienet/udp_ports.h
+++ b/libopie2/opienet/udp_ports.h
@@ -2,7 +2,7 @@
2 * This file has been generated by doing 2 * This file has been generated by doing
3 * find . -name "*"|xargs grep -h '#define UDP_PORT' > udp_ports.h 3 * find . -name "*"|xargs grep -h '#define UDP_PORT' > udp_ports.h
4 * in the root directory of Ethereal 0.9.15. Cudos to the Ethereal Team. 4 * in the root directory of Ethereal 0.9.15. Cudos to the Ethereal Team.
5 * -- Michael 'Mickey' Lauer <mickeyl@handhelds.org> 5 * -- Michael 'Mickey' Lauer <mickey@Vanille.de>
6 */ 6 */
7 7
8 #define UDP_PORT_AODV654 8 #define UDP_PORT_AODV654