logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

nflog_nlmsg_put_header, nflog_attr_put_cfg_mode, nflog_attr_put_cfg_cmd, nflog_nlmsg_parse,

Author

       Generated automatically by Doxygen for libnetfilter_log from the source code.

libnetfilter_log                                  Version 1.0.2                                         nlmsg(3)

Function Documentation

intnflog_attr_put_cfg_cmd(structnlmsghdr*nlh,uint8_tcmd)
       nflog_attr_put_cfg_cmd - add a command attribute to nflog netlink message

       Parametersnlh pointer to netlink message
           cmd one of the enum nfulnl_msg_config_cmds

       Returns
           0

       Definition at line 84 of file nlmsg.c.

   intnflog_attr_put_cfg_mode(structnlmsghdr*nlh,uint8_tmode,uint32_trange)
       nflog_attr_put_cfg_mode - add a mode attribute to nflog netlink message

       Parametersnlh 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.

   intnflog_nlmsg_parse(conststructnlmsghdr*nlh,structnlattr**attr)
       nflog_nlmsg_parse - set nlattrs from netlink message

       Parametersnlh 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.

   structnlmsghdr*nflog_nlmsg_put_header(char*buf,uint8_ttype,uint8_tfamily,uint16_tgnum)
       nflog_nlmsg_put_header - populate memory buffer with nflog Netlink headers

       Parametersbuf 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.

   intnflog_nlmsg_snprintf(char*buf,size_tbufsiz,conststructnlmsghdr*nlh,structnlattr**attr,enumnflog_output_typetype,uint32_tflags)
       nflog_nlmsg_snprintf - print a nflog nlattrs to a buffer

       Parametersbuf 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

       ErrorsEOPNOTSUPPtype is unsupported (i.e. not NFLOG_OUTPUT_XML)

       Seealsosnprintf(3)

       Definition at line 196 of file nlmsg.c.

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)

See Also