The ifaddrlistx() function is similar to ifaddrlist(), but: * Allows specific address flags to be matched against. * Provides the addresses for a *specific* interface name * Returns a linked-list rather than an array so that information can grow over time without affecting binary compatibility. * Leaves error-handling up to the caller. Specifically: int ifaddrlistx(const char *ifname, uint64_t set, uint64_t clear, ifaddrlistx_t **ifaddrp, uint_t *naddrp); * ifname: Interface name to match against. * set: One or more flags that must be set on the address for it to be returned. * clear: Flags that must be clear on the address for it to be returned. * ifaddrp: Upon success, ifaddrlistx() sets *ifaddrp to the head of a dynamically-allocated array of ifaddrlistx structures. The ifaddrlistx structure is defined as: typedef struct ifaddrlistx { struct ifaddrlistx *ia_next; char ia_name[LIFNAMSIZ]; uint64_t ia_flags; struct sockaddr_storage ia_addr; } ifaddrlistx_t; * naddrp: Upon success, if *naddrp is non-NULL, ifaddrlistx() sets it to the number of ifaddrlistx's chained though ifaddrp. Once done, the caller must free `ifaddrp' by calling ifaddrlistx_free(): void ifaddrlistx_free(ifaddrlistx_t *ifaddrp);