2 /* $OpenBSD: pflogd.h,v 1.3 2006/01/15 16:38:04 canacar Exp $ */
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.
21 #include <sys/limits.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 */
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);