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.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h
index 96ee9bd..33af391 100644
--- a/noncore/settings/networksettings2/networksettings2/system.h
+++ b/noncore/settings/networksettings2/networksettings2/system.h
@@ -1,18 +1,20 @@
1#ifndef __SYSTEM__H 1#ifndef __SYSTEM__H
2#define __SYSTEM__H 2#define __SYSTEM__H
3 3
4// for hardware types 4// for hardware types
5#include <net/if_arp.h> 5#include <net/if_arp.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qobject.h>
8#include <stdio.h>
7 9
8class ANetNodeInstance; 10class ANetNodeInstance;
9class QFile; 11class QFile;
10 12
11class InterfaceInfo { 13class InterfaceInfo {
12 14
13public : 15public :
14 16
15 InterfaceInfo() : 17 InterfaceInfo() :
16 Name(), 18 Name(),
17 MACAddress(), 19 MACAddress(),
18 BCastAddress(), 20 BCastAddress(),
@@ -38,44 +40,51 @@ public :
38 bool HasMulticast; // Supports Multicast 40 bool HasMulticast; // Supports Multicast
39 bool IsPointToPoint; // IsPointToPoint card 41 bool IsPointToPoint; // IsPointToPoint card
40 42
41 QString RcvBytes; 43 QString RcvBytes;
42 QString SndBytes; 44 QString SndBytes;
43 QString RcvErrors; 45 QString RcvErrors;
44 QString SndErrors; 46 QString SndErrors;
45 QString RcvDropped; 47 QString RcvDropped;
46 QString SndDropped; 48 QString SndDropped;
47 QString Collisions; 49 QString Collisions;
48}; 50};
49 51
50class System { 52class System : public QObject {
53
54 Q_OBJECT
51 55
52public : 56public :
53 57
54 System( void ); 58 System( void );
55 ~System( void ); 59 ~System( void );
56 60
57 QDict<InterfaceInfo> & interfaces( void ) 61 QDict<InterfaceInfo> & interfaces( void )
58 { return ProbedInterfaces; } 62 { return ProbedInterfaces; }
59 InterfaceInfo * interface( const QString& N ) 63 InterfaceInfo * interface( const QString& N )
60 { return ProbedInterfaces[N]; } 64 { return ProbedInterfaces[N]; }
61 65
62 // exec command as root 66 // exec command as root
63 int runAsRoot( const QString & S ); 67 int runAsRoot( const QString & S );
64 68
65 // exec command as user 69 // exec command as user
66 void execAsUser( QString & Cmd, char * argv[] ); 70 void execAsUser( QString & Cmd, char * argv[] );
67 71
68 // refresh stats for this interface 72 // refresh stats for this interface
69 void refreshStatistics( InterfaceInfo & ); 73 void refreshStatistics( InterfaceInfo & );
70 74
71 // reloads interfaces 75 // reloads interfaces
72 void probeInterfaces( void ); 76 void probeInterfaces( void );
73 77
78signals :
79
80 void lineFromCommand( const QString & S );
81
74private : 82private :
75 83
76 QDict<InterfaceInfo> ProbedInterfaces; 84 QDict<InterfaceInfo> ProbedInterfaces;
85 FILE * OutputOfCmd;
77 QFile * ProcDevNet; 86 QFile * ProcDevNet;
78 87
79}; 88};
80 89
81#endif 90#endif