perror("SIOCDARP(nopub)");
perror("SIOCDARP(dontpub)");
static int arp_del(char **args){    char host[128];    struct arpreq req;    struct sockaddr sa;    int flags = 0;    int deleted = 0;    memset((char *) &req, 0, sizeof(req));    /* Resolve the host name. */    if (*args == NULL) {	fprintf(stderr, _("arp: need host name\n"));	return (-1);    }    safe_strncpy(host, *args, (sizeof host));    if (ap->input(0, host, &sa) < 0) {	ap->herror(host);	return (-1);    }    /* If a host has more than one address, use the correct one! */    memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));    if (hw_set)	req.arp_ha.sa_family = hw->type;    req.arp_flags = ATF_PERM;    args++;    while (*args != NULL) {	if (opt_v)	    fprintf(stderr, "args=%s\n", *args);	if (!strcmp(*args, "pub")) {	    flags |= 1;	    args++;	    continue;	}	if (!strcmp(*args, "priv")) {	    flags |= 2;	    args++;	    continue;	}	if (!strcmp(*args, "temp")) {	    req.arp_flags &= ~ATF_PERM;	    args++;	    continue;	}	if (!strcmp(*args, "trail")) {	    req.arp_flags |= ATF_USETRAILERS;	    args++;	    continue;	}	if (!strcmp(*args, "dontpub")) {#ifdef HAVE_ATF_DONTPUB	    req.arp_flags |= ATF_DONTPUB;#else	    ENOSUPP("arp", "ATF_DONTPUB");#endif	    args++;	    continue;	}	if (!strcmp(*args, "auto")) {#ifdef HAVE_ATF_MAGIC	    req.arp_flags |= ATF_MAGIC;#else	    ENOSUPP("arp", "ATF_MAGIC");#endif	    args++;	    continue;	}	if (!strcmp(*args, "dev")) {	    if (*++args == NULL)		usage();	    safe_strncpy(device, *args, sizeof(device));	    args++;	    continue;	}	if (!strcmp(*args, "netmask")) {	    if (*++args == NULL)		usage();	    if (strcmp(*args, "255.255.255.255") != 0) {		strcpy(host, *args);		if (ap->input(0, host, &sa) < 0) {		    ap->herror(host);		    return (-1);		}		memcpy((char *) &req.arp_netmask, (char *) &sa,		       sizeof(struct sockaddr));		req.arp_flags |= ATF_NETMASK;	    }	    args++;	    continue;	}	usage();    }    // if neighter priv nor pub is given, work on both    if (flags == 0)	flags = 3;    strcpy(req.arp_dev, device);    /* unfortuatelly the kernel interface does not allow us to       delete private entries anlone, so we need this hack       to avoid "not found" errors if we try both. */    deleted = 0;    /* Call the kernel. */    if (flags & 2) {	if (opt_v)	    fprintf(stderr, "arp: SIOCDARP(nopub)\n");	if (ioctl(sockfd, SIOCDARP, &req) < 0) {	    if ((errno == ENXIO) || (errno == ENOENT)) {		if (flags & 1)		    goto nopub;		printf(_("No ARP entry for %s\n"), host);		return (-1);	    }	    perror("SIOCDARP(nopub)");	    return (-1);	} else	  deleted = 1;    }    if (!deleted && (flags & 1)) {      nopub:	req.arp_flags |= ATF_PUBL;	if (opt_v)	    fprintf(stderr, "arp: SIOCDARP(pub)\n");	if (ioctl(sockfd, SIOCDARP, &req) < 0) {	    if ((errno == ENXIO) || (errno == ENOENT)) {		printf(_("No ARP entry for %s\n"), host);		return (-1);	    }	    perror("SIOCDARP(pub)");	    return (-1);	}    }    return (0);}