summaryrefslogtreecommitdiff
path: root/src/snmp-engine.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-01-26 23:46:10 +0000
committerStef Walter <stef@memberwebs.com>2006-01-26 23:46:10 +0000
commit24cd5a603c74e4733eeaf61c18c06558e1fd28f4 (patch)
treed6c2093118fbf02076c1eef147ffaebfad44500b /src/snmp-engine.c
parent154752ce6169093a36ffeb3cce3c408e1da2d3b2 (diff)
Make our own time type for use in monitoring.
Diffstat (limited to 'src/snmp-engine.c')
-rw-r--r--src/snmp-engine.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/snmp-engine.c b/src/snmp-engine.c
index 8d39991..896e8e4 100644
--- a/src/snmp-engine.c
+++ b/src/snmp-engine.c
@@ -66,10 +66,10 @@ typedef struct _rb_request
/* The SNMP request identifier */
uint32_t id;
- uint64_t next_retry; /* Time of the next retry */
- uint64_t interval; /* How long between retries */
- uint64_t timeout; /* When this request times out */
- uint32_t sent; /* How many times we've sent */
+ mstime next_retry; /* Time of the next retry */
+ mstime interval; /* How long between retries */
+ mstime timeout; /* When this request times out */
+ uint sent; /* How many times we've sent */
/* The poller and host associated with this request */
rb_poller* poll;
@@ -204,7 +204,7 @@ free_req(rb_request* req)
*/
static void
-finish_poll(rb_poller* poll, uint64_t when)
+finish_poll(rb_poller* poll, mstime when)
{
#ifdef _DEBUG
{
@@ -224,7 +224,7 @@ finish_poll(rb_poller* poll, uint64_t when)
}
static void
-send_req(rb_request* req, uint64_t when)
+send_req(rb_request* req, mstime when)
{
struct asn_buf b;
ssize_t ret;
@@ -251,7 +251,7 @@ send_req(rb_request* req, uint64_t when)
}
static void
-timeout_req(rb_request* req, uint64_t when)
+timeout_req(rb_request* req, mstime when)
{
rb_poller* poll = req->poll;
int incomplete = 0;
@@ -285,7 +285,7 @@ timeout_req(rb_request* req, uint64_t when)
}
static void
-check_req(rb_request* req, uint64_t when)
+check_req(rb_request* req, mstime when)
{
ASSERT(req->id);
@@ -305,7 +305,7 @@ fprintf(stderr, "check_req timeout_req %lld %lld\n", when, req->timeout);
}
static void
-respond_req(rb_request* req, struct snmp_pdu* pdu, uint64_t when)
+respond_req(rb_request* req, struct snmp_pdu* pdu, mstime when)
{
struct snmp_value* value;
rb_poller* poll = req->poll;
@@ -384,7 +384,7 @@ respond_req(rb_request* req, struct snmp_pdu* pdu, uint64_t when)
}
static int
-poller_timer(uint64_t when, void* arg)
+poller_timer(mstime when, void* arg)
{
rb_poller* poll = (rb_poller*)arg;
const rb_host* last_host = NULL;
@@ -452,9 +452,7 @@ poller_timer(uint64_t when, void* arg)
req->interval = (poll->interval <= 2000) ? 200L : 600L;
/* Timeout is for the last packet sent, not first */
-fprintf(stderr, "timeout info: %lld %lld %d\n", when, req->interval, g_state.retries);
- req->timeout = when + ((uint64_t)req->interval * (uint64_t)g_state.retries) + poll->timeout;
-fprintf(stderr, "new request with timeout: %lld %lld %lld\n", poll->timeout, req->timeout, req->interval);
+ req->timeout = when + (req->interval * ((mstime)g_state.retries)) + poll->timeout;
req->sent = 0;
last_host = it->host;
@@ -541,7 +539,7 @@ receive_resp(int fd, int type, void* arg)
}
static int
-resend_timer(uint64_t when, void* arg)
+resend_timer(mstime when, void* arg)
{
int i;
@@ -557,7 +555,7 @@ resend_timer(uint64_t when, void* arg)
}
static int
-prep_timer(uint64_t when, void* arg)
+prep_timer(mstime when, void* arg)
{
/*
* We don't prepare all timers at exactly the same time