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

Re: [ns] interaction between layers



I am not sure if you have made the target_ point to a DSR agent. 
You should understand how a DSR node is formed first. You can
find the related info from ns doc

-Ya

On Tue, 30 Oct 2001, Herve Maillard wrote:

> Dear all,
> I face the following problem:
> I wrote a public function in DSRAgent  class (which is an NsObject's
> heir) . this function is declared in dsragent.h as follow: "int
> DsrForTcp(Packet *);"
> 
> I'd like call it from tcp.cc code, so I do:
> "int xxx = ((DSRAgent*)target_)->DsrForTcp(p);".
> It compiles properly, but at execution I have the error message:
> "Segmentation fault (core dumped)". Under gdb debugger, I have the
> following message when the previous line is executed: "Program received
> signal SIGSEGV, Segmentation fault. 0xbea34 in TcpAgent::output
> (this=0x6b1830, seqno=0, reason=0) at tcp.cc:521"
> 
> If I don't put "(DSRAgent*)",  there is a problem when compile since no
> function "DsrForTcp()" is found in DSRAgent object.
> I don't understand why it doesn't work. Is there any other mean to
> perform comparable interactions between layers ?
> I would appreciate some help.
> Thanks by advance
> Herve.
>