author | mickeyl <mickeyl> | 2003-04-22 22:11:28 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-22 22:11:28 (UTC) |
commit | a0ffe9079338a8b870de5267a22ddbb01cb1cc27 (patch) (unidiff) | |
tree | fe240ab38bd11cd32d51674e4f79a465092476e5 /libopie2/opienet/opcap.h | |
parent | bb8965d31b06ec122a0916d8c5bc4c4b68873a14 (diff) | |
download | opie-a0ffe9079338a8b870de5267a22ddbb01cb1cc27.zip opie-a0ffe9079338a8b870de5267a22ddbb01cb1cc27.tar.gz opie-a0ffe9079338a8b870de5267a22ddbb01cb1cc27.tar.bz2 |
add prism header parsing capability!
-rw-r--r-- | libopie2/opienet/opcap.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index fe88e68..83f7115 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h | |||
@@ -110,96 +110,115 @@ class QSocketNotifier; | |||
110 | * odebug << "got ip packet from " << ip->fromIPAddress().toString() << " to " << ip->toIPAddress().toString() << oendl; | 110 | * odebug << "got ip packet from " << ip->fromIPAddress().toString() << " to " << ip->toIPAddress().toString() << oendl; |
111 | * | 111 | * |
112 | */ | 112 | */ |
113 | 113 | ||
114 | class OPacket : public QObject | 114 | class OPacket : public QObject |
115 | { | 115 | { |
116 | Q_OBJECT | 116 | Q_OBJECT |
117 | 117 | ||
118 | public: | 118 | public: |
119 | OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); | 119 | OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); |
120 | virtual ~OPacket(); | 120 | virtual ~OPacket(); |
121 | 121 | ||
122 | timevalstruct timeval() const; | 122 | timevalstruct timeval() const; |
123 | 123 | ||
124 | int caplen() const; | 124 | int caplen() const; |
125 | int len() const; | 125 | int len() const; |
126 | QString dump( int = 32 ) const; | 126 | QString dump( int = 32 ) const; |
127 | 127 | ||
128 | void updateStats( QMap<QString,int>&, QObjectList* ); | 128 | void updateStats( QMap<QString,int>&, QObjectList* ); |
129 | 129 | ||
130 | private: | 130 | private: |
131 | const packetheaderstruct _hdr; // pcap packet header | 131 | const packetheaderstruct _hdr; // pcap packet header |
132 | const unsigned char* _data; // pcap packet data | 132 | const unsigned char* _data; // pcap packet data |
133 | const unsigned char* _end; // end of pcap packet data | 133 | const unsigned char* _end; // end of pcap packet data |
134 | }; | 134 | }; |
135 | 135 | ||
136 | /*====================================================================================== | 136 | /*====================================================================================== |
137 | * OEthernetPacket - DLT_EN10MB frame | 137 | * OEthernetPacket - DLT_EN10MB frame |
138 | *======================================================================================*/ | 138 | *======================================================================================*/ |
139 | 139 | ||
140 | class OEthernetPacket : public QObject | 140 | class OEthernetPacket : public QObject |
141 | { | 141 | { |
142 | Q_OBJECT | 142 | Q_OBJECT |
143 | 143 | ||
144 | public: | 144 | public: |
145 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); | 145 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); |
146 | virtual ~OEthernetPacket(); | 146 | virtual ~OEthernetPacket(); |
147 | 147 | ||
148 | OMacAddress sourceAddress() const; | 148 | OMacAddress sourceAddress() const; |
149 | OMacAddress destinationAddress() const; | 149 | OMacAddress destinationAddress() const; |
150 | int type() const; | 150 | int type() const; |
151 | 151 | ||
152 | private: | 152 | private: |
153 | const struct ether_header* _ether; | 153 | const struct ether_header* _ether; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | 156 | ||
157 | /*====================================================================================== | 157 | /*====================================================================================== |
158 | * OPrismHeaderPacket - DLT_PRISM_HEADER frame | ||
159 | *======================================================================================*/ | ||
160 | |||
161 | class OPrismHeaderPacket : public QObject | ||
162 | { | ||
163 | Q_OBJECT | ||
164 | |||
165 | public: | ||
166 | OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 ); | ||
167 | virtual ~OPrismHeaderPacket(); | ||
168 | |||
169 | unsigned int signalStrength() const; | ||
170 | |||
171 | private: | ||
172 | const struct prism_hdr* _header; | ||
173 | }; | ||
174 | |||
175 | |||
176 | /*====================================================================================== | ||
158 | * OWaveLanPacket - DLT_IEEE802_11 frame | 177 | * OWaveLanPacket - DLT_IEEE802_11 frame |
159 | *======================================================================================*/ | 178 | *======================================================================================*/ |
160 | 179 | ||
161 | class OWaveLanPacket : public QObject | 180 | class OWaveLanPacket : public QObject |
162 | { | 181 | { |
163 | Q_OBJECT | 182 | Q_OBJECT |
164 | 183 | ||
165 | public: | 184 | public: |
166 | OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); | 185 | OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); |
167 | virtual ~OWaveLanPacket(); | 186 | virtual ~OWaveLanPacket(); |
168 | 187 | ||
169 | int duration() const; | 188 | int duration() const; |
170 | bool fromDS() const; | 189 | bool fromDS() const; |
171 | bool toDS() const; | 190 | bool toDS() const; |
172 | virtual OMacAddress macAddress1() const; | 191 | virtual OMacAddress macAddress1() const; |
173 | virtual OMacAddress macAddress2() const; | 192 | virtual OMacAddress macAddress2() const; |
174 | virtual OMacAddress macAddress3() const; | 193 | virtual OMacAddress macAddress3() const; |
175 | virtual OMacAddress macAddress4() const; | 194 | virtual OMacAddress macAddress4() const; |
176 | bool usesPowerManagement() const; | 195 | bool usesPowerManagement() const; |
177 | int type() const; | 196 | int type() const; |
178 | int subType() const; | 197 | int subType() const; |
179 | int version() const; | 198 | int version() const; |
180 | bool usesWep() const; | 199 | bool usesWep() const; |
181 | 200 | ||
182 | private: | 201 | private: |
183 | const struct ieee_802_11_header* _wlanhdr; | 202 | const struct ieee_802_11_header* _wlanhdr; |
184 | }; | 203 | }; |
185 | 204 | ||
186 | 205 | ||
187 | /*====================================================================================== | 206 | /*====================================================================================== |
188 | * OWaveLanManagementPacket - type: management (T_MGMT) | 207 | * OWaveLanManagementPacket - type: management (T_MGMT) |
189 | *======================================================================================*/ | 208 | *======================================================================================*/ |
190 | 209 | ||
191 | class OWaveLanManagementPacket : public QObject | 210 | class OWaveLanManagementPacket : public QObject |
192 | { | 211 | { |
193 | Q_OBJECT | 212 | Q_OBJECT |
194 | 213 | ||
195 | public: | 214 | public: |
196 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); | 215 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); |
197 | virtual ~OWaveLanManagementPacket(); | 216 | virtual ~OWaveLanManagementPacket(); |
198 | 217 | ||
199 | QString managementType() const; | 218 | QString managementType() const; |
200 | 219 | ||
201 | int beaconInterval() const; | 220 | int beaconInterval() const; |
202 | int capabilities() const; // generic | 221 | int capabilities() const; // generic |
203 | 222 | ||
204 | bool canESS() const; | 223 | bool canESS() const; |
205 | bool canIBSS() const; | 224 | bool canIBSS() const; |