void hostadd(long ip, const char *name) { struct hostcache *ptr; MALLOC(ptr, struct hostcache, 1); ptr->next = hostcache_list; if (ptr->next) { ptr->next->prev = &ptr->next; } ptr->prev = &hostcache_list; hostcache_list = ptr; ptr->ipnum = ip; ptr->time = 0; strcpy(ptr->name, name); hostprune(); }
static void hostadd_v6(struct in6_addr *ip, const char *name) { struct hostcache *ptr; MALLOC(ptr, struct hostcache, 1); ptr->next = hostcache_list; if (ptr->next) { ptr->next->prev = &ptr->next; } ptr->prev = &hostcache_list; hostcache_list = ptr; memcpy(&(ptr->ipnum_v6), ip, sizeof(struct in6_addr)); ptr->ipnum = 0; ptr->time = 0; strcpyn(ptr->name, sizeof(ptr->name), name); hostprune(); }
static void hostadd(long ip, const char *name) { struct hostcache *ptr; MALLOC(ptr, struct hostcache, 1); ptr->next = hostcache_list; if (ptr->next) { ptr->next->prev = &ptr->next; } ptr->prev = &hostcache_list; hostcache_list = ptr; #ifdef USE_IPV6 memset(&(ptr->ipnum_v6), 0, sizeof(struct in6_addr)); #endif ptr->ipnum = ip; ptr->time = 0; strcpyn(ptr->name, sizeof(ptr->name), name); hostprune(); }