aboutsummaryrefslogtreecommitdiff
path: root/src/ban.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ban.c')
-rw-r--r--src/ban.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/ban.c b/src/ban.c
index 0c354e9..1f4583b 100644
--- a/src/ban.c
+++ b/src/ban.c
@@ -51,7 +51,7 @@ varnish_ban(netsnmp_agent_request_info *reqinfo,
}
memcpy(expr, requests->requestvb->val.string, len);
expr[len] = 0;
- DEBUGMSGTL(("varnish_ban", "setting ban %s\n", expr));
+ DEBUGMSGTL(("varnish_mib:ban", "setting ban %s\n", expr));
rc = vcli_connect(vsm, &conn);
if (rc == SNMP_ERR_NOERROR) {
rc = send_ban_cmd(&conn, expr);
@@ -61,43 +61,6 @@ varnish_ban(netsnmp_agent_request_info *reqinfo,
return rc ? SNMP_ERR_GENERR : SNMP_ERR_NOERROR;
}
-unsigned banTable_timeout = 60;
-
-int
-varnish_mib_timeout_parser(const char *token, char *line, unsigned *retval)
-{
- char *p;
- unsigned long n = strtoul(line, &p, 10);
-
- if (*p) {
- if (isspace(*p)) {
- while (*p && isspace(*p))
- ++p;
- if (*p) {
- config_perror("too many arguments");
- return 1;
- }
- } else {
- config_perror("invalid timeout value");
- return 1;
- }
- }
-
- if (n > UINT_MAX) {
- config_perror("timeout value out of allowed range");
- return 1;
- }
-
- *retval = n;
- return 0;
-}
-
-void
-varnish_ban_table_timeout_parser(const char *token, char *line)
-{
- varnish_mib_timeout_parser(token, line, &banTable_timeout);
-}
-
/*
* create a new row in the table
*/
@@ -156,7 +119,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
if (!vsm)
return SNMP_ERR_GENERR;
- DEBUGMSGTL(("varnish_ban", "reloading ban table\n"));
+ DEBUGMSGTL(("varnish_mib:ban", "reloading ban table\n"));
rc = vcli_connect(vsm, &conn);
if (rc != SNMP_ERR_NOERROR)
@@ -266,7 +229,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
p = q;
}
vcli_disconnect(&conn);
- DEBUGMSGTL(("varnish_ban", "loaded %ld ban entries\n", idx));
+ DEBUGMSGTL(("varnish_mib:ban", "loaded %ld ban entries\n", idx));
return 0;
}
@@ -276,7 +239,7 @@ banTable_free(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
- DEBUGMSGTL(("varnish_ban", "freeing ban table\n"));
+ DEBUGMSGTL(("varnish_mib:ban", "freeing ban table\n"));
while ((row = netsnmp_tdata_row_first(table))) {
struct banTable_entry *entry = row->data;
free(entry->banExpression);

Return to:

Send suggestions and report system problems to the System administrator.