libnetfilter_queue  1.0.3
Config helpers


void nfq_nlmsg_cfg_put_cmd (struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
void nfq_nlmsg_cfg_put_params (struct nlmsghdr *nlh, uint8_t mode, int range)
void nfq_nlmsg_cfg_put_qmaxlen (struct nlmsghdr *nlh, uint32_t queue_maxlen)

Detailed Description

Function Documentation

void nfq_nlmsg_cfg_put_cmd ( struct nlmsghdr *  nlh,
uint16_t  pf,
uint8_t  cmd 

nfq_nlmsg_cfg_build_request- build netlink config message

bufBuffer where netlink message is going to be written.
cfgStructure that contains the config parameters.
commandnfqueue nfnetlink command.

This function returns a pointer to the netlink message. If something goes wrong it returns NULL.

Possible commands are:

  • NFQNL_CFG_CMD_NONE: Do nothing. It can be useful to know if the queue subsystem is working.
  • NFQNL_CFG_CMD_BIND: Binds the program to a specific queue.
  • NFQNL_CFG_CMD_UNBIND: Unbinds the program to a specifiq queue.

Obsolete commands:

  • NFQNL_CFG_CMD_PF_BIND: Binds to process packets belonging to the given protocol family (ie. PF_INET, PF_INET6, etc).
  • NFQNL_CFG_CMD_PF_UNBIND: Unbinds from processing packets belonging to the given protocol family. Both commands are ignored by Linux kernel 3.8 and later versions.

Definition at line 88 of file nlmsg.c.