[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Get an interface label from an agent
ns developers:
I am implementing CBTv2 in ns. A CBT agent needs to know the local
interface (its label) through a message (CBT PDU) has arrived. I have
not
find an efficient way to do it without modify C code defining a compiled
variable, iif_, as follows:
message.cc, add : int iif_;
modif.:
MessageAgent::MessageAgent():Agent(PT_MESSAGE), iif_(2)
add : bind("iif_", &iif_);
add(recv): iif_ =
((hdr_cmn*)pkt->access(off_cmn_))->iface();
ns-default.tcl, add : Agent/Message set iif_ -2
then, a CBT agent access the interface label:
set input_interface_label [messager set iif_]
(messager is an Agent/Message object)
Do anyone knows a way to do it entirely in Tcl?
thanks,
Guillermo Rigotti