Diffstat (limited to 'noncore/net/networksetup/interface.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interface.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/net/networksetup/interface.h b/noncore/net/networksetup/interface.h new file mode 100644 index 0000000..1ad71eb --- a/dev/null +++ b/noncore/net/networksetup/interface.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef INTERFACE_H | ||
2 | #define INTERFACE_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | class Interface { | ||
7 | |||
8 | public: | ||
9 | Interface(QString name = "unknown", bool status = false); | ||
10 | virtual ~Interface(){}; | ||
11 | |||
12 | virtual bool getStatus(){ return status; }; | ||
13 | virtual void setStatus(bool newSatus){ status = newSatus; refresh(); }; | ||
14 | |||
15 | virtual bool isAttached(){ return attached; }; | ||
16 | virtual void setAttached(bool isAttached=false){ attached = isAttached; }; | ||
17 | |||
18 | virtual QString getInterfaceName(){ return interfaceName; }; | ||
19 | virtual void setInterfaceName(QString name="unknown"){ interfaceName = name; }; | ||
20 | |||
21 | virtual QString getHardwareName(){ return hardareName; }; | ||
22 | virtual void setHardwareName(QString name="Unknown"){ hardareName = name; }; | ||
23 | |||
24 | virtual QString getModuleOwner(){ return moduleOwner; }; | ||
25 | virtual void setModuleOwner(QString owner="Default"){ moduleOwner = owner; }; | ||
26 | |||
27 | // inet information. | ||
28 | QString getMacAddress(){ return macAddress; }; | ||
29 | QString getIp(){ return ip; }; | ||
30 | QString getSubnetMask(){ return subnetMask; }; | ||
31 | QString getBroadcast(){ return broadcast; }; | ||
32 | bool isDhcp(){ return dhcp; }; | ||
33 | QString getDhcpServerIp(){ return dhcpServerIp; }; | ||
34 | QString getLeaseObtained(){ return leaseObtained; }; | ||
35 | QString getLeaseExpires(){ return leaseExpires; }; | ||
36 | |||
37 | bool refresh(); | ||
38 | bool start(); | ||
39 | bool stop(); | ||
40 | bool restart(); | ||
41 | |||
42 | private: | ||
43 | // Interface information | ||
44 | bool status; | ||
45 | bool attached; | ||
46 | QString interfaceName; | ||
47 | QString hardareName; | ||
48 | QString moduleOwner; | ||
49 | |||
50 | // Network information | ||
51 | QString macAddress; | ||
52 | QString ip; | ||
53 | QString broadcast; | ||
54 | QString subnetMask; | ||
55 | bool dhcp; | ||
56 | QString dhcpServerIp; | ||
57 | QString leaseObtained; | ||
58 | QString leaseExpires; | ||
59 | |||
60 | }; | ||
61 | |||
62 | #endif | ||
63 | |||
64 | // interface.h | ||
65 | |||