1171169Smlaier/* $OpenBSD: pflogd.h,v 1.3 2006/01/15 16:38:04 canacar Exp $ */ 2130614Smlaier 3130614Smlaier/* 4130614Smlaier * Copyright (c) 2003 Can Erkin Acar 5130614Smlaier * 6130614Smlaier * Permission to use, copy, modify, and distribute this software for any 7130614Smlaier * purpose with or without fee is hereby granted, provided that the above 8130614Smlaier * copyright notice and this permission notice appear in all copies. 9130614Smlaier * 10130614Smlaier * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11130614Smlaier * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12130614Smlaier * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13130614Smlaier * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14130614Smlaier * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15130614Smlaier * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16130614Smlaier * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17130614Smlaier */ 18130614Smlaier 19130614Smlaier#include <sys/limits.h> 20130614Smlaier#include <pcap.h> 21130614Smlaier 22130614Smlaier#define DEF_SNAPLEN 116 /* default plus allow for larger header of pflog */ 23130614Smlaier#define PCAP_TO_MS 500 /* pcap read timeout (ms) */ 24130614Smlaier#define PCAP_NUM_PKTS 1000 /* max number of packets to process at each loop */ 25130614Smlaier#define PCAP_OPT_FIL 1 /* filter optimization */ 26130614Smlaier#define FLUSH_DELAY 60 /* flush delay */ 27130614Smlaier 28130614Smlaier#define PFLOGD_LOG_FILE "/var/log/pflog" 29130614Smlaier#define PFLOGD_DEFAULT_IF "pflog0" 30130614Smlaier 31130614Smlaier#define PFLOGD_MAXSNAPLEN INT_MAX 32130614Smlaier#define PFLOGD_BUFSIZE 65536 /* buffer size for incoming packets */ 33130614Smlaier 34130614Smlaiervoid logmsg(int priority, const char *message, ...); 35130614Smlaier 36130614Smlaier/* Privilege separation */ 37130614Smlaierint priv_init(void); 38130614Smlaierint priv_set_snaplen(int snaplen); 39130614Smlaierint priv_open_log(void); 40171169Smlaierint priv_move_log(void); 41130614Smlaierpcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf); 42130614Smlaier 43130614Smlaiervoid set_pcap_filter(void); 44130614Smlaier/* File descriptor send/recv */ 45130614Smlaiervoid send_fd(int, int); 46130614Smlaierint receive_fd(int); 47130614Smlaier 48130614Smlaierextern int Debug; 49