some compilers dont like unnamed unions and structs
[obnox/wireshark/wip.git] / epan / dissectors / packet-pflog.h
1 /* packet-pflog.h
2  *
3  * $Id$
4  *
5  * Copyright 2001 Mike Frantzen
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  *    - Redistributions of source code must retain the above copyright
13  *      notice, this list of conditions and the following disclaimer.
14  *      with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 #ifndef __PACKET_PFLOG_H__
31 #define __PACKET_PFLOG_H__
32
33 /* The header in OpenBSD pflog files. */
34
35 struct pfloghdr {
36         guchar  length;
37         guchar  af;
38         guchar  action;
39         guchar  reason;
40         char    ifname[16];
41         char    ruleset[16];
42         guint32 rulenr;
43         guint32 subrulenr;
44         guchar  dir;
45         guchar  pad[3];
46 };
47
48 #define PFLOG_HDRLEN            sizeof(struct pfloghdr)
49 /* minus pad, also used as a signature */
50 #define PFLOG_REAL_HDRLEN       offsetof(struct pfloghdr, pad);
51 #define MIN_PFLOG_HDRLEN        45
52
53 struct old_pfloghdr {
54   guint32       af;
55   char          ifname[16];
56   gint16        rnr;
57   guint16       reason;
58   guint16       action;
59   guint16       dir;
60 };
61 #define OLD_PFLOG_HDRLEN        sizeof(struct old_pfloghdr)
62
63 /* Actions */
64 #define PF_PASS  0
65 #define PF_DROP  1
66 #define PF_SCRUB 2
67
68 /* Directions */
69 #define PF_OLD_IN  0
70 #define PF_OLD_OUT 1
71
72 #define PF_INOUT 0
73 #define PF_IN    1
74 #define PF_OUT   2
75
76 # define BSD_PF_INET    2
77 # define BSD_PF_INET6   24
78
79 #endif /* __PACKET_PFLOG_H__ */