Update of /cvsroot/pure-data/externals/iem/snmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042
Modified Files: get-help.pd get.c Log Message: output "anything" with selector==queried MIB
Index: get.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/snmp/get.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** get.c 16 Mar 2007 13:22:30 -0000 1.4 --- get.c 16 Mar 2007 16:13:00 -0000 1.5 *************** *** 37,40 **** --- 37,42 ---- } t_snmpget;
+ static void snmpget_disconnect(t_snmpget *x); + static void snmpget_get(t_snmpget *x, t_symbol *s) { *************** *** 85,99 **** case ASN_INTEGER: { long v=(long)(*vars->val.integer); ! outlet_float(x->out_data, (t_float)v); } break; - /* - case ASN_OCTET_STR: - { - outlet_symbol(x->out_data, gensym(vars->val.string)); - } - break; - */ default: snprint_value(mybuf, sizeof(mybuf), vars->name, vars->name_length, vars); --- 87,102 ---- case ASN_INTEGER: { + t_atom aflist[2]; long v=(long)(*vars->val.integer); ! unsigned short lo=(unsigned short)v; ! unsigned short hi=(unsigned short)(v>>16); ! SETFLOAT(aflist+0, hi); ! SETFLOAT(aflist+1, lo); ! outlet_anything(x->out_data, ! s, ! 2, aflist); ! //outlet_float(x->out_data, (t_float)v); } break; default: snprint_value(mybuf, sizeof(mybuf), vars->name, vars->name_length, vars); *************** *** 102,106 **** t_atom*av=binbuf_getvec(bbuf); outlet_list(x->out_data, ! gensym("list"), ac, av); } --- 105,109 ---- t_atom*av=binbuf_getvec(bbuf); outlet_list(x->out_data, ! s, ac, av); } *************** *** 110,114 **** snprint_value(mybuf, sizeof(mybuf), vars->name, vars->name_length, vars); SETSYMBOL(ap, gensym(mybuf)); ! outlet_anything(x->out_data, gensym("raw"), 1, ap); } if(bbuf)binbuf_free(bbuf); --- 113,117 ---- snprint_value(mybuf, sizeof(mybuf), vars->name, vars->name_length, vars); SETSYMBOL(ap, gensym(mybuf)); ! outlet_anything(x->out_data, s, 1, ap); } if(bbuf)binbuf_free(bbuf); *************** *** 117,120 **** --- 120,124 ---- } else { error("[snmp/get] error while synching"); + snmpget_disconnect(x); } snmp_free_pdu(response); *************** *** 125,129 ****
- /* connect <host>[:<port>] <community> --- 129,132 ----
Index: get-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/iem/snmp/get-help.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** get-help.pd 16 Mar 2007 12:20:42 -0000 1.1 --- get-help.pd 16 Mar 2007 16:13:00 -0000 1.2 *************** *** 1,8 **** ! #N canvas 39 0 849 551 10; #X msg 207 274 disconnect; #X msg 139 152 get SNMPv2-MIB::system.sysUpTime.0; #X obj 121 379 print result; #X msg 202 177 get SNMPv2-MIB::system.sysDescr.0; - #X msg 205 204 get system.sysDescr.0; #X obj 121 299 snmp/get; #X msg 121 92 connect localhost public; --- 1,7 ---- ! #N canvas 0 46 849 470 10; #X msg 207 274 disconnect; #X msg 139 152 get SNMPv2-MIB::system.sysUpTime.0; #X obj 121 379 print result; #X msg 202 177 get SNMPv2-MIB::system.sysDescr.0; #X obj 121 299 snmp/get; #X msg 121 92 connect localhost public; *************** *** 14,22 **** #X text 110 22 [snmp/get] communicates with a network entity usigng SNMP GET requests; ! #X connect 0 0 5 0; ! #X connect 1 0 5 0; ! #X connect 3 0 5 0; ! #X connect 4 0 5 0; ! #X connect 5 0 2 0; ! #X connect 5 1 7 0; ! #X connect 6 0 5 0; --- 13,36 ---- #X text 110 22 [snmp/get] communicates with a network entity usigng SNMP GET requests; ! #X msg 212 211 get system.sysDescr.1; ! #X msg 211 240 get system.sysContact.0; ! #X msg 365 328 set get $1; ! #X symbolatom 365 303 0 0 0 0 - - -; ! #X msg 32 245 raw $1; ! #X obj 32 224 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 ! 1; ! #X msg 365 357 get IF-MIB::ifInOctets.2 , get IF-MIB::ifOutOctets.2 ! ; ! #X connect 0 0 4 0; ! #X connect 1 0 4 0; ! #X connect 3 0 4 0; ! #X connect 4 0 2 0; ! #X connect 4 1 6 0; ! #X connect 5 0 4 0; ! #X connect 11 0 4 0; ! #X connect 12 0 4 0; ! #X connect 13 0 17 0; ! #X connect 14 0 13 0; ! #X connect 15 0 4 0; ! #X connect 16 0 15 0; ! #X connect 17 0 4 0;