ircproxy The Ultimate Cyborg |
00001 // ircproxy -- An IRC bouncer. 00002 // 00003 //! @file match.h 00004 //! @brief This file contains the declaration of match related functions. 00005 // 00006 // Copyright (C) 2006, 2007 by 00007 // 00008 // Carlo Wood, Run on IRC <carlo@alinoe.com> 00009 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 00010 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 00011 // 00012 // This file may be distributed under the terms of the Q Public License 00013 // version 1.0 as appearing in the file LICENSE.QPL included in the 00014 // packaging of this file. 00015 00016 #ifndef MATCH_H 00017 #define MATCH_H 00018 00019 #ifndef USE_PCH 00020 #include <netinet/in.h> 00021 #endif 00022 00023 //! An IP mask used for matchcompIP. 00024 struct in_mask { 00025 struct in_addr bits; //!< What these bits should look like to have a match. 00026 struct in_addr mask; //!< The bits considered significative in the IP. 00027 int fall; //!< Non-zero if besides bits and mask a text compare is still needed. 00028 }; 00029 00030 int mmatch(char const* old_mask, char const* new_mask); //!< Mask match. 00031 int match(char const* mask, char const* string); //!< Wildcard match. 00032 char* collapse(char* mask); //!< Collapse mask. 00033 int matchcomp(char* cmask, int* minlen, int* charset, char const* mask); //!< Match compile function. 00034 int matchexec(char const* string, size_t len, char const* cmask, int minlen); //!< Match execute function. 00035 int matchdecomp(char* mask, char const* cmask); //!< Match decompile function. 00036 int mmexec(char const* wcm, int wminlen, char const* rcm, int rminlen); //!< Match execute function. 00037 int matchcompIP(in_mask* imask, char const* mask); //!< Match compile function. 00038 00039 #endif // MATCH_H
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|