summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings2/system.h
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/system.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h
new file mode 100644
index 0000000..f89fe5d
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/system.h
@@ -0,0 +1,76 @@
1#ifndef __SYSTEM__H
2#define __SYSTEM__H
3
4// for hardware types
5#include <net/if_arp.h>
6#include <qdict.h>
7
8class ANetNodeInstance;
9class QFile;
10
11class InterfaceInfo {
12
13public :
14
15 InterfaceInfo() :
16 Name(),
17 MACAddress(),
18 BCastAddress(),
19 Netmask(),
20 DstAddress() {
21 }
22
23 ANetNodeInstance * assignedNode()
24 { return NetNode; }
25
26 void assignNode( ANetNodeInstance * NNI )
27 { NetNode = NNI; }
28
29 ANetNodeInstance * NetNode; // netnode taking care of me
30 QString Name; // name of interface
31 int CardType; // type of card
32 QString MACAddress; // MAC address
33 QString Address; // IP Address
34 QString BCastAddress; // Broadcast Address
35 QString Netmask; // Netmask
36 QString DstAddress; // Peer address (if P-t-P)
37 bool IsUp; // interface is UP
38 bool HasMulticast; // Supports Multicast
39 bool IsPointToPoint; // IsPointToPoint card
40
41 QString RcvBytes;
42 QString SndBytes;
43 QString RcvErrors;
44 QString SndErrors;
45 QString RcvDropped;
46 QString SndDropped;
47 QString Collisions;
48};
49
50class System {
51
52public :
53
54 System( void );
55 ~System( void );
56
57 QDict<InterfaceInfo> & interfaces( void )
58 { return ProbedInterfaces; }
59 InterfaceInfo * interface( const QString& N )
60 { return ProbedInterfaces[N]; }
61
62 int execute( const QString & S );
63 // refresh stats for this interface
64 void refreshStatistics( InterfaceInfo & );
65
66 // reloads interfaces
67 void probeInterfaces( void );
68
69private :
70
71 QDict<InterfaceInfo> ProbedInterfaces;
72 QFile * ProcDevNet;
73
74};
75
76#endif