summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetutils.h
Unidiff
Diffstat (limited to 'libopie2/opienet/onetutils.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetutils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index bedea63..9611518 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -29,100 +29,103 @@
29 29
30*/ 30*/
31 31
32#ifndef ONETUTILS_H 32#ifndef ONETUTILS_H
33#define ONETUTILS_H 33#define ONETUTILS_H
34 34
35#include <qdict.h> 35#include <qdict.h>
36#include <qmap.h> 36#include <qmap.h>
37#include <qstring.h> 37#include <qstring.h>
38#include <qhostaddress.h> 38#include <qhostaddress.h>
39#include <qobject.h> 39#include <qobject.h>
40 40
41#include <sys/types.h> 41#include <sys/types.h>
42 42
43struct ifreq; 43struct ifreq;
44class OWirelessNetworkInterface; 44class OWirelessNetworkInterface;
45 45
46/*====================================================================================== 46/*======================================================================================
47 * OMacAddress 47 * OMacAddress
48 *======================================================================================*/ 48 *======================================================================================*/
49 49
50class OMacAddress 50class OMacAddress
51{ 51{
52 public: 52 public:
53 // QString c'tor? -zecke
53 OMacAddress( unsigned char* ); 54 OMacAddress( unsigned char* );
54 OMacAddress( const unsigned char* ); 55 OMacAddress( const unsigned char* );
55 OMacAddress( struct ifreq& ); 56 OMacAddress( struct ifreq& );
56 ~OMacAddress(); 57 ~OMacAddress();
57 58
58 QString manufacturer() const; 59 QString manufacturer() const;
59 QString toString( bool substitute = false ) const; 60 QString toString( bool substitute = false ) const;
60 const unsigned char* native() const; 61 const unsigned char* native() const;
61 62
63 // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem?
62 static OMacAddress fromString( const QString& ); 64 static OMacAddress fromString( const QString& );
63 65
64 public: 66 public:
65 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff 67 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff
66 static const OMacAddress& unknown; // 44:44:44:44:44:44 68 static const OMacAddress& unknown; // 44:44:44:44:44:44
67 69
68 private: 70 private:
69 unsigned char _bytes[6]; 71 unsigned char _bytes[6];
70 72
71 friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); 73 friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 );
72 74
73}; 75};
74 76
75bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); 77bool operator==( const OMacAddress &m1, const OMacAddress &m2 );
76 78
77 79
78/*====================================================================================== 80/*======================================================================================
79 * OHostAddress 81 * OHostAddress
80 *======================================================================================*/ 82 *======================================================================================*/
81 83
82class OHostAddress : public QHostAddress 84class OHostAddress : public QHostAddress
83{ 85{
84 public: 86 public:
85 OHostAddress(); 87 OHostAddress();
86 ~OHostAddress(); 88 ~OHostAddress();
87}; 89};
88 90
89 91
90/*====================================================================================== 92/*======================================================================================
91 * OPrivateIOCTL 93 * OPrivateIOCTL
92 *======================================================================================*/ 94 *======================================================================================*/
93 95
94class OPrivateIOCTL : public QObject 96class OPrivateIOCTL : public QObject
95{ 97{
96 public: 98 public:
97 OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs ); 99 OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs );
98 ~OPrivateIOCTL(); 100 ~OPrivateIOCTL();
99 101
100 int numberGetArgs() const; 102 int numberGetArgs() const;
101 int typeGetArgs() const; 103 int typeGetArgs() const;
102 int numberSetArgs() const; 104 int numberSetArgs() const;
103 int typeSetArgs() const; 105 int typeSetArgs() const;
104 106
107 // FIXME return int? as ::ioctl does? -zecke
105 void invoke() const; 108 void invoke() const;
106 void setParameter( int, u_int32_t ); 109 void setParameter( int, u_int32_t );
107 110
108 private: 111 private:
109 u_int32_t _ioctl; 112 u_int32_t _ioctl;
110 u_int16_t _getargs; 113 u_int16_t _getargs;
111 u_int16_t _setargs; 114 u_int16_t _setargs;
112 115
113}; 116};
114 117
115 /*====================================================================================== 118 /*======================================================================================
116 * Miscellaneous 119 * Miscellaneous
117 *======================================================================================*/ 120 *======================================================================================*/
118 121
119/* dump bytes */ 122/* dump bytes */
120 123
121void dumpBytes( const unsigned char* data, int num ); 124void dumpBytes( const unsigned char* data, int num );
122 125
123/* Network to host order macros */ 126/* Network to host order macros */
124 127
125#ifdef LBL_ALIGN 128#ifdef LBL_ALIGN
126#define EXTRACT_16BITS(p) \ 129#define EXTRACT_16BITS(p) \
127 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ 130 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \
128 (u_int16_t)*((const u_int8_t *)(p) + 1))) 131 (u_int16_t)*((const u_int8_t *)(p) + 1)))