Commit 9e8ad209 authored by Pino Toscano's avatar Pino Toscano
Browse files

view1394: drop support for custom oui.db

Our custom oui.db is utterly outdated, and using it is simply a bad
idea. Since we have been supporting a system oui.txt for quite a while,
then drop the support for the custom oui.db.
parent 2926bb66
......@@ -2,12 +2,9 @@ this kcontrol module shows the current configuration of the IEEE 1394 bus.
It uses libraw1394 (see www.linux1394.org). I don't know how the 1394 apis
on other OS's look, feel free to port it :-)
The file oui.db is generated from the file oui.txt which you can get at
http://standards.ieee.org/regauth/oui/index.shtml
It was generated using the following command:
awk '/base 16/ { if (NF>3) {s=$1; for (i=4; i<=NF; i++) s=s " " $i; print s}}' oui.txt > oui.db
The file oui.txt is available from the hwdata project, installed as system
package:
https://github.com/vcrhonek/hwdata
Alex
<neundorf@kde.org>
......@@ -290,12 +290,6 @@ OuiDb::OuiDb() {
break;
}
}
if (!filename.isEmpty())
return;
filename=QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kcmview1394/oui.db"));
if (!filename.isEmpty())
loadFromCustomOuiDb(filename);
}
void OuiDb::loadFromOuiTxt(const QString &filename) {
......@@ -315,30 +309,6 @@ void OuiDb::loadFromOuiTxt(const QString &filename) {
}
}
void OuiDb::loadFromCustomOuiDb(const QString &filename) {
QFile f(filename);
if (!f.open(QIODevice::ReadOnly))
return;
QByteArray ba=f.readAll();
int bytesLeft=ba.size();
char* data=ba.data();
while (bytesLeft>8) {
char *eol=(char*)memchr((const void*)data, '\n', bytesLeft);
if (eol==0)
break;
if ((eol-data)<8)
break;
data[6]='\0';
*eol='\0';
m_vendorIds.insert(QLatin1String(data), QString::fromUtf8(data+7));
bytesLeft-=(eol+1-data);
data=eol+1;
}
f.close();
}
QString OuiDb::vendor(octlet_t guid) {
guid=(guid & 0xffffff0000000000LL)>>40;
QString key=QString::number((unsigned int)(guid), 16);
......
......@@ -39,7 +39,6 @@ public:
QString vendor(octlet_t guid);
private:
void loadFromOuiTxt(const QString &filename);
void loadFromCustomOuiDb(const QString &filename);
QMap<QString, QString> m_vendorIds;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment