Commit graph

2 commits

Author SHA1 Message Date
Elliott Hughes
ed57b98758 Implement if_nameindex(3)/if_freenameindex(3).
This is just a subset of the recently-implemented getifaddrs(3), though if
we want to handle interfaces (such as "rmnet_*") that don't have an address,
we need to either expose ifaddrs_storage and keep track of which interfaces
we've already seen (which is pretty messy), or refactor the netlink code so
we can reuse it and just extract the information we need for if_nameindex(3).
This patch goes the latter route.

Also clean up if_nametoindex(3) and if_indextoname(3).

Change-Id: I5ffc5df0bab62286cdda2e7af06f032c767119a8
2016-01-18 12:07:38 -08:00
Elliott Hughes
588213a37d Add basic tests for <net/if.h>.
Bug: http://b/26447711
Change-Id: I9bbcdffc07e99c98e367a63de861ddc7b274d579
2016-01-11 13:18:20 -08:00