Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

core.sys.darwin.ifaddrs

Binding for Mac OSX's , expose network interface addresses
The following functions are present as of Mac OSX 10.15:
  • getifaddrs(3): get interface addresses
  • freeifaddrs(3): deallocates the return value of getifaddrs
  • getifmaddrs(3): get multicast group membership
  • freeifmaddrs(3): deallocates the return value of getifmaddrs
Authors:
Daniel Graczer
struct ifaddrs;
ifaddrs* ifa_next;
Next item in the list
char* ifa_name;
Name of the interface
uint ifa_flags;
Flags from SIOCGIFFLAGS
sockaddr* ifa_addr;
Address of interface
sockaddr* ifa_netmask;
Netmask of interface
sockaddr* if_dstaddr;
Point-to-point destination addresss
void* ifa_data;
Address specific data
nothrow @nogc int getifaddrs(ifaddrs**);
Returns:
linked list of ifaddrs structures describing interfaces
nothrow @nogc void freeifaddrs(ifaddrs*);
Frees the linked list returned by getifaddrs
struct ifmaddrs;
ifmaddrs* ifma_next;
Pointer to next struct
sockaddr* ifma_name;
Interface name (AF_LINK)
sockaddr* ifma_addr;
Multicast address
sockaddr* ifma_lladdr;
Link-layer translation, if any
nothrow @nogc int getifmaddrs(ifmaddrs**);
Stores a reference to a linked list of the multicast memberships on the local machine in the memory referenced by ifmaddrs
nothrow @nogc void freeifmaddrs(ifmaddrs*);
Frees the list allocated by getifmaddrs