00001 /* $Id$ */ 00002 /* 00003 * Copyright(C) 2002 Sourcefire, Inc. 00004 * 00005 * Author(s): Andrew R. Baker <andrewb@sourcefire.com> 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 * 00021 */ 00022 00023 #ifndef __IP_ADDR_SET_H__ 00024 #define __IP_ADDR_SET_H__ 00025 00026 #include <sys/types.h> 00027 00028 typedef struct _IpAddrSet 00029 { 00030 u_int32_t ip_addr; /* IP addr */ 00031 u_int32_t netmask; /* netmask */ 00032 u_int8_t addr_flags; /* flag for normal/exception processing */ 00033 00034 struct _IpAddrSet *next; 00035 } IpAddrSet; 00036 00037 /* flags */ 00038 #define EXCEPT_IP 0x01 00039 00040 void IpAddrSetPrint(char *prefix, IpAddrSet *); 00041 void IpAddrSetDestroy(IpAddrSet *); 00042 IpAddrSet *IpAddrSetCopy(IpAddrSet *); 00043 IpAddrSet *IpAddrSetCreate(); 00044 IpAddrSet *IpAddrSetParse(char *); 00045 int IpAddrSetContains(IpAddrSet *, struct in_addr); 00046 00047 00048 /* XXX legacy support function */ 00049 int ParseIP(char *paddr, IpAddrSet *); 00050 00051 #endif /* __IP_ADDR_SET_H__ */