This file contains definitions of some primitives to dedicated to
statistics output.
- Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
+ Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
#define STATS_TYPE_BE 1
#define STATS_TYPE_SV 2
-int stats_parse_global(const char **args, char *err, int errlen);
int stats_dump_raw(struct session *s, struct uri_auth *uri);
int stats_dump_http(struct session *s, struct uri_auth *uri);
int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri);
else if (!strcmp(args[0], "quiet")) {
global.mode |= MODE_QUIET;
}
- else if (!strcmp(args[0], "stats")) {
- memcpy(trash, "error near 'stats'", 19);
- if (stats_parse_global((const char **)args + 1, trash, sizeof(trash)) < 0) {
- Alert("parsing [%s:%d] : %s\n", file, linenum, trash);
- return -1;
- }
- }
else if (!strcmp(args[0], "tune.maxpollevents")) {
if (global.tune.maxpollevents != 0) {
Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
#include <sys/stat.h>
#include <sys/types.h>
+#include <common/cfgparse.h>
#include <common/compat.h>
#include <common/config.h>
#include <common/debug.h>
* zero included. The trailing '\n' must not be written. The function must be
* called with <args> pointing to the first word after "stats".
*/
-int stats_parse_global(const char **args, char *err, int errlen)
+static int stats_parse_global(char **args, int section_type, struct proxy *curpx,
+ struct proxy *defpx, char *err, int errlen)
{
+ args++;
if (!strcmp(args[0], "socket")) {
struct sockaddr_un su;
int cur_arg;
}
}
+static struct cfg_kw_list cfg_kws = {{ },{
+ { CFG_GLOBAL, "stats", stats_parse_global },
+ { 0, NULL, NULL },
+}};
+
+__attribute__((constructor))
+static void __dumpstats_module_init(void)
+{
+ cfg_register_keywords(&cfg_kws);
+}
+
/*
* Local variables:
* c-indent-level: 8