X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fipaccess.h;h=b407783885eef4d93a36413000b3492c87eca036;hb=1f05348cde42852d77da3457b96a33dff1600ca4;hp=aedb15877db744578b698ef0e55e8276ee4fc62d;hpb=cad27e97e6370f96903d42aaf345c099af0a03bd;p=libucw.git diff --git a/lib/ipaccess.h b/lib/ipaccess.h index aedb1587..b4077838 100644 --- a/lib/ipaccess.h +++ b/lib/ipaccess.h @@ -1,14 +1,28 @@ /* * UCW Library -- IP address access lists * - * (c) 1997--2001 Martin Mares + * (c) 1997--2007 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -struct ipaccess_list; +#ifndef _UCW_IPACCESS_H +#define _UCW_IPACCESS_H -struct ipaccess_list *ipaccess_init(void); -byte *ipaccess_parse(struct ipaccess_list *l, byte *c, int is_allow); -int ipaccess_check(struct ipaccess_list *l, u32 ip); +#include "lib/clists.h" + +extern struct cf_section ipaccess_cf; +int ipaccess_check(clist *l, u32 ip); + +/* Low-level handling of addresses and masks */ + +struct ip_addrmask { + u32 addr; + u32 mask; +}; + +extern struct cf_user_type ip_addrmask_type; +int ip_addrmask_match(struct ip_addrmask *am, u32 ip); + +#endif