blob: 1ad71eb7e7f5a5c338b1ee196618a5db9bf6cffa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef INTERFACE_H
#define INTERFACE_H
#include <qstring.h>
class Interface {
public:
Interface(QString name = "unknown", bool status = false);
virtual ~Interface(){};
virtual bool getStatus(){ return status; };
virtual void setStatus(bool newSatus){ status = newSatus; refresh(); };
virtual bool isAttached(){ return attached; };
virtual void setAttached(bool isAttached=false){ attached = isAttached; };
virtual QString getInterfaceName(){ return interfaceName; };
virtual void setInterfaceName(QString name="unknown"){ interfaceName = name; };
virtual QString getHardwareName(){ return hardareName; };
virtual void setHardwareName(QString name="Unknown"){ hardareName = name; };
virtual QString getModuleOwner(){ return moduleOwner; };
virtual void setModuleOwner(QString owner="Default"){ moduleOwner = owner; };
// inet information.
QString getMacAddress(){ return macAddress; };
QString getIp(){ return ip; };
QString getSubnetMask(){ return subnetMask; };
QString getBroadcast(){ return broadcast; };
bool isDhcp(){ return dhcp; };
QString getDhcpServerIp(){ return dhcpServerIp; };
QString getLeaseObtained(){ return leaseObtained; };
QString getLeaseExpires(){ return leaseExpires; };
bool refresh();
bool start();
bool stop();
bool restart();
private:
// Interface information
bool status;
bool attached;
QString interfaceName;
QString hardareName;
QString moduleOwner;
// Network information
QString macAddress;
QString ip;
QString broadcast;
QString subnetMask;
bool dhcp;
QString dhcpServerIp;
QString leaseObtained;
QString leaseExpires;
};
#endif
// interface.h
|