Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / tcpdump / pf.h
blob25548b511cd16dcf3c4545879bcad7f423fd3860
1 /* $NetBSD$ */
3 /*
4 * Copyright (c) 2001 Daniel Hartmeier
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
11 * - Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * - Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
31 * @(#) Header: /tcpdump/master/tcpdump/pf.h,v 1.2 2004/04/02 06:36:25 guy Exp (LBL)
34 /* from $OpenBSD: pfvar.h,v 1.170 2003/08/22 21:50:34 david Exp $ */
36 enum { PF_INOUT=0, PF_IN=1, PF_OUT=2 };
37 enum { PF_PASS=0, PF_DROP=1, PF_SCRUB=2, PF_NAT=3, PF_NONAT=4,
38 PF_BINAT=5, PF_NOBINAT=6, PF_RDR=7, PF_NORDR=8, PF_SYNPROXY_DROP=9 };
40 /* Reasons code for passing/dropping a packet */
41 #define PFRES_MATCH 0 /* Explicit match of a rule */
42 #define PFRES_BADOFF 1 /* Bad offset for pull_hdr */
43 #define PFRES_FRAG 2 /* Dropping following fragment */
44 #define PFRES_SHORT 3 /* Dropping short packet */
45 #define PFRES_NORM 4 /* Dropping by normalizer */
46 #define PFRES_MEMORY 5 /* Dropped due to lacking mem */
47 #define PFRES_MAX 6 /* total+1 */
49 #define PFRES_NAMES { \
50 "match", \
51 "bad-offset", \
52 "fragment", \
53 "short", \
54 "normalize", \
55 "memory", \
56 NULL \
59 #define PF_RULESET_NAME_SIZE 16
61 /* from $OpenBSD: if_pflog.h,v 1.9 2003/07/15 20:27:27 dhartmei Exp $ */
63 #ifndef IFNAMSIZ
64 #define IFNAMSIZ 16
65 #endif
67 struct pfloghdr {
68 u_int8_t length;
69 u_int8_t af;
70 u_int8_t action;
71 u_int8_t reason;
72 char ifname[IFNAMSIZ];
73 char ruleset[PF_RULESET_NAME_SIZE];
74 u_int32_t rulenr;
75 u_int32_t subrulenr;
76 u_int8_t dir;
77 u_int8_t pad[3];
79 #define PFLOG_HDRLEN sizeof(struct pfloghdr)