1249423Sdim/* $NetBSD: npfd.h,v 1.5 2017/10/15 15:26:10 christos Exp $ */ 2249423Sdim 3249423Sdim/*- 4249423Sdim * Copyright (c) 2015 The NetBSD Foundation, Inc. 5249423Sdim * All rights reserved. 6249423Sdim * 7249423Sdim * This code is derived from software contributed to The NetBSD Foundation 8249423Sdim * by Mindaugas Rasiukevicius. 9249423Sdim * 10249423Sdim * Redistribution and use in source and binary forms, with or without 11249423Sdim * modification, are permitted provided that the following conditions 12249423Sdim * are met: 13249423Sdim * 1. Redistributions of source code must retain the above copyright 14249423Sdim * notice, this list of conditions and the following disclaimer. 15249423Sdim * 2. Redistributions in binary form must reproduce the above copyright 16249423Sdim * notice, this list of conditions and the following disclaimer in the 17249423Sdim * documentation and/or other materials provided with the distribution. 18249423Sdim * 19249423Sdim * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20249423Sdim * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21249423Sdim * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22249423Sdim * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23249423Sdim * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24249423Sdim * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25249423Sdim * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26249423Sdim * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27249423Sdim * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28249423Sdim * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29249423Sdim * POSSIBILITY OF SUCH DAMAGE. 30249423Sdim */ 31249423Sdim 32249423Sdim#ifndef _NPFD_H_ 33263508Sdim#define _NPFD_H_ 34249423Sdim 35249423Sdim#define PCAP_NPACKETS 1024 36249423Sdim#define NPFD_LOG_PATH "/var/log" 37249423Sdim#define NPF_DEV_PATH "/dev/npf" 38249423Sdim 39249423Sdim#define NPFD_NPFLOG "npflog" 40249423Sdim#define NPFD_NPFLOG_LEN (sizeof(NPFD_NPFLOG) - 1) 41249423Sdim 42249423Sdimstruct npf_log; 43249423Sdimtypedef struct npfd_log npfd_log_t; 44249423Sdim 45249423Sdimnpfd_log_t * npfd_log_create(const char *, const char *, const char *, int); 46249423Sdimvoid npfd_log_destroy(npfd_log_t *); 47249423Sdimint npfd_log_getsock(npfd_log_t *); 48263508Sdimbool npfd_log_file_reopen(npfd_log_t *, bool); 49249423Sdimbool npfd_log_pcap_reopen(npfd_log_t *); 50249423Sdimint npfd_log(npfd_log_t *); 51249423Sdimvoid npfd_log_stats(npfd_log_t *); 52249423Sdimvoid npfd_log_flush(npfd_log_t *); 53249423Sdim 54249423Sdim 55249423Sdim#endif 56249423Sdim