xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

netmeter.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 1994, 1995 by Mike Romberg ( romberg@fsl.noaa.gov )
3 //
4 // This file may be distributed under terms of the GPL
5 //
6 
7 #ifndef _NETMETER_H_
8 #define _NETMETER_H_
9 
10 #include "fieldmetergraph.h"
11 #include "xosview.h"
12 #include "kstats.h"
13 #include <kstat.h>
14 #include <net/if.h>
15 #include <string>
16 
17 
18 class NetMeter : public FieldMeterGraph {
19 public:
20  NetMeter( XOSView *parent, kstat_ctl_t *kc, float max );
21  ~NetMeter( void );
22 
23  const char *name( void ) const { return "NetMeter"; }
24  void checkevent( void );
25  void checkResources( void );
26 
27 protected:
28  void getnetstats( void );
29 
30 private:
31  float _maxpackets;
33  kstat_ctl_t *_kc;
35  std::string _netIface;
36  bool _ignored;
37  struct lifreq _lfr;
38  int _socket;
39 };
40 
41 #endif
float _maxpackets
Definition: netmeter.h:27
~NetMeter(void)
struct lifreq _lfr
Definition: netmeter.h:37
kstat_ctl_t * _kc
Definition: netmeter.h:33
void checkResources(void)
int _socket
Definition: netmeter.h:38
KStatList * _nets
Definition: netmeter.h:34
void getnetstats(void)
Definition: netmeter.cc:60
uint64_t _lastBytesIn
Definition: netmeter.h:32
NetMeter(XOSView *parent, double max)
Definition: netmeter.cc:22
std::string _netIface
Definition: netmeter.h:28
unsigned long long _lastBytesOut
Definition: netmeter.h:30
void checkevent(void)
const char * name(void) const
Definition: netmeter.h:23
bool _ignored
Definition: netmeter.h:29
static const int max
Definition: intmeter.cc:17