Feature #3654
closed
ioctl-based listNetworkInterfaces
Added by Alex Afanasyev over 8 years ago.
Updated almost 8 years ago.
Description
Listing available interfaces is necessary to enable multicast Faces.
Currently, listNetworkInterfaces
function is implemented based on getifaddrs
.
On some platforms, including Android NDK, getifaddrs
is unavailable.
However, similar functionality, at least in the simplified form, can be implemented using direct ioctl
system calls.
This task is to make ioctl
based implementation of listNetworkInterfaces
method, at the minimum targeting Android 19 platform.
The original modifications were done during NDN Hackathon by Pedro Soares (Universidade Fedara de Para - UFPA), Pedro Batista (Universidade Fedara de Para - UFPA).
http://gerrit.named-data.net/#/c/2791/ (not yet finished at the time of this note).
- Tracker changed from Task to Feature
- Subject changed from ioctl-based alternative to getifaddrs to ioctl-based listNetworkInterfaces
- Description updated (diff)
What's the functional limitation of ioctl
compared to getifaddrs
?
Does it skip some interfaces?
Which interfaces are skipped?
Does it skip some attributes of an interface?
Which attributes are unavailable?
Does the unavailability of an attribute cause a semantic error?
For example, suppose NetworkInterfaceInfo::broadcastAddress
becomes unavailable, it would be semantic error because this field has no Doxygen so I assume it's always available.
Doxygen needs to be added to every field that could be unavailable, and indicate what would be the value when the field is unavailable.
- Start date deleted (
06/21/2016)
As I commented on gerrit, the SIOCGIFCONF/SIOCGIFBRDADDR
method returns only IPv4 info; no IPv6 and no LL stuff. At least that's what I understood, and what a quick test on linux confirms.
If this is an important feature for Android that can't be postponed and IPv4 is enough, then fine. Otherwise, assuming the Android kernel supports netlink, I suggest to reimplement listNetworkInterfaces()
on top of ndn-cxx's enhanced NetworkMonitor (#3353).
The only problem of lacking IPv6 is that two Androids cannot talk to each other over cellular network.
Many carriers assign a globally unique IPv6 address when a phone connects to UMTS network, but a phone only gets an IPv4 address behind NAT.
However, I've never tested whether this IPv6 address is globally reachable.
We haven't enabled IPv6 multicast support, so not having IPv6 addresses would be ok. I would be ok with netlink
-based implementation if it works, though this one definitely works and we can merge (at least as a short-term solution).
Junxiao Shi wrote:
Maybe we could adapt #3353, and ioctl-based implementation isn't needed after all?
Yep, this is what I suggested in note-3.
- Status changed from New to Abandoned
- Assignee deleted (
Alex Afanasyev)
Also available in: Atom
PDF