From af872c80a0335eec8b492f24b8a294c558dc83fb Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanassche@acm.org>
Date: Wed, 5 Oct 2011 08:45:49 +0200
Subject: [PATCH] CHANGES: perl: Add agent::uptime()

---
 perl/agent/agent.pm |    6 ++++++
 perl/agent/agent.xs |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/perl/agent/agent.pm b/perl/agent/agent.pm
index 6135443..4ffd3ea 100644
--- a/perl/agent/agent.pm
+++ b/perl/agent/agent.pm
@@ -199,6 +199,12 @@ sub agent_check_and_process {
     __agent_check_and_process($blocking || 0);
 }
 
+sub uptime {
+    my ($self) = @_;
+    $self->maybe_init_lib();
+    return _uptime();
+}
+
 bootstrap NetSNMP::agent $VERSION;
 
 # Preloaded methods go here.
diff --git a/perl/agent/agent.xs b/perl/agent/agent.xs
index ee77d50..b81886f 100644
--- a/perl/agent/agent.xs
+++ b/perl/agent/agent.xs
@@ -239,6 +239,13 @@ __agent_check_and_process(block = 1)
     OUTPUT:
 	RETVAL
 
+int
+_uptime()
+    CODE:
+        RETVAL = netsnmp_get_agent_uptime();
+    OUTPUT:
+	RETVAL
+
 void
 init_mib()
     CODE:
-- 
1.7.5.1

