2004-08-23 20:38:10 +00:00
|
|
|
/*
|
2020-01-03 15:44:07 -05:00
|
|
|
* Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
|
2019-01-25 10:15:50 -05:00
|
|
|
* Copyright (C) 2007-2013 Sourcefire, Inc.
|
2009-02-13 10:55:45 +00:00
|
|
|
*
|
|
|
|
* Authors: Tomasz Kojm
|
2004-08-23 20:38:10 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-03-31 20:31:04 +00:00
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
2004-08-23 20:38:10 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-04-09 19:59:28 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
2004-08-23 20:38:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MISC_H
|
|
|
|
#define __MISC_H
|
2009-09-24 19:23:21 +02:00
|
|
|
#ifndef _WIN32
|
2009-10-06 22:53:45 +02:00
|
|
|
#include <sys/types.h>
|
2009-02-12 21:14:51 +00:00
|
|
|
#include <netdb.h>
|
|
|
|
#include <netinet/in.h>
|
2009-09-24 19:23:21 +02:00
|
|
|
#endif
|
2017-08-31 16:38:41 -04:00
|
|
|
#include "platform.h"
|
2009-02-12 21:29:42 +00:00
|
|
|
#include "optparser.h"
|
2006-10-29 13:41:24 +00:00
|
|
|
/* Maximum filenames under various systems - njh */
|
2018-12-03 12:40:13 -05:00
|
|
|
#ifndef NAME_MAX /* e.g. Linux */
|
|
|
|
#ifdef MAXNAMELEN /* e.g. Solaris */
|
|
|
|
#define NAME_MAX MAXNAMELEN
|
|
|
|
#else
|
|
|
|
#ifdef FILENAME_MAX /* e.g. SCO */
|
|
|
|
#define NAME_MAX FILENAME_MAX
|
|
|
|
#endif
|
|
|
|
#endif
|
2006-10-29 13:41:24 +00:00
|
|
|
#endif
|
|
|
|
|
2016-02-09 13:46:13 -05:00
|
|
|
#ifdef HAVE_SYSTEMD
|
2018-12-03 12:40:13 -05:00
|
|
|
#include <systemd/sd-daemon.h>
|
2016-02-09 13:46:13 -05:00
|
|
|
#else
|
2018-12-03 12:40:13 -05:00
|
|
|
#define sd_listen_fds(u) 0
|
|
|
|
#define SD_LISTEN_FDS_START 3
|
|
|
|
#define sd_is_socket(f, a, s, l) 1
|
2016-02-09 13:46:13 -05:00
|
|
|
#endif
|
|
|
|
|
2009-02-13 11:05:14 +00:00
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
#define PATH_MAX 1024
|
|
|
|
#endif
|
|
|
|
|
2019-05-07 18:00:47 -04:00
|
|
|
#ifndef ADDR_LEN
|
|
|
|
#define ADDR_LEN 13
|
|
|
|
#endif
|
|
|
|
|
2005-01-26 14:15:04 +00:00
|
|
|
char *freshdbdir(void);
|
2008-01-22 10:42:30 +00:00
|
|
|
void print_version(const char *dbdir);
|
2010-05-10 17:05:16 +02:00
|
|
|
int check_flevel(void);
|
2009-05-21 13:43:05 +00:00
|
|
|
const char *filelist(const struct optstruct *opts, int *err);
|
2004-11-28 23:26:29 +00:00
|
|
|
int filecopy(const char *src, const char *dest);
|
2008-01-22 17:47:15 +00:00
|
|
|
int daemonize(void);
|
2008-08-04 10:38:24 +00:00
|
|
|
const char *get_version(void);
|
2008-08-21 20:21:43 +00:00
|
|
|
int match_regex(const char *filename, const char *pattern);
|
2009-09-25 00:09:13 +02:00
|
|
|
int cli_is_abspath(const char *path);
|
2010-09-16 14:37:43 +02:00
|
|
|
unsigned int countlines(const char *filename);
|
2009-09-25 00:09:13 +02:00
|
|
|
|
2004-08-23 20:38:10 +00:00
|
|
|
#endif
|