00001 /*_############################################################################ 00002 _## 00003 _## system_group.h 00004 _## 00005 _## 00006 _## AGENT++ API Version 3.5.30 00007 _## ----------------------------------------------- 00008 _## Copyright (C) 2000-2009 Frank Fock, Jochen Katz 00009 _## 00010 _## LICENSE AGREEMENT 00011 _## 00012 _## WHEREAS, Frank Fock and Jochen Katz are the owners of valuable 00013 _## intellectual property rights relating to the AGENT++ API and wish to 00014 _## license AGENT++ subject to the terms and conditions set forth below; 00015 _## and 00016 _## 00017 _## WHEREAS, you ("Licensee") acknowledge that Frank Fock and Jochen Katz 00018 _## have the right to grant licenses to the intellectual property rights 00019 _## relating to AGENT++, and that you desire to obtain a license to use 00020 _## AGENT++ subject to the terms and conditions set forth below; 00021 _## 00022 _## Frank Fock and Jochen Katz grants Licensee a non-exclusive, 00023 _## non-transferable, royalty-free license to use AGENT++ and related 00024 _## materials without charge provided the Licensee adheres to all of the 00025 _## terms and conditions of this Agreement. 00026 _## 00027 _## By downloading, using, or copying AGENT++ or any portion thereof, 00028 _## Licensee agrees to abide by the intellectual property laws and all 00029 _## other applicable laws of Germany, and to all of the terms and 00030 _## conditions of this Agreement, and agrees to take all necessary steps 00031 _## to ensure that the terms and conditions of this Agreement are not 00032 _## violated by any person or entity under the Licensee's control or in 00033 _## the Licensee's service. 00034 _## 00035 _## Licensee shall maintain the copyright and trademark notices on the 00036 _## materials within or otherwise related to AGENT++, and not alter, 00037 _## erase, deface or overprint any such notice. 00038 _## 00039 _## Except as specifically provided in this Agreement, Licensee is 00040 _## expressly prohibited from copying, merging, selling, leasing, 00041 _## assigning, or transferring in any manner, AGENT++ or any portion 00042 _## thereof. 00043 _## 00044 _## Licensee may copy materials within or otherwise related to AGENT++ 00045 _## that bear the author's copyright only as required for backup purposes 00046 _## or for use solely by the Licensee. 00047 _## 00048 _## Licensee may not distribute in any form of electronic or printed 00049 _## communication the materials within or otherwise related to AGENT++ 00050 _## that bear the author's copyright, including but not limited to the 00051 _## source code, documentation, help files, examples, and benchmarks, 00052 _## without prior written consent from the authors. Send any requests for 00053 _## limited distribution rights to fock@agentpp.com. 00054 _## 00055 _## Licensee hereby grants a royalty-free license to any and all 00056 _## derivatives based upon this software code base, that may be used 00057 _## as a SNMP agent development environment or a SNMP agent development 00058 _## tool. 00059 _## 00060 _## Licensee may modify the sources of AGENT++ for the Licensee's own 00061 _## purposes. Thus, Licensee may not distribute modified sources of 00062 _## AGENT++ without prior written consent from the authors. 00063 _## 00064 _## The Licensee may distribute binaries derived from or contained within 00065 _## AGENT++ provided that: 00066 _## 00067 _## 1) The Binaries are not integrated, bundled, combined, or otherwise 00068 _## associated with a SNMP agent development environment or SNMP agent 00069 _## development tool; and 00070 _## 00071 _## 2) The Binaries are not a documented part of any distribution material. 00072 _## 00073 _## 00074 _## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 00075 _## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00076 _## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00077 _## IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00078 _## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00079 _## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00080 _## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00081 _## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00082 _## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00083 _## IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00084 _## POSSIBILITY OF SUCH DAMAGE. 00085 _## 00086 _## 00087 _## Stuttgart, Germany, Fri May 29 22:36:02 CEST 2009 00088 _## 00089 _##########################################################################*/ 00090 00091 #ifndef system_group_h_ 00092 #define system_group_h_ 00093 00094 #ifndef WIN32 00095 #include <sys/time.h> 00096 #endif 00097 00098 #include <string.h> 00099 #include <agent_pp/mib.h> 00100 #include <agent_pp/snmp_textual_conventions.h> 00101 00102 #define oidSysGroup "1.3.6.1.2.1.1" 00103 #define oidSysDescr "1.3.6.1.2.1.1.1.0" 00104 #define oidSysObjectID "1.3.6.1.2.1.1.2.0" 00105 #define oidSysUpTime "1.3.6.1.2.1.1.3.0" 00106 #define oidSysContact "1.3.6.1.2.1.1.4.0" 00107 #define oidSysName "1.3.6.1.2.1.1.5.0" 00108 #define oidSysLocation "1.3.6.1.2.1.1.6.0" 00109 #define oidSysServices "1.3.6.1.2.1.1.7.0" 00110 00111 #define confSysName "sysName.leaf" 00112 #define confSysContact "sysContact.leaf" 00113 #define confSysLocation "sysLocation.leaf" 00114 #define confSysORTable "sysORTable.table" 00115 00116 #define oidSysORLastChange "1.3.6.1.2.1.1.8.0" 00117 #define oidSysORTable "1.3.6.1.2.1.1.9" 00118 #define oidSysOREntry "1.3.6.1.2.1.1.9.1" 00119 #define oidSysORIndex "1.3.6.1.2.1.1.9.1.1" 00120 #define colSysORIndex "1" 00121 #define oidSysORID "1.3.6.1.2.1.1.9.1.2" 00122 #define colSysORID "2" 00123 #define oidSysORDescr "1.3.6.1.2.1.1.9.1.3" 00124 #define colSysORDescr "3" 00125 #define oidSysORUpTime "1.3.6.1.2.1.1.9.1.4" 00126 #define colSysORUpTime "4" 00127 00128 #ifdef AGENTPP_NAMESPACE 00129 namespace Agentpp { 00130 #endif 00131 00132 00133 /********************************************************************** 00134 * 00135 * class sysUpTime 00136 * 00137 **********************************************************************/ 00138 00139 class AGENTPP_DECL sysUpTime: public MibLeaf { 00140 00141 public: 00142 sysUpTime(); 00143 00144 void get_request(Request*, int); 00145 00146 static u_int get(); 00147 static time_t get_currentTime(); 00148 00149 virtual boolean is_volatile() { return TRUE; } 00150 static u_int start; 00151 }; 00152 00153 /********************************************************************** 00154 * 00155 * class sysDescr 00156 * 00157 **********************************************************************/ 00158 00159 class AGENTPP_DECL sysDescr: public SnmpDisplayString { 00160 00161 public: 00162 sysDescr(const char*); 00163 }; 00164 00165 /********************************************************************** 00166 * 00167 * class sysObjectID 00168 * 00169 **********************************************************************/ 00170 00171 class AGENTPP_DECL sysObjectID: public MibLeaf { 00172 00173 public: 00174 sysObjectID(const Oidx&); 00175 }; 00176 00177 /********************************************************************** 00178 * 00179 * class sysServices 00180 * 00181 **********************************************************************/ 00182 00183 class AGENTPP_DECL sysServices: public MibLeaf { 00184 00185 public: 00186 sysServices(const int); 00187 }; 00188 00189 00198 class AGENTPP_DECL sysORLastChange: public MibLeaf { 00199 00200 public: 00201 sysORLastChange(); 00202 virtual ~sysORLastChange() {}; 00203 00204 static sysORLastChange* instance; 00205 00206 virtual boolean is_volatile() { return TRUE; } 00207 void update(); 00208 }; 00209 00217 class AGENTPP_DECL sysOREntry: public TimeStampTable { 00218 00219 public: 00220 sysOREntry(TimeStamp*); 00221 virtual ~sysOREntry(); 00222 00223 static sysOREntry* instance; 00224 00225 virtual void set_row(MibTableRow* r, 00226 const Oidx&, const NS_SNMP OctetStr&, int); 00236 virtual MibTableRow* find(const Oidx&); 00237 00238 virtual boolean is_volatile() { return TRUE; } 00239 }; 00240 00241 00242 00243 00244 /********************************************************************** 00245 * 00246 * class sysGroup 00247 * 00248 **********************************************************************/ 00249 00250 class AGENTPP_DECL sysGroup: public MibGroup { 00251 00252 public: 00253 // must values for the system group are: 00254 // system descriptor, system object ID, 00255 // and the services of the system 00256 00257 sysGroup(const char*, const Oidx&, const int); 00258 private: 00259 char* path; 00260 }; 00261 #ifdef AGENTPP_NAMESPACE 00262 } 00263 #endif 00264 #endif