/************************************************************************
 *
 * NSCA Common Config Header File
 * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org)
 * Last Modified: 11-23-2007
 *
 * License:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 ************************************************************************/

#ifndef _CONFIG_H
#define _CONFIG_H


#include <stdio.h>
#include <stdlib.h>

#define DEFAULT_SERVER_PORT     @nsca_port@     /* default port to use */

#define NSCA_LOG_FACILITY       @log_facility@

#undef socklen_t

#undef STDC_HEADERS
#undef HAVE_SYSLOG_H
#undef HAVE_STRDUP
#undef HAVE_STRSTR
#undef HAVE_STRTOUL 
#undef HAVE_INITGROUPS
#undef HAVE_LIMITS_H
#undef HAVE_SYS_RESOURCE_H
#undef HAVE_SIGACTION

#undef HAVE_LIBWRAP

#define SOCKET_SIZE_TYPE ""
#define GETGROUPS_T ""
#define RETSIGTYPE ""


#undef SIZEOF_INT
#undef SIZEOF_SHORT
#undef SIZEOF_LONG

/* stupid stuff for u_int32_t */
#undef U_INT32_T_IS_USHORT
#undef U_INT32_T_IS_UINT
#undef U_INT32_T_IS_ULONG
#undef U_INT32_T_IS_UINT32_T

#ifdef U_INT32_T_IS_USHORT
typedef unsigned short u_int32_t;
#endif
#ifdef U_INT32_T_IS_ULONG
typedef unsigned long u_int32_t;
#endif
#ifdef U_INT32_T_IS_UINT
typedef unsigned int u_int32_t;
#endif
#ifdef U_INT32_T_IS_UINT32_t
typedef uint32_t u_int32_t;
#endif

/* stupid stuff for int32_t */
#undef INT32_T_IS_SHORT
#undef INT32_T_IS_INT
#undef INT32_T_IS_LONG

#ifdef INT32_T_IS_USHORT
typedef short int32_t;
#endif
#ifdef INT32_T_IS_ULONG
typedef long int32_t;
#endif
#ifdef INT32_T_IS_UINT
typedef int int32_t;
#endif

#undef HAVE_REGEX_H
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif

#undef HAVE_STRINGS_H
#undef HAVE_STRING_H
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_STRINGS_H
#include <string.h>
#endif

#undef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif


#undef HAVE_SIGNAL_H
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif

#undef HAVE_SYSLOG_H
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif

#undef HAVE_SYS_INT_TYPES_H
#ifdef HAVE_SYS_INT_TYPES_H
#include <sys/int_types.h>
#endif

#undef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif

#undef HAVE_FCNTL_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#undef HAVE_STDINT_H
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif

#undef HAVE_SYS_POLL_H
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

#undef HAVE_SYS_TYPES_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#undef HAVE_SYS_WAIT_H
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif

#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif

#undef HAVE_ERRNO_H
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif

/* needed for the time_t structures we use later... */
#undef TIME_WITH_SYS_TIME
#undef HAVE_SYS_TIME_H
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif


#undef HAVE_SYS_SOCKET_H
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

#undef HAVE_SOCKET
#ifdef HAVE_SOCKET_H
#include <socket.h>
#endif

#undef HAVE_TCPD_H
#ifdef HAVE_TCPD_H
#include <tcpd.h>
#endif

#undef HAVE_NETINET_IN_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

#undef HAVE_ARPA_INET_H
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

#undef HAVE_NETDB_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#undef HAVE_CTYPE_H
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif

#undef HAVE_LIBMCRYPT
#ifdef HAVE_LIBMCRYPT
#include <mcrypt.h>
#endif

#undef HAVE_DB_H
#ifdef HAVE_DB_H
#include <db.h>
#endif

#undef HAVE_PWD_H
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
 
#undef HAVE_GRP_H
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
 
#undef HAVE_INTTYPES_H
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif

#undef HAVE_SYS_CONFIG_H
#ifdef HAVE_SYS_CONFIG_H
#include <sys/config.h>
#endif

#undef HAVE_INTTYPES_H
#undef HAVE_STDINT_H
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif

#endif
