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

[ns] SplitObject error



This is a follow up on my earlier mail, reproduced below. I was getting
the following error.

The cmd being passed is: _o108 down
ns: _o108 down: 
    (_o108 cmd line 1)
    invoked from within
"_o108 cmd down"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o108" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o108 down"


Can someone tell me as what's wrong ?

thanks,
Prasad.

> Earlier mail:

Hi,
   I am trying out alternate routing strategies in ns. I want to a link
down if the no if packets sent over that link crosses a certain threshold.
So, I changed the datastructure in the classifier and had the following
code in classifier.cc. 


NsObject* Classifier::find(Packet* p)
{
	NsObject* node = NULL;
	int cl = classify(p);

	if (cl < 0 || cl >= nslot_ || (node = slot_[cl].next_hop) == 0) { 
		if (default_target_) return default_target_;
		......... removed some code ........
	}

	slot_[cl].no_pkts++;
        if (slot_[cl].no_pkts == THRESHOLD) {

	--->	char cmd[] = "$node down";
	--->	Tcl &tcl = Tcl::instance();

	--->	tcl.evalf("%s down", node->name());
	}
	return (node);
}

However I am unable to pass the link object to the interpreter (from
C++) so that the instproc "down" is invoked on that link. How I can do
that ? I didn't completely get this interface between the compiled and the
interpreted hierarchy. Can someone help me out ?


thanks,
Prasad Boddupalli.