summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-07-29 02:29:15 +0000
committerStef Walter <stef@memberwebs.com>2008-07-29 02:29:15 +0000
commit0a3d06dfa8f534c48109e3afd49a292c3947d0cd (patch)
treea5f03f6c30f1415bef857dd7fce55f6ade64f8cd /daemon
parent723785873edd5fc3c00fefc8894a2c2085676313 (diff)
- Add parameter to specify bind address.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/rrdbotd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/daemon/rrdbotd.c b/daemon/rrdbotd.c
index bbbc84b..573eb5f 100644
--- a/daemon/rrdbotd.c
+++ b/daemon/rrdbotd.c
@@ -205,6 +205,7 @@ int
main(int argc, char* argv[])
{
const char* pidfile = NULL;
+ const char *bind_address = NULL;
int daemonize = 1;
char ch;
char* t;
@@ -223,11 +224,16 @@ main(int argc, char* argv[])
g_state.timeout = DEFAULT_TIMEOUT;
/* Parse the arguments nicely */
- while((ch = getopt(argc, argv, "c:d:m:Mp:r:t:w:V")) != -1)
+ while((ch = getopt(argc, argv, "b:c:d:m:Mp:r:t:w:V")) != -1)
{
switch(ch)
{
+ /* Bind address */
+ case 'b':
+ bind_address = optarg;
+ break;
+
/* Config directory */
case 'c':
g_state.confdir = optarg;
@@ -305,7 +311,7 @@ main(int argc, char* argv[])
mib_uninit();
/* Rev up the main engine */
- snmp_engine_init(3);
+ snmp_engine_init(bind_address, 3);
rb_poll_engine_init();
if(daemonize)