summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetutils.cpp
authormickeyl <mickeyl>2003-04-05 19:29:47 (UTC)
committer mickeyl <mickeyl>2003-04-05 19:29:47 (UTC)
commit30e5401a945ebdfd92eedb9f3def9a6acd0fc6ca (patch) (unidiff)
treeeca3cb8d01045773db7de60d8194ea85313d3e0a /libopie2/opienet/onetutils.cpp
parent2bfd529736f1dcf008540be2199cd3887a53c75c (diff)
downloadopie-30e5401a945ebdfd92eedb9f3def9a6acd0fc6ca.zip
opie-30e5401a945ebdfd92eedb9f3def9a6acd0fc6ca.tar.gz
opie-30e5401a945ebdfd92eedb9f3def9a6acd0fc6ca.tar.bz2
- setting the monitor mode on wireless cards via private ioctls is now much more reliable because we detect the appropriate ioctl number at runtime
- ONetworkInterface supports now the evil but handy feature to change MAC address on the fly (provided the driver supports this)
Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/onetutils.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index b317810..0fb21ff 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -64,3 +64,3 @@ OMacAddress::OMacAddress( unsigned char* p )
64{ 64{
65 memcpy( _bytes, p, 6 ); // D'OH! memcpy in my sources... eeek... 65 memcpy( _bytes, p, 6 );
66} 66}
@@ -85,2 +85,28 @@ OMacAddress::~OMacAddress()
85 85
86#ifdef QT_NO_DEBUG
87inline
88#endif
89const unsigned char* OMacAddress::native() const
90{
91 return (const unsigned char*) &_bytes;
92}
93
94
95OMacAddress OMacAddress::fromString( const QString& str )
96{
97 QString addr( str );
98 unsigned char buf[6];
99 bool ok = true;
100 int index = 14;
101 for ( int i = 5; i >= 0; --i )
102 {
103 buf[i] = addr.right( 2 ).toUShort( &ok, 16 );
104 if ( !ok ) return OMacAddress::unknown;
105 addr.truncate( index );
106 index -= 3;
107 }
108 return (const unsigned char*) &buf;
109}
110
111
86QString OMacAddress::toString() const 112QString OMacAddress::toString() const