Lines Matching refs:hwaddr
531 struct in_addr *addrp, unsigned char *hwaddr, int hw_len,
535 a particular hwaddr/clientid/hostname in our configuration.
543 /* hash hwaddr */
545 j += hwaddr[i] + (hwaddr[i] << 8) + (hwaddr[i] << 16);
555 /* pick a seed based on hwaddr then iterate until we find a free address. */
648 int config_has_mac(struct dhcp_config *config, unsigned char *hwaddr, int len, int type)
652 for (conf_addr = config->hwaddr; conf_addr; conf_addr = conf_addr->next)
656 memcmp(conf_addr->hwaddr, hwaddr, len) == 0)
665 unsigned char *hwaddr, int hw_len,
691 if (config_has_mac(config, hwaddr, hw_len, hw_type) &&
705 for (conf_addr = config->hwaddr; conf_addr; conf_addr = conf_addr->next)
709 (new = memcmp_masked(conf_addr->hwaddr, hwaddr, hw_len, conf_addr->wildcard_mask)) > count)
725 unsigned char hwaddr[ETHER_ADDR_LEN];
748 free(config->hwaddr);
770 if (!*ip || parse_hex(buff, hwaddr, ETHER_ADDR_LEN, NULL, NULL) != ETHER_ADDR_LEN)
823 struct hwaddr_config *conf_addr = config->hwaddr;
829 memcmp(conf_addr->hwaddr, hwaddr, ETHER_ADDR_LEN) == 0)
838 config->hwaddr = NULL;
857 if (!config->hwaddr)
858 config->hwaddr = whine_malloc(sizeof(struct hwaddr_config));
859 if (config->hwaddr)
861 memcpy(config->hwaddr->hwaddr, hwaddr, ETHER_ADDR_LEN);
862 config->hwaddr->hwaddr_len = ETHER_ADDR_LEN;
863 config->hwaddr->hwaddr_type = ARPHRD_ETHER;
864 config->hwaddr->wildcard_mask = 0;
865 config->hwaddr->next = NULL;