[ndnSIM] Access to the queue inside OnData() in forwarding-strategy

Ayush Agarwal ayush0071 at gmail.com
Thu Feb 18 22:02:28 PST 2016


Hi,
I forgot to mention I am using ndnSIM version 1.0

On Thu, Feb 18, 2016 at 10:12 PM, Ayush Agarwal <ayush0071 at gmail.com> wrote:

> Hello everyone,
>
> I am using the following code to get hold of the queue object inside the
> forwarding strategy, OnData(....) function.
>
> Ptr<NetDeviceFace> netDeviceFace = DynamicCast<NetDeviceFace> (inFace);
> if (netDeviceFace == NULL) {  }
> Ptr<NetDevice> nd = netDeviceFace->GetNetDevice ();
> if (nd == NULL) {  }
> PointerValue txQueueAttribute;
> nd->GetAttribute ("TxQueue", txQueueAttribute);
> Ptr<ns3::Queue> txQueue = txQueueAttribute.Get<ns3::Queue> ();
> if (txQueue == 0) {    }
>
> But I am getting a segmentation fault SIGSEV error while fetching the
> NetDevice object and the following errors for accessing queue.
>
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:238:3: error:
> ‘PointerValue’ was not declared in this scope
>     PointerValue txQueueAttribute;
>    ^
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:239:32: error:
> ‘txQueueAttribute’ was not declared in this scope
>    nd->GetAttribute ("TxQueue", txQueueAttribute);
>                                 ^
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:243:50: error: expected
> primary-expression before ‘>’ token
>    Ptr<Queue> txQueue = txQueueAttribute.Get<Queue> ();
>                                                   ^
> ../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:243:53: error: expected
> primary-expression before ‘)’ token
>    Ptr<Queue> txQueue = txQueueAttribute.Get<Queue> ();
>
>
> Can you please point me out where I am going wrong.
>
>
> *Thanks & Regards,*
>
> *Ayush Agarwal*
>
> *Reseach Scholar, Computer Science*
>
> *National Institute of Technology, KarnatakaSurathkal, India*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160219/7686ac44/attachment.html>


More information about the ndnSIM mailing list