summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpaul <paul>2003-06-19 01:21:07 +0000
committerpaul <paul>2003-06-19 01:21:07 +0000
commitdd488a78add05f10f58f4096dca622c6b5f1f0c9 (patch)
tree22c986ccc07a5378e5b99fcdf32cc953c841b8d8 /lib
parent3db0a77852cc0de1385f7046355321229a567924 (diff)
2003-06-19 Paul Jakma <paul@dishone.st>
* Fix lib/smux.c's reliance on daemons exporting struct thread_master *master.
Diffstat (limited to 'lib')
-rw-r--r--lib/smux.c12
-rw-r--r--lib/smux.h4
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/smux.c b/lib/smux.c
index 952c5a81..c6884d1b 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -29,7 +29,6 @@
#include <snmp.h>
#include <snmp_impl.h>
-#include "smux.h"
#include "log.h"
#include "thread.h"
#include "linklist.h"
@@ -37,6 +36,7 @@
#include "version.h"
#include "memory.h"
#include "sockunion.h"
+#include "smux.h"
#define min(A,B) ((A) < (B) ? (A) : (B))
@@ -81,6 +81,9 @@ struct cmd_node smux_node =
SMUX_NODE,
"" /* SMUX has no interface. */
};
+
+/* thread master */
+static struct thread_master *master;
void *
oid_copy (void *dest, void *src, size_t size)
@@ -1224,7 +1227,7 @@ smux_stop ()
}
}
-extern struct thread_master *master;
+
void
smux_event (enum smux_event event, int sock)
@@ -1471,7 +1474,7 @@ smux_tree_cmp(struct subtree *tree1, struct subtree *tree2)
/* Initialize some values then schedule first SMUX connection. */
void
-smux_init (oid defoid[], size_t defoid_len)
+smux_init (struct thread_master *tm, oid defoid[], size_t defoid_len)
{
/* Set default SMUX oid. */
smux_default_oid = defoid;
@@ -1480,6 +1483,9 @@ smux_init (oid defoid[], size_t defoid_len)
smux_oid = smux_default_oid;
smux_oid_len = smux_default_oid_len;
smux_passwd = smux_default_passwd;
+
+ /* copy callers thread master */
+ master = tm;
/* Make MIB tree. */
treelist = list_new();
diff --git a/lib/smux.h b/lib/smux.h
index 91c3d46f..1d259932 100644
--- a/lib/smux.h
+++ b/lib/smux.h
@@ -144,12 +144,12 @@ struct trap_object
(u_char *) &snmp_in_addr_val \
)
-void smux_init (oid [], size_t);
+void smux_init (struct thread_master *tm, oid [], size_t);
void smux_start (void);
void smux_register_mib(char *, struct variable *, size_t, int, oid [], size_t);
int smux_header_generic (struct variable *, oid [], size_t *, int, size_t *,
WriteMethod **);
-int smux_trap (oid *, size_t, oid *, size_t, struct trap_object *, size_t, unsigned int);
+int smux_trap (oid *, size_t, oid *, size_t, struct trap_object *, size_t, unsigned int, u_char);
int oid_compare (oid *, int, oid *, int);
void oid2in_addr (oid [], int, struct in_addr *);