<div dir="ltr">Hi Alex,<div><br></div><div style>It works. Thanks. </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/30 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just put the definition of the FailLink function before the main function.  Or at least, put the prototype of FailLink before main:<br>

<br>
void FailLink (Ptr<NetDevice> nd);<br>
<br>
---<br>
Alex<br>
<div><div class="h5"><br>
On Apr 29, 2013, at 7:53 AM, yao hu <<a href="mailto:huyao0107@gmail.com">huyao0107@gmail.com</a>> wrote:<br>
<br>
> Hi Alex,<br>
><br>
> 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..<br>
><br>
> ../src/ndnSIM/examples/ndn-linkfailure.cc: In function ‘int main(int, char**)’:<br>
> ../src/ndnSIM/examples/ndn-linkfailure.cc:160:40: error: ‘FailLink’ was not declared in this scope<br>
><br>
> Thanks in advance!<br>
><br>
> ----------------------------------<br>
><br>
> int<br>
> main (int argc, char *argv[])<br>
> {<br>
> ......<br>
><br>
>   Ptr<Node> device1 = Names::Find<Node> ("n1");<br>
>   Ptr<Node> device2 = Names::Find<Node> ("n2");<br>
><br>
>   Simulator::Schedule (Seconds (10.0), FailLink, device1);<br>
>   Simulator::Schedule (Seconds (10.0), FailLink, device2);<br>
><br>
>   Simulator::Run ();<br>
>   Simulator::Destroy ();<br>
><br>
>   return 0;<br>
> }<br>
><br>
>   void<br>
>   FailLink (Ptr<NetDevice> nd)<br>
>   {<br>
>     Ptr<RateErrorModel> error = CreateObject<RateErrorModel> ();<br>
>     error->SetAttribute ("ErrorRate", DoubleValue (1.0));<br>
><br>
>     nd->SetAttribute ("ReceiveErrorModel", PointerValue (error));<br>
>   }<br>
</div></div>> _______________________________________________<br>
> ndnSIM mailing list<br>
> <a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
<br>
</blockquote></div><br></div>