Sync usage with man page.
[netbsd-mini2440.git] / dist / pf / sbin / pflogd / pflogd.h
blob6b6ab7c03a6674b55e1baf3275606f8a1f54ac12
1 /* $NetBSD$ */
2 /* $OpenBSD: pflogd.h,v 1.3 2006/01/15 16:38:04 canacar Exp $ */
4 /*
5 * Copyright (c) 2003 Can Erkin Acar
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.
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.
20 #ifdef __OpenBSD__
21 #include <sys/limits.h>
22 #else
23 #include <limits.h>
24 #endif
25 #include <pcap.h>
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 */
33 #define PFLOGD_LOG_FILE "/var/log/pflog"
34 #define PFLOGD_DEFAULT_IF "pflog0"
36 #define PFLOGD_MAXSNAPLEN INT_MAX
37 #define PFLOGD_BUFSIZE 65536 /* buffer size for incoming packets */
39 void logmsg(int priority, const char *message, ...);
41 /* Privilege separation */
42 int priv_init(void);
43 int priv_set_snaplen(int snaplen);
44 int priv_open_log(void);
45 int priv_move_log(void);
46 pcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf);
48 void set_pcap_filter(void);
49 /* File descriptor send/recv */
50 void send_fd(int, int);
51 int receive_fd(int);
53 extern int Debug;