struct ippool * ippool_new(char *address, char *netmask) { struct ippool *ippool; ippool = malloc(sizeof(struct ippool)); if (ipcalc(ippool, address, netmask) != 0) { return NULL; } alloc_bitmap(ippool->hosts, &(ippool->pool)); return ippool; }
int checkmyrelay(char *iprelay, char *myrelays[]) { int i; /* Check if Relay is one of our own */ for(i = 0; myrelays[i] != NULL; i++) { if(ipcalc(iprelay, myrelays[i]) == 1) { #if WITH_DEBUG == 1 if(DEBUG) fprintf(stderr, " Match My Relay (%d) %s, continuing...\n", i, iprelay); #endif /* Matched */ return (0); } } /* No Match */ return (1); }