I am trying to fetch DHCP server identifiers of the current network. For IPv4 I am able to get this information using SCDynamicStoreCopyDHCPInfo and then using DHCPInfoGetOptionData fetching option 54. I am trying to do the same thing for IPv6, in my scutil I do see DHCPv6 present. Is there any API present which fetches this information for v6 DHCP servers, or do I have to get this direct from scutil?
Is there any API present which fetches this information for v6 DHCP servers, or do I have to get this direct from scutil?
Those are not your only two options!
SCDynamicStoreCopyDHCPInfo
is a thin wrapper around the SC dynamic store API [1]. If the data you need is in the dynamic store, you don’t have to run scutil
to get it. You can get arbitrary data from the dynamic store using its API.
I recommend that you read System Configuration Programming Guidelines, which has a good introduction to the SC architecture. With that in hand, you should be able to make progress with the API reference.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] If you want to see how thin that wrapper is, here’s the macOS 14-ish code in Darwin.