19823Sprr/* $OpenBSD: pflogd.h,v 1.3 2006/01/15 16:38:04 canacar Exp $ */ 29823Sprr 39823Sprr/* 49823Sprr * Copyright (c) 2003 Can Erkin Acar 59823Sprr * 69823Sprr * Permission to use, copy, modify, and distribute this software for any 79823Sprr * purpose with or without fee is hereby granted, provided that the above 89823Sprr * copyright notice and this permission notice appear in all copies. 99823Sprr * 109823Sprr * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 119823Sprr * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 129823Sprr * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 139823Sprr * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 149823Sprr * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 159823Sprr * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 169823Sprr * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 179823Sprr */ 189823Sprr 199823Sprr#include <sys/limits.h> 209823Sprr#include <pcap.h> 219823Sprr 229823Sprr#define DEF_SNAPLEN 116 /* default plus allow for larger header of pflog */ 239823Sprr#define PCAP_TO_MS 500 /* pcap read timeout (ms) */ 249823Sprr#define PCAP_NUM_PKTS 1000 /* max number of packets to process at each loop */ 259823Sprr#define PCAP_OPT_FIL 1 /* filter optimization */ 269823Sprr#define FLUSH_DELAY 60 /* flush delay */ 279823Sprr 289823Sprr#define PFLOGD_LOG_FILE "/var/log/pflog" 299823Sprr#define PFLOGD_DEFAULT_IF "pflog0" 309823Sprr 319823Sprr#define PFLOGD_MAXSNAPLEN INT_MAX 329823Sprr#define PFLOGD_BUFSIZE 65536 /* buffer size for incoming packets */ 339823Sprr 349823Sprrvoid logmsg(int priority, const char *message, ...); 359823Sprr 369823Sprr/* Privilege separation */ 379823Sprrint priv_init(void); 389823Sprrint priv_set_snaplen(int snaplen); 399823Sprrint priv_open_log(void); 409823Sprrint priv_move_log(void); 419823Sprrpcap_t *pcap_open_live_fd(int fd, int snaplen, char *ebuf); 429823Sprr 439823Sprrvoid set_pcap_filter(void); 449823Sprr/* File descriptor send/recv */ 459823Sprrvoid send_fd(int, int); 469823Sprrint receive_fd(int); 479823Sprr 489823Sprrextern int Debug; 499823Sprr