From 7b7cb3c95e9fe5af0072d290e39cda9fa0f85b60 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 16 Nov 2014 16:10:47 +0200 Subject: Minor changes --- src/varnish_mib.mib2c | 34 ++++++++++++++++++++++------------ 1 file 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 . + +# 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 #include #include -#include "vapi/vsc.h" -#include "vapi/vsm.h" +#include +#include #include #include @@ -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@ -- cgit v1.2.1