[ndnSIM] error when simulating link failure

yao hu huyao0107 at gmail.com
Tue Apr 30 08:19:36 PDT 2013


Hi Alex,

It works. Thanks.


2013/4/30 Alex Afanasyev <alexander.afanasyev at ucla.edu>

> Just put the definition of the FailLink function before the main function.
>  Or at least, put the prototype of FailLink before main:
>
> void FailLink (Ptr<NetDevice> nd);
>
> ---
> Alex
>
> On Apr 29, 2013, at 7:53 AM, yao hu <huyao0107 at gmail.com> wrote:
>
> > Hi Alex,
> >
> > I added the following code to simulate the link failure between node n1
> and n2 at 10 seconds. But it is strange it produces the error " ‘FailLink’
> was not declared in this scope" as follows..
> >
> > ../src/ndnSIM/examples/ndn-linkfailure.cc: In function ‘int main(int,
> char**)’:
> > ../src/ndnSIM/examples/ndn-linkfailure.cc:160:40: error: ‘FailLink’ was
> not declared in this scope
> >
> > Thanks in advance!
> >
> > ----------------------------------
> >
> > int
> > main (int argc, char *argv[])
> > {
> > ......
> >
> >   Ptr<Node> device1 = Names::Find<Node> ("n1");
> >   Ptr<Node> device2 = Names::Find<Node> ("n2");
> >
> >   Simulator::Schedule (Seconds (10.0), FailLink, device1);
> >   Simulator::Schedule (Seconds (10.0), FailLink, device2);
> >
> >   Simulator::Run ();
> >   Simulator::Destroy ();
> >
> >   return 0;
> > }
> >
> >   void
> >   FailLink (Ptr<NetDevice> nd)
> >   {
> >     Ptr<RateErrorModel> error = CreateObject<RateErrorModel> ();
> >     error->SetAttribute ("ErrorRate", DoubleValue (1.0));
> >
> >     nd->SetAttribute ("ReceiveErrorModel", PointerValue (error));
> >   }
> > _______________________________________________
> > ndnSIM mailing list
> > ndnSIM at lists.cs.ucla.edu
> > http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130501/ca4ea2ad/attachment.html>


More information about the ndnSIM mailing list