• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
  • sensors
network.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2003 by Hans Karlsson *
3  * karlsson.h@home.se *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ***************************************************************************/
10 #ifndef NETWORKSENSOR_H
11 #define NETWORKSENSOR_H
12 
13 #include "sensor.h"
14 
15 #include <QDateTime>
16 #include <QFile>
17 
18 #ifdef Q_OS_FREEBSD
19 #include <sys/types.h>
20 #include <sys/socket.h>
21 #include <net/if.h>
22 #include <net/if_mib.h>
23 #endif
24 
25 #ifndef Q_OS_SOLARIS
26 #include <ifaddrs.h>
27 #endif
28 #include <stdio.h>
29 #include <netdb.h>
30 
31 
32 #define NO_DEVICE "<none>"
33 #define DEFAULT_DEVICE "eth1|eth0"
34 #define NO_IP "-.-.-.-"
35 
36 class NetworkSensor : public Sensor
37 {
38  Q_OBJECT
39 public:
40  NetworkSensor(const QString &device, int interval);
41  ~NetworkSensor();
42  void update();
43 
44 
45 private:
46  unsigned long receivedBytes;
47  unsigned long transmittedBytes;
48  QTime netTimer;
49  QString ipAddress;
50  QString device;
51  QStringList interfaceList;
52 #ifdef __FreeBSD__
53  int if_number;
54  ifmibdata if_mib;
55 #endif
56  void getInOutBytes(unsigned long &in, unsigned long &out) const;
57  void getIPAddress();
58  void refreshDevice();
59 };
60 #endif // NETWORKSENSOR_H
61 
NetworkSensor::NetworkSensor
NetworkSensor(const QString &device, int interval)
Definition: network.cpp:25
NetworkSensor::~NetworkSensor
~NetworkSensor()
Definition: network.cpp:122
NetworkSensor
Definition: network.h:36
Sensor
Definition: sensor.h:17
sensor.h
NetworkSensor::update
void update()
Definition: network.cpp:225
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal