Diffstat (limited to 'libopie2/opienet/onetutils.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h index 18731ba..541c5ab 100644 --- a/libopie2/opienet/onetutils.h +++ b/libopie2/opienet/onetutils.h | |||
@@ -63,87 +63,88 @@ class OMacAddress | |||
63 | 63 | ||
64 | // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem? | 64 | // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem? |
65 | static OMacAddress fromString( const QString& ); | 65 | static OMacAddress fromString( const QString& ); |
66 | 66 | ||
67 | public: | 67 | public: |
68 | static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff | 68 | static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff |
69 | static const OMacAddress& unknown; // 44:44:44:44:44:44 | 69 | static const OMacAddress& unknown; // 44:44:44:44:44:44 |
70 | 70 | ||
71 | private: | 71 | private: |
72 | unsigned char _bytes[6]; | 72 | unsigned char _bytes[6]; |
73 | 73 | ||
74 | friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); | 74 | friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); | 78 | bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); |
79 | 79 | ||
80 | 80 | ||
81 | /*====================================================================================== | 81 | /*====================================================================================== |
82 | * OHostAddress | 82 | * OHostAddress |
83 | *======================================================================================*/ | 83 | *======================================================================================*/ |
84 | 84 | ||
85 | class OHostAddress : public QHostAddress | 85 | class OHostAddress : public QHostAddress |
86 | { | 86 | { |
87 | public: | 87 | /*public: |
88 | OHostAddress(); | 88 | OHostAddress(); |
89 | ~OHostAddress(); | 89 | ~OHostAddress(); |
90 | */ | ||
90 | }; | 91 | }; |
91 | 92 | ||
92 | 93 | ||
93 | /*====================================================================================== | 94 | /*====================================================================================== |
94 | * OPrivateIOCTL | 95 | * OPrivateIOCTL |
95 | *======================================================================================*/ | 96 | *======================================================================================*/ |
96 | 97 | ||
97 | class OPrivateIOCTL : public QObject | 98 | class OPrivateIOCTL : public QObject |
98 | { | 99 | { |
99 | public: | 100 | public: |
100 | OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs ); | 101 | OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs ); |
101 | ~OPrivateIOCTL(); | 102 | ~OPrivateIOCTL(); |
102 | 103 | ||
103 | int numberGetArgs() const; | 104 | int numberGetArgs() const; |
104 | int typeGetArgs() const; | 105 | int typeGetArgs() const; |
105 | int numberSetArgs() const; | 106 | int numberSetArgs() const; |
106 | int typeSetArgs() const; | 107 | int typeSetArgs() const; |
107 | 108 | ||
108 | // FIXME return int? as ::ioctl does? -zecke | 109 | // FIXME return int? as ::ioctl does? -zecke |
109 | void invoke() const; | 110 | void invoke() const; |
110 | void setParameter( int, u_int32_t ); | 111 | void setParameter( int, u_int32_t ); |
111 | 112 | ||
112 | private: | 113 | private: |
113 | u_int32_t _ioctl; | 114 | u_int32_t _ioctl; |
114 | u_int16_t _getargs; | 115 | u_int16_t _getargs; |
115 | u_int16_t _setargs; | 116 | u_int16_t _setargs; |
116 | 117 | ||
117 | }; | 118 | }; |
118 | 119 | ||
119 | /*====================================================================================== | 120 | /*====================================================================================== |
120 | * Miscellaneous | 121 | * Miscellaneous |
121 | *======================================================================================*/ | 122 | *======================================================================================*/ |
122 | 123 | ||
123 | /* dump bytes */ | ||
124 | |||
125 | void dumpBytes( const unsigned char* data, int num ); | 124 | void dumpBytes( const unsigned char* data, int num ); |
125 | QString modeToString( int ); | ||
126 | int stringToMode( const QString& ); | ||
126 | 127 | ||
127 | /* Network to host order macros */ | 128 | /* Network to host order macros */ |
128 | 129 | ||
129 | #ifdef LBL_ALIGN | 130 | #ifdef LBL_ALIGN |
130 | #define EXTRACT_16BITS(p) \ | 131 | #define EXTRACT_16BITS(p) \ |
131 | ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ | 132 | ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ |
132 | (u_int16_t)*((const u_int8_t *)(p) + 1))) | 133 | (u_int16_t)*((const u_int8_t *)(p) + 1))) |
133 | #define EXTRACT_32BITS(p) \ | 134 | #define EXTRACT_32BITS(p) \ |
134 | ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ | 135 | ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ |
135 | (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ | 136 | (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ |
136 | (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ | 137 | (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ |
137 | (u_int32_t)*((const u_int8_t *)(p) + 3))) | 138 | (u_int32_t)*((const u_int8_t *)(p) + 3))) |
138 | #else | 139 | #else |
139 | #define EXTRACT_16BITS(p) \ | 140 | #define EXTRACT_16BITS(p) \ |
140 | ((u_int16_t)ntohs(*(const u_int16_t *)(p))) | 141 | ((u_int16_t)ntohs(*(const u_int16_t *)(p))) |
141 | #define EXTRACT_32BITS(p) \ | 142 | #define EXTRACT_32BITS(p) \ |
142 | ((u_int32_t)ntohl(*(const u_int32_t *)(p))) | 143 | ((u_int32_t)ntohl(*(const u_int32_t *)(p))) |
143 | #endif | 144 | #endif |
144 | 145 | ||
145 | #define EXTRACT_24BITS(p) \ | 146 | #define EXTRACT_24BITS(p) \ |
146 | ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \ | 147 | ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \ |
147 | (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ | 148 | (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ |
148 | (u_int32_t)*((const u_int8_t *)(p) + 2))) | 149 | (u_int32_t)*((const u_int8_t *)(p) + 2))) |
149 | 150 | ||