author | mickeyl <mickeyl> | 2003-12-01 22:44:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-01 22:44:38 (UTC) |
commit | 7a7683d435cfbb4fa2d6ed99fd4a94d388402aec (patch) (unidiff) | |
tree | 1a34de131d935f34dd2622e3606ba664a7783e24 /libopie2 | |
parent | a4a47fca8badeca2b1aae51b39295ccdc8782c4f (diff) | |
download | opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.zip opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.gz opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.bz2 |
slowly start to refactor & cleanup libopie2 before merging it with libopie1
36 files changed, 162 insertions, 115 deletions
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp index 74886fa..e8bf04f 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp | |||
@@ -1,138 +1,140 @@ | |||
1 | /* QT */ | 1 | /* QT */ |
2 | 2 | ||
3 | #include <qvbox.h> | 3 | #include <qvbox.h> |
4 | #include <qhbox.h> | 4 | #include <qhbox.h> |
5 | #include <qvbuttongroup.h> | 5 | #include <qvbuttongroup.h> |
6 | #include <qhbuttongroup.h> | 6 | #include <qhbuttongroup.h> |
7 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
8 | #include <qradiobutton.h> | 8 | #include <qradiobutton.h> |
9 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
10 | 10 | ||
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | 12 | ||
13 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
14 | 14 | ||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/oapplication.h> | 16 | #include <opie2/oapplication.h> |
17 | #include <opie2/oglobal.h> | 17 | #include <opie2/oglobal.h> |
18 | #include <opie2/oglobalsettings.h> | 18 | #include <opie2/oglobalsettings.h> |
19 | 19 | ||
20 | class DemoApp : public OApplication | 20 | class DemoApp : public OApplication |
21 | { | 21 | { |
22 | Q_OBJECT | 22 | Q_OBJECT |
23 | public: | 23 | public: |
24 | DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) | 24 | DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) |
25 | { | 25 | { |
26 | // you have access to your OApplication object via oApp | 26 | // you have access to your OApplication object via oApp |
27 | qDebug( "Process-wide OApplication object @ %0x", oApp ); | 27 | qDebug( "Process-wide OApplication object @ %0x", oApp ); |
28 | 28 | ||
29 | // you have access to global settings via OGlobalSettings | 29 | // you have access to global settings via OGlobalSettings |
30 | int mode = OGlobalSettings::debugMode(); | 30 | int mode = OGlobalSettings::debugMode(); |
31 | 31 | ||
32 | QVBox* vbox = new QVBox(); | 32 | QVBox* vbox = new QVBox(); |
33 | setMainWidget( vbox ); | 33 | setMainWidget( vbox ); |
34 | 34 | ||
35 | g = new QVButtonGroup( "Output Strategy", vbox ); | 35 | g = new QVButtonGroup( "Output Strategy", vbox ); |
36 | QRadioButton* r0 = new QRadioButton( "file", g ); | 36 | QRadioButton* r0 = new QRadioButton( "file", g ); |
37 | QRadioButton* r1 = new QRadioButton( "messagebox", g ); | 37 | QRadioButton* r1 = new QRadioButton( "messagebox", g ); |
38 | QRadioButton* r2 = new QRadioButton( "stderr", g ); | 38 | QRadioButton* r2 = new QRadioButton( "stderr", g ); |
39 | QRadioButton* r3 = new QRadioButton( "syslog", g ); | 39 | QRadioButton* r3 = new QRadioButton( "syslog", g ); |
40 | QRadioButton* r4 = new QRadioButton( "socket", g ); | 40 | QRadioButton* r4 = new QRadioButton( "socket", g ); |
41 | g->insert( r0, 0 ); | 41 | g->insert( r0, 0 ); |
42 | g->insert( r1, 1 ); | 42 | g->insert( r1, 1 ); |
43 | g->insert( r2, 2 ); | 43 | g->insert( r2, 2 ); |
44 | g->insert( r3, 3 ); | 44 | g->insert( r3, 3 ); |
45 | g->insert( r4, 4 ); | 45 | g->insert( r4, 4 ); |
46 | g->setRadioButtonExclusive( true ); | 46 | g->setRadioButtonExclusive( true ); |
47 | connect( g, SIGNAL( clicked(int) ), this, SLOT( chooseMethod(int) ) ); | 47 | connect( g, SIGNAL( clicked(int) ), this, SLOT( chooseMethod(int) ) ); |
48 | 48 | ||
49 | if ( mode != -1 ) g->setButton( mode ); | 49 | if ( mode != -1 ) g->setButton( mode ); |
50 | 50 | ||
51 | QHButtonGroup* hbox = new QHButtonGroup( "Extra Output Information", vbox ); | 51 | QHButtonGroup* hbox = new QHButtonGroup( "Extra Output Information", vbox ); |
52 | e = new QLineEdit( hbox ); | 52 | e = new QLineEdit( hbox ); |
53 | QPushButton* pb = new QPushButton( hbox ); | 53 | QPushButton* pb = new QPushButton( hbox ); |
54 | 54 | ||
55 | connect( e, SIGNAL( returnPressed() ), this, SLOT( updateDebugOutput() ) ); | 55 | connect( e, SIGNAL( returnPressed() ), this, SLOT( updateDebugOutput() ) ); |
56 | connect( pb, SIGNAL( clicked() ), this, SLOT( updateDebugOutput() ) ); | 56 | connect( pb, SIGNAL( clicked() ), this, SLOT( updateDebugOutput() ) ); |
57 | 57 | ||
58 | // show the additional debug mode dependent output information | 58 | // show the additional debug mode dependent output information |
59 | e->setText( OGlobalSettings::debugOutput() ); | 59 | e->setText( OGlobalSettings::debugOutput() ); |
60 | 60 | ||
61 | // buttos | 61 | // buttos |
62 | QPushButton* info = new QPushButton( "Emit Debug(Info) Output!", vbox ); | 62 | QPushButton* info = new QPushButton( "Emit Debug(Info) Output!", vbox ); |
63 | connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); | 63 | connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); |
64 | QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); | 64 | QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); |
65 | connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); | 65 | connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); |
66 | QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); | 66 | QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); |
67 | connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); | 67 | connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); |
68 | QPushButton* fatal = new QPushButton( "Emit a Fatal Output!", vbox ); | 68 | QPushButton* fatal = new QPushButton( "Emit a Fatal Output!", vbox ); |
69 | connect( fatal, SIGNAL( clicked() ), this, SLOT( emitFatalOutput() ) ); | 69 | connect( fatal, SIGNAL( clicked() ), this, SLOT( emitFatalOutput() ) ); |
70 | 70 | ||
71 | QPushButton* tb = new QPushButton( "Emit a Fatal Backtrace!", vbox ); | 71 | QPushButton* tb = new QPushButton( "Emit a Fatal Backtrace!", vbox ); |
72 | connect( tb, SIGNAL( clicked() ), this, SLOT( emitTBOutput() ) ); | 72 | connect( tb, SIGNAL( clicked() ), this, SLOT( emitTBOutput() ) ); |
73 | 73 | ||
74 | info->show(); | 74 | info->show(); |
75 | warn->show(); | 75 | warn->show(); |
76 | error->show(); | 76 | error->show(); |
77 | fatal->show(); | 77 | fatal->show(); |
78 | tb->show(); | 78 | tb->show(); |
79 | g->show(); | 79 | g->show(); |
80 | hbox->show(); | 80 | hbox->show(); |
81 | e->show(); | 81 | e->show(); |
82 | vbox->show(); | 82 | vbox->show(); |
83 | showMainWidget( vbox ); | 83 | showMainWidget( vbox ); |
84 | } | 84 | } |
85 | 85 | ||
86 | public slots: | 86 | public slots: |
87 | void chooseMethod(int method) | 87 | void chooseMethod(int method) |
88 | { | 88 | { |
89 | m = method; | 89 | m = method; |
90 | qDebug( "choosing method: %d", method ); | 90 | qDebug( "choosing method: %d", method ); |
91 | OConfig* g = OGlobal::config(); | 91 | OConfig* g = OGlobal::config(); |
92 | g->setGroup( "General" ); | 92 | g->setGroup( "General" ); |
93 | g->writeEntry( "debugMode", m ); | 93 | g->writeEntry( "debugMode", m ); |
94 | e->setText( OGlobalSettings::debugOutput() ); | 94 | e->setText( OGlobalSettings::debugOutput() ); |
95 | g->write(); | ||
95 | } | 96 | } |
96 | void updateDebugOutput() | 97 | void updateDebugOutput() |
97 | { | 98 | { |
98 | OConfig* g = OGlobal::config(); | 99 | OConfig* g = OGlobal::config(); |
99 | g->setGroup( "General" ); | 100 | g->setGroup( "General" ); |
100 | g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); | 101 | g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); |
102 | g->write(); | ||
101 | } | 103 | } |
102 | void emitInfoOutput() | 104 | void emitInfoOutput() |
103 | { | 105 | { |
104 | odebug << "This is a debug message" << oendl; | 106 | odebug << "This is a debug message" << oendl; |
105 | } | 107 | } |
106 | void emitWarningOutput() | 108 | void emitWarningOutput() |
107 | { | 109 | { |
108 | owarn << "This is a warning message" << oendl; | 110 | owarn << "This is a warning message" << oendl; |
109 | } | 111 | } |
110 | void emitErrorOutput() | 112 | void emitErrorOutput() |
111 | { | 113 | { |
112 | oerr << "This is an errror message" << oendl; | 114 | oerr << "This is an errror message" << oendl; |
113 | } | 115 | } |
114 | void emitFatalOutput() | 116 | void emitFatalOutput() |
115 | { | 117 | { |
116 | ofatal << "This is a fatal message" << oendl; | 118 | ofatal << "This is a fatal message" << oendl; |
117 | } | 119 | } |
118 | void emitTBOutput() | 120 | void emitTBOutput() |
119 | { | 121 | { |
120 | ofatal << "This is a fatal message + backtrace\n" + odBacktrace(); // odBacktrace includes \n | 122 | ofatal << "This is a fatal message + backtrace\n" + odBacktrace(); // odBacktrace includes \n |
121 | } | 123 | } |
122 | 124 | ||
123 | private: | 125 | private: |
124 | QButtonGroup* g; | 126 | QButtonGroup* g; |
125 | int m; | 127 | int m; |
126 | QLineEdit* e; | 128 | QLineEdit* e; |
127 | }; | 129 | }; |
128 | 130 | ||
129 | int main( int argc, char** argv ) | 131 | int main( int argc, char** argv ) |
130 | { | 132 | { |
131 | DemoApp* app = new DemoApp( argc, argv ); | 133 | DemoApp* app = new DemoApp( argc, argv ); |
132 | app->exec(); | 134 | app->exec(); |
133 | 135 | ||
134 | return 0; | 136 | return 0; |
135 | 137 | ||
136 | } | 138 | } |
137 | 139 | ||
138 | #include "moc/odebugdemo.moc" | 140 | #include "moc/odebugdemo.moc" |
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp index c49daa0..eb2e8e8 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp | |||
@@ -1,217 +1,232 @@ | |||
1 | #include <qdict.h> | 1 | #include <qdict.h> |
2 | #include <qsocketnotifier.h> | 2 | #include <qsocketnotifier.h> |
3 | #include <qstring.h> | 3 | #include <qstring.h> |
4 | #include <opie2/onetwork.h> | 4 | #include <opie2/onetwork.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <opie2/opcap.h> | 6 | #include <opie2/opcap.h> |
7 | #include <cerrno> | 7 | #include <cerrno> |
8 | #include <cstdio> | 8 | #include <cstdio> |
9 | #include <cstdlib> | 9 | #include <cstdlib> |
10 | #include <cstring> | 10 | #include <cstring> |
11 | 11 | ||
12 | //======================== Station help class =============================== | 12 | //======================== Station help class =============================== |
13 | 13 | ||
14 | class Station | 14 | class Station |
15 | { | 15 | { |
16 | public: | 16 | public: |
17 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; | 17 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; |
18 | ~Station() {}; | 18 | ~Station() {}; |
19 | 19 | ||
20 | QString type; | 20 | QString type; |
21 | int channel; | 21 | int channel; |
22 | bool wep; | 22 | bool wep; |
23 | int beacons; | 23 | int beacons; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | QDict<Station> stations; | 26 | QDict<Station> stations; |
27 | 27 | ||
28 | //======================== Application class =============================== | 28 | //======================== Application class =============================== |
29 | 29 | ||
30 | class Wellenreiter : public QApplication | 30 | class Wellenreiter : public QApplication |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | public: | 33 | public: |
34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ) | 34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) |
35 | { | 35 | { |
36 | 36 | ||
37 | ONetwork* net = ONetwork::instance(); | 37 | ONetwork* net = ONetwork::instance(); |
38 | 38 | ||
39 | if ( argc < 3 ) | 39 | if ( argc < 3 ) |
40 | { | 40 | { |
41 | printf( "Usage: ./%s <interface> <driver> <interval>\n", argv[0] ); | 41 | printf( "Usage: ./%s <interface> <driver> <interval>\n", argv[0] ); |
42 | printf( "\n" ); | 42 | printf( "\n" ); |
43 | printf( "Valid wireless interfaces (detected) are:\n" ); | 43 | printf( "Valid wireless interfaces (detected) are:\n" ); |
44 | 44 | ||
45 | ONetwork::InterfaceIterator it = net->iterator(); | 45 | ONetwork::InterfaceIterator it = net->iterator(); |
46 | while ( it.current() ) | 46 | while ( it.current() ) |
47 | { | 47 | { |
48 | if ( it.current()->isWireless() ) | 48 | if ( it.current()->isWireless() ) |
49 | { | 49 | { |
50 | printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), | 50 | printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), |
51 | (const char*) it.current()->macAddress().toString(), | 51 | (const char*) it.current()->macAddress().toString(), |
52 | (const char*) it.current()->ipV4Address() ); | 52 | (const char*) it.current()->ipV4Address() ); |
53 | } | 53 | } |
54 | ++it; | 54 | ++it; |
55 | } | 55 | } |
56 | exit( -1 ); | 56 | exit( -1 ); |
57 | } | 57 | } |
58 | 58 | ||
59 | printf( "****************************************************\n" ); | 59 | printf( "*******************************************************************\n" ); |
60 | printf( "* Wellenreiter mini edition 1.0 (C) 2003 M-M-M *\n" ); | 60 | printf( "* Wellenreiter mini edition 1.0.0 (C) 2003 Michael 'Mickey' Lauer *\n" ); |
61 | printf( "****************************************************\n" ); | 61 | printf( "*******************************************************************\n" ); |
62 | printf( "\n\n" ); | 62 | printf( "\n\n" ); |
63 | 63 | ||
64 | QString interface( argv[1] ); | 64 | QString interface( argv[1] ); |
65 | QString driver( argv[2] ); | 65 | QString driver( argv[2] ); |
66 | 66 | ||
67 | printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); | 67 | printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); |
68 | 68 | ||
69 | // sanity checks before downcasting | 69 | // sanity checks before downcasting |
70 | ONetworkInterface* iface = net->interface( interface ); | 70 | ONetworkInterface* iface = net->interface( interface ); |
71 | if ( !iface ) | 71 | if ( !iface ) |
72 | { | 72 | { |
73 | printf( "Interface '%s' doesn't exist. Exiting.\n", (const char*) interface ); | 73 | printf( "Interface '%s' doesn't exist. Exiting.\n", (const char*) interface ); |
74 | exit( -1 ); | 74 | exit( -1 ); |
75 | } | 75 | } |
76 | if ( !iface->isWireless() ) | 76 | if ( !iface->isWireless() ) |
77 | { | 77 | { |
78 | printf( "Interface '%s' doesn't support wireless extensions. Exiting.\n", (const char*) interface ); | 78 | printf( "Interface '%s' doesn't support wireless extensions. Exiting.\n", (const char*) interface ); |
79 | exit( -1 ); | 79 | exit( -1 ); |
80 | } | 80 | } |
81 | 81 | ||
82 | // downcast should be safe now | 82 | // downcast should be safe now |
83 | wiface = (OWirelessNetworkInterface*) iface; | 83 | wiface = (OWirelessNetworkInterface*) iface; |
84 | printf( "Using wireless interface '%s' for scanning (current SSID is '%s')...\n", (const char*) interface, (const char*) wiface->SSID() ); | 84 | printf( "Using wireless interface '%s' for scanning (current SSID is '%s')...\n", (const char*) interface, (const char*) wiface->SSID() ); |
85 | 85 | ||
86 | // ifconfig +promisc the interface to receive all packets | 86 | // ifconfig +promisc the interface to receive all packets |
87 | if ( !wiface->promiscuousMode() ) | 87 | if ( !wiface->promiscuousMode() ) |
88 | { | 88 | { |
89 | printf( "Interface status is not promisc... switching to promisc... " ); | 89 | printf( "Interface status is not promisc... switching to promisc... " ); |
90 | wiface->setPromiscuousMode( true ); | 90 | wiface->setPromiscuousMode( true ); |
91 | if ( !wiface->promiscuousMode() ) | 91 | if ( !wiface->promiscuousMode() ) |
92 | { | 92 | { |
93 | printf( "failed (%s). Exiting.\n", strerror( errno ) ); | 93 | printf( "failed (%s). Exiting.\n", strerror( errno ) ); |
94 | exit( -1 ); | 94 | exit( -1 ); |
95 | } | 95 | } |
96 | else | 96 | else |
97 | { | 97 | { |
98 | printf( "ok.\n" ); | 98 | printf( "ok.\n" ); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | else | 101 | else |
102 | printf( "Interface status is already promisc - good.\n" ); | 102 | printf( "Interface status is already promisc - good.\n" ); |
103 | 103 | ||
104 | // connect a monitoring strategy to the interface | 104 | // connect a monitoring strategy to the interface |
105 | if ( driver == "orinoco" ) | 105 | if ( driver == "orinoco" ) |
106 | new OOrinocoMonitoringInterface( wiface, false ); | 106 | new OOrinocoMonitoringInterface( wiface, false ); |
107 | else | 107 | else |
108 | if ( driver == "hostap" ) | ||
109 | new OHostAPMonitoringInterface( wiface, false ); | ||
110 | else | ||
111 | if ( driver == "wlan-ng" ) | ||
112 | new OWlanNGMonitoringInterface( wiface, false ); | ||
113 | else | ||
108 | { | 114 | { |
109 | printf( "Unknown driver. Exiting\n" ); | 115 | printf( "Unknown driver. Exiting\n" ); |
110 | exit( -1 ); | 116 | exit( -1 ); |
111 | } | 117 | } |
112 | 118 | ||
113 | // enable monitoring mode | 119 | // enable monitoring mode |
114 | printf( "Enabling monitor mode...\n" ); | 120 | printf( "Enabling monitor mode...\n" ); |
115 | //wiface->setMonitorMode( true ); | 121 | wiface->setMode( "monitor" ); |
116 | 122 | ||
117 | // open a packet capturer | 123 | // open a packet capturer |
118 | cap = new OPacketCapturer(); | 124 | cap = new OPacketCapturer(); |
119 | cap->open( interface ); | 125 | cap->open( interface ); |
120 | if ( !cap->isOpen() ) | 126 | if ( !cap->isOpen() ) |
121 | { | 127 | { |
122 | printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); | 128 | printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); |
123 | exit( -1 ); | 129 | exit( -1 ); |
124 | } | 130 | } |
125 | 131 | ||
126 | // set capturer to non-blocking mode | 132 | // set capturer to non-blocking mode |
127 | cap->setBlocking( false ); | 133 | cap->setBlocking( false ); |
128 | 134 | ||
129 | // start channel hopper | 135 | // start channel hopper |
130 | //wiface->setChannelHopping( 1000 ); | 136 | //wiface->setChannelHopping( 1000 ); |
131 | 137 | ||
132 | // connect | 138 | // connect |
133 | connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 139 | connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
140 | // timer | ||
141 | startTimer( 1000 ); | ||
134 | 142 | ||
135 | } | 143 | } |
136 | 144 | ||
137 | ~Wellenreiter() {}; | 145 | ~Wellenreiter() {}; |
138 | 146 | ||
139 | public slots: | 147 | public slots: |
148 | virtual void timerEvent(QTimerEvent* e) | ||
149 | { | ||
150 | wiface->setChannel( channel++ ); | ||
151 | if ( channel == 14 ) channel = 1; | ||
152 | } | ||
153 | |||
140 | void receivePacket(OPacket* p) | 154 | void receivePacket(OPacket* p) |
141 | { | 155 | { |
142 | if (!p) | 156 | if (!p) |
143 | { | 157 | { |
144 | printf( "(empty packet received)\n" ); | 158 | printf( "(empty packet received)\n" ); |
145 | return; | 159 | return; |
146 | } | 160 | } |
147 | 161 | ||
148 | OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); | 162 | OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); |
149 | if ( beacon ) | 163 | if ( beacon ) |
150 | { | 164 | { |
151 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 165 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
152 | QString essid = ssid ? ssid->ID() : "<unknown>"; | 166 | QString essid = ssid ? ssid->ID() : "<unknown>"; |
153 | 167 | ||
154 | if ( stations.find( essid ) ) | 168 | if ( stations.find( essid ) ) |
155 | stations[essid]->beacons++; | 169 | stations[essid]->beacons++; |
156 | else | 170 | else |
157 | { | 171 | { |
158 | printf( "found new network @ channel %d, SSID = '%s'\n", wiface->channel(), (const char*) essid ); | 172 | printf( "found new network @ channel %d, SSID = '%s'\n", wiface->channel(), (const char*) essid ); |
159 | stations.insert( essid, new Station( "unknown", wiface->channel(), | 173 | stations.insert( essid, new Station( "unknown", wiface->channel(), |
160 | ((OWaveLanPacket*) beacon->parent())->usesWep() ) ); | 174 | ((OWaveLanPacket*) beacon->parent())->usesWep() ) ); |
161 | } | 175 | } |
162 | return; | 176 | return; |
163 | } | 177 | } |
164 | 178 | ||
165 | OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" ); | 179 | OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" ); |
166 | if ( data ) | 180 | if ( data ) |
167 | { | 181 | { |
168 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 182 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
169 | if ( wlan->fromDS() && !wlan->toDS() ) | 183 | if ( wlan->fromDS() && !wlan->toDS() ) |
170 | { | 184 | { |
171 | printf( "FromDS: '%s' -> '%s' via '%s'\n", | 185 | printf( "FromDS: '%s' -> '%s' via '%s'\n", |
172 | (const char*) wlan->macAddress3().toString(true), | 186 | (const char*) wlan->macAddress3().toString(true), |
173 | (const char*) wlan->macAddress1().toString(true), | 187 | (const char*) wlan->macAddress1().toString(true), |
174 | (const char*) wlan->macAddress2().toString(true) ); | 188 | (const char*) wlan->macAddress2().toString(true) ); |
175 | } | 189 | } |
176 | else | 190 | else |
177 | if ( !wlan->fromDS() && wlan->toDS() ) | 191 | if ( !wlan->fromDS() && wlan->toDS() ) |
178 | { | 192 | { |
179 | printf( "ToDS: '%s' -> '%s' via '%s'\n", | 193 | printf( "ToDS: '%s' -> '%s' via '%s'\n", |
180 | (const char*) wlan->macAddress2().toString(true), | 194 | (const char*) wlan->macAddress2().toString(true), |
181 | (const char*) wlan->macAddress3().toString(true), | 195 | (const char*) wlan->macAddress3().toString(true), |
182 | (const char*) wlan->macAddress1().toString(true) ); | 196 | (const char*) wlan->macAddress1().toString(true) ); |
183 | } | 197 | } |
184 | else | 198 | else |
185 | if ( wlan->fromDS() && wlan->toDS() ) | 199 | if ( wlan->fromDS() && wlan->toDS() ) |
186 | { | 200 | { |
187 | printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n", | 201 | printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n", |
188 | (const char*) wlan->macAddress4().toString(true), | 202 | (const char*) wlan->macAddress4().toString(true), |
189 | (const char*) wlan->macAddress3().toString(true), | 203 | (const char*) wlan->macAddress3().toString(true), |
190 | (const char*) wlan->macAddress1().toString(true), | 204 | (const char*) wlan->macAddress1().toString(true), |
191 | (const char*) wlan->macAddress2().toString(true) ); | 205 | (const char*) wlan->macAddress2().toString(true) ); |
192 | } | 206 | } |
193 | else | 207 | else |
194 | { | 208 | { |
195 | printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n", | 209 | printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n", |
196 | (const char*) wlan->macAddress2().toString(true), | 210 | (const char*) wlan->macAddress2().toString(true), |
197 | (const char*) wlan->macAddress1().toString(true), | 211 | (const char*) wlan->macAddress1().toString(true), |
198 | (const char*) wlan->macAddress3().toString(true) ); | 212 | (const char*) wlan->macAddress3().toString(true) ); |
199 | } | 213 | } |
200 | return; | 214 | return; |
201 | } | 215 | } |
202 | } | 216 | } |
203 | private: | 217 | private: |
204 | OPacketCapturer* cap; | 218 | OPacketCapturer* cap; |
205 | OWirelessNetworkInterface* wiface; | 219 | OWirelessNetworkInterface* wiface; |
220 | int channel; | ||
206 | }; | 221 | }; |
207 | 222 | ||
208 | 223 | ||
209 | int main( int argc, char** argv ) | 224 | int main( int argc, char** argv ) |
210 | { | 225 | { |
211 | Wellenreiter w( argc, argv ); | 226 | Wellenreiter w( argc, argv ); |
212 | w.exec(); | 227 | w.exec(); |
213 | return 0; | 228 | return 0; |
214 | } | 229 | } |
215 | 230 | ||
216 | #include "miniwellenreiter.moc" | 231 | #include "miniwellenreiter.moc" |
217 | 232 | ||
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro index 7ce535c..b2c5c14 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | HEADERS = | 3 | HEADERS = |
4 | SOURCES = miniwellenreiter.cpp | 4 | SOURCES = miniwellenreiter.cpp |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
7 | LIBS += -lopiecore2 -lopienet2 | 7 | LIBS += -lopiecore2 -lopienet2 |
8 | TARGET = miniwellenreiter | 8 | TARGET = miniwellenreiter |
9 | MOC_DIR = moc | 9 | MOC_DIR = moc |
10 | OBJECTS_DIR = obj | 10 | OBJECTS_DIR = obj |
11 | 11 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
13 | 13 | ||
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 06b8b19..4763316 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | |||
@@ -17,126 +17,127 @@ int main( int argc, char** argv ) | |||
17 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); | 17 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); |
18 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); | 18 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); |
19 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); | 19 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); |
20 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); | 20 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); |
21 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); | 21 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); |
22 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); | 22 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); |
23 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); | 23 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); |
24 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); | 24 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); |
25 | if ( it.current()->isWireless() ) | 25 | if ( it.current()->isWireless() ) |
26 | { | 26 | { |
27 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); | 27 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); |
28 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); | 28 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); |
29 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); | 29 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); |
30 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); | 30 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); |
31 | 31 | ||
32 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) | 32 | //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) |
33 | //{ | 33 | //{ |
34 | //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); | 34 | //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); |
35 | //} | 35 | //} |
36 | 36 | ||
37 | /* | 37 | /* |
38 | 38 | ||
39 | // nickname | 39 | // nickname |
40 | qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); | 40 | qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); |
41 | iface->setNickName( "MyNickName" ); | 41 | iface->setNickName( "MyNickName" ); |
42 | if ( iface->nickName() != "MyNickName" ) | 42 | if ( iface->nickName() != "MyNickName" ) |
43 | qDebug( "DEMO: Warning! Can't change nickname" ); | 43 | qDebug( "DEMO: Warning! Can't change nickname" ); |
44 | else | 44 | else |
45 | qDebug( "DEMO: Nickname change successful." ); | 45 | qDebug( "DEMO: Nickname change successful." ); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | 48 | ||
49 | // operation mode | 49 | // operation mode |
50 | qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); | 50 | qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); |
51 | iface->setMode( "adhoc" ); | 51 | iface->setMode( "adhoc" ); |
52 | if ( iface->mode() != "adhoc" ) | 52 | if ( iface->mode() != "adhoc" ) |
53 | qDebug( "DEMO: Warning! Can't change operation mode" ); | 53 | qDebug( "DEMO: Warning! Can't change operation mode" ); |
54 | else | 54 | else |
55 | qDebug( "DEMO: Operation Mode change successful." ); | 55 | qDebug( "DEMO: Operation Mode change successful." ); |
56 | 56 | ||
57 | // RF channel | 57 | // RF channel |
58 | qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); | 58 | qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); |
59 | iface->setChannel( 1 ); | 59 | iface->setChannel( 1 ); |
60 | if ( iface->channel() != 1 ) | 60 | if ( iface->channel() != 1 ) |
61 | qDebug( "DEMO: Warning! Can't change RF channel" ); | 61 | qDebug( "DEMO: Warning! Can't change RF channel" ); |
62 | else | 62 | else |
63 | qDebug( "DEMO: RF channel change successful." ); | 63 | qDebug( "DEMO: RF channel change successful." ); |
64 | 64 | ||
65 | iface->setMode( "managed" ); | 65 | iface->setMode( "managed" ); |
66 | 66 | ||
67 | */ | 67 | */ |
68 | 68 | ||
69 | /* | 69 | /* |
70 | 70 | ||
71 | // network scan | 71 | // network scan |
72 | 72 | ||
73 | OStationList* stations = iface->scanNetwork(); | 73 | OStationList* stations = iface->scanNetwork(); |
74 | if ( stations ) | 74 | if ( stations ) |
75 | { | 75 | { |
76 | qDebug( "DEMO: # of stations around = %d", stations->count() ); | 76 | qDebug( "DEMO: # of stations around = %d", stations->count() ); |
77 | OStation* station; | 77 | OStation* station; |
78 | for ( station = stations->first(); station != 0; station = stations->next() ) | 78 | for ( station = stations->first(); station != 0; station = stations->next() ) |
79 | { | 79 | { |
80 | qDebug( "DEMO: station dump following..." ); | 80 | qDebug( "DEMO: station dump following..." ); |
81 | station->dump(); | 81 | station->dump(); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | else | 85 | else |
86 | { | 86 | { |
87 | qDebug( "DEMO: Warning! Scan didn't work!" ); | 87 | qDebug( "DEMO: Warning! Scan didn't work!" ); |
88 | } | 88 | } |
89 | 89 | ||
90 | /* | 90 | /* |
91 | 91 | ||
92 | // first some wrong calls to check if this is working | 92 | // first some wrong calls to check if this is working |
93 | iface->setPrivate( "seppel", 10 ); | 93 | iface->setPrivate( "seppel", 10 ); |
94 | iface->setPrivate( "monitor", 0 ); | 94 | iface->setPrivate( "monitor", 0 ); |
95 | 95 | ||
96 | // now the real deal | 96 | // now the real deal |
97 | iface->setPrivate( "monitor", 2, 2, 3 ); | 97 | iface->setPrivate( "monitor", 2, 2, 3 ); |
98 | 98 | ||
99 | // trying to set hw address to 12:34:56:AB:CD:EF | 99 | // trying to set hw address to 12:34:56:AB:CD:EF |
100 | 100 | ||
101 | /* | 101 | /* |
102 | 102 | ||
103 | OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); | 103 | OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); |
104 | iface->setUp( false ); | 104 | iface->setUp( false ); |
105 | iface->setMacAddress( addr ); | 105 | iface->setMacAddress( addr ); |
106 | iface->setUp( true ); | 106 | iface->setUp( true ); |
107 | qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); | 107 | qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); |
108 | 108 | ||
109 | */ | 109 | */ |
110 | 110 | ||
111 | // monitor test | 111 | // monitor test |
112 | 112 | ||
113 | /* | 113 | |
114 | 114 | ||
115 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 115 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
116 | iface->setMode( "monitor" ); | 116 | iface->setMode( "monitor" ); |
117 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 117 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
118 | 118 | ||
119 | sleep( 1 ); */ | 119 | sleep( 1 ); |
120 | 120 | ||
121 | iface->setMode( "master" ); | 121 | iface->setChannel( 1 ); |
122 | iface->setMode( "managed" ); | ||
122 | 123 | ||
123 | //sleep( 1 ); | 124 | //sleep( 1 ); |
124 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 125 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
125 | 126 | ||
126 | /*iface->setMode( "adhoc" ); | 127 | /*iface->setMode( "adhoc" ); |
127 | sleep( 1 ); | 128 | sleep( 1 ); |
128 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 129 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
129 | iface->setMode( "managed" ); | 130 | iface->setMode( "managed" ); |
130 | sleep( 1 ); | 131 | sleep( 1 ); |
131 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 132 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
132 | iface->setMode( "master" ); | 133 | iface->setMode( "master" ); |
133 | sleep( 1 ); | 134 | sleep( 1 ); |
134 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/ | 135 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/ |
135 | 136 | ||
136 | } | 137 | } |
137 | ++it; | 138 | ++it; |
138 | } | 139 | } |
139 | 140 | ||
140 | return 0; | 141 | return 0; |
141 | 142 | ||
142 | } | 143 | } |
diff --git a/libopie2/libopie2.control b/libopie2/libopie2.control index 6e11cbf..f54efd8 100644 --- a/libopie2/libopie2.control +++ b/libopie2/libopie2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopie2 | 1 | Package: libopie2 |
2 | Files: | 2 | Files: |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libopiecore2 (1.8.1), libopiedb2 (1.8.1), libopiemm2 (1.8.1), libopienet2 (1.8.1), libopiepim2 (1.8.1), libopieui2 (1.8.1) | 8 | Depends: libopiecore2 (1.8.2), libopiedb2 (1.8.2), libopiemm2 (1.8.2), libopienet2 (1.8.2), libopiepim2 (1.8.2), libopieui2 (1.8.2) |
9 | Provides: libopie2 | 9 | Provides: libopie2 |
10 | Description: Opie library 2.0 | 10 | Description: Opie library 2.0 |
11 | 11 | ||
diff --git a/libopie2/opiecore/libopiecore2.control b/libopie2/opiecore/libopiecore2.control index 7dec1b9..956d24f 100644 --- a/libopie2/opiecore/libopiecore2.control +++ b/libopie2/opiecore/libopiecore2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopiecore2 | 1 | Package: libopiecore2 |
2 | Files: $OPIEDIR/lib/libopiecore2.so.* | 2 | Files: $OPIEDIR/lib/libopiecore2.so.* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1 | 8 | Depends: libqpe1 |
9 | Provides: libopiecore2 | 9 | Provides: libopiecore2 |
10 | Description: Opie library 2.0 CORE | 10 | Description: Opie library 2.0 CORE |
11 | 11 | ||
diff --git a/libopie2/opiecore/oconfig.cpp b/libopie2/opiecore/oconfig.cpp index dc4d0b3..fb5eabb 100644 --- a/libopie2/opiecore/oconfig.cpp +++ b/libopie2/opiecore/oconfig.cpp | |||
@@ -1,143 +1,145 @@ | |||
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 Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | Inspired by the config classes from the KDE Project which are | 5 | Inspired by the config classes from the KDE Project which are |
6 | =. (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> | 6 | =. (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | /* QT */ | 32 | /* QT */ |
33 | 33 | ||
34 | #include <qfont.h> | 34 | #include <qfont.h> |
35 | #include <qcolor.h> | 35 | #include <qcolor.h> |
36 | 36 | ||
37 | /* OPIE */ | 37 | /* OPIE */ |
38 | 38 | ||
39 | #include <opie2/oconfig.h> | 39 | #include <opie2/oconfig.h> |
40 | 40 | ||
41 | OConfig::OConfig( const QString &name, Domain domain ) | 41 | OConfig::OConfig( const QString &name, Domain domain ) |
42 | :OpieConfig( name, domain ) | 42 | :Config( name, domain ) |
43 | { | 43 | { |
44 | qDebug( "OConfig::OConfig()" ); | ||
44 | } | 45 | } |
45 | 46 | ||
46 | OConfig::~OConfig() | 47 | OConfig::~OConfig() |
47 | { | 48 | { |
49 | qDebug( "OConfig::~OConfig()" ); | ||
48 | } | 50 | } |
49 | 51 | ||
50 | QColor OConfig::readColorEntry( const QString& key, const QColor* pDefault ) const | 52 | QColor OConfig::readColorEntry( const QString& key, const QColor* pDefault ) const |
51 | { | 53 | { |
52 | QColor aRetColor; | 54 | QColor aRetColor; |
53 | int nRed = 0, nGreen = 0, nBlue = 0; | 55 | int nRed = 0, nGreen = 0, nBlue = 0; |
54 | 56 | ||
55 | QString aValue = readEntry( key ); | 57 | QString aValue = readEntry( key ); |
56 | if( !aValue.isEmpty() ) | 58 | if( !aValue.isEmpty() ) |
57 | { | 59 | { |
58 | if ( aValue.at(0) == '#' ) | 60 | if ( aValue.at(0) == '#' ) |
59 | { | 61 | { |
60 | aRetColor.setNamedColor(aValue); | 62 | aRetColor.setNamedColor(aValue); |
61 | } | 63 | } |
62 | else | 64 | else |
63 | { | 65 | { |
64 | bool bOK; | 66 | bool bOK; |
65 | 67 | ||
66 | // find first part (red) | 68 | // find first part (red) |
67 | int nIndex = aValue.find( ',' ); | 69 | int nIndex = aValue.find( ',' ); |
68 | 70 | ||
69 | if( nIndex == -1 ) | 71 | if( nIndex == -1 ) |
70 | { | 72 | { |
71 | // return a sensible default -- Bernd | 73 | // return a sensible default -- Bernd |
72 | if( pDefault ) | 74 | if( pDefault ) |
73 | aRetColor = *pDefault; | 75 | aRetColor = *pDefault; |
74 | return aRetColor; | 76 | return aRetColor; |
75 | } | 77 | } |
76 | 78 | ||
77 | nRed = aValue.left( nIndex ).toInt( &bOK ); | 79 | nRed = aValue.left( nIndex ).toInt( &bOK ); |
78 | 80 | ||
79 | // find second part (green) | 81 | // find second part (green) |
80 | int nOldIndex = nIndex; | 82 | int nOldIndex = nIndex; |
81 | nIndex = aValue.find( ',', nOldIndex+1 ); | 83 | nIndex = aValue.find( ',', nOldIndex+1 ); |
82 | 84 | ||
83 | if( nIndex == -1 ) | 85 | if( nIndex == -1 ) |
84 | { | 86 | { |
85 | // return a sensible default -- Bernd | 87 | // return a sensible default -- Bernd |
86 | if( pDefault ) | 88 | if( pDefault ) |
87 | aRetColor = *pDefault; | 89 | aRetColor = *pDefault; |
88 | return aRetColor; | 90 | return aRetColor; |
89 | } | 91 | } |
90 | nGreen = aValue.mid( nOldIndex+1, | 92 | nGreen = aValue.mid( nOldIndex+1, |
91 | nIndex-nOldIndex-1 ).toInt( &bOK ); | 93 | nIndex-nOldIndex-1 ).toInt( &bOK ); |
92 | 94 | ||
93 | // find third part (blue) | 95 | // find third part (blue) |
94 | nBlue = aValue.right( aValue.length()-nIndex-1 ).toInt( &bOK ); | 96 | nBlue = aValue.right( aValue.length()-nIndex-1 ).toInt( &bOK ); |
95 | 97 | ||
96 | aRetColor.setRgb( nRed, nGreen, nBlue ); | 98 | aRetColor.setRgb( nRed, nGreen, nBlue ); |
97 | } | 99 | } |
98 | } | 100 | } |
99 | else { | 101 | else { |
100 | 102 | ||
101 | if( pDefault ) | 103 | if( pDefault ) |
102 | aRetColor = *pDefault; | 104 | aRetColor = *pDefault; |
103 | } | 105 | } |
104 | 106 | ||
105 | return aRetColor; | 107 | return aRetColor; |
106 | } | 108 | } |
107 | 109 | ||
108 | // FIXME: The whole font handling has to be revised for Opie | 110 | // FIXME: The whole font handling has to be revised for Opie |
109 | 111 | ||
110 | QFont OConfig::readFontEntry( const QString& key, const QFont* pDefault ) const | 112 | QFont OConfig::readFontEntry( const QString& key, const QFont* pDefault ) const |
111 | { | 113 | { |
112 | /* | 114 | /* |
113 | QFont aRetFont; | 115 | QFont aRetFont; |
114 | 116 | ||
115 | QString aValue = readEntry( key ); | 117 | QString aValue = readEntry( key ); |
116 | if( !aValue.isNull() ) { | 118 | if( !aValue.isNull() ) { |
117 | if ( aValue.contains( ',' ) > 5 ) { | 119 | if ( aValue.contains( ',' ) > 5 ) { |
118 | // KDE3 and upwards entry | 120 | // KDE3 and upwards entry |
119 | if ( !aRetFont.fromString( aValue ) && pDefault ) | 121 | if ( !aRetFont.fromString( aValue ) && pDefault ) |
120 | aRetFont = *pDefault; | 122 | aRetFont = *pDefault; |
121 | } | 123 | } |
122 | else { | 124 | else { |
123 | // backward compatibility with older font formats | 125 | // backward compatibility with older font formats |
124 | // ### remove KDE 3.1 ? | 126 | // ### remove KDE 3.1 ? |
125 | // find first part (font family) | 127 | // find first part (font family) |
126 | int nIndex = aValue.find( ',' ); | 128 | int nIndex = aValue.find( ',' ); |
127 | if( nIndex == -1 ){ | 129 | if( nIndex == -1 ){ |
128 | if( pDefault ) | 130 | if( pDefault ) |
129 | aRetFont = *pDefault; | 131 | aRetFont = *pDefault; |
130 | return aRetFont; | 132 | return aRetFont; |
131 | } | 133 | } |
132 | aRetFont.setFamily( aValue.left( nIndex ) ); | 134 | aRetFont.setFamily( aValue.left( nIndex ) ); |
133 | 135 | ||
134 | // find second part (point size) | 136 | // find second part (point size) |
135 | int nOldIndex = nIndex; | 137 | int nOldIndex = nIndex; |
136 | nIndex = aValue.find( ',', nOldIndex+1 ); | 138 | nIndex = aValue.find( ',', nOldIndex+1 ); |
137 | if( nIndex == -1 ){ | 139 | if( nIndex == -1 ){ |
138 | if( pDefault ) | 140 | if( pDefault ) |
139 | aRetFont = *pDefault; | 141 | aRetFont = *pDefault; |
140 | return aRetFont; | 142 | return aRetFont; |
141 | } | 143 | } |
142 | 144 | ||
143 | aRetFont.setPointSize( aValue.mid( nOldIndex+1, | 145 | aRetFont.setPointSize( aValue.mid( nOldIndex+1, |
diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h index 75aa170..444d280 100644 --- a/libopie2/opiecore/oconfig.h +++ b/libopie2/opiecore/oconfig.h | |||
@@ -1,140 +1,140 @@ | |||
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@tm.informatik.uni-frankfurt.de> |
5 | Inspired by the config classes from the KDE Project which are | 5 | Inspired by the config classes from the KDE Project which are |
6 | =. (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> | 6 | =. (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OCONFIG_H | 32 | #ifndef OCONFIG_H |
33 | #define OCONFIG_H | 33 | #define OCONFIG_H |
34 | 34 | ||
35 | //FIXME: Implement for X11 or reuse libqpe/Config there also? | 35 | //FIXME: Implement for X11 or reuse libqpe/Config there also? |
36 | //FIXME: Or rather use QSettings also for libqpe? | 36 | //FIXME: Or rather use QSettings also for libqpe? |
37 | 37 | ||
38 | #include "opieconfig.h" | 38 | #include <qpe/config.h> |
39 | 39 | ||
40 | class QColor; | 40 | class QColor; |
41 | class QFont; | 41 | class QFont; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * A Configuration class based on the Qtopia @ref Config class | 44 | * A Configuration class based on the Qtopia @ref Config class |
45 | * featuring additional handling of color and font entries | 45 | * featuring additional handling of color and font entries |
46 | */ | 46 | */ |
47 | 47 | ||
48 | class OConfig : public OpieConfig | 48 | class OConfig : public Config |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | * Constructs a OConfig object with a @a name. | 52 | * Constructs a OConfig object with a @a name. |
53 | */ | 53 | */ |
54 | OConfig( const QString &name, Domain domain = User ); | 54 | OConfig( const QString &name, Domain domain = User ); |
55 | /** | 55 | /** |
56 | * Destructs the OConfig object. | 56 | * Destructs the OConfig object. |
57 | * | 57 | * |
58 | * Writes back any dirty configuration entries, and destroys | 58 | * Writes back any dirty configuration entries, and destroys |
59 | * dynamically created objects. | 59 | * dynamically created objects. |
60 | */ | 60 | */ |
61 | virtual ~OConfig(); | 61 | virtual ~OConfig(); |
62 | /** | 62 | /** |
63 | * @returns the name of the current group. | 63 | * @returns the name of the current group. |
64 | * The current group is used for searching keys and accessing entries. | 64 | * The current group is used for searching keys and accessing entries. |
65 | */ | 65 | */ |
66 | const QString& group() { return OpieConfig::group(); }; | 66 | const QString& group() { return git.key(); }; |
67 | /** | 67 | /** |
68 | * @returns a @ref QColor entry or a @a default value if the key is not found. | 68 | * @returns a @ref QColor entry or a @a default value if the key is not found. |
69 | */ | 69 | */ |
70 | QColor readColorEntry( const QString& key, const QColor* pDefault ) const; | 70 | QColor readColorEntry( const QString& key, const QColor* pDefault ) const; |
71 | /** | 71 | /** |
72 | * @returns a @ref QFont value or a @a default value if the key is not found. | 72 | * @returns a @ref QFont value or a @a default value if the key is not found. |
73 | */ | 73 | */ |
74 | QFont readFontEntry( const QString& key, const QFont* pDefault ) const; | 74 | QFont readFontEntry( const QString& key, const QFont* pDefault ) const; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * @brief Helper class for easier use of OConfig groups. | 78 | * @brief Helper class for easier use of OConfig groups. |
79 | * | 79 | * |
80 | * Careful programmers always set the group of a | 80 | * Careful programmers always set the group of a |
81 | * @ref OConfig object to the group they want to read from | 81 | * @ref OConfig object to the group they want to read from |
82 | * and set it back to the old one of afterwards. This is usually | 82 | * and set it back to the old one of afterwards. This is usually |
83 | * written as: | 83 | * written as: |
84 | * <pre> | 84 | * <pre> |
85 | * | 85 | * |
86 | * QString oldgroup config()->group(); | 86 | * QString oldgroup config()->group(); |
87 | * config()->setGroup( "TheGroupThatIWant" ); | 87 | * config()->setGroup( "TheGroupThatIWant" ); |
88 | * ... | 88 | * ... |
89 | * config()->writeEntry( "Blah", "Blubb" ); | 89 | * config()->writeEntry( "Blah", "Blubb" ); |
90 | * | 90 | * |
91 | * config()->setGroup( oldgroup ); | 91 | * config()->setGroup( oldgroup ); |
92 | * </pre> | 92 | * </pre> |
93 | * | 93 | * |
94 | * In order to facilitate this task, you can use | 94 | * In order to facilitate this task, you can use |
95 | * OConfigGroupSaver. Simply construct such an object ON THE STACK | 95 | * OConfigGroupSaver. Simply construct such an object ON THE STACK |
96 | * when you want to switch to a new group. Then, when the object goes | 96 | * when you want to switch to a new group. Then, when the object goes |
97 | * out of scope, the group will automatically be restored. If you | 97 | * out of scope, the group will automatically be restored. If you |
98 | * want to use several different groups within a function or method, | 98 | * want to use several different groups within a function or method, |
99 | * you can still use OConfigGroupSaver: Simply enclose all work with | 99 | * you can still use OConfigGroupSaver: Simply enclose all work with |
100 | * one group (including the creation of the OConfigGroupSaver object) | 100 | * one group (including the creation of the OConfigGroupSaver object) |
101 | * in one block. | 101 | * in one block. |
102 | * | 102 | * |
103 | * @author Matthias Kalle Dalheimer <Kalle@kde.org> | 103 | * @author Matthias Kalle Dalheimer <Kalle@kde.org> |
104 | * @version $Id$ | 104 | * @version $Id$ |
105 | * @see OConfig | 105 | * @see OConfig |
106 | */ | 106 | */ |
107 | 107 | ||
108 | class OConfigGroupSaver | 108 | class OConfigGroupSaver |
109 | { | 109 | { |
110 | public: | 110 | public: |
111 | /** | 111 | /** |
112 | * Constructor. | 112 | * Constructor. |
113 | * Create the object giving a @config object and a @a group to become | 113 | * Create the object giving a @config object and a @a group to become |
114 | * the current group. | 114 | * the current group. |
115 | */ | 115 | */ |
116 | OConfigGroupSaver( OConfig* config, QString group ) :_config(config), _oldgroup(config->group() ) | 116 | OConfigGroupSaver( OConfig* config, QString group ) :_config(config), _oldgroup(config->group() ) |
117 | { _config->setGroup( group ); } | 117 | { _config->setGroup( group ); } |
118 | 118 | ||
119 | OConfigGroupSaver( OConfig* config, const char *group ) :_config(config), _oldgroup(config->group()) | 119 | OConfigGroupSaver( OConfig* config, const char *group ) :_config(config), _oldgroup(config->group()) |
120 | { _config->setGroup( group ); } | 120 | { _config->setGroup( group ); } |
121 | 121 | ||
122 | OConfigGroupSaver( OConfig* config, const QCString &group ) : _config(config), _oldgroup(config->group()) | 122 | OConfigGroupSaver( OConfig* config, const QCString &group ) : _config(config), _oldgroup(config->group()) |
123 | { _config->setGroup( group ); } | 123 | { _config->setGroup( group ); } |
124 | /** | 124 | /** |
125 | * Destructor. | 125 | * Destructor. |
126 | * Restores the last current group. | 126 | * Restores the last current group. |
127 | */ | 127 | */ |
128 | ~OConfigGroupSaver() { _config->setGroup( _oldgroup ); } | 128 | ~OConfigGroupSaver() { _config->setGroup( _oldgroup ); } |
129 | 129 | ||
130 | OConfig* config() { return _config; }; | 130 | OConfig* config() { return _config; }; |
131 | 131 | ||
132 | private: | 132 | private: |
133 | OConfig* _config; | 133 | OConfig* _config; |
134 | QString _oldgroup; | 134 | QString _oldgroup; |
135 | 135 | ||
136 | OConfigGroupSaver( const OConfigGroupSaver& ); | 136 | OConfigGroupSaver( const OConfigGroupSaver& ); |
137 | OConfigGroupSaver& operator=( const OConfigGroupSaver& ); | 137 | OConfigGroupSaver& operator=( const OConfigGroupSaver& ); |
138 | }; | 138 | }; |
139 | 139 | ||
140 | #endif // OCONFIG_H | 140 | #endif // OCONFIG_H |
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index b2a37bc..4505ce7 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp | |||
@@ -1,102 +1,101 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) | 3 | (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) |
4 | Inspired by the KDE debug classes, which are | ||
5 | (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) | ||
6 | (C) 2002 Holger Freyther (freyther@kde.org) | 4 | (C) 2002 Holger Freyther (freyther@kde.org) |
5 | (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) | ||
7 | =. | 6 | =. |
8 | .=l. | 7 | .=l. |
9 | .>+-= | 8 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 15 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 23 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
31 | */ | 30 | */ |
32 | 31 | ||
33 | // Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo | 32 | // Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo |
34 | // functions inlined to noops (which would then conflict with their definition here). | 33 | // functions inlined to noops (which would then conflict with their definition here). |
35 | 34 | ||
36 | #include <opie2/odebug.h> | 35 | #include <opie2/odebug.h> |
37 | 36 | ||
38 | #ifdef OPIE_NO_DEBUG | 37 | #ifdef OPIE_NO_DEBUG |
39 | #undef odDebug | 38 | #undef odDebug |
40 | #undef odBacktrace | 39 | #undef odBacktrace |
41 | #endif | 40 | #endif |
42 | 41 | ||
43 | /* OPIE */ | 42 | /* OPIE */ |
44 | 43 | ||
45 | #include <opie2/oapplication.h> | 44 | #include <opie2/oapplication.h> |
46 | #include <opie2/oglobalsettings.h> | 45 | #include <opie2/oglobalsettings.h> |
47 | #include <opie2/oconfig.h> | 46 | #include <opie2/oconfig.h> |
48 | 47 | ||
49 | /* QT */ | 48 | /* QT */ |
50 | 49 | ||
51 | #include <qbrush.h> | 50 | #include <qbrush.h> |
52 | #include <qdatetime.h> | 51 | #include <qdatetime.h> |
53 | #include <qfile.h> | 52 | #include <qfile.h> |
54 | #include <qhostaddress.h> | 53 | #include <qhostaddress.h> |
55 | #include <qmessagebox.h> | 54 | #include <qmessagebox.h> |
56 | #include <qintdict.h> | 55 | #include <qintdict.h> |
57 | #include <qpoint.h> | 56 | #include <qpoint.h> |
58 | #include <qrect.h> | 57 | #include <qrect.h> |
59 | #include <qregion.h> | 58 | #include <qregion.h> |
60 | #include <qsize.h> | 59 | #include <qsize.h> |
61 | #include <qsocketdevice.h> | 60 | #include <qsocketdevice.h> |
62 | #include <qstring.h> | 61 | #include <qstring.h> |
63 | #include <qstringlist.h> | 62 | #include <qstringlist.h> |
64 | #include <qtextstream.h> | 63 | #include <qtextstream.h> |
65 | 64 | ||
66 | /* UNIX */ | 65 | /* UNIX */ |
67 | 66 | ||
68 | #include <stdlib.h> // abort | 67 | #include <stdlib.h> // abort |
69 | #include <unistd.h> // getpid | 68 | #include <unistd.h> // getpid |
70 | #include <stdarg.h> // vararg stuff | 69 | #include <stdarg.h> // vararg stuff |
71 | #include <ctype.h> // isprint | 70 | #include <ctype.h> // isprint |
72 | #include <syslog.h> | 71 | #include <syslog.h> |
73 | #include <errno.h> | 72 | #include <errno.h> |
74 | #include <string.h> | 73 | #include <string.h> |
75 | 74 | ||
76 | #ifndef OPIE_NO_BACKTRACE | 75 | #ifndef OPIE_NO_BACKTRACE |
77 | #include <execinfo.h> | 76 | #include <execinfo.h> |
78 | #endif | 77 | #endif |
79 | 78 | ||
80 | 79 | ||
81 | /*====================================================================================== | 80 | /*====================================================================================== |
82 | * debug levels | 81 | * debug levels |
83 | *======================================================================================*/ | 82 | *======================================================================================*/ |
84 | 83 | ||
85 | enum DebugLevels { | 84 | enum DebugLevels { |
86 | ODEBUG_INFO = 0, | 85 | ODEBUG_INFO = 0, |
87 | ODEBUG_WARN = 1, | 86 | ODEBUG_WARN = 1, |
88 | ODEBUG_ERROR = 2, | 87 | ODEBUG_ERROR = 2, |
89 | ODEBUG_FATAL = 3 | 88 | ODEBUG_FATAL = 3 |
90 | }; | 89 | }; |
91 | 90 | ||
92 | /*====================================================================================== | 91 | /*====================================================================================== |
93 | * oDebug private data | 92 | * oDebug private data |
94 | *======================================================================================*/ | 93 | *======================================================================================*/ |
95 | 94 | ||
96 | /*====================================================================================== | 95 | /*====================================================================================== |
97 | * the main debug function | 96 | * the main debug function |
98 | *======================================================================================*/ | 97 | *======================================================================================*/ |
99 | 98 | ||
100 | static void oDebugBackend( unsigned short level, unsigned int area, const char *data) | 99 | static void oDebugBackend( unsigned short level, unsigned int area, const char *data) |
101 | { | 100 | { |
102 | //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); | 101 | //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); |
diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp index f6071be..ae2fcb6 100644 --- a/libopie2/opiecore/oglobal.cpp +++ b/libopie2/opiecore/oglobal.cpp | |||
@@ -1,36 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <opie2/oglobal.h> | 31 | #include <opie2/oglobal.h> |
32 | 32 | ||
33 | OConfig* OGlobal::_config = 0; | ||
34 | |||
33 | OConfig* OGlobal::config() | 35 | OConfig* OGlobal::config() |
34 | { | 36 | { |
35 | return globalconfig; | 37 | if ( !OGlobal::_config ) |
38 | { | ||
39 | qDebug( "OGlobal::creating global configuration instance." ); | ||
40 | OGlobal::_config = new OConfig( "global" ); | ||
41 | } | ||
42 | return OGlobal::_config; | ||
36 | } | 43 | } |
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index 23cedde..2dc4f9e 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h | |||
@@ -1,49 +1,49 @@ | |||
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 Michael 'Mickey' Lauer <mickey@Vanille.de> | |
4 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
5 | =. | 4 | =. |
6 | .=l. | 5 | .=l. |
7 | .>+-= | 6 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 13 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 21 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
29 | */ | 28 | */ |
30 | 29 | ||
31 | #ifndef OGLOBAL_H | 30 | #ifndef OGLOBAL_H |
32 | #define OGLOBAL_H | 31 | #define OGLOBAL_H |
33 | 32 | ||
34 | #include <qpe/global.h> | ||
35 | #include <opie2/oconfig.h> | 33 | #include <opie2/oconfig.h> |
36 | 34 | ||
37 | static OConfig *globalconfig = new OConfig( "global" ); | 35 | //FIXME Is it wise or even necessary to inherit OGlobal from Global? |
38 | 36 | // once we totally skip libqpe it should ideally swallow Global -zecke | |
39 | //FIXME: Is it wise or even necessary to inherit OGlobal from Global? | 37 | // You're right. I deleted global as the base class. -mickeyl |
40 | // once we totally skip libqpe it should ideally swallow Global -zecke | ||
41 | 38 | ||
42 | class OGlobal : public Global | 39 | class OGlobal |
43 | { | 40 | { |
44 | public: | 41 | public: |
45 | // do we want to put that into OApplication as in KApplication -zecke | 42 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke |
43 | // We already have a per-application config in OApplication | ||
44 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl | ||
46 | static OConfig* config(); | 45 | static OConfig* config(); |
46 | static OConfig* _config; | ||
47 | }; | 47 | }; |
48 | 48 | ||
49 | #endif // OGLOBAL_H | 49 | #endif // OGLOBAL_H |
diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp index 1799529..66adbd0 100644 --- a/libopie2/opiecore/oglobalsettings.cpp +++ b/libopie2/opiecore/oglobalsettings.cpp | |||
@@ -1,136 +1,137 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | Inspired by the KDE globalsettings which are | 5 | Inspired by the KDE globalsettings which are |
6 | Copyright (C) 2000 David Faure <faure@kde.org> | 6 | Copyright (C) 2000 David Faure <faure@kde.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | 34 | ||
35 | #include <opie2/oglobalsettings.h> | 35 | #include <opie2/oglobalsettings.h> |
36 | #include <opie2/oconfig.h> | 36 | #include <opie2/oconfig.h> |
37 | #include <opie2/oglobal.h> | 37 | #include <opie2/oglobal.h> |
38 | 38 | ||
39 | /* QT */ | 39 | /* QT */ |
40 | 40 | ||
41 | #include <qobject.h> | ||
41 | #include <qdir.h> | 42 | #include <qdir.h> |
42 | #include <qpixmap.h> | 43 | #include <qpixmap.h> |
43 | #include <qfontinfo.h> | 44 | #include <qfontinfo.h> |
44 | 45 | ||
45 | /* UNIX */ | 46 | /* UNIX */ |
46 | 47 | ||
47 | #include <stdlib.h> | 48 | #include <stdlib.h> |
48 | 49 | ||
49 | QString* OGlobalSettings::s_desktopPath = 0; | 50 | QString* OGlobalSettings::s_desktopPath = 0; |
50 | QString* OGlobalSettings::s_autostartPath = 0; | 51 | QString* OGlobalSettings::s_autostartPath = 0; |
51 | QString* OGlobalSettings::s_trashPath = 0; | 52 | QString* OGlobalSettings::s_trashPath = 0; |
52 | QString* OGlobalSettings::s_documentPath = 0; | 53 | QString* OGlobalSettings::s_documentPath = 0; |
53 | QFont *OGlobalSettings::_generalFont = 0; | 54 | QFont *OGlobalSettings::_generalFont = 0; |
54 | QFont *OGlobalSettings::_fixedFont = 0; | 55 | QFont *OGlobalSettings::_fixedFont = 0; |
55 | QFont *OGlobalSettings::_toolBarFont = 0; | 56 | QFont *OGlobalSettings::_toolBarFont = 0; |
56 | QFont *OGlobalSettings::_menuFont = 0; | 57 | QFont *OGlobalSettings::_menuFont = 0; |
57 | QFont *OGlobalSettings::_windowTitleFont = 0; | 58 | QFont *OGlobalSettings::_windowTitleFont = 0; |
58 | QFont *OGlobalSettings::_taskbarFont = 0; | 59 | QFont *OGlobalSettings::_taskbarFont = 0; |
59 | 60 | ||
60 | QColor *OGlobalSettings::OpieGray = 0; | 61 | QColor *OGlobalSettings::OpieGray = 0; |
61 | QColor *OGlobalSettings::OpieHighlight = 0; | 62 | QColor *OGlobalSettings::OpieHighlight = 0; |
62 | QColor *OGlobalSettings::OpieAlternate = 0; | 63 | QColor *OGlobalSettings::OpieAlternate = 0; |
63 | 64 | ||
64 | OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0; | 65 | OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0; |
65 | 66 | ||
66 | //FIXME: Add manipulators to the accessors | 67 | //FIXME: Add manipulators to the accessors |
67 | 68 | ||
68 | int OGlobalSettings::dndEventDelay() | 69 | int OGlobalSettings::dndEventDelay() |
69 | { | 70 | { |
70 | OConfig *c = OGlobal::config(); | 71 | OConfig *c = OGlobal::config(); |
71 | OConfigGroupSaver cgs( c, "General" ); | 72 | OConfigGroupSaver cgs( c, "General" ); |
72 | return c->readNumEntry("DndDelay", 2); | 73 | return c->readNumEntry("DndDelay", 2); |
73 | } | 74 | } |
74 | 75 | ||
75 | bool OGlobalSettings::singleClick() | 76 | bool OGlobalSettings::singleClick() |
76 | { | 77 | { |
77 | OConfig *c = OGlobal::config(); | 78 | OConfig *c = OGlobal::config(); |
78 | OConfigGroupSaver cgs( c, "OPIE" ); | 79 | OConfigGroupSaver cgs( c, "OPIE" ); |
79 | return c->readBoolEntry("SingleClick", OPIE_DEFAULT_SINGLECLICK); | 80 | return c->readBoolEntry("SingleClick", OPIE_DEFAULT_SINGLECLICK); |
80 | } | 81 | } |
81 | 82 | ||
82 | bool OGlobalSettings::insertTearOffHandle() | 83 | bool OGlobalSettings::insertTearOffHandle() |
83 | { | 84 | { |
84 | OConfig *c = OGlobal::config(); | 85 | OConfig *c = OGlobal::config(); |
85 | OConfigGroupSaver cgs( c, "OPIE" ); | 86 | OConfigGroupSaver cgs( c, "OPIE" ); |
86 | return c->readBoolEntry("InsertTearOffHandle", OPIE_DEFAULT_INSERTTEAROFFHANDLES); | 87 | return c->readBoolEntry("InsertTearOffHandle", OPIE_DEFAULT_INSERTTEAROFFHANDLES); |
87 | } | 88 | } |
88 | 89 | ||
89 | bool OGlobalSettings::changeCursorOverIcon() | 90 | bool OGlobalSettings::changeCursorOverIcon() |
90 | { | 91 | { |
91 | OConfig *c = OGlobal::config(); | 92 | OConfig *c = OGlobal::config(); |
92 | OConfigGroupSaver cgs( c, "OPIE" ); | 93 | OConfigGroupSaver cgs( c, "OPIE" ); |
93 | return c->readBoolEntry("ChangeCursor", OPIE_DEFAULT_CHANGECURSOR); | 94 | return c->readBoolEntry("ChangeCursor", OPIE_DEFAULT_CHANGECURSOR); |
94 | } | 95 | } |
95 | 96 | ||
96 | bool OGlobalSettings::visualActivate() | 97 | bool OGlobalSettings::visualActivate() |
97 | { | 98 | { |
98 | OConfig *c = OGlobal::config(); | 99 | OConfig *c = OGlobal::config(); |
99 | OConfigGroupSaver cgs( c, "OPIE" ); | 100 | OConfigGroupSaver cgs( c, "OPIE" ); |
100 | return c->readBoolEntry("VisualActivate", OPIE_DEFAULT_VISUAL_ACTIVATE); | 101 | return c->readBoolEntry("VisualActivate", OPIE_DEFAULT_VISUAL_ACTIVATE); |
101 | } | 102 | } |
102 | 103 | ||
103 | unsigned int OGlobalSettings::visualActivateSpeed() | 104 | unsigned int OGlobalSettings::visualActivateSpeed() |
104 | { | 105 | { |
105 | OConfig *c = OGlobal::config(); | 106 | OConfig *c = OGlobal::config(); |
106 | OConfigGroupSaver cgs( c, "OPIE" ); | 107 | OConfigGroupSaver cgs( c, "OPIE" ); |
107 | return | 108 | return |
108 | c->readNumEntry( | 109 | c->readNumEntry( |
109 | "VisualActivateSpeed", | 110 | "VisualActivateSpeed", |
110 | OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED | 111 | OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED |
111 | ); | 112 | ); |
112 | } | 113 | } |
113 | 114 | ||
114 | int OGlobalSettings::autoSelectDelay() | 115 | int OGlobalSettings::autoSelectDelay() |
115 | { | 116 | { |
116 | OConfig *c = OGlobal::config(); | 117 | OConfig *c = OGlobal::config(); |
117 | OConfigGroupSaver cgs( c, "OPIE" ); | 118 | OConfigGroupSaver cgs( c, "OPIE" ); |
118 | return c->readNumEntry("AutoSelectDelay", OPIE_DEFAULT_AUTOSELECTDELAY); | 119 | return c->readNumEntry("AutoSelectDelay", OPIE_DEFAULT_AUTOSELECTDELAY); |
119 | } | 120 | } |
120 | 121 | ||
121 | OGlobalSettings::Completion OGlobalSettings::completionMode() | 122 | OGlobalSettings::Completion OGlobalSettings::completionMode() |
122 | { | 123 | { |
123 | int completion; | 124 | int completion; |
124 | OConfig *c = OGlobal::config(); | 125 | OConfig *c = OGlobal::config(); |
125 | OConfigGroupSaver cgs( c, "General" ); | 126 | OConfigGroupSaver cgs( c, "General" ); |
126 | completion = c->readNumEntry("completionMode", -1); | 127 | completion = c->readNumEntry("completionMode", -1); |
127 | if ((completion < (int) CompletionNone) || | 128 | if ((completion < (int) CompletionNone) || |
128 | (completion > (int) CompletionPopupAuto)) | 129 | (completion > (int) CompletionPopupAuto)) |
129 | { | 130 | { |
130 | completion = (int) CompletionPopup; // Default | 131 | completion = (int) CompletionPopup; // Default |
131 | } | 132 | } |
132 | return (Completion) completion; | 133 | return (Completion) completion; |
133 | } | 134 | } |
134 | 135 | ||
135 | 136 | ||
136 | bool OGlobalSettings::showContextMenusOnPress () | 137 | bool OGlobalSettings::showContextMenusOnPress () |
diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro index fe5800e..5d630ea 100644 --- a/libopie2/opiecore/opiecore.pro +++ b/libopie2/opiecore/opiecore.pro | |||
@@ -1,43 +1,43 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = oapplication.h \ | 4 | HEADERS = oapplication.h \ |
5 | opieapplication.h \ | 5 | opieapplication.h \ |
6 | oconfig.h \ | 6 | oconfig.h \ |
7 | opieconfig.h \ | 7 | opieconfig.h \ |
8 | ocompletionbase.h \ | 8 | ocompletionbase.h \ |
9 | ocompletion.h \ | 9 | ocompletion.h \ |
10 | odebug.h \ | 10 | odebug.h \ |
11 | oglobal.h \ | 11 | oglobal.h \ |
12 | oglobalsettings.h \ | 12 | oglobalsettings.h \ |
13 | osortablevaluelist.h | 13 | osortablevaluelist.h |
14 | 14 | ||
15 | 15 | ||
16 | SOURCES = oapplication.cpp \ | 16 | SOURCES = oapplication.cpp \ |
17 | opieapplication.cpp \ | 17 | opieapplication.cpp \ |
18 | oconfig.cpp \ | 18 | oconfig.cpp \ |
19 | opieconfig.cpp \ | 19 | opieconfig.cpp \ |
20 | ocompletionbase.cpp \ | 20 | ocompletionbase.cpp \ |
21 | ocompletion.cpp \ | 21 | ocompletion.cpp \ |
22 | odebug.cpp \ | 22 | odebug.cpp \ |
23 | oglobal.cpp \ | 23 | oglobal.cpp \ |
24 | oglobalsettings.cpp | 24 | oglobalsettings.cpp |
25 | 25 | ||
26 | INTERFACES = | 26 | INTERFACES = |
27 | TARGET = opiecore2 | 27 | TARGET = opiecore2 |
28 | VERSION = 1.8.1 | 28 | VERSION = 1.8.2 |
29 | INCLUDEPATH += $(OPIEDIR)/include | 29 | INCLUDEPATH += $(OPIEDIR)/include |
30 | DEPENDPATH += $(OPIEDIR)/include | 30 | DEPENDPATH += $(OPIEDIR)/include |
31 | MOC_DIR = moc | 31 | MOC_DIR = moc |
32 | OBJECTS_DIR = obj | 32 | OBJECTS_DIR = obj |
33 | 33 | ||
34 | 34 | ||
35 | !contains( platform, x11 ) { | 35 | !contains( platform, x11 ) { |
36 | LIBS = -lqpe | 36 | LIBS = -lqpe |
37 | include ( $(OPIEDIR)/include.pro ) | 37 | include ( $(OPIEDIR)/include.pro ) |
38 | } | 38 | } |
39 | 39 | ||
40 | contains( platform, x11 ) { | 40 | contains( platform, x11 ) { |
41 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 41 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/libopie2/opiedb/libopiedb2.control b/libopie2/opiedb/libopiedb2.control index 3fe3820..5500dc8 100644 --- a/libopie2/opiedb/libopiedb2.control +++ b/libopie2/opiedb/libopiedb2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopiedb2 | 1 | Package: libopiedb2 |
2 | Files: $OPIEDIR/lib/libopiedb2.so* | 2 | Files: $OPIEDIR/lib/libopiedb2.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1, libopiecore2 (1.8.1) | 8 | Depends: libqpe1, libopiecore2 (1.8.2) |
9 | Provides: libopiedb2 | 9 | Provides: libopiedb2 |
10 | Description: Opie library 2.0 DB | 10 | Description: Opie library 2.0 DB |
11 | 11 | ||
diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro index 6a4e8f1..d869e6f 100644 --- a/libopie2/opiedb/opiedb.pro +++ b/libopie2/opiedb/opiedb.pro | |||
@@ -1,41 +1,41 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | #CONFIG += qt warn_on debug | 2 | #CONFIG += qt warn_on debug |
3 | CONFIG += qt warn_on release | 3 | CONFIG += qt warn_on release |
4 | DESTDIR = $(OPIEDIR)/lib | 4 | DESTDIR = $(OPIEDIR)/lib |
5 | HEADERS = osqlbackend.h \ | 5 | HEADERS = osqlbackend.h \ |
6 | osqldriver.h \ | 6 | osqldriver.h \ |
7 | osqlerror.h \ | 7 | osqlerror.h \ |
8 | osqlmanager.h \ | 8 | osqlmanager.h \ |
9 | osqlquery.h \ | 9 | osqlquery.h \ |
10 | osqlresult.h \ | 10 | osqlresult.h \ |
11 | osqltable.h \ | 11 | osqltable.h \ |
12 | osqlbackendmanager.h \ | 12 | osqlbackendmanager.h \ |
13 | osqlitedriver.h | 13 | osqlitedriver.h |
14 | SOURCES = osqlbackend.cpp \ | 14 | SOURCES = osqlbackend.cpp \ |
15 | osqldriver.cpp \ | 15 | osqldriver.cpp \ |
16 | osqlerror.cpp \ | 16 | osqlerror.cpp \ |
17 | osqlmanager.cpp \ | 17 | osqlmanager.cpp \ |
18 | osqlquery.cpp \ | 18 | osqlquery.cpp \ |
19 | osqlresult.cpp \ | 19 | osqlresult.cpp \ |
20 | osqltable.cpp \ | 20 | osqltable.cpp \ |
21 | osqlbackendmanager.cpp \ | 21 | osqlbackendmanager.cpp \ |
22 | osqlitedriver.cpp | 22 | osqlitedriver.cpp |
23 | INTERFACES = | 23 | INTERFACES = |
24 | TARGET = opiedb2 | 24 | TARGET = opiedb2 |
25 | VERSION = 1.8.1 | 25 | VERSION = 1.8.2 |
26 | INCLUDEPATH += $(OPIEDIR)/include | 26 | INCLUDEPATH += $(OPIEDIR)/include |
27 | DEPENDPATH += $(OPIEDIR)/include | 27 | DEPENDPATH += $(OPIEDIR)/include |
28 | 28 | ||
29 | MOC_DIR = moc | 29 | MOC_DIR = moc |
30 | OBJECTS_DIR = obj | 30 | OBJECTS_DIR = obj |
31 | 31 | ||
32 | LIBS += -lsqlite -lqpe | 32 | LIBS += -lsqlite -lqpe |
33 | 33 | ||
34 | !contains( platform, x11 ) { | 34 | !contains( platform, x11 ) { |
35 | include ( $(OPIEDIR)/include.pro ) | 35 | include ( $(OPIEDIR)/include.pro ) |
36 | } | 36 | } |
37 | 37 | ||
38 | contains( platform, x11 ) { | 38 | contains( platform, x11 ) { |
39 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 39 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
40 | } | 40 | } |
41 | 41 | ||
diff --git a/libopie2/opiemm/libopiemm2.control b/libopie2/opiemm/libopiemm2.control index 7fbadef..f528969 100644 --- a/libopie2/opiemm/libopiemm2.control +++ b/libopie2/opiemm/libopiemm2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopiemm2 | 1 | Package: libopiemm2 |
2 | Files: $OPIEDIR/lib/libopiemm2.so.* | 2 | Files: $OPIEDIR/lib/libopiemm2.so.* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1, libopiecore2 (1.8.1) | 8 | Depends: libqpe1, libopiecore2 (1.8.2) |
9 | Provides: libopiemm2 | 9 | Provides: libopiemm2 |
10 | Description: Opie library 2.0 MM | 10 | Description: Opie library 2.0 MM |
11 | 11 | ||
diff --git a/libopie2/opiemm/opiemm.pro b/libopie2/opiemm/opiemm.pro index d3ce8f7..d5c8238 100644 --- a/libopie2/opiemm/opiemm.pro +++ b/libopie2/opiemm/opiemm.pro | |||
@@ -1,22 +1,22 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = osoundsystem.h | 4 | HEADERS = osoundsystem.h |
5 | SOURCES = osoundsystem.cpp | 5 | SOURCES = osoundsystem.cpp |
6 | INTERFACES = | 6 | INTERFACES = |
7 | TARGET = opiemm2 | 7 | TARGET = opiemm2 |
8 | VERSION = 1.8.1 | 8 | VERSION = 1.8.2 |
9 | INCLUDEPATH += $(OPIEDIR)/include | 9 | INCLUDEPATH += $(OPIEDIR)/include |
10 | DEPENDPATH += $(OPIEDIR)/include | 10 | DEPENDPATH += $(OPIEDIR)/include |
11 | LIBS += | 11 | LIBS += |
12 | MOC_DIR = moc | 12 | MOC_DIR = moc |
13 | OBJECTS_DIR = obj | 13 | OBJECTS_DIR = obj |
14 | 14 | ||
15 | 15 | ||
16 | !contains( platform, x11 ) { | 16 | !contains( platform, x11 ) { |
17 | include ( $(OPIEDIR)/include.pro ) | 17 | include ( $(OPIEDIR)/include.pro ) |
18 | } | 18 | } |
19 | 19 | ||
20 | contains( platform, x11 ) { | 20 | contains( platform, x11 ) { |
21 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 21 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
22 | } | 22 | } |
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 | |||
@@ -104,97 +104,98 @@ struct dhcp_packet { | |||
104 | #define DHO_LOG_SERVERS 7 | 104 | #define DHO_LOG_SERVERS 7 |
105 | #define DHO_COOKIE_SERVERS 8 | 105 | #define DHO_COOKIE_SERVERS 8 |
106 | #define DHO_LPR_SERVERS 9 | 106 | #define DHO_LPR_SERVERS 9 |
107 | #define DHO_IMPRESS_SERVERS 10 | 107 | #define DHO_IMPRESS_SERVERS 10 |
108 | #define DHO_RESOURCE_LOCATION_SERVERS11 | 108 | #define DHO_RESOURCE_LOCATION_SERVERS11 |
109 | #define DHO_HOST_NAME 12 | 109 | #define DHO_HOST_NAME 12 |
110 | #define DHO_BOOT_SIZE 13 | 110 | #define DHO_BOOT_SIZE 13 |
111 | #define DHO_MERIT_DUMP 14 | 111 | #define DHO_MERIT_DUMP 14 |
112 | #define DHO_DOMAIN_NAME 15 | 112 | #define DHO_DOMAIN_NAME 15 |
113 | #define DHO_SWAP_SERVER 16 | 113 | #define DHO_SWAP_SERVER 16 |
114 | #define DHO_ROOT_PATH 17 | 114 | #define DHO_ROOT_PATH 17 |
115 | #define DHO_EXTENSIONS_PATH 18 | 115 | #define DHO_EXTENSIONS_PATH 18 |
116 | #define DHO_IP_FORWARDING 19 | 116 | #define DHO_IP_FORWARDING 19 |
117 | #define DHO_NON_LOCAL_SOURCE_ROUTING20 | 117 | #define DHO_NON_LOCAL_SOURCE_ROUTING20 |
118 | #define DHO_POLICY_FILTER 21 | 118 | #define DHO_POLICY_FILTER 21 |
119 | #define DHO_MAX_DGRAM_REASSEMBLY22 | 119 | #define DHO_MAX_DGRAM_REASSEMBLY22 |
120 | #define DHO_DEFAULT_IP_TTL 23 | 120 | #define DHO_DEFAULT_IP_TTL 23 |
121 | #define DHO_PATH_MTU_AGING_TIMEOUT24 | 121 | #define DHO_PATH_MTU_AGING_TIMEOUT24 |
122 | #define DHO_PATH_MTU_PLATEAU_TABLE25 | 122 | #define DHO_PATH_MTU_PLATEAU_TABLE25 |
123 | #define DHO_INTERFACE_MTU 26 | 123 | #define DHO_INTERFACE_MTU 26 |
124 | #define DHO_ALL_SUBNETS_LOCAL 27 | 124 | #define DHO_ALL_SUBNETS_LOCAL 27 |
125 | #define DHO_BROADCAST_ADDRESS 28 | 125 | #define DHO_BROADCAST_ADDRESS 28 |
126 | #define DHO_PERFORM_MASK_DISCOVERY29 | 126 | #define DHO_PERFORM_MASK_DISCOVERY29 |
127 | #define DHO_MASK_SUPPLIER 30 | 127 | #define DHO_MASK_SUPPLIER 30 |
128 | #define DHO_ROUTER_DISCOVERY 31 | 128 | #define DHO_ROUTER_DISCOVERY 31 |
129 | #define DHO_ROUTER_SOLICITATION_ADDRESS32 | 129 | #define DHO_ROUTER_SOLICITATION_ADDRESS32 |
130 | #define DHO_STATIC_ROUTES 33 | 130 | #define DHO_STATIC_ROUTES 33 |
131 | #define DHO_TRAILER_ENCAPSULATION34 | 131 | #define DHO_TRAILER_ENCAPSULATION34 |
132 | #define DHO_ARP_CACHE_TIMEOUT 35 | 132 | #define DHO_ARP_CACHE_TIMEOUT 35 |
133 | #define DHO_IEEE802_3_ENCAPSULATION36 | 133 | #define DHO_IEEE802_3_ENCAPSULATION36 |
134 | #define DHO_DEFAULT_TCP_TTL 37 | 134 | #define DHO_DEFAULT_TCP_TTL 37 |
135 | #define DHO_TCP_KEEPALIVE_INTERVAL38 | 135 | #define DHO_TCP_KEEPALIVE_INTERVAL38 |
136 | #define DHO_TCP_KEEPALIVE_GARBAGE39 | 136 | #define DHO_TCP_KEEPALIVE_GARBAGE39 |
137 | #define DHO_NIS_DOMAIN 40 | 137 | #define DHO_NIS_DOMAIN 40 |
138 | #define DHO_NIS_SERVERS 41 | 138 | #define DHO_NIS_SERVERS 41 |
139 | #define DHO_NTP_SERVERS 42 | 139 | #define DHO_NTP_SERVERS 42 |
140 | #define DHO_VENDOR_ENCAPSULATED_OPTIONS43 | 140 | #define DHO_VENDOR_ENCAPSULATED_OPTIONS43 |
141 | #define DHO_NETBIOS_NAME_SERVERS44 | 141 | #define DHO_NETBIOS_NAME_SERVERS44 |
142 | #define DHO_NETBIOS_DD_SERVER 45 | 142 | #define DHO_NETBIOS_DD_SERVER 45 |
143 | #define DHO_NETBIOS_NODE_TYPE 46 | 143 | #define DHO_NETBIOS_NODE_TYPE 46 |
144 | #define DHO_NETBIOS_SCOPE 47 | 144 | #define DHO_NETBIOS_SCOPE 47 |
145 | #define DHO_FONT_SERVERS 48 | 145 | #define DHO_FONT_SERVERS 48 |
146 | #define DHO_X_DISPLAY_MANAGER 49 | 146 | #define DHO_X_DISPLAY_MANAGER 49 |
147 | #define DHO_DHCP_REQUESTED_ADDRESS50 | 147 | #define DHO_DHCP_REQUESTED_ADDRESS50 |
148 | #define DHO_DHCP_LEASE_TIME 51 | 148 | #define DHO_DHCP_LEASE_TIME 51 |
149 | #define DHO_DHCP_OPTION_OVERLOAD52 | 149 | #define DHO_DHCP_OPTION_OVERLOAD52 |
150 | #define DHO_DHCP_MESSAGE_TYPE 53 | 150 | #define DHO_DHCP_MESSAGE_TYPE 53 |
151 | #define DHO_DHCP_SERVER_IDENTIFIER54 | 151 | #define DHO_DHCP_SERVER_IDENTIFIER54 |
152 | #define DHO_DHCP_PARAMETER_REQUEST_LIST55 | 152 | #define DHO_DHCP_PARAMETER_REQUEST_LIST55 |
153 | #define DHO_DHCP_MESSAGE 56 | 153 | #define DHO_DHCP_MESSAGE 56 |
154 | #define DHO_DHCP_MAX_MESSAGE_SIZE57 | 154 | #define DHO_DHCP_MAX_MESSAGE_SIZE57 |
155 | #define DHO_DHCP_RENEWAL_TIME 58 | 155 | #define DHO_DHCP_RENEWAL_TIME 58 |
156 | #define DHO_DHCP_REBINDING_TIME 59 | 156 | #define DHO_DHCP_REBINDING_TIME 59 |
157 | #define DHO_VENDOR_CLASS_IDENTIFIER60 | 157 | #define DHO_VENDOR_CLASS_IDENTIFIER60 |
158 | #define DHO_DHCP_CLIENT_IDENTIFIER61 | 158 | #define DHO_DHCP_CLIENT_IDENTIFIER61 |
159 | #define DHO_NWIP_DOMAIN_NAME 62 | 159 | #define DHO_NWIP_DOMAIN_NAME 62 |
160 | #define DHO_NWIP_SUBOPTIONS 63 | 160 | #define DHO_NWIP_SUBOPTIONS 63 |
161 | #define DHO_USER_CLASS 77 | 161 | #define DHO_USER_CLASS 77 |
162 | #define DHO_FQDN 81 | 162 | #define DHO_FQDN 81 |
163 | #define DHO_DHCP_AGENT_OPTIONS 82 | 163 | #define DHO_DHCP_AGENT_OPTIONS 82 |
164 | #define DHO_SUBNET_SELECTION 118 /* RFC3011! */ | 164 | #define DHO_SUBNET_SELECTION 118 /* RFC3011! */ |
165 | /* The DHO_AUTHENTICATE option is not a standard yet, so I've | 165 | /* The DHO_AUTHENTICATE option is not a standard yet, so I've |
166 | allocated an option out of the "local" option space for it on a | 166 | allocated an option out of the "local" option space for it on a |
167 | temporary basis. Once an option code number is assigned, I will | 167 | temporary basis. Once an option code number is assigned, I will |
168 | immediately and shamelessly break this, so don't count on it | 168 | immediately and shamelessly break this, so don't count on it |
169 | continuing to work. */ | 169 | continuing to work. */ |
170 | #define DHO_AUTHENTICATE 210 | 170 | #define DHO_AUTHENTICATE 210 |
171 | 171 | ||
172 | #define DHO_END 255 | 172 | #define DHO_END 255 |
173 | 173 | ||
174 | /* DHCP message types. */ | 174 | /* DHCP message types. */ |
175 | #define DHCPDISCOVER1 | 175 | #define DHCPDISCOVER1 |
176 | #define DHCPOFFER2 | 176 | #define DHCPOFFER2 |
177 | #define DHCPREQUEST3 | 177 | #define DHCPREQUEST3 |
178 | #define DHCPDECLINE4 | 178 | #define DHCPDECLINE4 |
179 | #define DHCPACK 5 | 179 | #define DHCPACK 5 |
180 | #define DHCPNAK 6 | 180 | #define DHCPNAK 6 |
181 | #define DHCPRELEASE7 | 181 | #define DHCPRELEASE7 |
182 | #define DHCPINFORM8 | 182 | #define DHCPINFORM8 |
183 | 183 | ||
184 | /* Relay Agent Information option subtypes: */ | 184 | /* Relay Agent Information option subtypes: */ |
185 | #define RAI_CIRCUIT_ID1 | 185 | #define RAI_CIRCUIT_ID1 |
186 | #define RAI_REMOTE_ID2 | 186 | #define RAI_REMOTE_ID2 |
187 | #define RAI_AGENT_ID3 | 187 | #define RAI_AGENT_ID3 |
188 | 188 | ||
189 | /* FQDN suboptions: */ | 189 | /* FQDN suboptions: */ |
190 | #define FQDN_NO_CLIENT_UPDATE 1 | 190 | #define FQDN_NO_CLIENT_UPDATE 1 |
191 | #define FQDN_SERVER_UPDATE 2 | 191 | #define FQDN_SERVER_UPDATE 2 |
192 | #define FQDN_ENCODED 3 | 192 | #define FQDN_ENCODED 3 |
193 | #define FQDN_RCODE1 4 | 193 | #define FQDN_RCODE1 4 |
194 | #define FQDN_RCODE2 5 | 194 | #define FQDN_RCODE2 5 |
195 | #define FQDN_HOSTNAME 6 | 195 | #define FQDN_HOSTNAME 6 |
196 | #define FQDN_DOMAINNAME 7 | 196 | #define FQDN_DOMAINNAME 7 |
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 | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopienet2 | 1 | Package: libopienet2 |
2 | Files: $OPIEDIR/lib/libopienet2.so.* $OPIEDIR/etc/manufacturers | 2 | Files: $OPIEDIR/lib/libopienet2.so.* $OPIEDIR/etc/manufacturers |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1, libopiecore2 (1.8.1) | 8 | Depends: libopiecore2 (1.8.2) |
9 | Provides: libopienet2 | 9 | Provides: libopienet2 |
10 | Description: Opie library 2.0 NET | 10 | Description: 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 | |||
@@ -1,213 +1,215 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
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 | ||
8 | DebugMapper::DebugMapper() | 10 | DebugMapper::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") ); |
14 | _map.insert( 0x8904, new QString("SIOCGPGRP") ); | 16 | _map.insert( 0x8904, new QString("SIOCGPGRP") ); |
15 | _map.insert( 0x8905, new QString("SIOCATMARK") ); | 17 | _map.insert( 0x8905, new QString("SIOCATMARK") ); |
16 | _map.insert( 0x8906, new QString("SIOCGSTAMP") ); | 18 | _map.insert( 0x8906, new QString("SIOCGSTAMP") ); |
17 | _map.insert( 0x890B, new QString("SIOCADDRT") ); | 19 | _map.insert( 0x890B, new QString("SIOCADDRT") ); |
18 | _map.insert( 0x890C, new QString("SIOCDELRT") ); | 20 | _map.insert( 0x890C, new QString("SIOCDELRT") ); |
19 | _map.insert( 0x890D, new QString("SIOCRTMSG") ); | 21 | _map.insert( 0x890D, new QString("SIOCRTMSG") ); |
20 | _map.insert( 0x8910, new QString("SIOCGIFNAME") ); | 22 | _map.insert( 0x8910, new QString("SIOCGIFNAME") ); |
21 | _map.insert( 0x8911, new QString("SIOCSIFLINK") ); | 23 | _map.insert( 0x8911, new QString("SIOCSIFLINK") ); |
22 | _map.insert( 0x8912, new QString("SIOCGIFCONF") ); | 24 | _map.insert( 0x8912, new QString("SIOCGIFCONF") ); |
23 | _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); | 25 | _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); |
24 | _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); | 26 | _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); |
25 | _map.insert( 0x8915, new QString("SIOCGIFADDR") ); | 27 | _map.insert( 0x8915, new QString("SIOCGIFADDR") ); |
26 | _map.insert( 0x8916, new QString("SIOCSIFADDR") ); | 28 | _map.insert( 0x8916, new QString("SIOCSIFADDR") ); |
27 | _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); | 29 | _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); |
28 | _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); | 30 | _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); |
29 | _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); | 31 | _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); |
30 | _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); | 32 | _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); |
31 | _map.insert( 0x891b, new QString("SIOCGIFNETMASK") ); | 33 | _map.insert( 0x891b, new QString("SIOCGIFNETMASK") ); |
32 | _map.insert( 0x891c, new QString("SIOCSIFNETMASK") ); | 34 | _map.insert( 0x891c, new QString("SIOCSIFNETMASK") ); |
33 | _map.insert( 0x891d, new QString("SIOCGIFMETRIC") ); | 35 | _map.insert( 0x891d, new QString("SIOCGIFMETRIC") ); |
34 | _map.insert( 0x891e, new QString("SIOCSIFMETRIC") ); | 36 | _map.insert( 0x891e, new QString("SIOCSIFMETRIC") ); |
35 | _map.insert( 0x891f, new QString("SIOCGIFMEM") ); | 37 | _map.insert( 0x891f, new QString("SIOCGIFMEM") ); |
36 | _map.insert( 0x8920, new QString("SIOCSIFMEM") ); | 38 | _map.insert( 0x8920, new QString("SIOCSIFMEM") ); |
37 | _map.insert( 0x8921, new QString("SIOCGIFMTU") ); | 39 | _map.insert( 0x8921, new QString("SIOCGIFMTU") ); |
38 | _map.insert( 0x8922, new QString("SIOCSIFMTU") ); | 40 | _map.insert( 0x8922, new QString("SIOCSIFMTU") ); |
39 | _map.insert( 0x8923, new QString("SIOCSIFNAME") ); | 41 | _map.insert( 0x8923, new QString("SIOCSIFNAME") ); |
40 | _map.insert( 0x8924, new QString("SIOCSIFHWADDR") ); | 42 | _map.insert( 0x8924, new QString("SIOCSIFHWADDR") ); |
41 | _map.insert( 0x8925, new QString("SIOCGIFENCAP") ); | 43 | _map.insert( 0x8925, new QString("SIOCGIFENCAP") ); |
42 | _map.insert( 0x8926, new QString("SIOCSIFENCAP") ); | 44 | _map.insert( 0x8926, new QString("SIOCSIFENCAP") ); |
43 | _map.insert( 0x8927, new QString("SIOCGIFHWADDR") ); | 45 | _map.insert( 0x8927, new QString("SIOCGIFHWADDR") ); |
44 | _map.insert( 0x8929, new QString("SIOCGIFSLAVE") ); | 46 | _map.insert( 0x8929, new QString("SIOCGIFSLAVE") ); |
45 | _map.insert( 0x8930, new QString("SIOCSIFSLAVE") ); | 47 | _map.insert( 0x8930, new QString("SIOCSIFSLAVE") ); |
46 | _map.insert( 0x8931, new QString("SIOCADDMULTI") ); | 48 | _map.insert( 0x8931, new QString("SIOCADDMULTI") ); |
47 | _map.insert( 0x8932, new QString("SIOCDELMULTI") ); | 49 | _map.insert( 0x8932, new QString("SIOCDELMULTI") ); |
48 | _map.insert( 0x8933, new QString("SIOCGIFINDEX") ); | 50 | _map.insert( 0x8933, new QString("SIOCGIFINDEX") ); |
49 | _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") ); | 51 | _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") ); |
50 | _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") ); | 52 | _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") ); |
51 | _map.insert( 0x8936, new QString("SIOCDIFADDR") ); | 53 | _map.insert( 0x8936, new QString("SIOCDIFADDR") ); |
52 | _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") ); | 54 | _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") ); |
53 | _map.insert( 0x8938, new QString("SIOCGIFCOUNT") ); | 55 | _map.insert( 0x8938, new QString("SIOCGIFCOUNT") ); |
54 | _map.insert( 0x8940, new QString("SIOCGIFBR") ); | 56 | _map.insert( 0x8940, new QString("SIOCGIFBR") ); |
55 | _map.insert( 0x8941, new QString("SIOCSIFBR") ); | 57 | _map.insert( 0x8941, new QString("SIOCSIFBR") ); |
56 | _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") ); | 58 | _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") ); |
57 | _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") ); | 59 | _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") ); |
58 | _map.insert( 0x8953, new QString("SIOCDARP") ); | 60 | _map.insert( 0x8953, new QString("SIOCDARP") ); |
59 | _map.insert( 0x8954, new QString("SIOCGARP") ); | 61 | _map.insert( 0x8954, new QString("SIOCGARP") ); |
60 | _map.insert( 0x8955, new QString("SIOCSARP") ); | 62 | _map.insert( 0x8955, new QString("SIOCSARP") ); |
61 | _map.insert( 0x8960, new QString("SIOCDRARP") ); | 63 | _map.insert( 0x8960, new QString("SIOCDRARP") ); |
62 | _map.insert( 0x8961, new QString("SIOCGRARP") ); | 64 | _map.insert( 0x8961, new QString("SIOCGRARP") ); |
63 | _map.insert( 0x8962, new QString("SIOCSRARP") ); | 65 | _map.insert( 0x8962, new QString("SIOCSRARP") ); |
64 | _map.insert( 0x8970, new QString("SIOCGIFMAP") ); | 66 | _map.insert( 0x8970, new QString("SIOCGIFMAP") ); |
65 | _map.insert( 0x8971, new QString("SIOCSIFMAP") ); | 67 | _map.insert( 0x8971, new QString("SIOCSIFMAP") ); |
66 | _map.insert( 0x8980, new QString("SIOCADDDLCI") ); | 68 | _map.insert( 0x8980, new QString("SIOCADDDLCI") ); |
67 | _map.insert( 0x8981, new QString("SIOCDELDLCI") ); | 69 | _map.insert( 0x8981, new QString("SIOCDELDLCI") ); |
68 | _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") ); | 70 | _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") ); |
69 | _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") ); | 71 | _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") ); |
70 | _map.insert( 0x1fff, new QString("SIOCPARM_MASK") ); | 72 | _map.insert( 0x1fff, new QString("SIOCPARM_MASK") ); |
71 | _map.insert( 0x00000000, new QString("SIOC_VOID") ); | 73 | _map.insert( 0x00000000, new QString("SIOC_VOID") ); |
72 | _map.insert( 0x20000000, new QString("SIOC_OUT") ); | 74 | _map.insert( 0x20000000, new QString("SIOC_OUT") ); |
73 | _map.insert( 0x40000000, new QString("SIOC_IN") ); | 75 | _map.insert( 0x40000000, new QString("SIOC_IN") ); |
74 | _map.insert( 0x8B00, new QString("SIOCSIWCOMMIT") ); | 76 | _map.insert( 0x8B00, new QString("SIOCSIWCOMMIT") ); |
75 | _map.insert( 0x8B01, new QString("SIOCGIWNAME") ); | 77 | _map.insert( 0x8B01, new QString("SIOCGIWNAME") ); |
76 | _map.insert( 0x8B02, new QString("SIOCSIWNWID") ); | 78 | _map.insert( 0x8B02, new QString("SIOCSIWNWID") ); |
77 | _map.insert( 0x8B03, new QString("SIOCGIWNWID") ); | 79 | _map.insert( 0x8B03, new QString("SIOCGIWNWID") ); |
78 | _map.insert( 0x8B04, new QString("SIOCSIWFREQ") ); | 80 | _map.insert( 0x8B04, new QString("SIOCSIWFREQ") ); |
79 | _map.insert( 0x8B05, new QString("SIOCGIWFREQ") ); | 81 | _map.insert( 0x8B05, new QString("SIOCGIWFREQ") ); |
80 | _map.insert( 0x8B06, new QString("SIOCSIWMODE") ); | 82 | _map.insert( 0x8B06, new QString("SIOCSIWMODE") ); |
81 | _map.insert( 0x8B07, new QString("SIOCGIWMODE") ); | 83 | _map.insert( 0x8B07, new QString("SIOCGIWMODE") ); |
82 | _map.insert( 0x8B08, new QString("SIOCSIWSENS") ); | 84 | _map.insert( 0x8B08, new QString("SIOCSIWSENS") ); |
83 | _map.insert( 0x8B09, new QString("SIOCGIWSENS") ); | 85 | _map.insert( 0x8B09, new QString("SIOCGIWSENS") ); |
84 | _map.insert( 0x8B0A, new QString("SIOCSIWRANGE") ); | 86 | _map.insert( 0x8B0A, new QString("SIOCSIWRANGE") ); |
85 | _map.insert( 0x8B0B, new QString("SIOCGIWRANGE") ); | 87 | _map.insert( 0x8B0B, new QString("SIOCGIWRANGE") ); |
86 | _map.insert( 0x8B0C, new QString("SIOCSIWPRIV") ); | 88 | _map.insert( 0x8B0C, new QString("SIOCSIWPRIV") ); |
87 | _map.insert( 0x8B0D, new QString("SIOCGIWPRIV") ); | 89 | _map.insert( 0x8B0D, new QString("SIOCGIWPRIV") ); |
88 | _map.insert( 0x8B0E, new QString("SIOCSIWSTATS") ); | 90 | _map.insert( 0x8B0E, new QString("SIOCSIWSTATS") ); |
89 | _map.insert( 0x8B0F, new QString("SIOCGIWSTATS") ); | 91 | _map.insert( 0x8B0F, new QString("SIOCGIWSTATS") ); |
90 | _map.insert( 0x8B10, new QString("SIOCSIWSPY") ); | 92 | _map.insert( 0x8B10, new QString("SIOCSIWSPY") ); |
91 | _map.insert( 0x8B11, new QString("SIOCGIWSPY") ); | 93 | _map.insert( 0x8B11, new QString("SIOCGIWSPY") ); |
92 | _map.insert( 0x8B14, new QString("SIOCSIWAP") ); | 94 | _map.insert( 0x8B14, new QString("SIOCSIWAP") ); |
93 | _map.insert( 0x8B15, new QString("SIOCGIWAP") ); | 95 | _map.insert( 0x8B15, new QString("SIOCGIWAP") ); |
94 | _map.insert( 0x8B17, new QString("SIOCGIWAPLIST") ); | 96 | _map.insert( 0x8B17, new QString("SIOCGIWAPLIST") ); |
95 | _map.insert( 0x8B18, new QString("SIOCSIWSCAN") ); | 97 | _map.insert( 0x8B18, new QString("SIOCSIWSCAN") ); |
96 | _map.insert( 0x8B19, new QString("SIOCGIWSCAN") ); | 98 | _map.insert( 0x8B19, new QString("SIOCGIWSCAN") ); |
97 | _map.insert( 0x8B1A, new QString("SIOCSIWESSID") ); | 99 | _map.insert( 0x8B1A, new QString("SIOCSIWESSID") ); |
98 | _map.insert( 0x8B1B, new QString("SIOCGIWESSID") ); | 100 | _map.insert( 0x8B1B, new QString("SIOCGIWESSID") ); |
99 | _map.insert( 0x8B1C, new QString("SIOCSIWNICKN") ); | 101 | _map.insert( 0x8B1C, new QString("SIOCSIWNICKN") ); |
100 | _map.insert( 0x8B1D, new QString("SIOCGIWNICKN") ); | 102 | _map.insert( 0x8B1D, new QString("SIOCGIWNICKN") ); |
101 | _map.insert( 0x8B20, new QString("SIOCSIWRATE") ); | 103 | _map.insert( 0x8B20, new QString("SIOCSIWRATE") ); |
102 | _map.insert( 0x8B21, new QString("SIOCGIWRATE") ); | 104 | _map.insert( 0x8B21, new QString("SIOCGIWRATE") ); |
103 | _map.insert( 0x8B22, new QString("SIOCSIWRTS") ); | 105 | _map.insert( 0x8B22, new QString("SIOCSIWRTS") ); |
104 | _map.insert( 0x8B23, new QString("SIOCGIWRTS") ); | 106 | _map.insert( 0x8B23, new QString("SIOCGIWRTS") ); |
105 | _map.insert( 0x8B24, new QString("SIOCSIWFRAG") ); | 107 | _map.insert( 0x8B24, new QString("SIOCSIWFRAG") ); |
106 | _map.insert( 0x8B25, new QString("SIOCGIWFRAG") ); | 108 | _map.insert( 0x8B25, new QString("SIOCGIWFRAG") ); |
107 | _map.insert( 0x8B26, new QString("SIOCSIWTXPOW") ); | 109 | _map.insert( 0x8B26, new QString("SIOCSIWTXPOW") ); |
108 | _map.insert( 0x8B27, new QString("SIOCGIWTXPOW") ); | 110 | _map.insert( 0x8B27, new QString("SIOCGIWTXPOW") ); |
109 | _map.insert( 0x8B28, new QString("SIOCSIWRETRY") ); | 111 | _map.insert( 0x8B28, new QString("SIOCSIWRETRY") ); |
110 | _map.insert( 0x8B29, new QString("SIOCGIWRETRY") ); | 112 | _map.insert( 0x8B29, new QString("SIOCGIWRETRY") ); |
111 | _map.insert( 0x8B2A, new QString("SIOCSIWENCODE") ); | 113 | _map.insert( 0x8B2A, new QString("SIOCSIWENCODE") ); |
112 | _map.insert( 0x8B2B, new QString("SIOCGIWENCODE") ); | 114 | _map.insert( 0x8B2B, new QString("SIOCGIWENCODE") ); |
113 | _map.insert( 0x8B2C, new QString("SIOCSIWPOWER") ); | 115 | _map.insert( 0x8B2C, new QString("SIOCSIWPOWER") ); |
114 | _map.insert( 0x8B2D, new QString("SIOCGIWPOWER") ); | 116 | _map.insert( 0x8B2D, new QString("SIOCGIWPOWER") ); |
115 | _map.insert( 0x8BE0, new QString("SIOCIWFIRSTPRIV") ); | 117 | _map.insert( 0x8BE0, new QString("SIOCIWFIRSTPRIV") ); |
116 | _map.insert( 0x8BFF, new QString("SIOCIWLASTPRIV") ); | 118 | _map.insert( 0x8BFF, new QString("SIOCIWLASTPRIV") ); |
117 | _map.insert( 0x8B00, new QString("SIOCIWFIRST") ); | 119 | _map.insert( 0x8B00, new QString("SIOCIWFIRST") ); |
118 | _map.insert( 0x5000, new QString("SIOCGBPQETHPARAM") ); | 120 | _map.insert( 0x5000, new QString("SIOCGBPQETHPARAM") ); |
119 | _map.insert( 0x5001, new QString("SIOCSBPQETHPARAM") ); | 121 | _map.insert( 0x5001, new QString("SIOCSBPQETHPARAM") ); |
120 | _map.insert( 0x890B, new QString("SIOCADDRT") ); | 122 | _map.insert( 0x890B, new QString("SIOCADDRT") ); |
121 | _map.insert( 0x890C, new QString("SIOCDELRT") ); | 123 | _map.insert( 0x890C, new QString("SIOCDELRT") ); |
122 | _map.insert( 0x890D, new QString("SIOCRTMSG") ); | 124 | _map.insert( 0x890D, new QString("SIOCRTMSG") ); |
123 | _map.insert( 0x8910, new QString("SIOCGIFNAME") ); | 125 | _map.insert( 0x8910, new QString("SIOCGIFNAME") ); |
124 | _map.insert( 0x8911, new QString("SIOCSIFLINK") ); | 126 | _map.insert( 0x8911, new QString("SIOCSIFLINK") ); |
125 | _map.insert( 0x8912, new QString("SIOCGIFCONF") ); | 127 | _map.insert( 0x8912, new QString("SIOCGIFCONF") ); |
126 | _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); | 128 | _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); |
127 | _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); | 129 | _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); |
128 | _map.insert( 0x8915, new QString("SIOCGIFADDR") ); | 130 | _map.insert( 0x8915, new QString("SIOCGIFADDR") ); |
129 | _map.insert( 0x8916, new QString("SIOCSIFADDR") ); | 131 | _map.insert( 0x8916, new QString("SIOCSIFADDR") ); |
130 | _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); | 132 | _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); |
131 | _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); | 133 | _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); |
132 | _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); | 134 | _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); |
133 | _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); | 135 | _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); |
134 | _map.insert( 0x891b, new QString("SIOCGIFNETMASK") ); | 136 | _map.insert( 0x891b, new QString("SIOCGIFNETMASK") ); |
135 | _map.insert( 0x891c, new QString("SIOCSIFNETMASK") ); | 137 | _map.insert( 0x891c, new QString("SIOCSIFNETMASK") ); |
136 | _map.insert( 0x891d, new QString("SIOCGIFMETRIC") ); | 138 | _map.insert( 0x891d, new QString("SIOCGIFMETRIC") ); |
137 | _map.insert( 0x891e, new QString("SIOCSIFMETRIC") ); | 139 | _map.insert( 0x891e, new QString("SIOCSIFMETRIC") ); |
138 | _map.insert( 0x891f, new QString("SIOCGIFMEM") ); | 140 | _map.insert( 0x891f, new QString("SIOCGIFMEM") ); |
139 | _map.insert( 0x8920, new QString("SIOCSIFMEM") ); | 141 | _map.insert( 0x8920, new QString("SIOCSIFMEM") ); |
140 | _map.insert( 0x8921, new QString("SIOCGIFMTU") ); | 142 | _map.insert( 0x8921, new QString("SIOCGIFMTU") ); |
141 | _map.insert( 0x8922, new QString("SIOCSIFMTU") ); | 143 | _map.insert( 0x8922, new QString("SIOCSIFMTU") ); |
142 | _map.insert( 0x8923, new QString("SIOCSIFNAME") ); | 144 | _map.insert( 0x8923, new QString("SIOCSIFNAME") ); |
143 | _map.insert( 0x8924, new QString("SIOCSIFHWADDR") ); | 145 | _map.insert( 0x8924, new QString("SIOCSIFHWADDR") ); |
144 | _map.insert( 0x8925, new QString("SIOCGIFENCAP") ); | 146 | _map.insert( 0x8925, new QString("SIOCGIFENCAP") ); |
145 | _map.insert( 0x8926, new QString("SIOCSIFENCAP") ); | 147 | _map.insert( 0x8926, new QString("SIOCSIFENCAP") ); |
146 | _map.insert( 0x8927, new QString("SIOCGIFHWADDR") ); | 148 | _map.insert( 0x8927, new QString("SIOCGIFHWADDR") ); |
147 | _map.insert( 0x8929, new QString("SIOCGIFSLAVE") ); | 149 | _map.insert( 0x8929, new QString("SIOCGIFSLAVE") ); |
148 | _map.insert( 0x8930, new QString("SIOCSIFSLAVE") ); | 150 | _map.insert( 0x8930, new QString("SIOCSIFSLAVE") ); |
149 | _map.insert( 0x8931, new QString("SIOCADDMULTI") ); | 151 | _map.insert( 0x8931, new QString("SIOCADDMULTI") ); |
150 | _map.insert( 0x8932, new QString("SIOCDELMULTI") ); | 152 | _map.insert( 0x8932, new QString("SIOCDELMULTI") ); |
151 | _map.insert( 0x8933, new QString("SIOCGIFINDEX") ); | 153 | _map.insert( 0x8933, new QString("SIOCGIFINDEX") ); |
152 | _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") ); | 154 | _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") ); |
153 | _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") ); | 155 | _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") ); |
154 | _map.insert( 0x8936, new QString("SIOCDIFADDR") ); | 156 | _map.insert( 0x8936, new QString("SIOCDIFADDR") ); |
155 | _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") ); | 157 | _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") ); |
156 | _map.insert( 0x8938, new QString("SIOCGIFCOUNT") ); | 158 | _map.insert( 0x8938, new QString("SIOCGIFCOUNT") ); |
157 | _map.insert( 0x8940, new QString("SIOCGIFBR") ); | 159 | _map.insert( 0x8940, new QString("SIOCGIFBR") ); |
158 | _map.insert( 0x8941, new QString("SIOCSIFBR") ); | 160 | _map.insert( 0x8941, new QString("SIOCSIFBR") ); |
159 | _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") ); | 161 | _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") ); |
160 | _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") ); | 162 | _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") ); |
161 | _map.insert( 0x8944, new QString("SIOCGIFDIVERT") ); | 163 | _map.insert( 0x8944, new QString("SIOCGIFDIVERT") ); |
162 | _map.insert( 0x8945, new QString("SIOCSIFDIVERT") ); | 164 | _map.insert( 0x8945, new QString("SIOCSIFDIVERT") ); |
163 | _map.insert( 0x8946, new QString("SIOCETHTOOL") ); | 165 | _map.insert( 0x8946, new QString("SIOCETHTOOL") ); |
164 | _map.insert( 0x8947, new QString("SIOCGMIIPHY") ); | 166 | _map.insert( 0x8947, new QString("SIOCGMIIPHY") ); |
165 | _map.insert( 0x8948, new QString("SIOCGMIIREG") ); | 167 | _map.insert( 0x8948, new QString("SIOCGMIIREG") ); |
166 | _map.insert( 0x8949, new QString("SIOCSMIIREG") ); | 168 | _map.insert( 0x8949, new QString("SIOCSMIIREG") ); |
167 | _map.insert( 0x894A, new QString("SIOCWANDEV") ); | 169 | _map.insert( 0x894A, new QString("SIOCWANDEV") ); |
168 | _map.insert( 0x8953, new QString("SIOCDARP") ); | 170 | _map.insert( 0x8953, new QString("SIOCDARP") ); |
169 | _map.insert( 0x8954, new QString("SIOCGARP") ); | 171 | _map.insert( 0x8954, new QString("SIOCGARP") ); |
170 | _map.insert( 0x8955, new QString("SIOCSARP") ); | 172 | _map.insert( 0x8955, new QString("SIOCSARP") ); |
171 | _map.insert( 0x8960, new QString("SIOCDRARP") ); | 173 | _map.insert( 0x8960, new QString("SIOCDRARP") ); |
172 | _map.insert( 0x8961, new QString("SIOCGRARP") ); | 174 | _map.insert( 0x8961, new QString("SIOCGRARP") ); |
173 | _map.insert( 0x8962, new QString("SIOCSRARP") ); | 175 | _map.insert( 0x8962, new QString("SIOCSRARP") ); |
174 | _map.insert( 0x8970, new QString("SIOCGIFMAP") ); | 176 | _map.insert( 0x8970, new QString("SIOCGIFMAP") ); |
175 | _map.insert( 0x8971, new QString("SIOCSIFMAP") ); | 177 | _map.insert( 0x8971, new QString("SIOCSIFMAP") ); |
176 | _map.insert( 0x8980, new QString("SIOCADDDLCI") ); | 178 | _map.insert( 0x8980, new QString("SIOCADDDLCI") ); |
177 | _map.insert( 0x8981, new QString("SIOCDELDLCI") ); | 179 | _map.insert( 0x8981, new QString("SIOCDELDLCI") ); |
178 | _map.insert( 0x8982, new QString("SIOCGIFVLAN") ); | 180 | _map.insert( 0x8982, new QString("SIOCGIFVLAN") ); |
179 | _map.insert( 0x8983, new QString("SIOCSIFVLAN") ); | 181 | _map.insert( 0x8983, new QString("SIOCSIFVLAN") ); |
180 | _map.insert( 0x8990, new QString("SIOCBONDENSLAVE") ); | 182 | _map.insert( 0x8990, new QString("SIOCBONDENSLAVE") ); |
181 | _map.insert( 0x8991, new QString("SIOCBONDRELEASE") ); | 183 | _map.insert( 0x8991, new QString("SIOCBONDRELEASE") ); |
182 | _map.insert( 0x8992, new QString("SIOCBONDSETHWADDR") ); | 184 | _map.insert( 0x8992, new QString("SIOCBONDSETHWADDR") ); |
183 | _map.insert( 0x8993, new QString("SIOCBONDSLAVEINFOQUERY") ); | 185 | _map.insert( 0x8993, new QString("SIOCBONDSLAVEINFOQUERY") ); |
184 | _map.insert( 0x8994, new QString("SIOCBONDINFOQUERY") ); | 186 | _map.insert( 0x8994, new QString("SIOCBONDINFOQUERY") ); |
185 | _map.insert( 0x8995, new QString("SIOCBONDCHANGEACTIVE") ); | 187 | _map.insert( 0x8995, new QString("SIOCBONDCHANGEACTIVE") ); |
186 | _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") ); | 188 | _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") ); |
187 | _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") ); | 189 | _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") ); |
188 | 190 | ||
189 | }; | 191 | }; |
190 | 192 | ||
191 | 193 | ||
192 | DebugMapper::~DebugMapper() | 194 | DebugMapper::~DebugMapper() |
193 | { | 195 | { |
194 | qDebug( "DebugMapper::~DebugMapper()" ); | 196 | odebug << "DebugMapper::~DebugMapper()" << oendl; |
195 | } | 197 | } |
196 | 198 | ||
197 | 199 | ||
198 | const QString& DebugMapper::map( int value ) const | 200 | const QString& DebugMapper::map( int value ) const |
199 | { | 201 | { |
200 | QString* result = _map[ value ]; | 202 | QString* result = _map[ value ]; |
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 |
208 | { | 210 | { |
209 | return *result; | 211 | return *result; |
210 | } | 212 | } |
211 | } | 213 | } |
212 | 214 | ||
213 | 215 | ||
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,118 +1,131 @@ | |||
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> |
21 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
22 | 40 | ||
23 | OManufacturerDB* OManufacturerDB::_instance = 0; | 41 | OManufacturerDB* OManufacturerDB::_instance = 0; |
24 | 42 | ||
25 | OManufacturerDB* OManufacturerDB::instance() | 43 | 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; |
33 | } | 51 | } |
34 | 52 | ||
35 | 53 | ||
36 | OManufacturerDB::OManufacturerDB() | 54 | OManufacturerDB::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 | ||
51 | QFile file( filename ); | 69 | QFile file( filename ); |
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; |
63 | QString extManu; | 81 | QString extManu; |
64 | while (!s.atEnd()) | 82 | while (!s.atEnd()) |
65 | { | 83 | { |
66 | s >> addr; | 84 | s >> addr; |
67 | if ( !addr ) // read nothing!? | 85 | if ( !addr ) // read nothing!? |
68 | { | 86 | { |
69 | continue; | 87 | continue; |
70 | } | 88 | } |
71 | else | 89 | else |
72 | if ( addr[0] == '#' ) | 90 | if ( addr[0] == '#' ) |
73 | { | 91 | { |
74 | continue; | 92 | continue; |
75 | } | 93 | } |
76 | s.skipWhiteSpace(); | 94 | s.skipWhiteSpace(); |
77 | s >> manu; | 95 | s >> manu; |
78 | s.skipWhiteSpace(); | 96 | s.skipWhiteSpace(); |
79 | s >> extManu; | 97 | s >> extManu; |
80 | if ( extManu[0] == '#' ) // we have an extended manufacturer | 98 | if ( extManu[0] == '#' ) // we have an extended manufacturer |
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 | ||
99 | } | 112 | } |
100 | 113 | ||
101 | 114 | ||
102 | OManufacturerDB::~OManufacturerDB() | 115 | OManufacturerDB::~OManufacturerDB() |
103 | { | 116 | { |
104 | } | 117 | } |
105 | 118 | ||
106 | 119 | ||
107 | const QString& OManufacturerDB::lookup( const QString& macaddr ) const | 120 | const QString& OManufacturerDB::lookup( const QString& macaddr ) const |
108 | { | 121 | { |
109 | return manufacturers[macaddr.upper().left(8)]; | 122 | return manufacturers[macaddr.upper().left(8)]; |
110 | } | 123 | } |
111 | 124 | ||
112 | 125 | ||
113 | const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const | 126 | const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const |
114 | { | 127 | { |
115 | QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); | 128 | QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); |
116 | return it == manufacturersExt.end() ? lookup( macaddr ) : *it; | 129 | return it == manufacturersExt.end() ? lookup( macaddr ) : *it; |
117 | } | 130 | } |
118 | 131 | ||
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,54 +1,69 @@ | |||
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 |
18 | 33 | ||
19 | #include <qmap.h> | 34 | #include <qmap.h> |
20 | 35 | ||
21 | /** | 36 | /** |
22 | * @brief A Ethernet card vendor database. | 37 | * @brief A Ethernet card vendor database. |
23 | * | 38 | * |
24 | * This class encapsulates the lookup of Ethernet vendor given a | 39 | * This class encapsulates the lookup of Ethernet vendor given a |
25 | * certain Mac Address. Only the first three bytes define the vendor. | 40 | * certain Mac Address. Only the first three bytes define the vendor. |
26 | */ | 41 | */ |
27 | class OManufacturerDB | 42 | class OManufacturerDB |
28 | { | 43 | { |
29 | public: | 44 | public: |
30 | /** | 45 | /** |
31 | * @returns the one-and-only @ref OManufacturerDB instance. | 46 | * @returns the one-and-only @ref OManufacturerDB instance. |
32 | */ | 47 | */ |
33 | static OManufacturerDB* instance(); | 48 | static OManufacturerDB* instance(); |
34 | /** | 49 | /** |
35 | * @returns the short manufacturer string given a @a macaddr. | 50 | * @returns the short manufacturer string given a @a macaddr. |
36 | */ | 51 | */ |
37 | const QString& lookup( const QString& macaddr ) const; | 52 | const QString& lookup( const QString& macaddr ) const; |
38 | /** | 53 | /** |
39 | * @returns the enhanced manufacturer string given a @a macaddr. | 54 | * @returns the enhanced manufacturer string given a @a macaddr. |
40 | */ | 55 | */ |
41 | const QString& lookupExt( const QString& macaddr ) const; | 56 | const QString& lookupExt( const QString& macaddr ) const; |
42 | 57 | ||
43 | protected: | 58 | protected: |
44 | OManufacturerDB(); | 59 | OManufacturerDB(); |
45 | virtual ~OManufacturerDB(); | 60 | virtual ~OManufacturerDB(); |
46 | 61 | ||
47 | private: | 62 | private: |
48 | QMap<QString, QString> manufacturers; | 63 | QMap<QString, QString> manufacturers; |
49 | QMap<QString, QString> manufacturersExt; | 64 | QMap<QString, QString> manufacturersExt; |
50 | static OManufacturerDB* _instance; | 65 | static OManufacturerDB* _instance; |
51 | }; | 66 | }; |
52 | 67 | ||
53 | #endif | 68 | #endif |
54 | 69 | ||
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,100 +1,100 @@ | |||
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 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <opie2/onetutils.h> | 32 | #include <opie2/onetutils.h> |
33 | #include <opie2/onetwork.h> | 33 | #include <opie2/onetwork.h> |
34 | #include <opie2/omanufacturerdb.h> | 34 | #include <opie2/omanufacturerdb.h> |
35 | 35 | ||
36 | #include <net/if.h> | 36 | #include <net/if.h> |
37 | #include <assert.h> | 37 | #include <assert.h> |
38 | #include <stdio.h> | 38 | #include <stdio.h> |
39 | 39 | ||
40 | /*====================================================================================== | 40 | /*====================================================================================== |
41 | * OMacAddress | 41 | * OMacAddress |
42 | *======================================================================================*/ | 42 | *======================================================================================*/ |
43 | 43 | ||
44 | // static initializer for broadcast and unknown MAC Adresses | 44 | // static initializer for broadcast and unknown MAC Adresses |
45 | const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 45 | const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
46 | const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); | 46 | const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); |
47 | const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; | 47 | const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; |
48 | const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); | 48 | const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); |
49 | 49 | ||
50 | //TODO: Incorporate Ethernet Manufacturer database here! (inline or so) | 50 | //TODO: Incorporate Ethernet Manufacturer database here! (inline or so) |
51 | 51 | ||
52 | OMacAddress::OMacAddress() | 52 | OMacAddress::OMacAddress() |
53 | { | 53 | { |
54 | memcpy( _bytes, __unknown, 6 ); | 54 | memcpy( _bytes, __unknown, 6 ); |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | OMacAddress::OMacAddress( unsigned char* p ) | 58 | OMacAddress::OMacAddress( unsigned char* p ) |
59 | { | 59 | { |
60 | memcpy( _bytes, p, 6 ); | 60 | memcpy( _bytes, p, 6 ); |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | OMacAddress::OMacAddress( const unsigned char* p ) | 64 | OMacAddress::OMacAddress( const unsigned char* p ) |
65 | { | 65 | { |
66 | memcpy( _bytes, p, 6 ); | 66 | memcpy( _bytes, p, 6 ); |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
70 | OMacAddress::OMacAddress( struct ifreq& ifr ) | 70 | OMacAddress::OMacAddress( struct ifreq& ifr ) |
71 | { | 71 | { |
72 | memcpy( _bytes, ifr.ifr_hwaddr.sa_data, 6 ); | 72 | memcpy( _bytes, ifr.ifr_hwaddr.sa_data, 6 ); |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | OMacAddress::~OMacAddress() | 76 | OMacAddress::~OMacAddress() |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | //#ifdef QT_NO_DEBUG | 81 | //#ifdef QT_NO_DEBUG |
82 | //inline | 82 | //inline |
83 | //#endif | 83 | //#endif |
84 | const unsigned char* OMacAddress::native() const | 84 | const unsigned char* OMacAddress::native() const |
85 | { | 85 | { |
86 | return (const unsigned char*) &_bytes; | 86 | return (const unsigned char*) &_bytes; |
87 | } | 87 | } |
88 | 88 | ||
89 | 89 | ||
90 | OMacAddress OMacAddress::fromString( const QString& str ) | 90 | OMacAddress OMacAddress::fromString( const QString& str ) |
91 | { | 91 | { |
92 | QString addr( str ); | 92 | QString addr( str ); |
93 | unsigned char buf[6]; | 93 | unsigned char buf[6]; |
94 | bool ok = true; | 94 | bool ok = true; |
95 | int index = 14; | 95 | int index = 14; |
96 | for ( int i = 5; i >= 0; --i ) | 96 | for ( int i = 5; i >= 0; --i ) |
97 | { | 97 | { |
98 | buf[i] = addr.right( 2 ).toUShort( &ok, 16 ); | 98 | buf[i] = addr.right( 2 ).toUShort( &ok, 16 ); |
99 | if ( !ok ) return OMacAddress::unknown; | 99 | if ( !ok ) return OMacAddress::unknown; |
100 | addr.truncate( index ); | 100 | addr.truncate( index ); |
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,102 +1,99 @@ | |||
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 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 13 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 21 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
31 | 28 | ||
32 | */ | 29 | */ |
33 | 30 | ||
34 | /* OPIE */ | 31 | /* OPIE */ |
35 | 32 | ||
36 | #include <opie2/onetwork.h> | 33 | #include <opie2/onetwork.h> |
37 | #include <opie2/ostation.h> | 34 | #include <opie2/ostation.h> |
38 | 35 | ||
39 | /* QT */ | 36 | /* QT */ |
40 | 37 | ||
41 | #include <qfile.h> | 38 | #include <qfile.h> |
42 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
43 | 40 | ||
44 | /* UNIX */ | 41 | /* UNIX */ |
45 | 42 | ||
46 | #include <assert.h> | 43 | #include <assert.h> |
47 | #include <arpa/inet.h> | 44 | #include <arpa/inet.h> |
48 | #include <errno.h> | 45 | #include <errno.h> |
49 | #include <string.h> | 46 | #include <string.h> |
50 | #include <stdlib.h> | 47 | #include <stdlib.h> |
51 | #include <math.h> | 48 | #include <math.h> |
52 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
53 | #include <sys/socket.h> | 50 | #include <sys/socket.h> |
54 | #include <sys/types.h> | 51 | #include <sys/types.h> |
55 | #include <unistd.h> | 52 | #include <unistd.h> |
56 | #include <linux/sockios.h> | 53 | #include <linux/sockios.h> |
57 | #include <net/if_arp.h> | 54 | #include <net/if_arp.h> |
58 | #include <stdarg.h> | 55 | #include <stdarg.h> |
59 | 56 | ||
60 | #ifndef NODEBUG | 57 | #ifndef NODEBUG |
61 | #include <opie2/odebugmapper.h> | 58 | #include <opie2/odebugmapper.h> |
62 | DebugMapper* debugmapper = new DebugMapper(); | 59 | DebugMapper* debugmapper = new DebugMapper(); |
63 | #endif | 60 | #endif |
64 | 61 | ||
65 | /*====================================================================================== | 62 | /*====================================================================================== |
66 | * ONetwork | 63 | * ONetwork |
67 | *======================================================================================*/ | 64 | *======================================================================================*/ |
68 | 65 | ||
69 | ONetwork* ONetwork::_instance = 0; | 66 | ONetwork* ONetwork::_instance = 0; |
70 | 67 | ||
71 | ONetwork::ONetwork() | 68 | ONetwork::ONetwork() |
72 | { | 69 | { |
73 | qDebug( "ONetwork::ONetwork()" ); | 70 | qDebug( "ONetwork::ONetwork()" ); |
74 | qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT ); | 71 | qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT ); |
75 | synchronize(); | 72 | synchronize(); |
76 | } | 73 | } |
77 | 74 | ||
78 | void ONetwork::synchronize() | 75 | void ONetwork::synchronize() |
79 | { | 76 | { |
80 | // gather available interfaces by inspecting /proc/net/dev | 77 | // gather available interfaces by inspecting /proc/net/dev |
81 | //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices | 78 | //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices |
82 | //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices | 79 | //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices |
83 | //FIXME: Best is use SIOCGIFCONF and if this doesn't work (result=-1), then fallback to parsing /proc/net/dev | 80 | //FIXME: Best is use SIOCGIFCONF and if this doesn't work (result=-1), then fallback to parsing /proc/net/dev |
84 | 81 | ||
85 | _interfaces.clear(); | 82 | _interfaces.clear(); |
86 | QString str; | 83 | QString str; |
87 | QFile f( "/proc/net/dev" ); | 84 | QFile f( "/proc/net/dev" ); |
88 | bool hasFile = f.open( IO_ReadOnly ); | 85 | bool hasFile = f.open( IO_ReadOnly ); |
89 | if ( !hasFile ) | 86 | if ( !hasFile ) |
90 | { | 87 | { |
91 | qDebug( "ONetwork: /proc/net/dev not existing. No network devices available" ); | 88 | qDebug( "ONetwork: /proc/net/dev not existing. No network devices available" ); |
92 | return; | 89 | return; |
93 | } | 90 | } |
94 | QTextStream s( &f ); | 91 | QTextStream s( &f ); |
95 | s.readLine(); | 92 | s.readLine(); |
96 | s.readLine(); | 93 | s.readLine(); |
97 | while ( !s.atEnd() ) | 94 | while ( !s.atEnd() ) |
98 | { | 95 | { |
99 | s >> str; | 96 | s >> str; |
100 | str.truncate( str.find( ':' ) ); | 97 | str.truncate( str.find( ':' ) ); |
101 | qDebug( "ONetwork: found interface '%s'", (const char*) str ); | 98 | qDebug( "ONetwork: found interface '%s'", (const char*) str ); |
102 | ONetworkInterface* iface; | 99 | ONetworkInterface* iface; |
@@ -857,192 +854,193 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
857 | tv.tv_usec = 250000; // initial timeout ~ 250ms | 854 | tv.tv_usec = 250000; // initial timeout ~ 250ms |
858 | char buffer[IW_SCAN_MAX_DATA]; | 855 | char buffer[IW_SCAN_MAX_DATA]; |
859 | 856 | ||
860 | while ( !results && timeout > 0 ) | 857 | while ( !results && timeout > 0 ) |
861 | { | 858 | { |
862 | timeout -= tv.tv_usec; | 859 | timeout -= tv.tv_usec; |
863 | select( 0, 0, 0, 0, &tv ); | 860 | select( 0, 0, 0, 0, &tv ); |
864 | 861 | ||
865 | _iwr.u.data.pointer = &buffer[0]; | 862 | _iwr.u.data.pointer = &buffer[0]; |
866 | _iwr.u.data.flags = 0; | 863 | _iwr.u.data.flags = 0; |
867 | _iwr.u.data.length = sizeof buffer; | 864 | _iwr.u.data.length = sizeof buffer; |
868 | if ( wioctl( SIOCGIWSCAN ) ) | 865 | if ( wioctl( SIOCGIWSCAN ) ) |
869 | { | 866 | { |
870 | results = true; | 867 | results = true; |
871 | continue; | 868 | continue; |
872 | } | 869 | } |
873 | else if ( errno == EAGAIN) | 870 | else if ( errno == EAGAIN) |
874 | { | 871 | { |
875 | qDebug( "ONetworkInterface::scanNetwork() - scan in progress..." ); | 872 | qDebug( "ONetworkInterface::scanNetwork() - scan in progress..." ); |
876 | #if 0 | 873 | #if 0 |
877 | if ( qApp ) | 874 | if ( qApp ) |
878 | { | 875 | { |
879 | qApp->processEvents( 100 ); | 876 | qApp->processEvents( 100 ); |
880 | continue; | 877 | continue; |
881 | } | 878 | } |
882 | #endif | 879 | #endif |
883 | tv.tv_sec = 0; | 880 | tv.tv_sec = 0; |
884 | tv.tv_usec = 100000; | 881 | tv.tv_usec = 100000; |
885 | continue; | 882 | continue; |
886 | } | 883 | } |
887 | } | 884 | } |
888 | 885 | ||
889 | qDebug( "ONetworkInterface::scanNetwork() - scan finished." ); | 886 | qDebug( "ONetworkInterface::scanNetwork() - scan finished." ); |
890 | 887 | ||
891 | if ( results ) | 888 | if ( results ) |
892 | { | 889 | { |
893 | qDebug( " - result length = %d", _iwr.u.data.length ); | 890 | qDebug( " - result length = %d", _iwr.u.data.length ); |
894 | if ( !_iwr.u.data.length ) | 891 | if ( !_iwr.u.data.length ) |
895 | { | 892 | { |
896 | qDebug( " - no results (empty neighbourhood)" ); | 893 | qDebug( " - no results (empty neighbourhood)" ); |
897 | return stations; | 894 | return stations; |
898 | } | 895 | } |
899 | 896 | ||
900 | qDebug( " - results are in!" ); | 897 | qDebug( " - results are in!" ); |
901 | dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length ); | 898 | dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length ); |
902 | 899 | ||
903 | // parse results | 900 | // parse results |
904 | 901 | ||
905 | int offset = 0; | 902 | int offset = 0; |
906 | struct iw_event* we = (struct iw_event*) &buffer[0]; | 903 | struct iw_event* we = (struct iw_event*) &buffer[0]; |
907 | 904 | ||
908 | while ( offset < _iwr.u.data.length ) | 905 | while ( offset < _iwr.u.data.length ) |
909 | { | 906 | { |
910 | //const char* cmd = *(*_ioctlmap)[we->cmd]; | 907 | //const char* cmd = *(*_ioctlmap)[we->cmd]; |
911 | //if ( !cmd ) cmd = "<unknown>"; | 908 | //if ( !cmd ) cmd = "<unknown>"; |
912 | qDebug( "reading next event... cmd=%d, len=%d", we->cmd, we->len ); | 909 | qDebug( "reading next event... cmd=%d, len=%d", we->cmd, we->len ); |
913 | switch (we->cmd) | 910 | switch (we->cmd) |
914 | { | 911 | { |
915 | case SIOCGIWAP: | 912 | case SIOCGIWAP: |
916 | { | 913 | { |
917 | qDebug( "SIOCGIWAP" ); | 914 | qDebug( "SIOCGIWAP" ); |
918 | stations->append( new OStation() ); | 915 | stations->append( new OStation() ); |
919 | stations->last()->macAddress = (const unsigned char*) &we->u.ap_addr.sa_data[0]; | 916 | stations->last()->macAddress = (const unsigned char*) &we->u.ap_addr.sa_data[0]; |
920 | break; | 917 | break; |
921 | } | 918 | } |
922 | case SIOCGIWMODE: | 919 | case SIOCGIWMODE: |
923 | { | 920 | { |
924 | qDebug( "SIOCGIWMODE" ); | 921 | qDebug( "SIOCGIWMODE" ); |
925 | stations->last()->type = modeToString( we->u.mode ); | 922 | stations->last()->type = modeToString( we->u.mode ); |
926 | break; | 923 | break; |
927 | } | 924 | } |
928 | case SIOCGIWFREQ: | 925 | case SIOCGIWFREQ: |
929 | { | 926 | { |
930 | qDebug( "SIOCGIWFREQ" ); | 927 | qDebug( "SIOCGIWFREQ" ); |
931 | stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; | 928 | stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; |
932 | break; | 929 | break; |
933 | } | 930 | } |
934 | case SIOCGIWESSID: | 931 | case SIOCGIWESSID: |
935 | { | 932 | { |
936 | qDebug( "SIOCGIWESSID" ); | 933 | qDebug( "SIOCGIWESSID" ); |
937 | stations->last()->ssid = we->u.essid.pointer; | 934 | stations->last()->ssid = we->u.essid.pointer; |
938 | break; | 935 | break; |
939 | } | 936 | } |
940 | case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break; | 937 | case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break; |
941 | case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break; | 938 | case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break; |
942 | case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */ | 939 | case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */ |
943 | case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */ | 940 | case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */ |
944 | case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */ | 941 | case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */ |
945 | case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */ | 942 | case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */ |
946 | case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */ | 943 | case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */ |
947 | default: qDebug( "unhandled event" ); | 944 | default: qDebug( "unhandled event" ); |
948 | } | 945 | } |
949 | 946 | ||
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 | ||
956 | } | 954 | } |
957 | else | 955 | else |
958 | { | 956 | { |
959 | qDebug( " - no results (timeout) :(" ); | 957 | qDebug( " - no results (timeout) :(" ); |
960 | return stations; | 958 | return stations; |
961 | } | 959 | } |
962 | } | 960 | } |
963 | 961 | ||
964 | 962 | ||
965 | bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const | 963 | bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const |
966 | { | 964 | { |
967 | #ifndef NODEBUG | 965 | #ifndef NODEBUG |
968 | int result = ::ioctl( _sfd, call, &iwreq ); | 966 | int result = ::ioctl( _sfd, call, &iwreq ); |
969 | if ( result == -1 ) | 967 | if ( result == -1 ) |
970 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); | 968 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); |
971 | else | 969 | else |
972 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); | 970 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); |
973 | return ( result != -1 ); | 971 | return ( result != -1 ); |
974 | #else | 972 | #else |
975 | return ::ioctl( _sfd, call, &iwreq ) != -1; | 973 | return ::ioctl( _sfd, call, &iwreq ) != -1; |
976 | #endif | 974 | #endif |
977 | } | 975 | } |
978 | 976 | ||
979 | 977 | ||
980 | bool OWirelessNetworkInterface::wioctl( int call ) const | 978 | bool OWirelessNetworkInterface::wioctl( int call ) const |
981 | { | 979 | { |
982 | strcpy( _iwr.ifr_name, name() ); | 980 | strcpy( _iwr.ifr_name, name() ); |
983 | return wioctl( call, _iwr ); | 981 | return wioctl( call, _iwr ); |
984 | } | 982 | } |
985 | 983 | ||
986 | 984 | ||
987 | /*====================================================================================== | 985 | /*====================================================================================== |
988 | * OMonitoringInterface | 986 | * OMonitoringInterface |
989 | *======================================================================================*/ | 987 | *======================================================================================*/ |
990 | 988 | ||
991 | OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 989 | OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) |
992 | :_if( static_cast<OWirelessNetworkInterface*>( iface ) ), _prismHeader( prismHeader ) | 990 | :_if( static_cast<OWirelessNetworkInterface*>( iface ) ), _prismHeader( prismHeader ) |
993 | { | 991 | { |
994 | } | 992 | } |
995 | 993 | ||
996 | 994 | ||
997 | OMonitoringInterface::~OMonitoringInterface() | 995 | OMonitoringInterface::~OMonitoringInterface() |
998 | { | 996 | { |
999 | } | 997 | } |
1000 | 998 | ||
1001 | 999 | ||
1002 | void OMonitoringInterface::setChannel( int c ) | 1000 | void OMonitoringInterface::setChannel( int c ) |
1003 | { | 1001 | { |
1004 | // use standard WE channel switching protocol | 1002 | // use standard WE channel switching protocol |
1005 | memset( &_if->_iwr, 0, sizeof( struct iwreq ) ); | 1003 | memset( &_if->_iwr, 0, sizeof( struct iwreq ) ); |
1006 | _if->_iwr.u.freq.m = c; | 1004 | _if->_iwr.u.freq.m = c; |
1007 | _if->_iwr.u.freq.e = 0; | 1005 | _if->_iwr.u.freq.e = 0; |
1008 | _if->wioctl( SIOCSIWFREQ ); | 1006 | _if->wioctl( SIOCSIWFREQ ); |
1009 | } | 1007 | } |
1010 | 1008 | ||
1011 | 1009 | ||
1012 | void OMonitoringInterface::setEnabled( bool b ) | 1010 | void OMonitoringInterface::setEnabled( bool b ) |
1013 | { | 1011 | { |
1014 | } | 1012 | } |
1015 | 1013 | ||
1016 | 1014 | ||
1017 | /*====================================================================================== | 1015 | /*====================================================================================== |
1018 | * OCiscoMonitoringInterface | 1016 | * OCiscoMonitoringInterface |
1019 | *======================================================================================*/ | 1017 | *======================================================================================*/ |
1020 | 1018 | ||
1021 | OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 1019 | OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) |
1022 | :OMonitoringInterface( iface, prismHeader ) | 1020 | :OMonitoringInterface( iface, prismHeader ) |
1023 | { | 1021 | { |
1024 | iface->setMonitoring( this ); | 1022 | iface->setMonitoring( this ); |
1025 | } | 1023 | } |
1026 | 1024 | ||
1027 | 1025 | ||
1028 | OCiscoMonitoringInterface::~OCiscoMonitoringInterface() | 1026 | OCiscoMonitoringInterface::~OCiscoMonitoringInterface() |
1029 | { | 1027 | { |
1030 | } | 1028 | } |
1031 | 1029 | ||
1032 | 1030 | ||
1033 | void OCiscoMonitoringInterface::setEnabled( bool b ) | 1031 | void OCiscoMonitoringInterface::setEnabled( bool b ) |
1034 | { | 1032 | { |
1035 | QString fname; | 1033 | QString fname; |
1036 | fname.sprintf( "/proc/driver/aironet/%s", (const char*) _if->name() ); | 1034 | fname.sprintf( "/proc/driver/aironet/%s", (const char*) _if->name() ); |
1037 | QFile f( fname ); | 1035 | QFile f( fname ); |
1038 | if ( !f.exists() ) return; | 1036 | if ( !f.exists() ) return; |
1039 | 1037 | ||
1040 | if ( f.open( IO_WriteOnly ) ) | 1038 | if ( f.open( IO_WriteOnly ) ) |
1041 | { | 1039 | { |
1042 | QTextStream s( &f ); | 1040 | QTextStream s( &f ); |
1043 | s << "Mode: r"; | 1041 | s << "Mode: r"; |
1044 | s << "Mode: y"; | 1042 | s << "Mode: y"; |
1045 | s << "XmitPower: 1"; | 1043 | s << "XmitPower: 1"; |
1046 | } | 1044 | } |
1047 | 1045 | ||
1048 | // flushing and closing will be done automatically when f goes out of scope | 1046 | // flushing and closing will be done automatically when f goes out of scope |
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,102 +1,99 @@ | |||
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 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 13 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 21 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
31 | 28 | ||
32 | */ | 29 | */ |
33 | 30 | ||
34 | #ifndef ONETWORK_H | 31 | #ifndef ONETWORK_H |
35 | #define ONETWORK_H | 32 | #define ONETWORK_H |
36 | 33 | ||
37 | #include "wireless.h" | 34 | #include "wireless.h" |
38 | 35 | ||
39 | /* OPIE */ | 36 | /* OPIE */ |
40 | 37 | ||
41 | #include <opie2/onetutils.h> | 38 | #include <opie2/onetutils.h> |
42 | #include <opie2/ostation.h> | 39 | #include <opie2/ostation.h> |
43 | 40 | ||
44 | /* QT */ | 41 | /* QT */ |
45 | 42 | ||
46 | #include <qvaluelist.h> | 43 | #include <qvaluelist.h> |
47 | #include <qdict.h> | 44 | #include <qdict.h> |
48 | #include <qmap.h> | 45 | #include <qmap.h> |
49 | #include <qobject.h> | 46 | #include <qobject.h> |
50 | #include <qhostaddress.h> | 47 | #include <qhostaddress.h> |
51 | 48 | ||
52 | class ONetworkInterface; | 49 | class ONetworkInterface; |
53 | class OWirelessNetworkInterface; | 50 | class OWirelessNetworkInterface; |
54 | class OChannelHopper; | 51 | class OChannelHopper; |
55 | class OMonitoringInterface; | 52 | class OMonitoringInterface; |
56 | 53 | ||
57 | /*====================================================================================== | 54 | /*====================================================================================== |
58 | * ONetwork | 55 | * ONetwork |
59 | *======================================================================================*/ | 56 | *======================================================================================*/ |
60 | 57 | ||
61 | /** | 58 | /** |
62 | * @brief A container class for all network interfaces | 59 | * @brief A container class for all network interfaces |
63 | * | 60 | * |
64 | * This class provides access to all available network interfaces of your computer. | 61 | * This class provides access to all available network interfaces of your computer. |
65 | * | 62 | * |
66 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 63 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
67 | */ | 64 | */ |
68 | class ONetwork : public QObject | 65 | class ONetwork : public QObject |
69 | { | 66 | { |
70 | Q_OBJECT | 67 | Q_OBJECT |
71 | 68 | ||
72 | public: | 69 | public: |
73 | typedef QDict<ONetworkInterface> InterfaceMap; | 70 | typedef QDict<ONetworkInterface> InterfaceMap; |
74 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; | 71 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; |
75 | 72 | ||
76 | public: | 73 | public: |
77 | /** | 74 | /** |
78 | * @returns the number of available interfaces | 75 | * @returns the number of available interfaces |
79 | */ | 76 | */ |
80 | int count() const; | 77 | int count() const; |
81 | /** | 78 | /** |
82 | * @returns a pointer to the (one and only) @ref ONetwork instance. | 79 | * @returns a pointer to the (one and only) @ref ONetwork instance. |
83 | */ | 80 | */ |
84 | static ONetwork* instance(); | 81 | static ONetwork* instance(); |
85 | /** | 82 | /** |
86 | * @returns an iterator usable for iterating through all network interfaces. | 83 | * @returns an iterator usable for iterating through all network interfaces. |
87 | */ | 84 | */ |
88 | InterfaceIterator iterator() const; | 85 | InterfaceIterator iterator() const; |
89 | /** | 86 | /** |
90 | * @returns true, if the @a interface supports the wireless extension protocol. | 87 | * @returns true, if the @a interface supports the wireless extension protocol. |
91 | */ | 88 | */ |
92 | bool isWirelessInterface( const char* interface ) const; | 89 | bool isWirelessInterface( const char* interface ) const; |
93 | /** | 90 | /** |
94 | * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. | 91 | * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. |
95 | * @see ONetworkInterface | 92 | * @see ONetworkInterface |
96 | */ | 93 | */ |
97 | ONetworkInterface* interface( const QString& interface ) const; | 94 | ONetworkInterface* interface( const QString& interface ) const; |
98 | /** | 95 | /** |
99 | * @internal Rebuild the internal interface database | 96 | * @internal Rebuild the internal interface database |
100 | * @note Sometimes it might be useful to call this from client code, | 97 | * @note Sometimes it might be useful to call this from client code, |
101 | * e.g. after issuing a cardctl insert | 98 | * e.g. after issuing a cardctl insert |
102 | */ | 99 | */ |
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,102 +1,99 @@ | |||
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 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 13 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 21 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
31 | 28 | ||
32 | */ | 29 | */ |
33 | 30 | ||
34 | /* OPIE */ | 31 | /* OPIE */ |
35 | #include <opie2/opcap.h> | 32 | #include <opie2/opcap.h> |
36 | 33 | ||
37 | /* QT */ | 34 | /* QT */ |
38 | #include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects) | 35 | #include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects) |
39 | #include <qsocketnotifier.h> | 36 | #include <qsocketnotifier.h> |
40 | #include <qobjectlist.h> | 37 | #include <qobjectlist.h> |
41 | 38 | ||
42 | /* SYSTEM */ | 39 | /* SYSTEM */ |
43 | #include <sys/time.h> | 40 | #include <sys/time.h> |
44 | #include <sys/types.h> | 41 | #include <sys/types.h> |
45 | #include <unistd.h> | 42 | #include <unistd.h> |
46 | 43 | ||
47 | /* LOCAL */ | 44 | /* LOCAL */ |
48 | #include "udp_ports.h" | 45 | #include "udp_ports.h" |
49 | 46 | ||
50 | /*====================================================================================== | 47 | /*====================================================================================== |
51 | * OPacket | 48 | * OPacket |
52 | *======================================================================================*/ | 49 | *======================================================================================*/ |
53 | 50 | ||
54 | OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* data, QObject* parent ) | 51 | OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* data, QObject* parent ) |
55 | :QObject( parent, "Generic" ), _hdr( header ), _data( data ) | 52 | :QObject( parent, "Generic" ), _hdr( header ), _data( data ) |
56 | { | 53 | { |
57 | //qDebug( "OPacket::OPacket(): (Len %d, CapLen %d)" /*, ctime((const time_t*) header.ts.tv_sec)*/, header.len, header.caplen ); | 54 | //qDebug( "OPacket::OPacket(): (Len %d, CapLen %d)" /*, ctime((const time_t*) header.ts.tv_sec)*/, header.len, header.caplen ); |
58 | 55 | ||
59 | _end = (unsigned char*) data + header.len; | 56 | _end = (unsigned char*) data + header.len; |
60 | //qDebug( "OPacket::data @ %0x, end @ %0x", data, _end ); | 57 | //qDebug( "OPacket::data @ %0x, end @ %0x", data, _end ); |
61 | 58 | ||
62 | switch ( datalink ) | 59 | switch ( datalink ) |
63 | { | 60 | { |
64 | case DLT_EN10MB: | 61 | case DLT_EN10MB: |
65 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = ETHERNET" ); | 62 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = ETHERNET" ); |
66 | new OEthernetPacket( _end, (const struct ether_header*) data, this ); | 63 | new OEthernetPacket( _end, (const struct ether_header*) data, this ); |
67 | break; | 64 | break; |
68 | 65 | ||
69 | case DLT_IEEE802_11: | 66 | case DLT_IEEE802_11: |
70 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" ); | 67 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" ); |
71 | new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this ); | 68 | new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this ); |
72 | break; | 69 | break; |
73 | 70 | ||
74 | case DLT_PRISM_HEADER: | 71 | case DLT_PRISM_HEADER: |
75 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" ); | 72 | qDebug( "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" ); |
76 | new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this ); | 73 | new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this ); |
77 | break; | 74 | break; |
78 | 75 | ||
79 | default: | 76 | default: |
80 | qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink (type %d)!", datalink ); | 77 | qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink (type %d)!", datalink ); |
81 | } | 78 | } |
82 | } | 79 | } |
83 | 80 | ||
84 | 81 | ||
85 | OPacket::~OPacket() | 82 | OPacket::~OPacket() |
86 | { | 83 | { |
87 | } | 84 | } |
88 | 85 | ||
89 | 86 | ||
90 | timevalstruct OPacket::timeval() const | 87 | timevalstruct OPacket::timeval() const |
91 | { | 88 | { |
92 | return _hdr.ts; | 89 | return _hdr.ts; |
93 | } | 90 | } |
94 | 91 | ||
95 | 92 | ||
96 | int OPacket::caplen() const | 93 | int OPacket::caplen() const |
97 | { | 94 | { |
98 | return _hdr.caplen; | 95 | return _hdr.caplen; |
99 | } | 96 | } |
100 | 97 | ||
101 | 98 | ||
102 | void OPacket::updateStats( QMap<QString,int>& stats, QObjectList* l ) | 99 | void OPacket::updateStats( QMap<QString,int>& stats, QObjectList* l ) |
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,102 +1,99 @@ | |||
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 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 13 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 21 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
31 | 28 | ||
32 | */ | 29 | */ |
33 | 30 | ||
34 | #ifndef OPCAP_H | 31 | #ifndef OPCAP_H |
35 | #define OPCAP_H | 32 | #define OPCAP_H |
36 | 33 | ||
37 | /* LINUX */ | 34 | /* LINUX */ |
38 | extern "C" // work around a bpf/pcap conflict in recent headers | 35 | extern "C" // work around a bpf/pcap conflict in recent headers |
39 | { | 36 | { |
40 | #include <pcap.h> | 37 | #include <pcap.h> |
41 | } | 38 | } |
42 | #include <netinet/ether.h> | 39 | #include <netinet/ether.h> |
43 | #include <netinet/ip.h> | 40 | #include <netinet/ip.h> |
44 | #include <netinet/udp.h> | 41 | #include <netinet/udp.h> |
45 | #include <netinet/tcp.h> | 42 | #include <netinet/tcp.h> |
46 | #include <time.h> | 43 | #include <time.h> |
47 | 44 | ||
48 | /* QT */ | 45 | /* QT */ |
49 | #include <qevent.h> | 46 | #include <qevent.h> |
50 | #include <qfile.h> | 47 | #include <qfile.h> |
51 | #include <qhostaddress.h> | 48 | #include <qhostaddress.h> |
52 | #include <qobject.h> | 49 | #include <qobject.h> |
53 | #include <qstring.h> | 50 | #include <qstring.h> |
54 | #include <qmap.h> | 51 | #include <qmap.h> |
55 | 52 | ||
56 | /* OPIE */ | 53 | /* OPIE */ |
57 | #include <opie2/onetutils.h> | 54 | #include <opie2/onetutils.h> |
58 | 55 | ||
59 | /* Custom Network Includes */ | 56 | /* Custom Network Includes */ |
60 | #include "802_11_user.h" | 57 | #include "802_11_user.h" |
61 | #include "dhcp.h" | 58 | #include "dhcp.h" |
62 | 59 | ||
63 | /* TYPEDEFS */ | 60 | /* TYPEDEFS */ |
64 | typedef struct timeval timevalstruct; | 61 | typedef struct timeval timevalstruct; |
65 | typedef struct pcap_pkthdr packetheaderstruct; | 62 | typedef struct pcap_pkthdr packetheaderstruct; |
66 | 63 | ||
67 | /* FORWARDS */ | 64 | /* FORWARDS */ |
68 | class OPacketCapturer; | 65 | class OPacketCapturer; |
69 | class QSocketNotifier; | 66 | class QSocketNotifier; |
70 | 67 | ||
71 | /*====================================================================================== | 68 | /*====================================================================================== |
72 | * OPacket - A frame on the wire | 69 | * OPacket - A frame on the wire |
73 | *======================================================================================*/ | 70 | *======================================================================================*/ |
74 | 71 | ||
75 | /** @brief A class representing a data frame on the wire. | 72 | /** @brief A class representing a data frame on the wire. |
76 | * | 73 | * |
77 | * The whole family of the packet classes are used when capturing frames from a network. | 74 | * The whole family of the packet classes are used when capturing frames from a network. |
78 | * Most standard network protocols in use share a common architecture, which mostly is | 75 | * Most standard network protocols in use share a common architecture, which mostly is |
79 | * a packet header and then the packet payload. In layered architectures, each lower layer | 76 | * a packet header and then the packet payload. In layered architectures, each lower layer |
80 | * encapsulates data from its upper layer - that is it | 77 | * encapsulates data from its upper layer - that is it |
81 | * treats the data from its upper layer as payload and prepends an own header to the packet, | 78 | * treats the data from its upper layer as payload and prepends an own header to the packet, |
82 | * which - again - is treated as the payload for the layer below. The figure below is an | 79 | * which - again - is treated as the payload for the layer below. The figure below is an |
83 | * example for how such a data frame is composed out of packets, e.g. when sending a mail. | 80 | * example for how such a data frame is composed out of packets, e.g. when sending a mail. |
84 | * | 81 | * |
85 | * <pre> | 82 | * <pre> |
86 | * | User Data | == Mail Data | 83 | * | User Data | == Mail Data |
87 | * | SMTP Header | User Data | == SMTP | 84 | * | SMTP Header | User Data | == SMTP |
88 | * | TCP Header | SMTP Header | User Data | == TCP | 85 | * | TCP Header | SMTP Header | User Data | == TCP |
89 | * | IP Header | TCP Header | SMTP Header | User Data | == IP | 86 | * | IP Header | TCP Header | SMTP Header | User Data | == IP |
90 | * | MAC Header | IP Header | TCP Header | SMTP Header | User Data | == MAC | 87 | * | MAC Header | IP Header | TCP Header | SMTP Header | User Data | == MAC |
91 | * | 88 | * |
92 | * </pre> | 89 | * </pre> |
93 | * | 90 | * |
94 | * The example is trimmed for simplicity, because the MAC (Medium Access Control) layer | 91 | * The example is trimmed for simplicity, because the MAC (Medium Access Control) layer |
95 | * also contains a few more levels of encapsulation. | 92 | * also contains a few more levels of encapsulation. |
96 | * Since the type of the payload is more or less independent from the encapsulating protocol, | 93 | * Since the type of the payload is more or less independent from the encapsulating protocol, |
97 | * the header must be inspected before attempting to decode the payload. Hence, the | 94 | * the header must be inspected before attempting to decode the payload. Hence, the |
98 | * encapsulation level varies and can't be deduced without actually looking into the packets. | 95 | * encapsulation level varies and can't be deduced without actually looking into the packets. |
99 | * | 96 | * |
100 | * For actually working with captured frames, it's useful to identify the packets via names and | 97 | * For actually working with captured frames, it's useful to identify the packets via names and |
101 | * insert them into a parent/child - relationship based on the encapsulation. This is why | 98 | * insert them into a parent/child - relationship based on the encapsulation. This is why |
102 | * all packet classes derive from QObject. The amount of overhead caused by the QObject is | 99 | * all packet classes derive from QObject. The amount of overhead caused by the QObject is |
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 | |||
@@ -1,34 +1,34 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = 802_11_user.h \ | 4 | HEADERS = 802_11_user.h \ |
5 | dhcp.h \ | 5 | dhcp.h \ |
6 | udp_ports.h \ | 6 | udp_ports.h \ |
7 | wireless.h \ | 7 | wireless.h \ |
8 | odebugmapper.h \ | 8 | odebugmapper.h \ |
9 | omanufacturerdb.h \ | 9 | omanufacturerdb.h \ |
10 | onetutils.h \ | 10 | onetutils.h \ |
11 | onetwork.h \ | 11 | onetwork.h \ |
12 | opcap.h \ | 12 | opcap.h \ |
13 | ostation.h | 13 | ostation.h |
14 | SOURCES = odebugmapper.cpp \ | 14 | SOURCES = odebugmapper.cpp \ |
15 | omanufacturerdb.cpp \ | 15 | omanufacturerdb.cpp \ |
16 | onetutils.cpp \ | 16 | onetutils.cpp \ |
17 | onetwork.cpp \ | 17 | onetwork.cpp \ |
18 | opcap.cpp \ | 18 | opcap.cpp \ |
19 | ostation.cpp | 19 | ostation.cpp |
20 | INTERFACES = | 20 | INTERFACES = |
21 | TARGET = opienet2 | 21 | TARGET = opienet2 |
22 | VERSION = 1.8.1 | 22 | VERSION = 1.8.2 |
23 | INCLUDEPATH += $(OPIEDIR)/include | 23 | INCLUDEPATH += $(OPIEDIR)/include |
24 | DEPENDPATH += $(OPIEDIR)/include | 24 | DEPENDPATH += $(OPIEDIR)/include |
25 | LIBS += -lpcap | 25 | LIBS += -lpcap |
26 | 26 | ||
27 | 27 | ||
28 | !contains( platform, x11 ) { | 28 | !contains( platform, x11 ) { |
29 | include ( $(OPIEDIR)/include.pro ) | 29 | include ( $(OPIEDIR)/include.pro ) |
30 | } | 30 | } |
31 | 31 | ||
32 | contains( platform, x11 ) { | 32 | contains( platform, x11 ) { |
33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
34 | } | 34 | } |
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,64 +1,63 @@ | |||
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 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 13 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 21 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
29 | 28 | ||
30 | */ | 29 | */ |
31 | 30 | ||
32 | #include <opie2/ostation.h> | 31 | #include <opie2/ostation.h> |
33 | 32 | ||
34 | /*====================================================================================== | 33 | /*====================================================================================== |
35 | * OStation | 34 | * OStation |
36 | *======================================================================================*/ | 35 | *======================================================================================*/ |
37 | 36 | ||
38 | OStation::OStation() | 37 | OStation::OStation() |
39 | { | 38 | { |
40 | qDebug( "OStation::OStation()" ); | 39 | qDebug( "OStation::OStation()" ); |
41 | 40 | ||
42 | type = "<unknown>"; | 41 | type = "<unknown>"; |
43 | macAddress = OMacAddress::unknown; | 42 | macAddress = OMacAddress::unknown; |
44 | ssid = "<unknown>"; | 43 | ssid = "<unknown>"; |
45 | channel = 0; | 44 | channel = 0; |
46 | apAddress = OMacAddress::unknown; | 45 | apAddress = OMacAddress::unknown; |
47 | 46 | ||
48 | } | 47 | } |
49 | 48 | ||
50 | 49 | ||
51 | OStation::~OStation() | 50 | OStation::~OStation() |
52 | { | 51 | { |
53 | qDebug( "OStation::~OStation()" ); | 52 | qDebug( "OStation::~OStation()" ); |
54 | } | 53 | } |
55 | 54 | ||
56 | 55 | ||
57 | void OStation::dump() | 56 | void OStation::dump() |
58 | { | 57 | { |
59 | qDebug( "------- OStation::dump() ------------" ); | 58 | qDebug( "------- OStation::dump() ------------" ); |
60 | qDebug( "type: %s", (const char*) type ); | 59 | qDebug( "type: %s", (const char*) type ); |
61 | qDebug( "mac: %s", (const char*) macAddress.toString() ); | 60 | qDebug( "mac: %s", (const char*) macAddress.toString() ); |
62 | qDebug( "ap: %s", (const char*) apAddress.toString() ); | 61 | qDebug( "ap: %s", (const char*) apAddress.toString() ); |
63 | qDebug( "ip: %s", (const char*) ipAddress.toString() ); | 62 | qDebug( "ip: %s", (const char*) ipAddress.toString() ); |
64 | } | 63 | } |
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,74 +1,73 @@ | |||
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 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 13 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 21 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
29 | 28 | ||
30 | */ | 29 | */ |
31 | 30 | ||
32 | #ifndef OSTATION_H | 31 | #ifndef OSTATION_H |
33 | #define OSTATION_H | 32 | #define OSTATION_H |
34 | 33 | ||
35 | #include <opie2/onetutils.h> | 34 | #include <opie2/onetutils.h> |
36 | 35 | ||
37 | #include <qlist.h> | 36 | #include <qlist.h> |
38 | #include <qstring.h> | 37 | #include <qstring.h> |
39 | #include <qhostaddress.h> | 38 | #include <qhostaddress.h> |
40 | #include <qobject.h> | 39 | #include <qobject.h> |
41 | 40 | ||
42 | #include <sys/types.h> | 41 | #include <sys/types.h> |
43 | 42 | ||
44 | class OStation; | 43 | class OStation; |
45 | 44 | ||
46 | typedef QList<OStation> OStationList; | 45 | typedef QList<OStation> OStationList; |
47 | 46 | ||
48 | /*====================================================================================== | 47 | /*====================================================================================== |
49 | * OStation | 48 | * OStation |
50 | *======================================================================================*/ | 49 | *======================================================================================*/ |
51 | 50 | ||
52 | class OStation | 51 | class OStation |
53 | { | 52 | { |
54 | public: | 53 | public: |
55 | OStation(); | 54 | OStation(); |
56 | ~OStation(); | 55 | ~OStation(); |
57 | 56 | ||
58 | void dump(); | 57 | void dump(); |
59 | 58 | ||
60 | /* Ethernet */ | 59 | /* Ethernet */ |
61 | QString type; | 60 | QString type; |
62 | OMacAddress macAddress; | 61 | OMacAddress macAddress; |
63 | QHostAddress ipAddress; | 62 | QHostAddress ipAddress; |
64 | 63 | ||
65 | /* WaveLan */ | 64 | /* WaveLan */ |
66 | QString ssid; | 65 | QString ssid; |
67 | OMacAddress apAddress; | 66 | OMacAddress apAddress; |
68 | int channel; | 67 | int channel; |
69 | bool encrypted; | 68 | bool encrypted; |
70 | }; | 69 | }; |
71 | 70 | ||
72 | 71 | ||
73 | #endif // OSTATION_H | 72 | #endif // OSTATION_H |
74 | 73 | ||
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 | |||
@@ -1,89 +1,89 @@ | |||
1 | /* | 1 | /* |
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 |
9 | #define UDP_PORT_LENGTH 2 | 9 | #define UDP_PORT_LENGTH 2 |
10 | #define UDP_PORT_OFFSET PARAMETER_VALUE_OFFSET | 10 | #define UDP_PORT_OFFSET PARAMETER_VALUE_OFFSET |
11 | #define UDP_PORT_RAS1 1718 | 11 | #define UDP_PORT_RAS1 1718 |
12 | #define UDP_PORT_RAS2 1719 | 12 | #define UDP_PORT_RAS2 1719 |
13 | #define UDP_PORT_CPHA8116 | 13 | #define UDP_PORT_CPHA8116 |
14 | #define UDP_PORT_DDTP1052 | 14 | #define UDP_PORT_DDTP1052 |
15 | #define UDP_PORT_CUPS631 | 15 | #define UDP_PORT_CUPS631 |
16 | #define UDP_PORT_DLSW 2067 | 16 | #define UDP_PORT_DLSW 2067 |
17 | #define UDP_PORT_ISAKMP500 | 17 | #define UDP_PORT_ISAKMP500 |
18 | #define UDP_PORT_L2TP 1701 | 18 | #define UDP_PORT_L2TP 1701 |
19 | #define UDP_PORT_IAPP 2313 | 19 | #define UDP_PORT_IAPP 2313 |
20 | #define UDP_PORT_HSRP 1985 | 20 | #define UDP_PORT_HSRP 1985 |
21 | #define UDP_PORT_SSDP 1900 | 21 | #define UDP_PORT_SSDP 1900 |
22 | #define UDP_PORT_TACACS49 | 22 | #define UDP_PORT_TACACS49 |
23 | #define UDP_PORT_CLDAP 389 | 23 | #define UDP_PORT_CLDAP 389 |
24 | #define UDP_PORT_VINES573 | 24 | #define UDP_PORT_VINES573 |
25 | #define UDP_PORT_NBNS137 | 25 | #define UDP_PORT_NBNS137 |
26 | #define UDP_PORT_NBDGM138 | 26 | #define UDP_PORT_NBDGM138 |
27 | #define UDP_PORT_XYPLEX 173 | 27 | #define UDP_PORT_XYPLEX 173 |
28 | #define UDP_PORT_PIM_RP_DISC 496 | 28 | #define UDP_PORT_PIM_RP_DISC 496 |
29 | #define UDP_PORT_SLIMP3_V1 1069 | 29 | #define UDP_PORT_SLIMP3_V1 1069 |
30 | #define UDP_PORT_SLIMP3_V2 3483 | 30 | #define UDP_PORT_SLIMP3_V2 3483 |
31 | #define UDP_PORT_RMCP 623 | 31 | #define UDP_PORT_RMCP 623 |
32 | #define UDP_PORT_RMCP_SECURE664 | 32 | #define UDP_PORT_RMCP_SECURE664 |
33 | #define UDP_PORT_SYSLOG 514 | 33 | #define UDP_PORT_SYSLOG 514 |
34 | #define UDP_PORT_SNMP 161 | 34 | #define UDP_PORT_SNMP 161 |
35 | #define UDP_PORT_SNMP_TRAP162 | 35 | #define UDP_PORT_SNMP_TRAP162 |
36 | #define UDP_PORT_TFTP 69 | 36 | #define UDP_PORT_TFTP 69 |
37 | #define UDP_PORT_TIME 37 | 37 | #define UDP_PORT_TIME 37 |
38 | #define UDP_PORT_STUN 3478 | 38 | #define UDP_PORT_STUN 3478 |
39 | #define UDP_PORT_SRVLOC427 | 39 | #define UDP_PORT_SRVLOC427 |
40 | #define UDP_PORT_TZSP0x9090 | 40 | #define UDP_PORT_TZSP0x9090 |
41 | #define UDP_PORT_WCCP2048 | 41 | #define UDP_PORT_WCCP2048 |
42 | #define UDP_PORT_MSPROXY 1745 | 42 | #define UDP_PORT_MSPROXY 1745 |
43 | #define UDP_PORT_BOOTPS 67 | 43 | #define UDP_PORT_BOOTPS 67 |
44 | #define UDP_PORT_BOOTPC 68 | 44 | #define UDP_PORT_BOOTPC 68 |
45 | #define UDP_PORT_XDMCP 177 | 45 | #define UDP_PORT_XDMCP 177 |
46 | #define UDP_PORT_DHCPV6_DOWNSTREAM546 | 46 | #define UDP_PORT_DHCPV6_DOWNSTREAM546 |
47 | #define UDP_PORT_DHCPV6_UPSTREAM547 | 47 | #define UDP_PORT_DHCPV6_UPSTREAM547 |
48 | #define UDP_PORT_DNS 53 | 48 | #define UDP_PORT_DNS 53 |
49 | #define UDP_PORT_MDNS 5353 | 49 | #define UDP_PORT_MDNS 5353 |
50 | #define UDP_PORT_ICP 3130 | 50 | #define UDP_PORT_ICP 3130 |
51 | #define UDP_PORT_ICQ4000 | 51 | #define UDP_PORT_ICQ4000 |
52 | #define UDP_PORT_IPX 213 /* RFC 1234 */ | 52 | #define UDP_PORT_IPX 213 /* RFC 1234 */ |
53 | #define UDP_PORT_LDP 646 | 53 | #define UDP_PORT_LDP 646 |
54 | #define UDP_PORT_LLC1 12000 | 54 | #define UDP_PORT_LLC1 12000 |
55 | #define UDP_PORT_LLC2 12001 | 55 | #define UDP_PORT_LLC2 12001 |
56 | #define UDP_PORT_LLC3 12002 | 56 | #define UDP_PORT_LLC3 12002 |
57 | #define UDP_PORT_LLC4 12003 | 57 | #define UDP_PORT_LLC4 12003 |
58 | #define UDP_PORT_LLC5 12004 | 58 | #define UDP_PORT_LLC5 12004 |
59 | #define UDP_PORT_MIP 434 | 59 | #define UDP_PORT_MIP 434 |
60 | #define UDP_PORT_NCP 524 | 60 | #define UDP_PORT_NCP 524 |
61 | #define UDP_PORT_NTP123 | 61 | #define UDP_PORT_NTP123 |
62 | #define UDP_PORT_RIP 520 | 62 | #define UDP_PORT_RIP 520 |
63 | #define UDP_PORT_SAP9875 | 63 | #define UDP_PORT_SAP9875 |
64 | #define UDP_PORT_SIP 5060 | 64 | #define UDP_PORT_SIP 5060 |
65 | #define UDP_PORT_TIMED525 | 65 | #define UDP_PORT_TIMED525 |
66 | #define UDP_PORT_RIPNG 521 | 66 | #define UDP_PORT_RIPNG 521 |
67 | #define UDP_PORT_WSP 9200 /* wap-wsp */ | 67 | #define UDP_PORT_WSP 9200 /* wap-wsp */ |
68 | #define UDP_PORT_WTP_WSP 9201 /* wap-wsp-wtp */ | 68 | #define UDP_PORT_WTP_WSP 9201 /* wap-wsp-wtp */ |
69 | #define UDP_PORT_WTLS_WSP 9202 /* wap-wsp-s */ | 69 | #define UDP_PORT_WTLS_WSP 9202 /* wap-wsp-s */ |
70 | #define UDP_PORT_WTLS_WTP_WSP 9203 /* wap-wsp-wtp-s*/ | 70 | #define UDP_PORT_WTLS_WTP_WSP 9203 /* wap-wsp-wtp-s*/ |
71 | #define UDP_PORT_WSP_PUSH 2948 /* wap-wsp */ | 71 | #define UDP_PORT_WSP_PUSH 2948 /* wap-wsp */ |
72 | #define UDP_PORT_WTLS_WSP_PUSH 2949 /* wap-wsp-s */ | 72 | #define UDP_PORT_WTLS_WSP_PUSH 2949 /* wap-wsp-s */ |
73 | #define UDP_PORT_WHO 513 | 73 | #define UDP_PORT_WHO 513 |
74 | #define UDP_PORT_KERBEROS 88 | 74 | #define UDP_PORT_KERBEROS 88 |
75 | #define UDP_PORT_SFLOW 6343 | 75 | #define UDP_PORT_SFLOW 6343 |
76 | #define UDP_PORT_LAPLINK 1547 | 76 | #define UDP_PORT_LAPLINK 1547 |
77 | #define UDP_PORT_NETFLOW2055 | 77 | #define UDP_PORT_NETFLOW2055 |
78 | #define UDP_PORT_RX_LOW 7000 | 78 | #define UDP_PORT_RX_LOW 7000 |
79 | #define UDP_PORT_RX_HIGH7009 | 79 | #define UDP_PORT_RX_HIGH7009 |
80 | #define UDP_PORT_RX_AFS_BACKUPS7021 | 80 | #define UDP_PORT_RX_AFS_BACKUPS7021 |
81 | #define UDP_PORT_MGCP_GATEWAY 2427 | 81 | #define UDP_PORT_MGCP_GATEWAY 2427 |
82 | #define UDP_PORT_MGCP_CALLAGENT 2727 | 82 | #define UDP_PORT_MGCP_CALLAGENT 2727 |
83 | #define UDP_PORT_PCLI 9000 | 83 | #define UDP_PORT_PCLI 9000 |
84 | #define UDP_PORT_ARTNET 0x1936 | 84 | #define UDP_PORT_ARTNET 0x1936 |
85 | #define UDP_PORT_TERREDO 3544 | 85 | #define UDP_PORT_TERREDO 3544 |
86 | #define UDP_PORT_RADIUS 1645 | 86 | #define UDP_PORT_RADIUS 1645 |
87 | #define UDP_PORT_RADIUS_NEW1812 | 87 | #define UDP_PORT_RADIUS_NEW1812 |
88 | #define UDP_PORT_RADACCT1646 | 88 | #define UDP_PORT_RADACCT1646 |
89 | #define UDP_PORT_RADACCT_NEW1813 | 89 | #define UDP_PORT_RADACCT_NEW1813 |
diff --git a/libopie2/opiepim/libopiepim2.control b/libopie2/opiepim/libopiepim2.control index 5cfa453..ac8e13c 100644 --- a/libopie2/opiepim/libopiepim2.control +++ b/libopie2/opiepim/libopiepim2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopiepim2 | 1 | Package: libopiepim2 |
2 | Files: $OPIEDIR/lib/libopiepim2.so.* | 2 | Files: $OPIEDIR/lib/libopiepim2.so.* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1, libopiecore2 (1.8.1) | 8 | Depends: libqpe1, libopiecore2 (1.8.2) |
9 | Provides: libopiepim2 | 9 | Provides: libopiepim2 |
10 | Description: Opie library 2.0 PIM | 10 | Description: Opie library 2.0 PIM |
11 | 11 | ||
diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro index cc6ee90..3972c3f 100644 --- a/libopie2/opiepim/opiepim.pro +++ b/libopie2/opiepim/opiepim.pro | |||
@@ -1,24 +1,24 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = | 4 | HEADERS = |
5 | 5 | ||
6 | SOURCES = | 6 | SOURCES = |
7 | INTERFACES = | 7 | INTERFACES = |
8 | TARGET = opiepim2 | 8 | TARGET = opiepim2 |
9 | VERSION = 1.8.1 | 9 | VERSION = 1.8.2 |
10 | INCLUDEPATH += $(OPIEDIR)/include | 10 | INCLUDEPATH += $(OPIEDIR)/include |
11 | DEPENDPATH += $(OPIEDIR)/include | 11 | DEPENDPATH += $(OPIEDIR)/include |
12 | 12 | ||
13 | MOC_DIR = moc | 13 | MOC_DIR = moc |
14 | OBJECTS_DIR = obj | 14 | OBJECTS_DIR = obj |
15 | 15 | ||
16 | 16 | ||
17 | !contains( platform, x11 ) { | 17 | !contains( platform, x11 ) { |
18 | include ( $(OPIEDIR)/include.pro ) | 18 | include ( $(OPIEDIR)/include.pro ) |
19 | } | 19 | } |
20 | 20 | ||
21 | contains( platform, x11 ) { | 21 | contains( platform, x11 ) { |
22 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 22 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
23 | } | 23 | } |
24 | 24 | ||
diff --git a/libopie2/opieui/libopieui2.control b/libopie2/opieui/libopieui2.control index 6900fd6..71e6358 100644 --- a/libopie2/opieui/libopieui2.control +++ b/libopie2/opieui/libopieui2.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: libopieui2 | 1 | Package: libopieui2 |
2 | Files: $OPIEDIR/lib/libopieui2.so.* | 2 | Files: $OPIEDIR/lib/libopieui2.so.* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/system | 4 | Section: opie/system |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.8.1-$SUB_VERSION.2 | 7 | Version: 1.8.2-$SUB_VERSION.2 |
8 | Depends: libqpe1, libopiecore2 (1.8.1) | 8 | Depends: libqpe1, libopiecore2 (1.8.2) |
9 | Provides: libopieui2 | 9 | Provides: libopieui2 |
10 | Description: Opie library 2.0 UI | 10 | Description: Opie library 2.0 UI |
11 | 11 | ||
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 68a5c5f..4c15181 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro | |||
@@ -1,67 +1,67 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = ocompletionbox.h \ | 4 | HEADERS = ocompletionbox.h \ |
5 | ocombobox.h \ | 5 | ocombobox.h \ |
6 | oeditlistbox.h \ | 6 | oeditlistbox.h \ |
7 | olineedit.h \ | 7 | olineedit.h \ |
8 | olistview.h \ | 8 | olistview.h \ |
9 | oimageeffect.h \ | 9 | oimageeffect.h \ |
10 | opixmapeffect.h \ | 10 | opixmapeffect.h \ |
11 | opopupmenu.h \ | 11 | opopupmenu.h \ |
12 | opixmapprovider.h \ | 12 | opixmapprovider.h \ |
13 | oselector.h \ | 13 | oselector.h \ |
14 | oversatileview.h \ | 14 | oversatileview.h \ |
15 | oversatileviewitem.h \ | 15 | oversatileviewitem.h \ |
16 | #ojanuswidget.h \ | 16 | #ojanuswidget.h \ |
17 | odialog.h \ | 17 | odialog.h \ |
18 | omenubar.h \ | 18 | omenubar.h \ |
19 | opiemenubar.h \ | 19 | opiemenubar.h \ |
20 | omessagebox.h \ | 20 | omessagebox.h \ |
21 | oresource.h \ | 21 | oresource.h \ |
22 | otoolbar.h \ | 22 | otoolbar.h \ |
23 | oseparator.h | 23 | oseparator.h |
24 | # otaskbarapplet.h | 24 | # otaskbarapplet.h |
25 | 25 | ||
26 | SOURCES = ocompletionbox.cpp \ | 26 | SOURCES = ocompletionbox.cpp \ |
27 | ocombobox.cpp \ | 27 | ocombobox.cpp \ |
28 | oeditlistbox.cpp \ | 28 | oeditlistbox.cpp \ |
29 | olineedit.cpp \ | 29 | olineedit.cpp \ |
30 | olistview.cpp \ | 30 | olistview.cpp \ |
31 | oimageeffect.cpp \ | 31 | oimageeffect.cpp \ |
32 | opixmapeffect.cpp \ | 32 | opixmapeffect.cpp \ |
33 | opopupmenu.cpp \ | 33 | opopupmenu.cpp \ |
34 | opixmapprovider.cpp \ | 34 | opixmapprovider.cpp \ |
35 | oselector.cpp \ | 35 | oselector.cpp \ |
36 | oversatileview.cpp \ | 36 | oversatileview.cpp \ |
37 | oversatileviewitem.cpp \ | 37 | oversatileviewitem.cpp \ |
38 | #ojanuswidget.cpp \ | 38 | #ojanuswidget.cpp \ |
39 | odialog.cpp \ | 39 | odialog.cpp \ |
40 | omenubar.cpp \ | 40 | omenubar.cpp \ |
41 | opiemenubar.cpp \ | 41 | opiemenubar.cpp \ |
42 | oresource.cpp \ | 42 | oresource.cpp \ |
43 | otoolbar.cpp \ | 43 | otoolbar.cpp \ |
44 | oseparator.cpp #\ | 44 | oseparator.cpp #\ |
45 | # otaskbarapplet.cpp | 45 | # otaskbarapplet.cpp |
46 | 46 | ||
47 | INTERFACES = | 47 | INTERFACES = |
48 | TARGET = opieui2 | 48 | TARGET = opieui2 |
49 | VERSION = 1.8.1 | 49 | VERSION = 1.8.2 |
50 | INCLUDEPATH += $(OPIEDIR)/include | 50 | INCLUDEPATH += $(OPIEDIR)/include |
51 | DEPENDPATH += $(OPIEDIR)/include | 51 | DEPENDPATH += $(OPIEDIR)/include |
52 | LIBS += -lopiecore2 | 52 | LIBS += -lopiecore2 |
53 | MOC_DIR = moc | 53 | MOC_DIR = moc |
54 | OBJECTS_DIR = obj | 54 | OBJECTS_DIR = obj |
55 | 55 | ||
56 | 56 | ||
57 | !contains( platform, x11 ) { | 57 | !contains( platform, x11 ) { |
58 | include ( $(OPIEDIR)/include.pro ) | 58 | include ( $(OPIEDIR)/include.pro ) |
59 | HEADERS += otaskbarapplet.h | 59 | HEADERS += otaskbarapplet.h |
60 | SOURCES += otaskbarapplet.cpp | 60 | SOURCES += otaskbarapplet.cpp |
61 | } | 61 | } |
62 | 62 | ||
63 | contains( platform, x11 ) { | 63 | contains( platform, x11 ) { |
64 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 64 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
65 | message( Warning: NO otaskbarapplet ATM ) | 65 | message( Warning: NO otaskbarapplet ATM ) |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/libopie2/tools/regen.py b/libopie2/tools/regen.py index 9ad5352..3779896 100755 --- a/libopie2/tools/regen.py +++ b/libopie2/tools/regen.py | |||
@@ -1,94 +1,96 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | 2 | ||
3 | # | 3 | # |
4 | # regenerate ioctl_table.h | 4 | # regenerate ioctl_table.h |
5 | # | 5 | # |
6 | 6 | ||
7 | import sys | 7 | import sys |
8 | import os | 8 | import os |
9 | result = os.popen( 'find /usr/include -name "*.h" |xargs grep -h SIOC|grep 0x' ).readlines() | 9 | result = os.popen( 'find /usr/include -name "*.h" |xargs grep -h SIOC|grep 0x' ).readlines() |
10 | 10 | ||
11 | try: | 11 | try: |
12 | tablehfile = file( sys.argv[1]+".h", "w" ) | 12 | tablehfile = file( sys.argv[1]+".h", "w" ) |
13 | except: | 13 | except: |
14 | tablehfile = sys.stdout | 14 | tablehfile = sys.stdout |
15 | 15 | ||
16 | try: | 16 | try: |
17 | tablecfile = file( sys.argv[1]+".cpp", "w" ) | 17 | tablecfile = file( sys.argv[1]+".cpp", "w" ) |
18 | except: | 18 | except: |
19 | tablecfile = sys.stdout | 19 | tablecfile = sys.stdout |
20 | 20 | ||
21 | print >>tablehfile,""" | 21 | print >>tablehfile,""" |
22 | /* | 22 | /* |
23 | * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> | 23 | * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #ifndef DEBUGMAPPER_H | 26 | #ifndef DEBUGMAPPER_H |
27 | #define DEBUGMAPPER_H | 27 | #define DEBUGMAPPER_H |
28 | 28 | ||
29 | #include <qstring.h> | 29 | #include <qstring.h> |
30 | #include <qintdict.h> | 30 | #include <qintdict.h> |
31 | 31 | ||
32 | typedef QIntDict<QString> IntStringMap; | 32 | typedef QIntDict<QString> IntStringMap; |
33 | 33 | ||
34 | class DebugMapper | 34 | class DebugMapper |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | DebugMapper(); | 37 | DebugMapper(); |
38 | ~DebugMapper(); | 38 | ~DebugMapper(); |
39 | 39 | ||
40 | const QString& map( int value ) const; | 40 | const QString& map( int value ) const; |
41 | private: | 41 | private: |
42 | IntStringMap _map; | 42 | IntStringMap _map; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #endif | 45 | #endif |
46 | """ | 46 | """ |
47 | 47 | ||
48 | print >>tablecfile,""" | 48 | print >>tablecfile,""" |
49 | /* | 49 | /* |
50 | * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> | 50 | * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> |
51 | */ | 51 | */ |
52 | 52 | ||
53 | #include <opie2/odebug.h> | ||
54 | |||
53 | #include "%s" | 55 | #include "%s" |
54 | 56 | ||
55 | DebugMapper::DebugMapper() | 57 | DebugMapper::DebugMapper() |
56 | { | 58 | { |
57 | qDebug( "DebugMapper::DebugMapper()" ); | 59 | odebug << "DebugMapper::DebugMapper()" << oendl; |
58 | 60 | ||
59 | """ % (tablehfile.name) | 61 | """ % (tablehfile.name) |
60 | 62 | ||
61 | for line in result: | 63 | for line in result: |
62 | l = line.split() | 64 | l = line.split() |
63 | if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ): | 65 | if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ): |
64 | print >>sys.stderr, "can't parse line: %s" % l | 66 | print >>sys.stderr, "can't parse line: %s" % l |
65 | continue | 67 | continue |
66 | print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] ) | 68 | print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] ) |
67 | 69 | ||
68 | 70 | ||
69 | print >>tablecfile,""" | 71 | print >>tablecfile,""" |
70 | }; | 72 | }; |
71 | 73 | ||
72 | 74 | ||
73 | DebugMapper::~DebugMapper() | 75 | DebugMapper::~DebugMapper() |
74 | { | 76 | { |
75 | qDebug( "DebugMapper::~DebugMapper()" ); | 77 | odebug << "DebugMapper::~DebugMapper()" << oendl; |
76 | } | 78 | } |
77 | 79 | ||
78 | 80 | ||
79 | const QString& DebugMapper::map( int value ) const | 81 | const QString& DebugMapper::map( int value ) const |
80 | { | 82 | { |
81 | QString* result = _map[ value ]; | 83 | QString* result = _map[ value ]; |
82 | 84 | ||
83 | if ( !result ) | 85 | if ( !result ) |
84 | { | 86 | { |
85 | qDebug( "DebugMapper::map() - value not found." ); | 87 | owarn << "DebugMapper::map() - value " << value << " is not found." << oendl; |
86 | return QString::null; | 88 | return QString::null; |
87 | } | 89 | } |
88 | else | 90 | else |
89 | { | 91 | { |
90 | return *result; | 92 | return *result; |
91 | } | 93 | } |
92 | } | 94 | } |
93 | 95 | ||
94 | """ | 96 | """ |