Re: [tkined] Use of snmp# bind {} send [script]

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Mon, 17 May 1999 18:25:43 +0200

>>>>> Davide Minervini writes:

Davide> Hi, I am Davide and maybe becouse I'm very green at using
Davide> scotty but...... I work with a hp workstation (HP-UX B.10.20
Davide> A 9000/712) and with scotty2.1.10 and tcl8.0 my problem is: I
Davide> don't get any answer from the command " snmp# bind {} recv
Davide> [script] " while the send command works perfectly. Why ???

There is indeed a bug in the C code. Below is a patch against scotty
2.1.10 which cures the problem. This bug will be fixed in 2.1.11 and
the next 3.0.0 snapshot.
Juergen

--- scotty-2.1.10/tnm/snmp/tnmSnmpRecv.c Fri Jun 26 17:04:38 1998
+++ scotty-2.1.11/tnm/snmp/tnmSnmpRecv.c Mon May 17 18:15:33 1999
@@ -346,6 +346,7 @@
session->readCommunity = ckalloc(msg->comLen+1);
memcpy(session->readCommunity, msg->com, msg->comLen);
session->readCommunity[msg->comLen] = 0;
+ Tnm_SnmpEvalBinding(interp, session, pdu, TNM_SNMP_RECV_EVENT);
Tnm_SnmpEvalCallback(interp, session, pdu, bindPtr->command,
NULL, NULL, NULL, NULL);
ckfree(session->readCommunity);
@@ -369,6 +370,7 @@
session->readCommunity[msg->comLen] = 0;
}
#endif
+ Tnm_SnmpEvalBinding(interp, session, pdu, TNM_SNMP_RECV_EVENT);
Tnm_SnmpEvalCallback(interp, session, pdu, bindPtr->command,
NULL, NULL, NULL, NULL);
#ifdef TNM_SNMPv2C
@@ -395,6 +397,7 @@
session->readCommunity[msg->comLen] = 0;
}
#endif
+ Tnm_SnmpEvalBinding(interp, session, pdu, TNM_SNMP_RECV_EVENT);
Tnm_SnmpEvalCallback(interp, session, pdu, bindPtr->command,
NULL, NULL, NULL, NULL);
#ifdef TNM_SNMPv2C
@@ -421,6 +424,7 @@
u_int *statPtr;
if (! session->agentSocket) break;
if (Authentic(session, msg, pdu, packet, packetlen, &statPtr)) {
+ Tnm_SnmpEvalBinding(interp, session, pdu, TNM_SNMP_RECV_EVENT);
if (Tnm_SnmpAgentRequest(interp, session, pdu) != TCL_OK) {
Tcl_DStringFree(&pdu->varbind);
return TCL_ERROR;

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.