ipfallowed.c (732B)
1 /************************************************************************* 2 * This file is part of Crosroads 1.23, a load balancer and fail over 3 * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. 4 * Visit http://crossroads.e-tunity.com for information. 5 *************************************************************************/ 6 #include "crossroads.h" 7 8 int ipf_allowed () { 9 int i; 10 11 /* Always allow a connection when we ddon't have an allow list. */ 12 if (! activeservice->allowchain) 13 return (1); 14 15 /* Try all in the chain. */ 16 for (i = 0; i < activeservice->nallowchain; i++) 17 if (ipf_match (activeservice->allowchain[i])) 18 return (1); 19 20 /* Allow chain doesn't match */ 21 return (0); 22 }