1 /* $NetBSD: if_npflog.h,v 1.1 2017/01/29 00:15:54 christos Exp $ */ 2 3 /* 4 * Copyright 2001 Niels Provos <provos@citi.umich.edu> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 #ifndef _NET_NPF_IF_NPFLOG_H_ 28 #define _NET_NPF_IF_NPFLOG_H_ 29 30 #ifndef _KERNEL 31 #error "not supposed to be exposed to userland" 32 #endif 33 34 #define NPFLOG_RULESET_NAME_SIZE 16 35 36 /* 37 * For now, we use a header compatible with pflog. 38 * This will be improved in the future. 39 */ 40 41 struct npfloghdr { 42 uint8_t length; 43 sa_family_t af; 44 uint8_t action; 45 uint8_t reason; 46 char ifname[IFNAMSIZ]; 47 char ruleset[NPFLOG_RULESET_NAME_SIZE]; 48 uint32_t rulenr; 49 uint32_t subrulenr; 50 uint32_t uid; 51 uint32_t pid; 52 uint32_t rule_uid; 53 uint32_t rule_pid; 54 uint8_t dir; 55 uint8_t pad[3]; 56 }; 57 58 #define DLT_NPFLOG DLT_PFLOG 59 60 #define NPFLOG_HDRLEN sizeof(struct npfloghdr) 61 #define NPFLOG_REAL_HDRLEN offsetof(struct npfloghdr, pad) 62 63 #endif /* _NET_NPF_IF_NPFLOG_H_ */ 64