Home | History | Annotate | Line # | Download | only in net
if_pflog.h revision 1.2.2.2
      1  1.2.2.2  skrll /*	$NetBSD: if_pflog.h,v 1.2.2.2 2004/08/03 10:52:23 skrll Exp $	*/
      2  1.2.2.2  skrll /* $OpenBSD: if_pflog.h,v 1.10 2004/03/19 04:52:04 frantzen Exp $ */
      3  1.2.2.2  skrll /*
      4  1.2.2.2  skrll  * Copyright 2001 Niels Provos <provos (at) citi.umich.edu>
      5  1.2.2.2  skrll  * All rights reserved.
      6  1.2.2.2  skrll  *
      7  1.2.2.2  skrll  * Redistribution and use in source and binary forms, with or without
      8  1.2.2.2  skrll  * modification, are permitted provided that the following conditions
      9  1.2.2.2  skrll  * are met:
     10  1.2.2.2  skrll  * 1. Redistributions of source code must retain the above copyright
     11  1.2.2.2  skrll  *    notice, this list of conditions and the following disclaimer.
     12  1.2.2.2  skrll  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.2.2.2  skrll  *    notice, this list of conditions and the following disclaimer in the
     14  1.2.2.2  skrll  *    documentation and/or other materials provided with the distribution.
     15  1.2.2.2  skrll  *
     16  1.2.2.2  skrll  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.2.2.2  skrll  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  1.2.2.2  skrll  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  1.2.2.2  skrll  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  1.2.2.2  skrll  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21  1.2.2.2  skrll  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22  1.2.2.2  skrll  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23  1.2.2.2  skrll  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  1.2.2.2  skrll  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25  1.2.2.2  skrll  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  1.2.2.2  skrll  */
     27  1.2.2.2  skrll 
     28  1.2.2.2  skrll #ifndef _NET_IF_PFLOG_H_
     29  1.2.2.2  skrll #define _NET_IF_PFLOG_H_
     30  1.2.2.2  skrll 
     31  1.2.2.2  skrll struct pflog_softc {
     32  1.2.2.2  skrll 	struct ifnet	sc_if;  /* the interface */
     33  1.2.2.2  skrll };
     34  1.2.2.2  skrll 
     35  1.2.2.2  skrll /* XXX keep in sync with pfvar.h */
     36  1.2.2.2  skrll #ifndef PF_RULESET_NAME_SIZE
     37  1.2.2.2  skrll #define PF_RULESET_NAME_SIZE	 16
     38  1.2.2.2  skrll #endif
     39  1.2.2.2  skrll 
     40  1.2.2.2  skrll struct pfloghdr {
     41  1.2.2.2  skrll 	u_int8_t	length;
     42  1.2.2.2  skrll 	sa_family_t	af;
     43  1.2.2.2  skrll 	u_int8_t	action;
     44  1.2.2.2  skrll 	u_int8_t	reason;
     45  1.2.2.2  skrll 	char		ifname[IFNAMSIZ];
     46  1.2.2.2  skrll 	char		ruleset[PF_RULESET_NAME_SIZE];
     47  1.2.2.2  skrll 	u_int32_t	rulenr;
     48  1.2.2.2  skrll 	u_int32_t	subrulenr;
     49  1.2.2.2  skrll 	u_int8_t	dir;
     50  1.2.2.2  skrll 	u_int8_t	pad[3];
     51  1.2.2.2  skrll };
     52  1.2.2.2  skrll 
     53  1.2.2.2  skrll #define PFLOG_HDRLEN		sizeof(struct pfloghdr)
     54  1.2.2.2  skrll /* minus pad, also used as a signature */
     55  1.2.2.2  skrll #define PFLOG_REAL_HDRLEN	offsetof(struct pfloghdr, pad)
     56  1.2.2.2  skrll 
     57  1.2.2.2  skrll /* XXX remove later when old format logs are no longer needed */
     58  1.2.2.2  skrll struct old_pfloghdr {
     59  1.2.2.2  skrll 	u_int32_t af;
     60  1.2.2.2  skrll 	char ifname[IFNAMSIZ];
     61  1.2.2.2  skrll 	short rnr;
     62  1.2.2.2  skrll 	u_short reason;
     63  1.2.2.2  skrll 	u_short action;
     64  1.2.2.2  skrll 	u_short dir;
     65  1.2.2.2  skrll };
     66  1.2.2.2  skrll #define OLD_PFLOG_HDRLEN	sizeof(struct old_pfloghdr)
     67  1.2.2.2  skrll 
     68  1.2.2.2  skrll #ifdef _KERNEL
     69  1.2.2.2  skrll 
     70  1.2.2.2  skrll #if NPFLOG > 0
     71  1.2.2.2  skrll #define	PFLOG_PACKET(i,x,a,b,c,d,e,f,g) pflog_packet(i,a,b,c,d,e,f,g)
     72  1.2.2.2  skrll #else
     73  1.2.2.2  skrll #define	PFLOG_PACKET(i,x,a,b,c,d,e,f,g)	((void)0)
     74  1.2.2.2  skrll #endif /* NPFLOG > 0 */
     75  1.2.2.2  skrll #endif /* _KERNEL */
     76  1.2.2.2  skrll #endif /* _NET_IF_PFLOG_H_ */
     77