Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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);
}