Netlink message helper functions

## Functions

struct nlmsghdr __EXPORTED * | nfct_helper_nlmsg_build_hdr (char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
void __EXPORTED | nfct_helper_nlmsg_build_payload (struct nlmsghdr *nlh, struct nfct_helper *h)
int __EXPORTED | nfct_helper_nlmsg_parse_payload (const struct nlmsghdr *nlh, struct nfct_helper *h)

## Detailed Description

## Function Documentation

## nfct_helper_nlmsg_build_hdr()

struct nlmsghdr __EXPORTED * nfct_helper_nlmsg_build_hdr | ( | char * | buf,
|  | uint8_t | cmd,
|  | uint16_t | flags,
|  | uint32_t | seq
| ) |  |

nfct_helper_nlmsg_build_hdr - build netlink message header for nfct_helper subsystem

Parameters

  buf | buffer where this function outputs the netlink message.
  cmd | nfct_helper nfnetlink command.
  flags | netlink flags.
  seq | sequence number for this message.

Possible commands:

- NFNL_MSG_ACCT_NEW: new helper object.
- NFNL_MSG_ACCT_GET: get helper object.
- NFNL_MSG_ACCT_GET_CTRZERO: get helper object and atomically reset.

Examples:

- Command NFNL_MSG_ACCT_NEW + flags NLM_F_CREATE | NLM_F_ACK, to create one new helper object (if it does not already exists). You receive one acknoledgment in any case with the result of the operation.
- Command NFNL_MSG_ACCT_GET + flags NLM_F_DUMP, to obtain all the existing helper objects.
- Command NFNL_MSG_ACCT_DEL, to delete all existing unused objects.
- Command NFNL_MSG_ACCT_DEL, to delete one specific nfct_helper object (if unused, otherwise you hit EBUSY).

Definition at line 480 of file libnetfilter_cthelper.c.

## nfct_helper_nlmsg_build_payload()

void __EXPORTED nfct_helper_nlmsg_build_payload | ( | struct nlmsghdr * | nlh,
|  | struct nfct_helper * | h
| ) |  |

nfct_helper_nlmsg_build_payload - build payload from helper object

Parameters

  nlh | netlink message that you want to use to add the payload.
  nfct_helper | pointer to a helper object

Definition at line 519 of file libnetfilter_cthelper.c.

## nfct_helper_nlmsg_parse_payload()

int __EXPORTED nfct_helper_nlmsg_parse_payload | ( | const struct nlmsghdr * | nlh,
|  | struct nfct_helper * | h
| ) |  |

nfct_helper_nlmsg_parse_payload - set helper object attributes from message

Parameters

  nlh | netlink message that you want to use to add the payload.
  nfct_helper | pointer to a helper object

This function returns -1 in case that some mandatory attributes are missing. On sucess, it returns 0.

Definition at line 782 of file libnetfilter_cthelper.c.