1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _NFNETLINK_LOG_H
3 #define _NFNETLINK_LOG_H
5 /* This file describes the netlink messages (i.e. 'protocol packets'),
6 * and not any kind of function definitions. It is shared between kernel and
7 * userspace. Don't put kernel specific stuff in here */
9 #include <linux/types.h>
10 #include <linux/netfilter/nfnetlink.h>
12 enum nfulnl_msg_types {
13 NFULNL_MSG_PACKET, /* packet from kernel to userspace */
14 NFULNL_MSG_CONFIG, /* connect to a particular queue */
19 struct nfulnl_msg_packet_hdr {
20 __be16 hw_protocol; /* hw protocol (network order) */
21 __u8 hook; /* netfilter hook */
25 struct nfulnl_msg_packet_hw {
31 struct nfulnl_msg_packet_timestamp {
36 enum nfulnl_attr_type {
39 NFULA_MARK, /* __u32 nfmark */
40 NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
41 NFULA_IFINDEX_INDEV, /* __u32 ifindex */
42 NFULA_IFINDEX_OUTDEV, /* __u32 ifindex */
43 NFULA_IFINDEX_PHYSINDEV, /* __u32 ifindex */
44 NFULA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
45 NFULA_HWADDR, /* nfulnl_msg_packet_hw */
46 NFULA_PAYLOAD, /* opaque data payload */
47 NFULA_PREFIX, /* string prefix */
48 NFULA_UID, /* user id of socket */
49 NFULA_SEQ, /* instance-local sequence number */
50 NFULA_SEQ_GLOBAL, /* global sequence number */
51 NFULA_GID, /* group id of socket */
52 NFULA_HWTYPE, /* hardware type */
53 NFULA_HWHEADER, /* hardware header */
54 NFULA_HWLEN, /* hardware header length */
55 NFULA_CT, /* nf_conntrack_netlink.h */
56 NFULA_CT_INFO, /* enum ip_conntrack_info */
60 #define NFULA_MAX (__NFULA_MAX - 1)
62 enum nfulnl_msg_config_cmds {
65 NFULNL_CFG_CMD_UNBIND,
66 NFULNL_CFG_CMD_PF_BIND,
67 NFULNL_CFG_CMD_PF_UNBIND,
70 struct nfulnl_msg_config_cmd {
71 __u8 command; /* nfulnl_msg_config_cmds */
72 } __attribute__ ((packed));
74 struct nfulnl_msg_config_mode {
78 } __attribute__ ((packed));
80 enum nfulnl_attr_config {
82 NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
83 NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
84 NFULA_CFG_NLBUFSIZ, /* __u32 buffer size */
85 NFULA_CFG_TIMEOUT, /* __u32 in 1/100 s */
86 NFULA_CFG_QTHRESH, /* __u32 */
87 NFULA_CFG_FLAGS, /* __u16 */
90 #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
92 #define NFULNL_COPY_NONE 0x00
93 #define NFULNL_COPY_META 0x01
94 #define NFULNL_COPY_PACKET 0x02
95 /* 0xff is reserved, don't use it for new copy modes. */
97 #define NFULNL_CFG_F_SEQ 0x0001
98 #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
99 #define NFULNL_CFG_F_CONNTRACK 0x0004
101 #endif /* _NFNETLINK_LOG_H */