Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef SOLARIS_NETWORK_INTERFACE_MONITOR_H
00014 #define SOLARIS_NETWORK_INTERFACE_MONITOR_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/SString.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #include "ace/Monitor_Control/Monitor_Control_export.h"
00025
00026 #if defined (ACE_HAS_KSTAT)
00027
00028 #include "ace/os_include/os_kstat.h"
00029
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031
00032 namespace ACE
00033 {
00034 namespace Monitor_Control
00035 {
00036
00037
00038
00039
00040
00041
00042 class MONITOR_CONTROL_Export Solaris_Network_Interface_Monitor
00043 {
00044 protected:
00045
00046
00047
00048 Solaris_Network_Interface_Monitor (const ACE_TCHAR *lookup_str);
00049
00050
00051 void update_i (void);
00052
00053
00054 void clear_impl (void);
00055
00056 protected:
00057 ACE_UINT64 value_;
00058
00059 private:
00060
00061
00062 void init (void);
00063 void access_kstats (ACE_UINT64 &which_member);
00064 int check_ks_module (const unsigned long ks_instance,
00065 const unsigned long which_max,
00066 const char *max_str,
00067 ACE_UINT64 *value_array,
00068 ACE_UINT64 &which_member);
00069
00070
00071 private:
00072 static const unsigned long MAX_LO_INTERFACES = 5UL;
00073 static const unsigned long MAX_HME_INTERFACES = 10UL;
00074 ACE_UINT64 value_array_lo_[MAX_LO_INTERFACES];
00075 ACE_UINT64 value_array_hme_[MAX_HME_INTERFACES];
00076 ACE_UINT64 start_;
00077 ACE_TString lookup_str_;
00078 kstat_ctl_t *kstats_;
00079 kstat_t *kstat_;
00080 kid_t kstat_id_;
00081 };
00082 }
00083 }
00084
00085 ACE_END_VERSIONED_NAMESPACE_DECL
00086
00087 #endif
00088
00089 #include "ace/post.h"
00090
00091 #endif // SOLARIS_NETWORK_INTERFACE_MONITOR_H