summaryrefslogtreecommitdiffstats
path: root/examples/nfct-mnl-create.c
Commit message (Collapse)AuthorAgeFilesLines
* examples: check return value of nfct_nlmsg_build()Eyal Birger2021-01-031-1/+5
| | | | | | | | | | | | | | | | nfct_nlmsg_build() may fail for different reasons, for example if insufficient parameters exist in the ct object. The resulting nlh would not contain any of the ct attributes. Some conntrack operations would still operate in such case, for example an IPCTNL_MSG_CT_DELETE message would just delete all existing conntrack entries. While the example as it is does supply correct parameters, it's safer as reference to validate the return value. Signed-off-by: Eyal Birger <eyal.birger@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: add example using libmnl and the new low-level API (conntrack)Pablo Neira Ayuso2012-05-261-0/+86
This patch adds the following examples: nfct-mnl-create nfct-mnl-del nfct-mnl-dump nfct-mnl-event nfct-mnl-flush nfct-mnl-get Basically, we re-use the existing object oriented handling and we provide full control on the netlink socket at the same time. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>