aboutsummaryrefslogtreecommitdiff
path: root/src/varnish_mib.mib2c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-02-14 10:53:03 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-02-14 11:01:50 +0200
commit45c6086f8c0c0f6fe1a46b950682abfdbf104687 (patch)
tree61923d59ed3dbbe0365d88e574b7e4f1aec4fbcc /src/varnish_mib.mib2c
parentdffed71f70f7e7b6bf1cd32539a1a1131916a8b4 (diff)
downloadvarnish-mib-45c6086f8c0c0f6fe1a46b950682abfdbf104687.tar.gz
varnish-mib-45c6086f8c0c0f6fe1a46b950682abfdbf104687.tar.bz2
Rewrite as a stand-alone snmpd agent.
* NEWS: Document new features. * configure.ac: Raise version number. * src/.gitignore: Update. * src/Makefile.am: Build as an agent. * src/main.c: New file. * src/modconf.c: Remove "varnish" prefix from the configuration directives. (varnish_mib_config_init): Use program name as the base for the configuration file name. (varnish_mib_config_help): New function. * src/modconf.h (progname, pid_file, pid_file_immutable): New externs. * src/varnish-mib.8: Rewrite. * src/varnish_mib.mib2c (varnish_snmp_init) (varnish_snmp_deinit): Remove. (post_config): Extern. Called from main().
Diffstat (limited to 'src/varnish_mib.mib2c')
-rw-r--r--src/varnish_mib.mib2c30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index e8c143f..df8b537 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -1,5 +1,5 @@
# This file is part of varnish-mib -*- c -*-
-# Copyright (C) 2014-2018 Sergey Poznyakoff
+# Copyright (C) 2014-2019 Sergey Poznyakoff
#
# Varnish-mib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -197,6 +197,10 @@ int varnish_ban(netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests,
struct vsm *vsm);
+void init_$modulename(void);
+void deinit_$modulename(void);
+int post_config(void);
+
@open ${name}@
/* THIS FILE IS GENERATED AUTOMATICALLY. PLEASE DO NOT EDIT. */
@@ -209,7 +213,7 @@ static struct vsc *vsc;
static void dict_load(struct vsc *vsc);
int
-post_config(int majorID, int minorID, void *serverarg, void *clientarg)
+post_config(void)
{
vsm = VSM_New();
if (!vsm) {
@@ -231,21 +235,6 @@ post_config(int majorID, int minorID, void *serverarg, void *clientarg)
return 0;
}
-void
-varnish_snmp_init(void)
-{
- snmp_register_callback(SNMP_CALLBACK_LIBRARY,
- SNMP_CALLBACK_POST_READ_CONFIG,
- post_config,
- NULL);
-}
-
-void
-varnish_snmp_deinit(void)
-{
- /* FIXME? */
-}
-
struct vsm *
varnish_get_vsm_data(void)
{
@@ -675,10 +664,6 @@ initialize_table_$i(void)
void
init_$modulename(void)
{
- if (vsm) {
- snmp_log(LOG_ERR, "%s: can't be loaded twice\n", "$modulename");
- abort();
- }
@foreach $i scalar@
@startperl@
&{$vars{'varnish_translate'}}($vars{'i'});
@@ -716,12 +701,11 @@ $varnish_endif
@foreach $i table@
initialize_table_$i();
@end@
- varnish_snmp_init();
}
void
deinit_$modulename(void)
{
- varnish_snmp_deinit();
+ // FIXME
}
@calldefine ROCOM@

Return to:

Send suggestions and report system problems to the System administrator.