aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2014-11-16 16:10:47 +0200
committerSergey Poznyakoff <gray@gnu.org>2014-11-16 17:11:30 +0200
commit7b7cb3c95e9fe5af0072d290e39cda9fa0f85b60 (patch)
tree3164cbffc4c251983a769aee719b506fc5bc4d33 /src
parent2303726f29a4e4724301f36d4c12037a1b516a35 (diff)
downloadvarnish-mib-7b7cb3c95e9fe5af0072d290e39cda9fa0f85b60.tar.gz
varnish-mib-7b7cb3c95e9fe5af0072d290e39cda9fa0f85b60.tar.bz2
Minor changes
Diffstat (limited to 'src')
-rw-r--r--src/varnish_mib.mib2c34
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
@@ -10,24 +10,31 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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>
#include <net-snmp/agent/net-snmp-agent-includes.h>
static struct VSM_data *vd;
@@ -86,26 +93,28 @@ $vars{'modulename'} =~ s#.*/##;
$vars{'modulename'} =~ s/\.c$//;
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,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
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@
if (reqinfo->mode == MODE_GET) {
struct VSC_C_main const *st = VSC_Main(vd, NULL);
if (!st)
@@ -150,6 +159,7 @@ init_$modulename(void)
void
deinit_$modulename(void)
{
varnish_snmp_deinit();
}
+@calldefine ROCOM@

Return to:

Send suggestions and report system problems to the System administrator.