summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetutils.cpp
authormickeyl <mickeyl>2003-05-08 17:35:05 (UTC)
committer mickeyl <mickeyl>2003-05-08 17:35:05 (UTC)
commit41ca770b8bea964ea9c5905b1df1209fe4720f89 (patch) (unidiff)
tree585b10184e6afc283055ce3f7348ae19969b5174 /libopie2/opienet/onetutils.cpp
parent197cdbb5ca34517c077b69bb8517787ab1e52aeb (diff)
downloadopie-41ca770b8bea964ea9c5905b1df1209fe4720f89.zip
opie-41ca770b8bea964ea9c5905b1df1209fe4720f89.tar.gz
opie-41ca770b8bea964ea9c5905b1df1209fe4720f89.tar.bz2
- sync manufacturer list with ethereal
- fix onetworkdemo example - add API for short/extended manufacturer names
Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetutils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index e05efc2..08c40b4 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -116,21 +116,22 @@ QString OMacAddress::toString( bool substitute ) const
116 manu.sprintf( "%.2X:%.2X:%.2X", _bytes[0]&0xff, _bytes[1]&0xff, _bytes[2]&0xff ); 116 manu.sprintf( "%.2X:%.2X:%.2X", _bytes[0]&0xff, _bytes[1]&0xff, _bytes[2]&0xff );
117 QString serial; 117 QString serial;
118 serial.sprintf( ":%.2X:%.2X:%.2X", _bytes[3]&0xff, _bytes[4]&0xff, _bytes[5]&0xff ); 118 serial.sprintf( ":%.2X:%.2X:%.2X", _bytes[3]&0xff, _bytes[4]&0xff, _bytes[5]&0xff );
119 if ( !substitute ) return manu+serial; 119 if ( !substitute ) return manu+serial;
120 // fallback - if no vendor is found, just use the number 120 // fallback - if no vendor is found, just use the number
121 QString textmanu = OManufacturerDB::instance()->lookup( manu ); 121 QString textmanu = OManufacturerDB::instance()->lookup( manu );
122 return textmanu.isNull() ? manu+serial : textmanu + serial; 122 return textmanu.isNull() ? manu+serial : textmanu+serial;
123} 123}
124 124
125 125
126QString OMacAddress::manufacturer() const 126QString OMacAddress::manufacturer() const
127{ 127{
128 return OManufacturerDB::instance()->lookup( toString() ); 128 return OManufacturerDB::instance()->lookupExt( toString() );
129} 129}
130 130
131
131bool operator==( const OMacAddress &m1, const OMacAddress &m2 ) 132bool operator==( const OMacAddress &m1, const OMacAddress &m2 )
132{ 133{
133 return memcmp( &m1._bytes, &m2._bytes, 6 ) == 0; 134 return memcmp( &m1._bytes, &m2._bytes, 6 ) == 0;
134} 135}
135 136
136 137