|
Packit Service |
5e8d2a |
/* aide, Advanced Intrusion Detection Environment
|
|
Packit Service |
5e8d2a |
*
|
|
Packit Service |
5e8d2a |
* Copyright (C) 1999-2002,2006,2013 Rami Lehti, Pablo Virolainen, Richard
|
|
Packit Service |
5e8d2a |
* van den Berg, Hannes von Haugwitz
|
|
Packit Service |
5e8d2a |
* $Header$
|
|
Packit Service |
5e8d2a |
*
|
|
Packit Service |
5e8d2a |
* This program is free software; you can redistribute it and/or
|
|
Packit Service |
5e8d2a |
* modify it under the terms of the GNU General Public License as
|
|
Packit Service |
5e8d2a |
* published by the Free Software Foundation; either version 2 of the
|
|
Packit Service |
5e8d2a |
* License, or (at your option) any later version.
|
|
Packit Service |
5e8d2a |
*
|
|
Packit Service |
5e8d2a |
* This program is distributed in the hope that it will be useful, but
|
|
Packit Service |
5e8d2a |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
5e8d2a |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
5e8d2a |
* General Public License for more details.
|
|
Packit Service |
5e8d2a |
*
|
|
Packit Service |
5e8d2a |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
5e8d2a |
* along with this program; if not, write to the Free Software
|
|
Packit Service |
5e8d2a |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
Packit Service |
5e8d2a |
*/
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#ifndef _UTIL_H_INCLUDED
|
|
Packit Service |
5e8d2a |
#define _UTIL_H_INCLUDED
|
|
Packit Service |
5e8d2a |
#include <string.h>
|
|
Packit Service |
5e8d2a |
#include <sys/types.h>
|
|
Packit Service |
5e8d2a |
#include "db_config.h"
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A'))
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ? \
|
|
Packit Service |
5e8d2a |
((x) - '0') : (toupper(x) - 'A' + 10))
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#define ISXDIGIT(x) isxdigit ((unsigned char)(x))
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#define CLEANDUP(x) (contains_unsafe (x) ? encode_string (x) : strdup (x))
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#ifndef HAVE_STRICMP
|
|
Packit Service |
5e8d2a |
# define stricmp(a,b) strcasecmp( (a), (b) )
|
|
Packit Service |
5e8d2a |
#endif
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
int cmpurl(url_t*, url_t*);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
url_t* parse_url(char*);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
int contains_unsafe(const char*);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
void decode_string(char*);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
char* encode_string(const char*);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
char* perm_to_char(mode_t perm);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
void sig_handler(int signal);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
void init_sighandler(void);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
char *expand_tilde(char * path);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#ifndef HAVE_STRNSTR
|
|
Packit Service |
5e8d2a |
char* strnstr(char* haystack,char* needle,int n);
|
|
Packit Service |
5e8d2a |
#endif
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#ifndef HAVE_STRNLEN
|
|
Packit Service |
5e8d2a |
size_t strnlen(const char *s, size_t maxlen);
|
|
Packit Service |
5e8d2a |
#endif
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
int syslog_facility_lookup(char *);
|
|
Packit Service |
5e8d2a |
|
|
Packit Service |
5e8d2a |
#endif
|