2005-08-10 02:58:39 +00:00
|
|
|
#ifndef _NFNETLINK_LOG_H
|
|
|
|
#define _NFNETLINK_LOG_H
|
|
|
|
|
|
|
|
/* This file describes the netlink messages (i.e. 'protocol packets'),
|
|
|
|
* and not any kind of function definitions. It is shared between kernel and
|
|
|
|
* userspace. Don't put kernel specific stuff in here */
|
|
|
|
|
2005-08-13 20:55:44 +00:00
|
|
|
#include <linux/types.h>
|
2005-08-10 02:58:39 +00:00
|
|
|
#include <linux/netfilter/nfnetlink.h>
|
|
|
|
|
|
|
|
enum nfulnl_msg_types {
|
|
|
|
NFULNL_MSG_PACKET, /* packet from kernel to userspace */
|
|
|
|
NFULNL_MSG_CONFIG, /* connect to a particular queue */
|
|
|
|
|
|
|
|
NFULNL_MSG_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfulnl_msg_packet_hdr {
|
2006-11-08 08:26:51 +00:00
|
|
|
__be16 hw_protocol; /* hw protocol (network order) */
|
2005-08-10 02:58:39 +00:00
|
|
|
u_int8_t hook; /* netfilter hook */
|
|
|
|
u_int8_t _pad;
|
2006-08-22 07:43:20 +00:00
|
|
|
};
|
2005-08-10 02:58:39 +00:00
|
|
|
|
|
|
|
struct nfulnl_msg_packet_hw {
|
2006-11-08 08:26:51 +00:00
|
|
|
__be16 hw_addrlen;
|
2005-08-10 02:58:39 +00:00
|
|
|
u_int16_t _pad;
|
|
|
|
u_int8_t hw_addr[8];
|
2006-08-22 07:43:20 +00:00
|
|
|
};
|
2005-08-10 02:58:39 +00:00
|
|
|
|
|
|
|
struct nfulnl_msg_packet_timestamp {
|
2006-11-08 08:26:51 +00:00
|
|
|
aligned_be64 sec;
|
|
|
|
aligned_be64 usec;
|
2006-08-22 07:43:20 +00:00
|
|
|
};
|
2005-08-10 02:58:39 +00:00
|
|
|
|
|
|
|
enum nfulnl_attr_type {
|
|
|
|
NFULA_UNSPEC,
|
|
|
|
NFULA_PACKET_HDR,
|
|
|
|
NFULA_MARK, /* u_int32_t nfmark */
|
|
|
|
NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */
|
|
|
|
NFULA_IFINDEX_INDEV, /* u_int32_t ifindex */
|
|
|
|
NFULA_IFINDEX_OUTDEV, /* u_int32_t ifindex */
|
2005-08-10 03:22:10 +00:00
|
|
|
NFULA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */
|
|
|
|
NFULA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */
|
2005-08-10 02:58:39 +00:00
|
|
|
NFULA_HWADDR, /* nfulnl_msg_packet_hw */
|
|
|
|
NFULA_PAYLOAD, /* opaque data payload */
|
|
|
|
NFULA_PREFIX, /* string prefix */
|
|
|
|
NFULA_UID, /* user id of socket */
|
2006-03-21 01:15:11 +00:00
|
|
|
NFULA_SEQ, /* instance-local sequence number */
|
|
|
|
NFULA_SEQ_GLOBAL, /* global sequence number */
|
2007-12-18 06:41:52 +00:00
|
|
|
NFULA_GID, /* group id of socket */
|
2005-08-10 02:58:39 +00:00
|
|
|
|
|
|
|
__NFULA_MAX
|
|
|
|
};
|
|
|
|
#define NFULA_MAX (__NFULA_MAX - 1)
|
|
|
|
|
|
|
|
enum nfulnl_msg_config_cmds {
|
|
|
|
NFULNL_CFG_CMD_NONE,
|
|
|
|
NFULNL_CFG_CMD_BIND,
|
|
|
|
NFULNL_CFG_CMD_UNBIND,
|
|
|
|
NFULNL_CFG_CMD_PF_BIND,
|
|
|
|
NFULNL_CFG_CMD_PF_UNBIND,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfulnl_msg_config_cmd {
|
|
|
|
u_int8_t command; /* nfulnl_msg_config_cmds */
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct nfulnl_msg_config_mode {
|
2006-11-08 08:26:51 +00:00
|
|
|
__be32 copy_range;
|
2005-08-10 02:58:39 +00:00
|
|
|
u_int8_t copy_mode;
|
|
|
|
u_int8_t _pad;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
enum nfulnl_attr_config {
|
|
|
|
NFULA_CFG_UNSPEC,
|
|
|
|
NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */
|
|
|
|
NFULA_CFG_MODE, /* nfulnl_msg_config_mode */
|
|
|
|
NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */
|
|
|
|
NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */
|
|
|
|
NFULA_CFG_QTHRESH, /* u_int32_t */
|
2006-03-21 01:15:11 +00:00
|
|
|
NFULA_CFG_FLAGS, /* u_int16_t */
|
2005-08-10 02:58:39 +00:00
|
|
|
__NFULA_CFG_MAX
|
|
|
|
};
|
|
|
|
#define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
|
|
|
|
|
|
|
|
#define NFULNL_COPY_NONE 0x00
|
|
|
|
#define NFULNL_COPY_META 0x01
|
|
|
|
#define NFULNL_COPY_PACKET 0x02
|
|
|
|
|
2006-03-21 01:15:11 +00:00
|
|
|
#define NFULNL_CFG_F_SEQ 0x0001
|
|
|
|
#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
|
|
|
|
|
2005-08-10 02:58:39 +00:00
|
|
|
#endif /* _NFNETLINK_LOG_H */
|