00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #ifndef mib_h_
00093 #define mib_h_
00094
00095 #include <stdio.h>
00096
00097 #include <agent_pp/agent++.h>
00098 #include <agent_pp/threads.h>
00099 #include <agent_pp/List.h>
00100 #include <agent_pp/mib_avl_map.h>
00101 #include <agent_pp/snmp_pp_ext.h>
00102 #include <agent_pp/mib_entry.h>
00103 #include <agent_pp/oidx_ptr.h>
00104 #include <agent_pp/tools.h>
00105 #include <agent_pp/request.h>
00106 #include <agent_pp/mib_context.h>
00107 #include <agent_pp/proxy_forwarder.h>
00108
00109
00110 #define DEFAULT_PATH_PERSISTENT_MO "config/"
00111 #define VARIABLE_INDEX_LENGTH 0
00112
00113 #define DEFAULT_ROW_CREATION_TIMEOUT 300
00114
00115 #define VMODE_NONE 0
00116 #define VMODE_DEFAULT 1
00117 #define VMODE_LOCKED 2
00118
00119 #define LEAF_VALUE_INITIALIZED 1
00120 #define LEAF_VALUE_SET 2
00121
00122 #ifdef AGENTPP_NAMESPACE
00123 namespace Agentpp {
00124 #endif
00125
00126
00127
00128 class AGENTPP_DECL MibTableRow;
00129 class AGENTPP_DECL MibTable;
00130
00160 class AGENTPP_DECL MibLeaf: public MibEntry {
00161 friend class MibTable;
00162 friend class MibTableRow;
00163 public:
00164
00168 MibLeaf();
00169
00181 MibLeaf(const Oidx&, mib_access, NS_SNMP SmiUINT32);
00182
00196 MibLeaf(const Oidx&, mib_access, NS_SNMP SnmpSyntax*);
00197
00223 MibLeaf(const Oidx&, mib_access, NS_SNMP SnmpSyntax*, int);
00224
00228 MibLeaf(const MibLeaf&);
00229
00233 virtual ~MibLeaf();
00234
00254 virtual void init(NS_SNMP SnmpSyntax*, boolean);
00255
00261 virtual mib_type type() const;
00262
00268 virtual MibEntryPtr clone();
00269
00270
00278 virtual boolean serialize(char*&, int&);
00279
00291 virtual boolean deserialize(char*, int&);
00292
00293
00300 virtual NS_SNMP SmiUINT32 get_syntax() const;
00301
00308 virtual Vbx get_value() const;
00316 virtual int get_value(NS_SNMP SnmpSyntax& s) const
00317 { return get_value().get_value(s); }
00324 virtual int get_value(int& i) const
00325 { return get_value().get_value(i); }
00332 virtual int get_value(long& i) const
00333 { return get_value().get_value(i); }
00341 virtual int get_value(unsigned long& i) const
00342 { return get_value().get_value(i); }
00349 virtual int get_value(char* c) const
00350 { return get_value().get_value(c); }
00351
00357 virtual void set_value(const NS_SNMP SnmpSyntax&);
00358
00367 virtual void set_value(const unsigned long);
00368
00377 virtual int set_value(const Vbx&);
00383 virtual void replace_value(NS_SNMP SnmpSyntax* s);
00384
00385
00394 virtual OidxPtr max_key() { return key(); }
00395
00396
00407 virtual void get_request(Request*, int);
00408
00415 virtual void get_next_request(Request*, int);
00416
00424 virtual int commit_set_request(Request*, int);
00425
00434 virtual int prepare_set_request(Request*, int&);
00435
00443 virtual int undo_set_request(Request*, int&);
00444
00451 virtual void cleanup_set_request(Request*, int&);
00452
00453
00461 virtual boolean value_ok(const Vbx&) { return TRUE; }
00462
00471 virtual int set(const Vbx& vb);
00477 virtual int unset();
00478
00479
00486 MibTable* get_reference_to_table() { return my_table; }
00493 MibTableRow* get_reference_to_row() { return my_row; }
00494
00505 int valid() { return validity; }
00506
00512 boolean has_default() { return (value_mode & VMODE_DEFAULT);}
00513
00519 boolean is_locked() { return (value_mode & VMODE_LOCKED); }
00520
00526 void set_reference_to_table(MibTable* t) { my_table = t; }
00532 void set_reference_to_row(MibTableRow* r) { my_row = r; }
00533
00539 void set_access(mib_access a) { access = a; }
00540
00550 Oidx get_oid() const;
00551
00552
00553 protected:
00554
00562 int get_value_mode() { return value_mode; }
00563
00574 void set_validity(int flags) { validity = flags; }
00575
00581 void set_syntax(NS_SNMP SmiUINT32);
00582
00586 void free_value();
00587
00588
00589 NS_SNMP SnmpSyntax* value;
00590 NS_SNMP SnmpSyntax* undo;
00591
00592 int value_mode;
00593
00601 int validity;
00602
00603
00604
00605 MibTable* my_table;
00606 MibTableRow* my_row;
00607
00608 };
00609
00610
00611
00612
00613 #define rowEmpty 0
00614 #define rowActive 1
00615 #define rowNotInService 2
00616 #define rowNotReady 3
00617 #define rowCreateAndGo 4
00618 #define rowCreateAndWait 5
00619 #define rowDestroy 6
00620
00632 class AGENTPP_DECL snmpRowStatus: public MibLeaf {
00633
00634 public:
00638 snmpRowStatus() { }
00639
00646 snmpRowStatus(const Oidx&);
00647
00654 snmpRowStatus(const Oidx&, mib_access);
00655
00656
00660 virtual ~snmpRowStatus();
00661
00673 virtual boolean value_ok(const Vbx&);
00674
00686 virtual boolean transition_ok(const Vbx&);
00687
00693 virtual MibEntryPtr clone();
00694
00707 virtual boolean check_state_change(const Vbx&, Request* req=0);
00708
00716 virtual int set(const Vbx&);
00717
00724 virtual int unset();
00725
00731 long get();
00732
00744 virtual int prepare_set_request(Request*, int&);
00745 };
00746
00747
00748
00749
00750
00764 #if !defined (AGENTPP_DECL_TEMPL_LIST_MIBLEAF)
00765 #define AGENTPP_DECL_TEMPL_LIST_MIBLEAF
00766 AGENTPP_DECL_TEMPL template class AGENTPP_DECL List<MibLeaf>;
00767 #endif
00768 #if !defined (AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF)
00769 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF
00770 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OrderedList<MibLeaf>;
00771 #endif
00772 #if !defined (AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF)
00773 #define AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF
00774 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OrderedArray<MibLeaf>;
00775 #endif
00776
00777 class AGENTPP_DECL MibTableRow {
00778 friend class MibTable;
00779
00780 public:
00784 MibTableRow();
00785
00792 MibTableRow(const Oidx& base);
00793
00799 MibTableRow(const MibTableRow&);
00800
00805 virtual ~MibTableRow();
00806
00807
00813 MibTableRow* clone();
00814
00815
00823 MibLeaf* add(MibLeaf* l);
00824
00834 snmpRowStatus* add(snmpRowStatus* l);
00835
00836
00844 MibLeaf* get_nth(int i) { return row.getNth(i); }
00845
00851 MibLeaf* first() { return row.first(); }
00852
00858 MibLeaf* last() { return row.last(); }
00859
00865 int size() { return row.size(); }
00866
00874 MibLeaf* get_element(const Oidx&);
00875
00883 boolean remove(int);
00884
00893 void replace_element(unsigned int, MibLeaf*);
00894
00902 int operator<(const MibTableRow&);
00903
00911 int operator>(const MibTableRow&);
00912
00920 int operator==(const MibTableRow&);
00921
00928 MibTableRow& operator=(const MibTableRow&);
00929
00937 boolean contains(const Oidx&) const;
00938
00947 int index_of(const Oidx&) const;
00948
00960 int index_of(MibLeaf* l) const { return row.index(l); }
00961
00970 int index_of_upper(const Oidx&) const;
00971
00980 int index_of_lower(const Oidx&) const;
00981
00982
00991 virtual void set_index(const Oidx& ind);
00992
00998 Oidx get_index() { return index; }
00999
01006 Oidx* key() { return &index; }
01007
01021 void get_vblist(Vbx*, int,
01022 boolean returnVolatileAsNull=FALSE);
01023
01031 snmpRowStatus* get_row_status() { return row_status; }
01032
01036 void read_only();
01037
01045 void set_access(mib_access);
01046
01047 protected:
01055 virtual void set_base(const Oidx& b) { base = b; }
01056
01062 void set_reference_to_table(MibTable*);
01066 void set_reference_to_row();
01067
01068 Oidx index;
01069 Oidx base;
01070 #ifdef USE_ARRAY_TEMPLATE
01071 OrderedArray<MibLeaf> row;
01072 #else
01073 OrderedList<MibLeaf> row;
01074 #endif
01075
01076 snmpRowStatus* row_status;
01077 };
01078
01079
01080
01092 class AGENTPP_DECL MibTableVoter {
01093 public:
01094 MibTableVoter() { }
01095 virtual ~MibTableVoter() { }
01096
01139 virtual int is_transition_ok(MibTable*,
01140 MibTableRow*,
01141 const Oidx&,
01142 int,
01143 int) { return SNMP_ERROR_SUCCESS; }
01144 };
01145
01146
01147
01148 struct index_info {
01149 NS_SNMP SmiUINT32 type;
01150 boolean implied;
01151 unsigned int min;
01152 unsigned int max;
01153 };
01154
01155
01214 #if !defined (AGENTPP_DECL_TEMPL_LIST_MIBTABLE)
01215 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLE
01216 AGENTPP_DECL_TEMPL template class AGENTPP_DECL List<MibTable>;
01217 #endif
01218 #if !defined (AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW)
01219 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW
01220 AGENTPP_DECL_TEMPL template class AGENTPP_DECL List<MibTableRow>;
01221 #endif
01222 #if !defined (AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER)
01223 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER
01224 AGENTPP_DECL_TEMPL template class AGENTPP_DECL List<MibTableVoter>;
01225 #endif
01226 #if !defined (AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW)
01227 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW
01228 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OidList<MibTableRow>;
01229 #endif
01230 #if !defined (AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW)
01231 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW
01232 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OrderedList<MibTableRow>;
01233 #endif
01234
01235 class AGENTPP_DECL MibTable: public MibEntry, public MibTableVoter {
01236 friend class Mib;
01237 friend class snmpRowStatus;
01238 public:
01239
01243 MibTable(const MibTable&);
01244
01253 MibTable(const Oidx&);
01254
01268 MibTable(const Oidx&, unsigned int);
01269
01285 MibTable(const Oidx&, unsigned int, boolean);
01286
01287
01306 MibTable(const Oidx&, const index_info*, unsigned int);
01307
01311 virtual ~MibTable();
01312
01318 mib_type type() const { return AGENTPP_TABLE; }
01319
01325 virtual MibEntryPtr clone() { return new MibTable(*this); }
01326
01327
01334 virtual void add_col(MibLeaf*);
01335
01343 virtual void add_col(snmpRowStatus*);
01344
01353 virtual void replace_col(unsigned int, MibLeaf*);
01354
01362 virtual boolean serialize(char*&, int&);
01363
01375 virtual boolean deserialize(char*, int&);
01376
01385 virtual OidxPtr max_key();
01386
01402 virtual void update(Request*) { }
01403
01409 virtual boolean is_empty() { return content.empty(); }
01410
01420 virtual int set_value(Request*, int);
01421
01422
01429 virtual void get_request(Request*, int);
01430
01437 virtual void get_next_request(Request*, int);
01438
01447 virtual int commit_set_request(Request*, int);
01448
01458 virtual int prepare_set_request(Request*, int&);
01459
01468 virtual int undo_set_request(Request*, int&);
01469
01481 virtual void cleanup_set_request(Request*, int&);
01482
01492 virtual boolean ready_for_service(Vbx* pvbs, int sz);
01493
01502 virtual MibTableRow* add_row(const Oidx&);
01503
01517 virtual MibTableRow* init_row(const Oidx&, Vbx*);
01518
01526 virtual void remove_row(const Oidx&);
01527
01540 virtual void row_init(MibTableRow*, const Oidx&,
01541 MibTable* t=0) { }
01542
01553 virtual void row_added(MibTableRow*, const Oidx&,
01554 MibTable* t=0) { }
01564 virtual void row_delete(MibTableRow*, const Oidx&,
01565 MibTable* t=0) { }
01566
01577 virtual void row_activated(MibTableRow*, const Oidx&,
01578 MibTable* t=0) { }
01579
01590 virtual void row_deactivated(MibTableRow*, const Oidx&,
01591 MibTable* t=0) { }
01592
01600 virtual Oidx get_next_avail_index() const;
01601
01609 MibTableRow* find_index(const Oidx&) const;
01610
01617 Oidx index(const Oidx&) const;
01618
01628 virtual boolean is_index_valid(const Oidx&) const;
01629
01636 Oidx base(const Oidx&);
01637
01661 virtual void get_contents(Vbx**&, int&, int&, boolean = rowActive);
01662
01671 OidList<MibTableRow>* rows() { return &content; }
01672
01690 virtual List<MibTableRow>* get_rows(boolean = rowActive);
01691
01711 virtual List<MibTableRow>* get_rows_cloned(boolean = rowActive);
01712
01735 virtual List<MibTableRow>* get_rows_cloned(const Oidx*,
01736 boolean = rowActive);
01737
01744 virtual int size();
01745
01754 virtual void add_voter(MibTableVoter*);
01755
01762 virtual void remove_voter(MibTableVoter*);
01763
01777 virtual void add_listener(MibTable*);
01778
01786 virtual void remove_listener(MibTable*);
01787
01805 void fire_row_changed(int, MibTableRow*,
01806 const Oidx&);
01807
01815 ListCursor<MibTable>* get_listeners()
01816 { return new ListCursor<MibTable>(&listeners); }
01817
01825 boolean has_listeners() const
01826 { return (listeners.size() > 0); }
01827
01831 virtual void clear();
01832
01838 virtual void reset() { clear(); }
01839
01847 virtual MibTableRow* get_columns();
01848
01855 MibLeaf* find (const Oidx&) const;
01856
01863 virtual MibLeaf* find_next(const Oidx&);
01864
01871 MibLeaf* find_prev(const Oidx&);
01872
01881 MibLeaf* get(int, int);
01882
01891 virtual void reinit() { }
01892
01893 protected:
01894
01904 void init(const Oidx&, const index_info*, unsigned int);
01905
01917 virtual boolean could_ever_be_managed(const Oidx&, int&);
01918
01925 void remove_obsolete_rows(OrderedList<Oidx>& confirmed);
01926
01941 virtual Oidx find_succ(const Oidx&, Request* req = 0);
01942
01951 MibLeaf* get_generator(const Oidx&);
01952
01965 virtual int check_creation(Request*, int&);
01966
01984 virtual boolean ready(Vbx* pvbs, int sz, MibTableRow* row);
01985
01996 virtual void get_required_columns(boolean*, Vbx* vbs = 0);
01997
01998
02006 int get_row_status(MibTableRow*);
02007
02016 int set_row_status(MibTableRow*, int);
02017
02018
02029 void remove_unused_rows();
02030
02040 boolean check_index(Oidx&, unsigned long, unsigned long) const;
02041
02050 virtual boolean is_persistent(MibTableRow*) { return TRUE; }
02051
02065 int perform_voting(MibTableRow*, int, int);
02066
02067
02068
02069 Oidx upper;
02070
02071 MibTableRow generator;
02072 OidList<MibTableRow> content;
02073 unsigned int index_len;
02074 index_info* index_struc;
02075
02076
02077
02078
02079 snmpRowStatus* row_status;
02080 Timer row_timeout;
02081 OrderedList<MibTableRow> notready_rows;
02082 OrderedList<MibTableRow> delete_rows;
02083
02084 List<MibTable> listeners;
02085 List<MibTableVoter> voters;
02086 };
02087
02088
02089
02090
02102 class AGENTPP_DECL NotificationSender
02103 {
02104 public:
02108 NotificationSender() {}
02109
02113 virtual ~NotificationSender() {}
02114
02134 virtual int notify(const NS_SNMP OctetStr&, const Oidx&,
02135 Vbx*, int, unsigned int=0) = 0;
02136 };
02137
02138
02139
02151 class AGENTPP_DECL NotificationType
02152 {
02153 public:
02157 NotificationType() {}
02158
02162 virtual ~NotificationType() {}
02163
02181 virtual int notify(const NS_SNMP OctetStr&, Vbx*, int) = 0;
02182 };
02183
02184
02185
02194 class AGENTPP_DECL MibConfigFormat {
02195
02196 public:
02197
02198 virtual ~MibConfigFormat() {};
02199
02209 virtual boolean save(MibContext*, const NS_SNMP OctetStr&) = 0;
02210
02220 virtual boolean load(MibContext*, const NS_SNMP OctetStr&) = 0;
02221
02225 virtual MibConfigFormat* clone() = 0;
02226 };
02227
02228
02229
02237 class AGENTPP_DECL MibConfigBER: public MibConfigFormat {
02238
02239 public:
02240
02241 MibConfigBER() { }
02242
02252 virtual boolean save(MibContext*, const NS_SNMP OctetStr&);
02253
02263 virtual boolean load(MibContext*, const NS_SNMP OctetStr&);
02264
02265 virtual MibConfigFormat* clone() { return new MibConfigBER(); }
02266
02267 };
02268
02269
02270
02271
02329 #if !defined (AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT)
02330 #define AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT
02331 AGENTPP_DECL_TEMPL template class AGENTPP_DECL Array<MibConfigFormat>;
02332 #endif
02333
02334 #if !defined (AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT)
02335 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT
02336 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OidList<MibContext>;
02337 #endif
02338 #ifdef _SNMPv3
02339 #ifdef _PROXY_FORWARDER
02340 #if !defined (AGENTPP_DECL_TEMPL_OIDLIST_PROXYFORWARDER)
02341 #define AGENTPP_DECL_TEMPL_OIDLIST_PROXYFORWARDER
02342 AGENTPP_DECL_TEMPL template class AGENTPP_DECL OidList<ProxyForwarder>;
02343 #endif
02344 #endif
02345 #endif
02346
02347 class AGENTPP_DECL Mib {
02348 friend class MibProxy;
02349
02350 public:
02354 Mib();
02360 Mib(const NS_SNMP OctetStr&);
02361
02365 virtual ~Mib();
02366
02375 #ifndef STATIC_REQUEST_LIST
02376 void set_request_list(RequestList*);
02377 #else
02378 static void set_request_list(RequestList*);
02379 #endif
02380
02386 #ifndef STATIC_REQUEST_LIST
02387 RequestList* get_request_list() { return requestList; }
02388 #else
02389 static RequestList* get_request_list() { return requestList; }
02390 #endif
02391
02396 virtual void process_request(Request*);
02397
02417 virtual int notify(const NS_SNMP OctetStr&, const Oidx&,
02418 Vbx*, int, unsigned int=0);
02419
02435 void set_notification_sender(NotificationSender*);
02436
02444 NotificationSender* get_notification_sender() const
02445 { return notificationSender; }
02446
02452 virtual void cleanup();
02453
02466 virtual MibEntry* add(MibEntry*);
02467
02484 virtual MibEntry* add(const NS_SNMP OctetStr&, MibEntry*);
02485
02500 virtual MibContext* add_context(const NS_SNMP OctetStr&);
02501
02510 virtual void remove_context(const NS_SNMP OctetStr&);
02511
02528 virtual boolean add_agent_caps(const NS_SNMP OctetStr&,
02529 const Oidx&,
02530 const NS_SNMP OctetStr&);
02531
02542 virtual void remove_agent_caps(const NS_SNMP OctetStr&,
02543 const Oidx&);
02544
02571 virtual boolean remove(const Oidx&);
02572
02601 virtual boolean remove(const NS_SNMP OctetStr&, const Oidx&);
02602
02611 virtual boolean init();
02612
02616 virtual void save_all();
02617
02628 virtual boolean save(unsigned int, const NS_SNMP OctetStr&);
02629
02640 virtual boolean load(unsigned int, const NS_SNMP OctetStr&);
02641
02651 virtual MibEntryPtr get(const Oidx&);
02652
02664 virtual MibEntryPtr get(const NS_SNMP OctetStr&, const Oidx&);
02665
02679 virtual MibGroup* find_group_of(const NS_SNMP OctetStr&,
02680 const Oidx&);
02681
02687 virtual NS_SNMP OctetStr get_persistent_objects_path() const;
02688
02698 virtual void set_persistent_objects_path(const NS_SNMP OctetStr* str);
02699
02709 boolean is_persistency_activated() const
02710 { return (persistent_objects_path != 0); }
02711
02718 virtual boolean is_complex_node(const MibEntryPtr&);
02719
02726 boolean is_table_node(const MibEntryPtr& e)
02727 { return (e->type() == AGENTPP_TABLE); }
02728
02735 boolean is_leaf_node(const MibEntryPtr& e)
02736 { return (e->type() == AGENTPP_LEAF); }
02737
02738
02739 static Mib* instance;
02740
02744 #ifndef STATIC_REQUEST_LIST
02745 RequestList* requestList;
02746 #else
02747 static RequestList* requestList;
02748 #endif
02749
02764 void lock_mib();
02765
02771 void unlock_mib();
02772
02782 virtual MibContext* get_context(const NS_SNMP OctetStr&);
02783
02790 MibContext* get_default_context() { return defaultContext;}
02791
02812 virtual int find_next(MibContext*, const Oidx&, MibEntryPtr&,
02813 Request* req, const int);
02814
02833 virtual int find_managing_object(MibContext*,
02834 const Oidx&,
02835 MibEntryPtr&,
02836 Request*);
02837
02838 #ifdef _SNMPv3
02839 #ifdef _PROXY_FORWARDER
02840
02851 boolean register_proxy(ProxyForwarder*);
02852
02861 void unregister_proxy(const NS_SNMP OctetStr&,
02862 ProxyForwarder::pdu_type);
02871 void set_local_engine_id(const NS_SNMP OctetStr& s) { myEngineID=s;}
02872 #endif
02873 #endif
02874 #ifdef AGENTPP_USE_THREAD_POOL
02875
02887 void set_thread_pool(ThreadPool* pool);
02888
02895 void delete_thread_pool()
02896 { if (threadPool) delete threadPool; threadPool = 0; }
02897
02904 ThreadPool* get_thread_pool() { return threadPool; }
02905 #endif
02906
02914 virtual void do_process_request(Request*);
02915
02916
02923 virtual void process_set_request(Request*);
02924
02932 virtual int process_prepare_set_request(Request*);
02933
02941 virtual int process_commit_set_request(Request*);
02942
02950 virtual int process_undo_set_request(Request*);
02951
02957 virtual void process_cleanup_set_request(Request*);
02958
02964 virtual void process_get_bulk_request(Request*);
02965
02966 #ifdef _SNMPv3
02967
02980 virtual int get_boot_counter(const NS_SNMP OctetStr&, unsigned int&);
02981
02995 virtual int set_boot_counter(const NS_SNMP OctetStr&, unsigned int);
02996 #endif
02997
03014 MibConfigFormat* add_config_format(unsigned int format,
03015 MibConfigFormat*);
03016
03025 MibConfigFormat* get_config_format(unsigned int format)
03026 { return (configFormats.getNth(format-1)); }
03027
03028 protected:
03029
03041 static boolean set_exception_vb(Request*, int, int);
03042
03048 virtual boolean process_request(Request*, int);
03049
03050
03051
03059 virtual void finalize(Request*);
03060
03070 virtual void delete_request(Request* req) { delete req; }
03071
03072 #ifdef _SNMPv3
03073
03085 virtual int next_access_control(Request*,
03086 const MibEntryPtr, Oidx&);
03087
03088 #ifdef _PROXY_FORWARDER
03089 virtual void proxy_request(Request*);
03090 #endif
03091 #endif
03092
03093 OidList<MibContext> contexts;
03094 MibContext* defaultContext;
03095
03096 NotificationSender* notificationSender;
03097
03098 NS_SNMP OctetStr* persistent_objects_path;
03099 #ifdef _THREADS
03100 ThreadManager mibLock;
03101 #endif
03102 #ifdef _SNMPv3
03103 NS_SNMP OctetStr bootCounterFile;
03104 #ifdef _PROXY_FORWARDER
03105 NS_SNMP OctetStr myEngineID;
03106 OidList<ProxyForwarder> proxies;
03107 #endif
03108 #endif
03109
03110 #ifdef AGENTPP_USE_THREAD_POOL
03111 ThreadPool* threadPool;
03112 #endif
03113
03114 Array<MibConfigFormat> configFormats;
03115
03116 private:
03117 void construct(const NS_SNMP OctetStr& path);
03118 };
03119
03120 #ifdef _THREADS
03121 #ifndef AGENTPP_USE_THREAD_POOL
03122 #ifdef _WIN32THREADS
03123 void mib_method_routine_caller(void*);
03124 #else
03125 void* mib_method_routine_caller(void*);
03126 #endif
03127 #endif
03128 #endif
03129
03130 #ifdef AGENTPP_NAMESPACE
03131 }
03132 #endif
03133
03134 #endif
03135
03136
03137
03138