[ndnSIM] Accessing net device faces
aa at CS.UCLA.EDU
Fri Feb 26 00:46:22 PST 2016
> On Feb 21, 2016, at 11:19 PM, Ayush Agarwal <ayush0071 at gmail.com> wrote:
> Hello everyone,
> I am trying to access all the net device interfaces associated to a face.
> Firstly I am getting the object of ndnNetDeviceFace and then with its help I am accessing the net devices associated to it.
> I am also handling the NULL cases for the ndnNetDeviceFace to avoid segmentation faults. But due to this I am unable to access the net devices with id 0.
> The code I am using is as follows:
> Ptr<NetDeviceFace> netDeviceFace = DynamicCast<NetDeviceFace> (inFace);
> //std::cout << "device id is" << netDeviceFace->GetTypeId() << "\n";
> if (netDeviceFace == NULL)
> Ptr<NetDevice> nd = netDeviceFace->GetNetDevice ();
> Please help me in a solution so that I can access all the net devices without any segmentation faults.
I'm not quite sure what you mean by "unable to access the net devices with id 0". If the DynamicCast returns null, then the face is not NetDeviceFace. For example, it can be internal NFD face or it can be AppFace.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the ndnSIM