"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/sunos5/netmeter.h" (11 Jul 2020, 796 Bytes) of package /linux/misc/xosview-1.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "netmeter.h" see the Fossies "Dox" file reference documentation.

    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;
   32   uint64_t _lastBytesIn, _lastBytesOut;
   33   kstat_ctl_t *_kc;
   34   KStatList *_nets;
   35   std::string _netIface;
   36   bool _ignored;
   37   struct lifreq _lfr;
   38   int _socket;
   39 };
   40 
   41 #endif