libnetfilter_log
1.0.1
|
Functions | |
struct nlmsghdr * | nflog_nlmsg_put_header (char *buf, uint8_t type, uint8_t family, uint16_t qnum) |
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) |
int nflog_attr_put_cfg_cmd | ( | struct nlmsghdr * | nlh, |
uint8_t | cmd | ||
) |
nflog_attr_put_cfg_cmd - add a cmd attribute to nflog netlink message
nlh | pointer to the netlink message |
cmd | command one of the enum nfulnl_msg_config_cmds |
this function returns -1 and errno is explicitly set on error. On success, this function returns 1.
int nflog_attr_put_cfg_mode | ( | struct nlmsghdr * | nlh, |
uint8_t | mode, | ||
uint32_t | range | ||
) |
nflog_attr_put_cfg_mode - add a mode attribute to nflog netlink message
nlh | pointer to the netlink message |
mode | copy mode defined in linux/netfilter/nfnetlink_log.h |
range | copy range |
this function returns -1 and errno is explicitly set on error. On success, this function returns 1.
int nflog_nlmsg_parse | ( | const struct nlmsghdr * | nlh, |
struct nlattr ** | attr | ||
) |
struct nlmsghdr* nflog_nlmsg_put_header | ( | char * | buf, |
uint8_t | type, | ||
uint8_t | family, | ||
uint16_t | qnum | ||
) |
nflog_nlmsg_put_header - reserve and prepare room for nflog Netlink header
buf | memory already allocated to store the Netlink header |
type | message type one of the enum nfulnl_msg_types |
family | protocol family to be an object of |
qnum | queue number to be an object of |
This function creates Netlink header in the memory buffer passed as parameter that will send to nfnetlink log. This function returns a pointer to the Netlink header structure.
int nflog_nlmsg_snprintf | ( | char * | buf, |
size_t | bufsiz, | ||
const struct nlmsghdr * | nlh, | ||
struct nlattr ** | attr, | ||
enum nflog_output_type | type, | ||
uint32_t | flags | ||
) |
nflog_nlmsg_snprintf - print a nflog nlattrs to a buffer
buf | buffer used to build the printable nflog |
bufsiz | size of the buffer |
nlh | netlink message (to get queue num in the futuer) |
attr | pointer to a nflog attrs |
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 type - flags:
type: NFLOG_OUTPUT_XML
You can combine this flags with an binary OR.
this function returns -1 and errno is explicitly set in case of failure, otherwise the length of the string that would have been printed into the buffer (in case that there is enough room in it). See snprintf() return value for more information.