Home | History | Annotate | Line # | Download | only in pflogd
pflogd.h revision 1.3
      1 /*	$NetBSD: pflogd.h,v 1.3 2005/07/01 12:43:50 peter Exp $	*/
      2 /*	$OpenBSD: pflogd.h,v 1.2 2004/01/15 20:15:14 canacar Exp $ */
      3 
      4 /*
      5  * Copyright (c) 2003 Can Erkin Acar
      6  *
      7  * Permission to use, copy, modify, and distribute this software for any
      8  * purpose with or without fee is hereby granted, provided that the above
      9  * copyright notice and this permission notice appear in all copies.
     10  *
     11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     18  */
     19 
     20 #ifdef __OpenBSD__
     21 #include <sys/limits.h>
     22 #else
     23 #include <limits.h>
     24 #endif
     25 #include <pcap.h>
     26 
     27 #define DEF_SNAPLEN 116		/* default plus allow for larger header of pflog */
     28 #define PCAP_TO_MS 500		/* pcap read timeout (ms) */
     29 #define PCAP_NUM_PKTS 1000	/* max number of packets to process at each loop */
     30 #define PCAP_OPT_FIL 1		/* filter optimization */
     31 #define FLUSH_DELAY 60		/* flush delay */
     32 
     33 #define PFLOGD_LOG_FILE		"/var/log/pflog"
     34 #define PFLOGD_DEFAULT_IF	"pflog0"
     35 
     36 #define PFLOGD_MAXSNAPLEN	INT_MAX
     37 #define PFLOGD_BUFSIZE		65536	/* buffer size for incoming packets */
     38 
     39 void  logmsg(int priority, const char *message, ...);
     40 
     41 /* Privilege separation */
     42 int	priv_init(void);
     43 int	priv_set_snaplen(int snaplen);
     44 int	priv_open_log(void);
     45 pcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf);
     46 
     47 void set_pcap_filter(void);
     48 /* File descriptor send/recv */
     49 void send_fd(int, int);
     50 int  receive_fd(int);
     51 
     52 extern int Debug;
     53