pflogd.h revision 1.1 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.1 itojun #include <sys/limits.h>
20 1.1 itojun #include <pcap.h>
21 1.1 itojun
22 1.1 itojun #define DEF_SNAPLEN 116 /* default plus allow for larger header of pflog */
23 1.1 itojun #define PCAP_TO_MS 500 /* pcap read timeout (ms) */
24 1.1 itojun #define PCAP_NUM_PKTS 1000 /* max number of packets to process at each loop */
25 1.1 itojun #define PCAP_OPT_FIL 1 /* filter optimization */
26 1.1 itojun #define FLUSH_DELAY 60 /* flush delay */
27 1.1 itojun
28 1.1 itojun #define PFLOGD_LOG_FILE "/var/log/pflog"
29 1.1 itojun #define PFLOGD_DEFAULT_IF "pflog0"
30 1.1 itojun
31 1.1 itojun #define PFLOGD_MAXSNAPLEN INT_MAX
32 1.1 itojun #define PFLOGD_BUFSIZE 65536 /* buffer size for incoming packets */
33 1.1 itojun
34 1.1 itojun void logmsg(int priority, const char *message, ...);
35 1.1 itojun
36 1.1 itojun /* Privilege separation */
37 1.1 itojun int priv_init(void);
38 1.1 itojun int priv_set_snaplen(int snaplen);
39 1.1 itojun int priv_open_log(void);
40 1.1 itojun pcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf);
41 1.1 itojun
42 1.1 itojun void set_pcap_filter(void);
43 1.1 itojun /* File descriptor send/recv */
44 1.1 itojun void send_fd(int, int);
45 1.1 itojun int receive_fd(int);
46 1.1 itojun
47 1.1 itojun extern int Debug;
48