libnl: Conntrack

libnl 3.12.0

Conntrack
Netfilter Library (libnl-nf)

## Macros
#define | NFNLMSG_CT_TYPE(type)

## Functions
int | nfnlmsg_ct_group (struct nlmsghdr *nlh)
int | nfnlmsg_ct_parse (struct nlmsghdr *nlh, struct nfnl_ct **result)
int | nfnlmsg_ct_parse_nested (struct nlattr *attr, struct nfnl_ct **result)
int | nfnl_ct_dump_request (struct nl_sock *sk)
| Send nfnl ct dump request.
int | nfnl_ct_build_add_request (const struct nfnl_ct *ct, int flags, struct nl_msg **result)
int | nfnl_ct_add (struct nl_sock *sk, const struct nfnl_ct *ct, int flags)
int | nfnl_ct_build_delete_request (const struct nfnl_ct *ct, int flags, struct nl_msg **result)
int | nfnl_ct_del (struct nl_sock *sk, const struct nfnl_ct *ct, int flags)
int | nfnl_ct_build_query_request (const struct nfnl_ct *ct, int flags, struct nl_msg **result)
int | nfnl_ct_query (struct nl_sock *sk, const struct nfnl_ct *ct, int flags)

## Cache Management
int | nfnl_ct_alloc_cache (struct nl_sock *sk, struct nl_cache **result)
| Build a conntrack cache holding all conntrack currently in the kernel.

## Detailed Description

## Macro Definition Documentation

## ◆ NFNLMSG_CT_TYPE

#define NFNLMSG_CT_TYPE | ( |  | type | ) |

Value:
NFNLMSG_TYPE(NFNL_SUBSYS_CTNETLINK, (type))

Definition at line 694 of file ct.c.

## Function Documentation

## ◆ nfnlmsg_ct_group()

int nfnlmsg_ct_group | ( | struct nlmsghdr * | nlh | ) |

Definition at line 282 of file ct.c.

## ◆ nfnlmsg_ct_parse()

int nfnlmsg_ct_parse | ( | struct nlmsghdr * | nlh,
|  | struct nfnl_ct ** | result )

Definition at line 370 of file ct.c.

## ◆ nfnlmsg_ct_parse_nested()

int nfnlmsg_ct_parse_nested | ( | struct nlattr * | attr,
|  | struct nfnl_ct ** | result )

Definition at line 400 of file ct.c.

## ◆ nfnl_ct_dump_request()

int nfnl_ct_dump_request | ( | struct nl_sock * | sk | ) |

Send nfnl ct dump request.

Parameters

  sk | Netlink socket.

Returns
  0 on success or a negative error code. Due to a bug, this function returns the number of bytes sent. Treat any non-negative number as success.

Definition at line 452 of file ct.c.

References nfnl_send_simple().

Here is the call graph for this function:

## ◆ nfnl_ct_build_add_request()

int nfnl_ct_build_add_request | ( | const struct nfnl_ct * | ct,
|  | int | flags,
|  | struct nl_msg ** | result )

Definition at line 592 of file ct.c.

## ◆ nfnl_ct_add()

int nfnl_ct_add | ( | struct nl_sock * | sk,
|  | const struct nfnl_ct * | ct,
|  | int | flags )

Definition at line 598 of file ct.c.

## ◆ nfnl_ct_build_delete_request()

int nfnl_ct_build_delete_request | ( | const struct nfnl_ct * | ct,
|  | int | flags,
|  | struct nl_msg ** | result )

Definition at line 614 of file ct.c.

## ◆ nfnl_ct_del()

int nfnl_ct_del | ( | struct nl_sock * | sk,
|  | const struct nfnl_ct * | ct,
|  | int | flags )

Definition at line 620 of file ct.c.

## ◆ nfnl_ct_build_query_request()

int nfnl_ct_build_query_request | ( | const struct nfnl_ct * | ct,
|  | int | flags,
|  | struct nl_msg ** | result )

Definition at line 636 of file ct.c.

## ◆ nfnl_ct_query()

int nfnl_ct_query | ( | struct nl_sock * | sk,
|  | const struct nfnl_ct * | ct,
|  | int | flags )

Definition at line 642 of file ct.c.

## ◆ nfnl_ct_alloc_cache()

int nfnl_ct_alloc_cache | ( | struct nl_sock * | sk,
|  | struct nl_cache ** | result )

Build a conntrack cache holding all conntrack currently in the kernel.

Parameters

  sk | Netlink socket.
  result | Pointer to store resulting cache.

Allocates a new cache, initializes it properly and updates it to contain all conntracks currently in the kernel.

Returns
  0 on success or a negative error code.

Definition at line 673 of file ct.c.

References nl_cache_alloc_and_fill().

Here is the call graph for this function: