case GETMAC_ATTR_IFF_PROMISC: /* Receive all packets */
if (mi->buf[i].ifr_flags & IFF_PROMISC) {
* ((GETMAC_BOOL *) value) = GETMAC_TRUE;
snprintf (err->errmsg, GETMAC_MAX_MSGLEN, "Receive all packets");
} else {
* ((GETMAC_BOOL *) value) = GETMAC_FALSE;
snprintf (err->errmsg, GETMAC_MAX_MSGLEN, "Not a promisc mode");
}
break;
case GETMAC_ATTR_IFNAME: /* Interface name, e.g. "en0" */
strcpy (value, mi->buf[i].ifr_name);
snprintf (err->errmsg, GETMAC_MAX_MSGLEN, "Interface name");
break;
case GETMAC_ATTR_IPADDR: /* Interface address */
strcpy (value, inet_ntoa (((struct sockaddr_in*) (& mi->buf[i].ifr_addr))->sin_addr));
snprintf (err->errmsg, GETMAC_MAX_MSGLEN, "Interface address");
break;
case GETMAC_ATTR_HWADDR:
#ifdef SOLARIS
do {
mi->arp.arp_pa.sa_family = AF_INET;
mi->arp.arp_ha.sa_family = AF_INET;
((struct sockaddr_in *) & mi->arp.arp_pa)->sin_addr.s_addr = ((struct sockaddr_in*)(& buf[i].ifr_addr))->sin_addr.s_addr;