aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2007-03-15 21:23:56 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2007-03-15 21:23:56 +0000
commit58c226dc7648fe411cc82a9558f456b8b98a7eec (patch)
tree0c4780acbd457d1487440b1d8eea42fdf33ac772
parent0822c46070f35fcd1926a0af3e7ac2d1e538f95f (diff)
more fixes
svn path=/trunk/externals/iem/snmp/; revision=7494
-rw-r--r--Make.config.in2
-rw-r--r--Makefile6
-rw-r--r--configure.ac7
-rw-r--r--get.c6
-rw-r--r--snmp.c23
-rw-r--r--snmpget-help.pd24
6 files changed, 52 insertions, 16 deletions
diff --git a/Make.config.in b/Make.config.in
index 42a0ed4..af4e72b 100644
--- a/Make.config.in
+++ b/Make.config.in
@@ -27,5 +27,5 @@ WFLAGS =
TARNAME = $(LIBNAME).tgz
CONFIGUREFLAGS = @CONFIGUREFLAGS@
-CFLAGS = $(DEFS) $(IFLAGS) $(BUILDLIBRARY) -DPD $(WFLAGS) @CFLAGS@ $(CFLAGS)
+CFLAGS = $(DEFS) $(IFLAGS) $(BUILDLIBRARY) -DPD $(WFLAGS) @CFLAGS@
LIBS = @LIBS@
diff --git a/Makefile b/Makefile
index 96f86a2..b1b7098 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ default: all
install install-bin install-doc install-abs \
tests
-HELPERSOURCES=
+HELPERSOURCES=snmp.c
OBJECTSOURCES=$(sort $(filter-out $(HELPERSOURCES), $(filter %.c, $(wildcard *.c))))
SOURCES=$(OBJECTSOURCES) $(HELPERSOURCES)
@@ -28,7 +28,7 @@ ifdef MAKEDEP_FLAGS
## see http://www.gnu.org/software/make/manual/html_node/make_47.html#SEC51
%.d: %.c
@set -e; rm -f $@; \
- $(CPP) $(MAKEDEP_FLAGS) $(Z_CFLAGS) $< > $@.$$$$; \
+ $(CPP) $(MAKEDEP_FLAGS) $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
endif
@@ -59,7 +59,7 @@ $(LIBNAME): $(TARGETS)
$(STRIP) $(STRIPFLAGS) $(LIBNAME).$(EXT)
$(TARGETS): %.o : %.c
- $(CC) $(Z_CFLAGS) -c -o $@ $*.c
+ $(CC) $(CFLAGS) -c -o $@ $*.c
clean:
-rm -f *.$(EXT) *.o
diff --git a/configure.ac b/configure.ac
index c967c7b..86720f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AC_SUBST(PDLIBDIR)
AC_SUBST(INCLUDES)
AC_SUBST(LIBNAME)
AC_SUBST(CONFIGUREFLAGS)
+AC_SUBST(BUILDLIBRARY)
## store the flags passed to us
## is there no way to get the flags without quotes?
@@ -32,6 +33,12 @@ AC_ARG_WITH(pdversion, [ --with-pdversion=<ver> enforce a certain pd-version (
AC_ARG_WITH(extension, [ --with-extension=<ext> enforce a certain extension for the dynamic library (e.g. dll)])
AC_ARG_WITH(pdpath, [ --with-pd=</path/to/pd> where to look for pd-headers and and -libs])
AC_ARG_ENABLE(PIC, [ --disable-PIC disable compilation with PIC-flag])
+AC_ARG_ENABLE(library,[ --disable-library split the library into single externals])
+
+if test "xno" != "x${enable_library}" ; then
+dnl LATER: find a more generic way to generate the .._LIBRARY define
+ BUILDLIBRARY="-DBUILD_LIBRARY"
+fi
dnl Checks for libraries.
dnl Replace `main' with a function in -lc:
diff --git a/get.c b/get.c
index ee2c873..52fd275 100644
--- a/get.c
+++ b/get.c
@@ -38,6 +38,7 @@ typedef struct _snmpget
static void snmpget_get(t_snmpget *x, t_symbol *s)
{
+ post("system::get: %s", s->s_name);
if(NULL!=x->x_session){
oid name[MAX_OID_LEN];
size_t name_length=MAX_OID_LEN;
@@ -45,6 +46,7 @@ static void snmpget_get(t_snmpget *x, t_symbol *s)
netsnmp_pdu *pdu,*response;
int err=0;
char*symname=s->s_name;
+ post("getting %s", symname);
if(!snmp_parse_oid(symname, name, &name_length)){
error("snmpget: bad OID %d", name_length);
@@ -228,7 +230,11 @@ void snmpget_setup(void)
snmpget_class = class_new(gensym("snmpget"), (t_newmethod)snmpget_new,
0, sizeof(t_snmpget), 0, A_GIMME, 0);
+ class_addcreator((t_newmethod)snmpget_new, gensym("snmp/get"), 0);
+ //class_addcreator((t_newmethod)snmpget_new, gensym("get"), 0);
+
class_addmethod(snmpget_class, (t_method)snmpget_get, gensym("get"), A_SYMBOL, 0);
+
class_addmethod(snmpget_class, (t_method)snmpget_connect, gensym("connect"), A_SYMBOL, A_DEFSYM, 0);
class_addmethod(snmpget_class, (t_method)snmpget_disconnect, gensym("disconnect"), 0);
class_addmethod(snmpget_class, (t_method)snmpget_raw, gensym("raw"), A_FLOAT, 0);
diff --git a/snmp.c b/snmp.c
index 1087c85..a7048c8 100644
--- a/snmp.c
+++ b/snmp.c
@@ -1,4 +1,27 @@
+/******************************************************
+ *
+ * snmp - implementation file
+ *
+ * copyleft (c) IOhannes m zmölnig
+ *
+ * 1603:forum::für::umläute:2007
+ *
+ * institute of electronic music and acoustics (iem)
+ *
+ ******************************************************
+ *
+ * license: GNU General Public License v.2
+ *
+ ******************************************************/
+
+#include "m_pd.h"
+
+
+void snmpget_setup();
+
void snmp_setup(void)
{
+ post("snmp4pd: SimpleNetworkManagementProtocol objects for PureData");
+ post("snmp4pd: copyleft (c) IOhannes m zmoelnig 2006-2007");
snmpget_setup();
}
diff --git a/snmpget-help.pd b/snmpget-help.pd
index 895f001..6279930 100644
--- a/snmpget-help.pd
+++ b/snmpget-help.pd
@@ -1,6 +1,5 @@
#N canvas 0 0 849 365 10;
#X msg 121 92 connect;
-#X obj 100 125 snmpget;
#X msg 152 159 disconnect;
#X msg 208 99 get system;
#X msg 47 55 get;
@@ -11,15 +10,16 @@
#X msg 223 75 get bibabo;
#X msg 248 173 get SNMPv2-MIB::system.sysDescr.0;
#X msg 251 200 get system.sysDescr.0;
-#X connect 0 0 1 0;
-#X connect 1 0 8 0;
-#X connect 2 0 1 0;
-#X connect 3 0 1 0;
-#X connect 4 0 1 0;
-#X connect 5 0 1 0;
+#X obj 121 289 snmp/get;
+#X connect 0 0 11 0;
+#X connect 1 0 11 0;
+#X connect 2 0 11 0;
+#X connect 3 0 11 0;
+#X connect 4 0 11 0;
+#X connect 5 0 4 0;
+#X connect 5 1 0 0;
#X connect 6 0 5 0;
-#X connect 6 1 0 0;
-#X connect 7 0 6 0;
-#X connect 9 0 1 0;
-#X connect 10 0 1 0;
-#X connect 11 0 1 0;
+#X connect 8 0 11 0;
+#X connect 9 0 11 0;
+#X connect 10 0 11 0;
+#X connect 11 0 7 0;