[ndnSIM] Identifying an interface (face?)
Junxiao Shi
shijunxiao at email.arizona.edu
Sun Nov 20 08:05:16 PST 2016
Hi John
I would say looking at the face scope attribute is a more reliable solution
than testing for the exact type:
switch (face->getScope()) {
case ndn::nfd::FACE_SCOPE_LOCAL:
// application
break;
case ndn::nfd::FACE_SCOPE_NON_LOCAL:
// network
break;
default:
NS_ASSERT(false);
break;
}
Yours, Junxiao
On Sat, Nov 19, 2016 at 11:46 PM, Alex Afanasyev <aa at cs.ucla.edu> wrote:
>
> I'd like to be able to determine how much and which data arrives on a
> particular interface. I suppose I somehow need to obtain a FaceId, and
> somehow determine which Data arrives on that face? Also, I need to be able
> to distinguish between Faces among applications and NFD, and between NFD
> and the "outside world" - i.e., which are ACTUALLY network interfaces.
>
>
> The answer depends on where you want to achieve this function. If you're
> looking at the logs, the Face associated with the NetDevice identifies
> itself as netdev://[<mac-addr>]" (netdev prefix). If you have a
> pointer/reference to the face and want to determine whether it is one to
> the outside world, you can use dynamic_cast:
>
> Face* face = ...;
> if (dynamic_cast<NetDeviceLinkService*>(face->getLinkService()) !=
> nullptr) {
> // do stuff
> }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161120/3839ce97/attachment.html>
More information about the ndnSIM
mailing list