[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] How to set parameters on existing link's queue?



> I'm trying to get a handle/pointer/(whatever tcl calls it) to the queue between
> two nodes after having created them with the commands
> 	set s1 [$ns node]
> 	set r1 [$ns node]
> 	$ns duplex-link $s1 $r1 10Mb 4ms DropTail
> because I want to alter the default queueing parameters for just this one link.
> 
> How would I go about doing this?

If you sinply want to get a reference for a queue:

set q1 [[$ns link $s1 $r1] queue]

Carlos

> 
> I've tried the following for no good reason (grepped samples for 'queue' and
> 'link' and found similar code)
> 	$ns instvar link_
> 	[[$link([$s1 id]:[$r1 id]) queue] set limit_]
> but ns core dumps on the 'instvar' line. GDB tracing gives the following:
> 
> Program received signal SIGSEGV, Segmentation fault.
> OTclOInstVarOne (obj=0x8304338, in=0x8288a48, frameName=0x8206d0b "1",
> varName=0x839b268 "link_", 
>     localName=0x839b268 "link_", flags=0) at otcl.c:1429
> 1429	  CallFrame* saved = iPtr->varFramePtr->callerVarPtr;
> (gdb) l
> 1424	 */
> 1425	int
> 1426	OTclOInstVarOne(OTclObject* obj, Tcl_Interp *in, char *frameName, char
> *varName, char *localName, int flags)
> 1427	{
> 1428	  Interp* iPtr = (Interp*)in;
> 1429	  CallFrame* saved = iPtr->varFramePtr->callerVarPtr;
> 1430	  int level = iPtr->varFramePtr->level;
> 1431	  int result = TCL_ERROR;
> 1432	
> 1433	  /*
> (gdb) where
> #0  OTclOInstVarOne (obj=0x8304338, in=0x8288a48, frameName=0x8206d0b "1",
> varName=0x839b268 "link_", 
>     localName=0x839b268 "link_", flags=0) at otcl.c:1429
> #1  0x80fba35 in OTclOInstVarMethod (cd=0x8304338, in=0x8288a48, argc=5,
> argv=0xbfffedc8) at otcl.c:1462
> #2  0x80f9dd8 in OTclDispatch (cd=0x8304338, in=0x8288a48, argc=3,
> argv=0xbfffee10) at otcl.c:421
> #3  0x80fe674 in TclInvokeStringCommand ()
> #4  0x8116124 in TclExecuteByteCode ()
> #5  0x80fee7c in Tcl_EvalObj ()
> #6  0x812748c in Tcl_EvalFile ()
> #7  0x8129203 in Tcl_Main ()
> #8  0x804c85b in main ()
> #9  0x4013a9cb in __libc_start_main (main=0x804c840 <main>, argc=15,
> argv=0xbffff8f4, init=0x804b9c4 <_init>, 
>     fini=0x8167afc <_fini>, rtld_fini=0x4000ae60 <_dl_fini>,
> stack_end=0xbffff8ec) at ../sysdeps/generic/libc-start.c:92
> (gdb) p (*(Interp*)in).varFramePtr
> $4 = (CallFrame *) 0x0
> 
> So obviously I'm telling it to dereference a null, which is A Bad Thing.
> 
> Any insight or pointers to the appropriate documentation would be appreciated.
> 
> -Eric
> 
> ----------------------------------------------
>  Eric H. Weigle   CIC-5 Network Engineering
>  [email protected]     Los Alamos National Lab
>  (505) 665-4937   http://public.lanl.gov/ehw/
> ----------------------------------------------
>