Re: [tkined] Woes with PhysAddr and set-request in scotty 3.0.0 beta

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Fri, 12 Mar 1999 13:50:12 +0100

>>>>> Peder Chr Norgaard writes:

Peder> Hello. I have some problems with the scotty 3.0.0 beta (the
Peder> November 1998 unix version).

Peder> I use the scotty as a command generator to test functionality
Peder> of set-request in my own (non-scotty) SNMP agent.

Peder> I try to add an entry to the ipNetToMediaTable of IP-MIB. But
Peder> I cannot figure out how to specify the MAC address in the
Peder> scotty end.

Peder> The documentation (the snmp(n) entry, under SNMP DATA TYPES)
Peder> says to use string with hex digits and colons:

Peder> % $s3 set [list [list ipNetToMediaPhysAddress.1.194.182.136.185
Peder> \ "00:D0:33:02:00:07"] [list ipNetToMediaType.1.194.182.136.185
Peder> static]]

[...]

Peder> - that is, colons and hex digits all converted to individual
Peder> OCTETs. Evidently not the way to do it.

[...]

Peder> Any ideas? I am pretty much lost.

PhysAddress is a textual convention defined in SNMPv2-TC (RFC 1903).
The textual convention has a display-hint clause and scotty tries to
apply this clause. Scotty version 3.0.0 obviously has a bug here
(which does not exist in 2.1.X). Below is patch that should fix this
problem.
Juergen

Index: tnmMibUtil.c
===================================================================
RCS file: /usr/home/schoenw/CVS/scotty/tnm/snmp/tnmMibUtil.c,v
retrieving revision 1.12
diff -u -r1.12 tnmMibUtil.c
--- tnmMibUtil.c 1998/10/12 13:51:58 1.12
+++ tnmMibUtil.c 1999/03/12 12:42:52
@@ -693,7 +693,12 @@
}

if (strcmp(fmt, "1x:") == 0) {
- objPtr = TnmNewOctetStringObj(string, len);
+ objPtr = Tcl_DuplicateObj(val);
+ if (Tcl_ConvertToType((Tcl_Interp *) NULL,
+ objPtr, &tnmOctetStringType) != TCL_OK) {
+ Tcl_DecrRefCount(objPtr);
+ return NULL;
+ }
return objPtr;
}

--
!! 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.