コード例 #1
0
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();
}
コード例 #2
0
ファイル: resolver.c プロジェクト: foxbird/fuzzball
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();
}
コード例 #3
0
ファイル: resolver.c プロジェクト: foxbird/fuzzball
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();
}