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