summaryrefslogtreecommitdiffstats
path: root/examples/netfilter
Commit message (Collapse)AuthorAgeFilesLines
* examples: update .gitignore filesDario Binacchi2023-05-221-0/+3
| | | | | | | | The patch adds and modifies the .gitignore files to hide all the examples generated by the compilation. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* include: add MNL_SOCKET_DUMP_SIZE definitionPablo Neira Ayuso2019-10-141-1/+1
| | | | | | | | | | | | | | | | | Add definition to recommend a new buffer size for netlink dumps. Details are available here: commit d35c99ff77ecb2eb239731b799386f3b3637a31e Author: Eric Dumazet <edumazet@google.com> Date: Thu Oct 6 04:13:18 2016 +0900 netlink: do not enter direct reclaim from netlink_dump() iproute2 is using 32 KBytes buffer in netlink dumps to speed up netlink dumps for a while. Let's recommend this buffer size through this new definition. Update examples too. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: nfct-daemon: Fix test building on musl libcKylie McClain2016-07-211-0/+1
| | | | | | | On musl libc, sys/select.h is where FD_* definitions are located. Signed-off-by: Kylie McClain <somasis@exherbo.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* example: netfilter: get rid of aligned_be64 definitionsPablo Neira Ayuso2015-05-262-10/+0
| | | | | | | | | | This is defined in <linux/types.h>, which is included by the nfnetlink_* header files. Thus, we can get rid of u_int64_t which causes problems to musl according to Felix Janda. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples/netfilter: Include <endian.h> for be64tohFelix Janda2015-05-252-0/+2
| | | | | Signed-off-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: use mnl_socket_setsockoptKen-ichirou MATSUZAWA2013-12-071-4/+2
| | | | | | | instead of raw setsockopt() Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: fix display conditionKen-ichirou MATSUZAWA2013-12-071-2/+3
| | | | | Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: use mnl_nlmsg_get_payload()Ken-ichirou MATSUZAWA2013-12-071-1/+1
| | | | | | | not increment (nlmsghdr) pointer Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: fix trivial error messageKen-ichirou MATSUZAWA2013-12-075-19/+19
| | | | | Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
* examples: netfilter: add nfct daemon skeleton codePablo Neira Ayuso2013-07-052-1/+370
| | | | | | | | This patch adds the skeleton code for a daemon that collects statistics via ctnetlink. Consider it a simplified version of ulogd2. It also contains some documentation on several interesting tweaks. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: netfilter: add nfct-dumpPablo Neira Ayuso2013-05-312-0/+322
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* example: release them in the public domainPablo Neira Ayuso2012-01-024-24/+4
| | | | | | | | I have decided to release the examples in this library in the public domain. Jan Engelhardt, who has been the sole contributor so far, has agreed with this re-licensing by communication via e-mail. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: fix wrong group mask number in nfct-eventPablo Neira Ayuso2010-12-171-3/+3
| | | | | | | This patch replaces event group numbers NFNLGRP_CONNTRACK_* by the event group mask NF_NETLINK_CONNTRACK_* Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* nlmsg: add new message batching infrastructurePablo Neira Ayuso2010-12-172-1/+197
| | | | | | | | | This patch adds the new message batching infrastructure that allows to store several messages into one single datagram. This patch includes an example for ctnetlink. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Update .gitignoreJan Engelhardt2010-11-161-0/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* examples: add nflog examplePablo Neira Ayuso2010-11-072-0/+233
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* examples: remove redundant castsJan Engelhardt2010-10-302-5/+5
|
* src: avoid using deprecated unspecified argument listsJan Engelhardt2010-10-221-1/+1
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* src: define MNL_SOCKET_BUFFER_SIZE to 8192ULPablo Neira Ayuso2010-10-212-2/+2
| | | | | | | | | | | | | | | | Davem spotted during the Netfilter Workshop that user-space applications should use 8KB buffers for recv(). I accidentally found that NFLOG is not following this approach (in this case we're using 131072 bytes messages), we have to document this. Anyway, according to linux/netlink.h (and to complete this log message): "skb should fit one page. This choice is good for headerless malloc. But we should limit to 8K so that userspace does not have to use enormous buffer sizes on recvmsg() calls just to avoid MSG_TRUNC when PAGE_SIZE is very large." Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Add .gitignore filesJan Engelhardt2010-10-191-0/+2
| | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* build: remove unneeded -dynamic -ldl -nostartfiles flagsJan Engelhardt2010-10-191-2/+0
| | | | | | | | | Besides that -ldl should be in _LDADD (not _LDFLAGS), I do not see any dlopen calls at all that would make the library a requirement. I also see no reason to use -Wc,-nostartfiles. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* examples: put examples files into specific directoriesPablo Neira Ayuso2010-09-083-0/+509
put examples files into specific directories according to the Netlink bus they work with. And minor update in the readme file Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>