Man page - nflog_nlmsg_snprintf(3)
Packages contains this manual
- nflog_snprintf_xml(3)
- nflog_nlmsg_parse(3)
- nflog_unbind_pf(3)
- nflog_get_physindev(3)
- nflog_unbind_group(3)
- nflog_set_qthresh(3)
- nflog_fd(3)
- nflog_get_uid(3)
- nflog_bind_group(3)
- nflog_set_timeout(3)
- nflog_nlmsg_put_header(3)
- nflog_get_seq_global(3)
- nflog_get_msg_packet_hwhdr(3)
- nflog_get_payload(3)
- nflog_get_hwtype(3)
- nflog_get_gid(3)
- nflog_nlmsg_snprintf(3)
- nflog_get_physoutdev(3)
- nflog_callback_register(3)
- nflog_bind_pf(3)
- nflog_close(3)
- nflog_set_flags(3)
- nflog_get_nfmark(3)
- nflog_set_nlbufsiz(3)
- nflog_get_msg_packet_hdr(3)
- nflog_set_mode(3)
- nflog_get_seq(3)
- nflog_attr_put_cfg_mode(3)
- nflog_get_timestamp(3)
- nflog_get_indev(3)
- nflog_attr_put_cfg_cmd(3)
- nflog_get_prefix(3)
- nflog_get_outdev(3)
- nflog_get_packet_hw(3)
- nflog_get_ctid(3)
- nflog_handle_packet(3)
- nflog_get_msg_packet_hwhdrlen(3)
- nflog_open(3)
apt-get install libnetfilter-log-doc
Manual
nlmsg
NAMESYNOPSIS
Function Documentation
int nflog_attr_put_cfg_cmd (struct nlmsghdr * nlh, uint8_t cmd)
int nflog_attr_put_cfg_mode (struct nlmsghdr * nlh, uint8_t mode, uint32_trange)
int nflog_nlmsg_parse (const struct nlmsghdr * nlh, struct nlattr ** attr)
struct nlmsghdr * nflog_nlmsg_put_header (char * buf, uint8_t type, uint8_tfamily, uint16_t gnum)
int nflog_nlmsg_snprintf (char * buf, size_t bufsiz, const struct nlmsghdr* nlh, struct nlattr ** attr, enum nflog_output_type type, uint32_tflags)
Author
NAME
nflog_nlmsg_put_header, nflog_attr_put_cfg_mode, nflog_attr_put_cfg_cmd, nflog_nlmsg_parse, nflog_nlmsg_snprintf - Netlink message helper functions
SYNOPSIS
#include
<netinet/in.h>
#include <libnetfilter_log/libnetfilter_log.h>
struct nlmsghdr
*
nflog_nlmsg_put_header
(char *buf, uint8_t type,
uint8_t family, uint16_t gnum)
int
nflog_attr_put_cfg_mode
(struct nlmsghdr *nlh,
uint8_t mode, uint32_t range)
int
nflog_attr_put_cfg_cmd
(struct nlmsghdr *nlh,
uint8_t cmd)
int
nflog_nlmsg_parse
(const struct nlmsghdr *nlh,
struct nlattr **attr)
int
nflog_nlmsg_snprintf
(char *buf, size_t bufsiz,
const struct nlmsghdr *nlh, struct nlattr **attr, enum
nflog_output_type type, uint32_t flags)
Function Documentation
int nflog_attr_put_cfg_cmd (struct nlmsghdr * nlh, uint8_t cmd)
nflog_attr_put_cfg_cmd - add a command attribute to nflog netlink message
Parameters
nlh
pointer to netlink
message
cmd
one of the enum nfulnl_msg_config_cmds
Returns
0
Definition at line 84 of file nlmsg.c .
int nflog_attr_put_cfg_mode (struct nlmsghdr * nlh, uint8_t mode, uint32_trange)
nflog_attr_put_cfg_mode - add a mode attribute to nflog netlink message
Parameters
nlh
pointer to netlink
message
mode
copy mode: NFULNL_COPY_NONE, NFULNL_COPY_META or
NFULNL_COPY_PACKET
range
copy range
Returns
0
Definition at line 64 of file nlmsg.c .
int nflog_nlmsg_parse (const struct nlmsghdr * nlh, struct nlattr ** attr)
nflog_nlmsg_parse - set nlattrs from netlink message
Parameters
nlh
pointer to netlink
message
attr
pointer to an array of nlattr of size NFULA_MAX +
1
Returns
0
Definition at line 162 of file nlmsg.c .
struct nlmsghdr * nflog_nlmsg_put_header (char * buf, uint8_t type, uint8_tfamily, uint16_t gnum)
nflog_nlmsg_put_header - populate memory buffer with nflog Netlink headers
Parameters
buf
pointer to memory
buffer
type
either NFULNL_MSG_PACKET or NFULNL_MSG_CONFIG (enum
nfulnl_msg_types)
family
protocol family
gnum
group number
Initialises buf to start with a netlink header for the log subsystem followed by an nfnetlink header with the log group
Returns
pointer to created Netlink header structure
Definition at line 39 of file nlmsg.c .
int nflog_nlmsg_snprintf (char * buf, size_t bufsiz, const struct nlmsghdr* nlh, struct nlattr ** attr, enum nflog_output_type type, uint32_tflags)
nflog_nlmsg_snprintf - print a nflog nlattrs to a buffer
Parameters
buf
buffer used to build
the printable nflog
bufsiz
size of the buffer
nlh
pointer to netlink message (to get queue num in the
future)
attr
pointer to an array of nlattr of size NFULA_MAX + 1
type
print message type in enum nflog_output_type
flags
The flag that tell what to print into the
buffer
This function supports the following types / flags:
type: NFLOG_OUTPUT_XML
|
• |
NFLOG_XML_PREFIX: include the string prefix |
|||
|
• |
NFLOG_XML_HW: include the hardware link layer address |
|||
|
• |
NFLOG_XML_MARK: include the packet mark |
|||
|
• |
NFLOG_XML_DEV: include the device information |
|||
|
• |
NFLOG_XML_PHYSDEV: include the physical device information |
|||
|
• |
NFLOG_XML_PAYLOAD: include the payload (in hexadecimal) |
|||
|
• |
NFLOG_XML_TIME: include the timestamp |
|||
|
• |
NFLOG_XML_ALL: include all the logging information (all flags set) |
You can combine these flags with a bitwise OR.
Returns
-1 on failure else same as snprintf
Errors
EOPNOTSUPP type is unsupported (i.e. not NFLOG_OUTPUT_XML )
See also
snprintf (3)
Definition at line 196 of file nlmsg.c .
Author
Generated automatically by Doxygen for libnetfilter_log from the source code.