/*
* Copyright (c) 2001 Fenris, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* File: globals.h
*
* Purpose: This header file declares global object necessary to easily
* merge the backend and frontend options, as well as the objects necessary
* to make this code thread safe.
*
*/
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include "filter.h"
#include "network.h"
#include "cache_list.h"
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define IS_DIGIT(x) ((x) >= 48 && (x) <= 57)
#define NET_TO_RSLV_LEN 5
#define RSLV_TO_NET_LEN 5 + MAX_HOSTNAME_LEN
#define SNAPLEN 1514
extern Network *net;
extern Filter_Opts *opts;
extern pthread_mutex_t *net_mutex;
extern pthread_mutex_t *filter_mutex;
extern pthread_mutex_t *db_mutex;
extern char *basename;
extern pid_t resolver_pid;
extern int net_to_rslv[2];
extern int rslv_to_net[2];
extern Cache_List dnscache;
void die(char *message);
void kill_resolver(void);
void sig_exit(int signo);
#endif /* _GLOBALS_H */
syntax highlighted by Code2HTML, v. 0.9.1