[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Passing objects to interpreter
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.