superkaramba
networksensor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef NETWORKSENSOR_H
00011 #define NETWORKSENSOR_H
00012
00013 #include "sensor.h"
00014
00015 #include <tqdatetime.h>
00016 #include <tqfile.h>
00017 #include <tqregexp.h>
00018 #ifdef __FreeBSD__
00019 #include <sys/types.h>
00020 #include <sys/socket.h>
00021 #include <net/if.h>
00022 #include <net/if_mib.h>
00023 #endif
00024
00025 class NetworkSensor : public Sensor
00026 {
00027 Q_OBJECT
00028
00029 public:
00030 NetworkSensor( TQString device, int interval );
00031 ~NetworkSensor();
00032 void update();
00033
00034
00035 private:
00036 unsigned long receivedBytes;
00037 unsigned long transmittedBytes;
00038 TQTime netTimer;
00039 TQString device;
00040 #ifdef __FreeBSD__
00041 int if_number;
00042 ifmibdata if_mib;
00043 #endif
00044 void getInOutBytes (unsigned long &in,unsigned long &out) const;
00045
00046 };
00047 #endif // NETWORKSENSOR_H
00048