資源簡介
nginx服務(wù)器安裝時(shí)用到的插件親測(cè)有效。
代碼片段和文件信息
/*?Portions?of?this?file?are?subject?to?the?following?copyright(s).??See
?*?the?Net-SNMP‘s?COPYING?file?for?more?details?and?other?copyrights
?*?that?may?apply:
?*/
/*
?*?Portions?of?this?file?are?copyrighted?by:
?*?Copyright??2003?Sun?Microsystems?Inc.?All?rights?reserved.
?*?Use?is?subject?to?license?terms?specified?in?the?COPYING?file
?*?distributed?with?the?Net-SNMP?package.
?*/
#include?
#include?
#if?HAVE_STRING_H
#include?
#endif
#include?
#include?
#include?
static?netsnmp_mib_handler?*_clone_handler(netsnmp_mib_handler?*it);
/***********************************************************************/
/*
?*?New?Handler?based?API?
?*/
/***********************************************************************/
/**?@defgroup?handler?Net-SNMP?Agent?handler?and?extensibility?API
?*??@ingroup?agent
?*
?*??The?basic?theory?goes?something?like?this:?In?the?past?with?the
?*??original?mib?module?api?(which?derived?from?the?original?CMU?SNMP
?*??code)?the?underlying?mib?modules?were?passed?very?little
?*??information?(only?the?truly?most?basic?information?about?a
?*??request).??This?worked?well?at?the?time?but?in?todays?world?of
?*??subagents?device?instrumentation?low?resource?consumption?etc
?*??it?just?isn‘t?flexible?enough.??“handlers“?are?here?to?fix?all?that.
?*
?*??With?the?rewrite?of?the?agent?internals?for?the?net-snmp?5.0
?*??release?we?introduce?a?modular?calling?scheme?that?allows?agent
?*??modules?to?be?written?in?a?very?flexible?manner?and?more
?*??importantly?allows?reuse?of?code?in?a?decent?way?(and?without?the
?*??memory?and?speed?overheads?of?OO?languages?like?C++).
?*
?*??Functionally?the?notion?of?what?a?handler?does?is?the?same?as?the
?*??older?api:?A?handler?is?@link?netsnmp_create_handler()?created@endlink?and
?*??then?@link?netsnmp_register_handler()?registered@endlink?with?the?main
?*??agent?at?a?given?OID?in?the?OID?tree?and?gets?called?any?time?a
?*??request?is?made?that?it?should?respond?to.??You?probably?should
?*??use?one?of?the?convenience?helpers?instead?of?doing?anything?else
?*??yourself?though:
?*
?*??Most?importantly?though?is?that?the?handlers?are?built?on?the
?*??notion?of?modularity?and?reuse.??Specifically?rather?than?do?all
?*??the?really?hard?work?(like?parsing?table?indexes?out?of?an
?*??incoming?oid?request)?in?each?module?the?API?is?designed?to?make
?*??it?easy?to?write?“helper“?handlers?that?merely?process?some?aspect
?*??of?the?request?before?passing?it?along?to?the?final?handler?that
?*??returns?the?real?answer.??Most?people?will?want?to?make?use?of?the
?*??@link?instance?instance@endlink?@link?table?table@endlink?@link
?*??table_iterator?table_iterator@endlink?@link?table_data
?*??table_data@endlink?or?@link?table_dataset?table_dataset@endlink
?*??helpers?to?make?their?life?easier.??These?“helpers“?interpert
?*??important?aspects?o
評(píng)論
共有 條評(píng)論