AGENT++  4.0.3
snmp_community_mib.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## AGENT++ 4.0 - snmp_community_mib.h
4  _##
5  _## Copyright (C) 2000-2013 Frank Fock and Jochen Katz (agentpp.com)
6  _##
7  _## Licensed under the Apache License, Version 2.0 (the "License");
8  _## you may not use this file except in compliance with the License.
9  _## You may obtain a copy of the License at
10  _##
11  _## http://www.apache.org/licenses/LICENSE-2.0
12  _##
13  _## Unless required by applicable law or agreed to in writing, software
14  _## distributed under the License is distributed on an "AS IS" BASIS,
15  _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  _## See the License for the specific language governing permissions and
17  _## limitations under the License.
18  _##
19  _##########################################################################*/
20 
21 
22 #ifndef _snmp_community_mib_h
23 #define _snmp_community_mib_h
24 
25 
26 #include <agent_pp/mib.h>
30 
31 #ifdef AGENTPP_NAMESPACE
32 namespace Agentpp {
33 #endif
34 
35 #define oidSnmpCommunityTable "1.3.6.1.6.3.18.1.1"
36 #define oidSnmpCommunityEntry "1.3.6.1.6.3.18.1.1.1"
37 #define oidSnmpCommunityIndex "1.3.6.1.6.3.18.1.1.1.1"
38 #define oidSnmpCommunityName "1.3.6.1.6.3.18.1.1.1.2"
39 #define oidSnmpCommunitySecurityName "1.3.6.1.6.3.18.1.1.1.3"
40 #define oidSnmpCommunityContextEngineID "1.3.6.1.6.3.18.1.1.1.4"
41 #define oidSnmpCommunityContextName "1.3.6.1.6.3.18.1.1.1.5"
42 #define oidSnmpCommunityTransportTag "1.3.6.1.6.3.18.1.1.1.6"
43 #define oidSnmpCommunityStorageType "1.3.6.1.6.3.18.1.1.1.7"
44 #define oidSnmpCommunityStatus "1.3.6.1.6.3.18.1.1.1.8"
45 #define oidSnmpTargetAddrExtTable "1.3.6.1.6.3.18.1.2"
46 #define oidSnmpTargetAddrExtEntry "1.3.6.1.6.3.18.1.2.1"
47 #define oidSnmpTargetAddrTMask "1.3.6.1.6.3.18.1.2.1.1"
48 #define oidSnmpTargetAddrMMS "1.3.6.1.6.3.18.1.2.1.2"
49 #define oidSnmpTrapAddress "1.3.6.1.6.3.18.1.3.0"
50 #define oidSnmpTrapCommunity "1.3.6.1.6.3.18.1.4.0"
51 
52 #ifdef _SNMPv3
53 
172 class AGENTPP_DECL snmpTargetAddrTMask: public snmpTargetAddrTAddress {
173 
174 public:
175  snmpTargetAddrTMask(const Oidx&);
176  virtual ~snmpTargetAddrTMask();
177 
178  virtual MibEntryPtr clone();
179  virtual int prepare_set_request(Request*, int&);
180 
184  virtual NS_SNMP UdpAddress* getUdpAddress();
185 };
186 
187 
201 class AGENTPP_DECL snmpCommunityEntry: public StorageTable {
202 
203 public:
204  snmpCommunityEntry();
205  virtual ~snmpCommunityEntry();
206 
207  static snmpCommunityEntry* instance;
208 
209  virtual void set_row(MibTableRow* r, const NS_SNMP OctetStr& p0,
210  const NS_SNMP OctetStr& p1,
211  const NS_SNMP OctetStr& p2,
212  const NS_SNMP OctetStr& p3,
213  const NS_SNMP OctetStr& p4, int p5,
214  int p6);
234  virtual bool get_v3_info(NS_SNMP OctetStr&, NS_SNMP OctetStr&,
235  NS_SNMP OctetStr&, NS_SNMP OctetStr&);
236 
251  virtual bool get_community(NS_SNMP OctetStr&,
252  const NS_SNMP OctetStr&,
253  const NS_SNMP OctetStr&);
254 };
255 
256 
262 class AGENTPP_DECL snmpTargetAddrExtEntry: public MibTable {
263 
264 public:
265  snmpTargetAddrExtEntry();
266  virtual ~snmpTargetAddrExtEntry();
267 
268  static snmpTargetAddrExtEntry* instance;
269 
270  virtual void row_added(MibTableRow*, const Oidx&,
271  MibTable* s = 0);
272  virtual void row_delete(MibTableRow*, const Oidx&,
273  MibTable* s = 0);
274  virtual void set_row(MibTableRow* r, const NS_SNMP OctetStr& p0,
275  int p1);
276  virtual int prepare_set_request(Request*, int&);
277 #ifdef _SNMPv3
278  virtual bool passes_filter(const NS_SNMP OctetStr&, const NS_SNMP UTarget&);
279 #endif
280  virtual bool passes_filter(const NS_SNMP OctetStr&,const NS_SNMP OctetStr&);
281 };
282 
283 
284 class AGENTPP_DECL snmp_community_mib: public MibGroup
285 {
286  public:
287  snmp_community_mib();
288  virtual ~snmp_community_mib() { }
289  static void add_public();
290 };
291 #endif
292 
293 #ifdef AGENTPP_NAMESPACE
294 }
295 #endif
296 
302 #endif