00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef agentx_index_h_
00023 #define agentx_index_h_
00024
00025 #include <agent_pp/mib_complex_entry.h>
00026
00027 #ifdef AGENTPP_NAMESPACE
00028 namespace Agentpp {
00029 #endif
00030
00031
00032
00033 class AgentXIndexEntry: public MibStaticEntry {
00034 public:
00035 AgentXIndexEntry(u_int sid, const Oidx& o, const NS_SNMP SnmpSyntax& v):
00036 MibStaticEntry(o, v) { session_id = sid; }
00037 AgentXIndexEntry(const AgentXIndexEntry& o): MibStaticEntry(o)
00038 { session_id = o.session_id; }
00039 virtual ~AgentXIndexEntry() { }
00040
00041 u_int get_session_id() { return session_id; }
00042 protected:
00043 u_int session_id;
00044 };
00045
00046
00047
00048
00049 class AgentXIndex: public MibStaticEntry {
00050 public:
00051 AgentXIndex(const Vbx&);
00052
00053 AgentXIndex(AgentXIndex&);
00054
00055 virtual ~AgentXIndex();
00056
00057 virtual int allocate(u_int, const Vbx&, boolean);
00058 virtual boolean release(u_int, const Vbx&, boolean);
00059
00060 virtual int new_index(u_int, Vbx&, boolean);
00061 virtual int any_index(u_int, Vbx&, boolean);
00062
00063 virtual void remove_session(u_int);
00064
00065 protected:
00066
00067 virtual Oidx* get_index_value(const Vbx&);
00068
00069 virtual boolean is_simple_syntax();
00070
00071 OidList<AgentXIndexEntry> allocatedValues;
00072 OidList<AgentXIndexEntry> usedValues;
00073 };
00074
00075
00076
00077
00078 class AgentXIndexDB: public Synchronized {
00079
00080 public:
00081 AgentXIndexDB(const Oidx& c) { context = c; }
00082
00086 virtual ~AgentXIndexDB();
00087
00088 static boolean is_valid_syntax(NS_SNMP SmiUINT32);
00089
00090 virtual int allocate(u_int, const Vbx&, boolean);
00091 virtual boolean release(u_int, const Vbx&, boolean);
00092 virtual void remove_session(u_int);
00093
00094 virtual int new_index(u_int, Vbx&, boolean);
00095 virtual int any_index(u_int, Vbx&, boolean);
00096
00097 Oidx* key() { return &context; }
00098
00099 protected:
00100
00101 OidList<AgentXIndex> indexes;
00102 Oidx context;
00103 };
00104
00105 #ifdef AGENTPP_NAMESPACE
00106 }
00107 #endif
00108
00109
00110 #endif