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

Who and when to call "Agent/Mcast/Control instproc recv {type iface m}??



Hi, all,
    I made some small changes to SRM in order to get what I want.But I
met a problem. Please be patient to read, thanx a lot.
    I would like to unicast session message from receivers while
multicasting session messages from  the sender. I set a FLAG_ to differ
sender from receivers (Ugly as I know). In order to have the srm agent unicast a
packet, I added 2 lines before "target_->recv(p)"in SRMAgent::send_session()
         hdr_ip* iph = (hdr_ip*)p->access(off_ip_);
         iph->dst() = sender_addr;
, which was suggested by Chris, just as the implementation of MFTP in
NS2. sender_addr is tcl-variable, which could be accessed from Tcl.
    After I finished above changes, I met the following error.
>------------------------------------------------------------------
>     ns: _o210 recv  2 0: no value given for parameter "m" to "_o210"
>    (Agent/Mcast/Control recv line 1)
>    invoked from within
>"_o210 recv  2 0"
>------------------------------------------------------------------    
    It seems that it is not working as I expected.I used GDB to debug it.
Set breakpoint at mcast_ctrl.cc : 42 before it called
Tcl::instance().evalf("%s recv %s %d %d", name(),ph->type(),ch->iface(),ph->args());
1).When I ran the example "mftp.tcl", it stopped at this breakpoint,
     *ph= {ptype_ = "prune\000\000\000\000\000\000\000\000\000", args_ = 0}
     ch->iface_ = 4
2).When I ran the example "srm.tcl" using SRM after I made small changes
, it stopped at breakpoint,
     *ph= {ptype_ = '\000' <repeats 14 times>, args_ = 0}
          ^^^^^^^^^^^^^^^^^^THIS IS PROBLEM!
     ch->iface_=2
3).when I ran the example "srm.tcl" using SRM without any changes, it
NEVER stopped at breakpoint!
     Currently I am confused that " who and when to call
mcastControlAgent::recv(Packet *p, Handler *)?" . 
    This question makes me headache several days, which is still not
solved. I think PERHAPS that instpro was called when  multicast
routing.
    Anyone could provide some hints? Thank you very much in advance!
    BTW. Thank you very much , to Chris and John Heidemann.

Cheers
Cheng Liang