diff options
-rw-r--r-- | src/varnish_mib.mib2c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c index 55b57e5..798fc53 100644 --- a/src/varnish_mib.mib2c +++ b/src/varnish_mib.mib2c @@ -13,18 +13,25 @@ # # You should have received a copy of the GNU General Public License # along with varnish-mib. If not, see <http://www.gnu.org/licenses/>. + +# This macro inserts a comment instructing Emacs and vi that +# this file is read-only. It must be called at the end of the file. +@define ROCOM@ +/* Local variables: + buffer-read-only: t + End: + vi: set ro: +*/ +@enddefine@ @open ${name}@ -/* - * Note: this file originally auto-generated by mib2c using - * mib2c.varnish.conf - */ +/* THIS FILE IS GENERATED AUTOMATICALLY. PLEASE DO NOT EDIT. */ #include <config.h> #include <stdlib.h> #include <stdint.h> -#include "vapi/vsc.h" -#include "vapi/vsm.h" +#include <vapi/vsc.h> +#include <vapi/vsm.h> #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> @@ -89,6 +96,13 @@ print "$vars{'modulename'}\n"; 0; @endperl@ +/* Variable handlers. + + An instance handler only hands us one request at a time, unwrapping + any eventual GETNEXT requests. All OIDs are read-only, so the handlers + should only handle GET requests. +*/ + @foreach $i scalar@ static int handle_$i(netsnmp_mib_handler *handler, @@ -97,12 +111,7 @@ handle_$i(netsnmp_mib_handler *handler, netsnmp_request_info *requests) { uint32_t val; - /* We are never called for a GETNEXT if it's registered as a - "instance", as it's "magically" handled for us. */ - - /* an instance handler also only hands us one request at a time, so - we don't need to loop over a list of requests; we'll only get one. - */ + @startperl@ &{$vars{'varnish_translate'}}($vars{'i'}); @endperl@ @@ -153,3 +162,4 @@ deinit_$modulename(void) { varnish_snmp_deinit(); } +@calldefine ROCOM@ |