From 1ded2732d4c290dbff64d8091def1f70b76f6282 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 26 Jan 2006 09:54:31 +0000 Subject: SNMP support coded in. --- src/rrdbotd.h | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'src/rrdbotd.h') diff --git a/src/rrdbotd.h b/src/rrdbotd.h index 9c4f2b4..974c8f4 100644 --- a/src/rrdbotd.h +++ b/src/rrdbotd.h @@ -39,18 +39,23 @@ #ifndef __RRDBOTD_H__ #define __RRDBOTD_H__ +#include + #include "asn1.h" #include "snmp.h" -#include "sock_any.h" +#include "sock-any.h" #include "hash.h" /* ----------------------------------------------------------------------------- * DATA */ +#define RB_UNKNOWN -DBL_MAX + struct _rb_item; struct _rb_poller; struct _rb_host; +struct _rb_request; /* * Note that all the members are either in the config memory @@ -59,10 +64,14 @@ struct _rb_host; typedef struct _rb_item { + struct _rb_request* req; + /* Specific to this item */ const char* rrdfield; - struct snmp_value value; - const char* community; + struct snmp_value snmpfield; + + /* The last value / current request */ + double value; /* Pointers to related */ const struct _rb_poller* poller; @@ -76,6 +85,8 @@ rb_item; typedef struct _rb_host { const char* name; + const char* community; + int version; /* Host resolving and book keeping */ struct sockaddr_any address; @@ -89,13 +100,14 @@ rb_host; typedef struct _rb_poller { - /* The hash key is interval-rrdname */ + /* The hash key is interval-timeout:rrdname */ char key[MAXPATHLEN]; /* This points into the memory above */ const char* rrdname; uint32_t interval; + uint32_t timeout; /* The things to poll. rb_poller owns this list */ rb_item* items; @@ -113,6 +125,8 @@ typedef struct _rb_state /* Settings from command line */ const char* confdir; const char* rrddir; + uint retries; + uint timeout; /* All the pollers/hosts */ rb_poller* polls; @@ -148,6 +162,13 @@ void rb_config_free(); * SNMP HELPERS (snmp-help.c) */ -int rb_parse_mib(const char* oid, struct snmp_value* value); +int rb_snmp_parse_mib(const char* oid, struct snmp_value* value); + +/* ----------------------------------------------------------------------------- + * SNMP ENGINE (snmp-engine.c) + */ + +void rb_snmp_engine_init(); +void rb_snmp_engine_uninit(); #endif /* __RRDBOTD_H__ */ -- cgit v1.2.3