c - detect temporary ipv6 address crossplatform -


i want detect if address temporary ipv6 address, using getifaddrs list of addresses don't know how info there. , if possible want work linux, osx, solaris , windows.

i have seems in linux ifa_f_temporary set in inet6_ifaddr->ifa_flags, not sure if how can ifaddrs returned getifaddrs.

seems on osx need octl siocsifinfo_flags, , have no idea solaris or windows.

has body sample code that.

updated (aug 3, 2016): after searching on , off past couple months on question (because i'm in need of answer myself). believe have found windows-centric answer. i've tested on windows 10, don't know older versions. api shouldn't have changed if wants verify me :-)

all _ip_adapter_unicast_address structures have enumeration address prefix , suffix. i've bothered @ them , entire key solving issue!

what temporary ipv6 address....it's address random suffix! ipv6 addresses in ip_adapter_unicast_address @ ip_suffix_origin see if ipsuffixoriginrandom. thats...it.

i'm still shocked @ how little there on topic online , huge issue in few years network application developers if no 1 knows how solve issue server-side applications (even ones running on consumer pcs)

you heard answer here first!!!


(original answer): i've been looking @ exact topic cross-platform application well. think i've found "a" way filter ipv6 temporary addresses in windows. rfc 4941 claims temporary addresses must:

  1. have valid lifetime less "public" address
  2. have preferred lifetime less "public" address

so c++, when using function getadaptersaddresses can in pip_adapter_addresses struct _ip_adapter_unicast_address struct , evaluate validlifetime , preferredlifetime members. after filtering address type (if need know local-link vs public) can keep running tally of largest lifetime. largest life time (per adapter) should public address!

to see address lifetime info run windows terminal command: netsh interface ipv6 show address

you can see temporary addresses smaller defaulted slaac lifetimes.

i'm working assumption until testing proves otherwise. temporary addresses based on public , cannot out live it.

hope helps


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -