[Kde-hardware-devel] Network Mangement

Christopher Blauvelt cblauvelt at gmail.com
Sat May 13 12:54:42 CEST 2006


I hadn't updated my solid code in a while and last night I noticed
that you had added the network device code.  It was similar to what I
had written except that it contained less data in the structure.  I
had also included:  the bus type, isWireless was getMedium which would
return wired or wireless, and a function isPrimaryDevice for the
purposes of determining which device will be the default gateway.
My thoughts were to have each network device contain a "Network"
class.  This would give data such as: IPv(4|6) address, subnetmask,
broadcast, Rx bytes, Tx Bytes, errors.  If the device was wireless it
would also contain information about: SSID, encryption type, Tx Power,
sensitivity, etc.  Basically all the information you'd get out of
'iwconfig eth0.'

On the network device structure I believe we should have the following
functions:
QList <Qstring> getIPv4Info() const;
QList <Qstring> getIPv6Info() const;
bool isPrimaryDevice() const;

//Wireless specific
ProtocolType getProtocol() const;
QString getSSID() const;
EncryptionType getEncryption() const;
EncryptionKey getEncKey() const;
int getSignalStrength(bool inDBM=true) const;
QString getSignalStrength() const;
int getSensitivity() const;

//in enum.h
enum ProtocolType { WifiA, WifiB, WifiG, WifiN, BlueTooth, ZigBee };
enum EncryptionType { WEP, WPA, WPA2 };

EncryptionKey would have the following functions:
QString keyAsHex()
QString keyAsDec()

Later we can add some "setxyz" functions but I'm focusing mainly on
getting information right now.  What are your thoughts?

Additionally, where should we store class interfaces that aren't
necessarily devices.  A network isn't a device and would be possibly
confusing having it in with the rest of the devices.  On the other
hand, it may just be a special case and get put in with the rest of
the devices.  I can't think of any other instances within this project
that we'll be handling something that isn't actually, "hardware."
Chris


More information about the Kde-hardware-devel mailing list