summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-10-14 11:05:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-10-14 11:14:26 +0200
commit957dbe6fdc10ab6e25e90af503e78fc8c8c49b72 (patch)
tree497c536df219990ff14c8e6fe5e22333f9b3e9d6 /examples
parent9d35bd34196ba8aa044552c3f45b92fe70557627 (diff)
include: add MNL_SOCKET_DUMP_SIZE definitionHEADmaster
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>
Diffstat (limited to 'examples')
-rw-r--r--examples/netfilter/nfct-dump.c2
-rw-r--r--examples/rtnl/rtnl-addr-dump.c4
-rw-r--r--examples/rtnl/rtnl-link-dump.c4
-rw-r--r--examples/rtnl/rtnl-link-dump2.c4
-rw-r--r--examples/rtnl/rtnl-link-dump3.c4
-rw-r--r--examples/rtnl/rtnl-neigh-dump.c4
-rw-r--r--examples/rtnl/rtnl-route-dump.c4
7 files changed, 13 insertions, 13 deletions
diff --git a/examples/netfilter/nfct-dump.c b/examples/netfilter/nfct-dump.c
index 114af61..cb8e52c 100644
--- a/examples/netfilter/nfct-dump.c
+++ b/examples/netfilter/nfct-dump.c
@@ -263,8 +263,8 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(void)
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct nfgenmsg *nfh;
uint32_t seq, portid;
diff --git a/examples/rtnl/rtnl-addr-dump.c b/examples/rtnl/rtnl-addr-dump.c
index b92b75f..675e9b0 100644
--- a/examples/rtnl/rtnl-addr-dump.c
+++ b/examples/rtnl/rtnl-addr-dump.c
@@ -76,12 +76,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(int argc, char *argv[])
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtgenmsg *rt;
int ret;
- unsigned int seq, portid;
if (argc != 2) {
fprintf(stderr, "Usage: %s <inet|inet6>\n", argv[0]);
diff --git a/examples/rtnl/rtnl-link-dump.c b/examples/rtnl/rtnl-link-dump.c
index f5d6312..031346f 100644
--- a/examples/rtnl/rtnl-link-dump.c
+++ b/examples/rtnl/rtnl-link-dump.c
@@ -81,12 +81,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(void)
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtgenmsg *rt;
int ret;
- unsigned int seq, portid;
nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = RTM_GETLINK;
diff --git a/examples/rtnl/rtnl-link-dump2.c b/examples/rtnl/rtnl-link-dump2.c
index b3ca3fa..890e51a 100644
--- a/examples/rtnl/rtnl-link-dump2.c
+++ b/examples/rtnl/rtnl-link-dump2.c
@@ -54,12 +54,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(void)
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtgenmsg *rt;
int ret;
- unsigned int seq, portid;
nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = RTM_GETLINK;
diff --git a/examples/rtnl/rtnl-link-dump3.c b/examples/rtnl/rtnl-link-dump3.c
index 2521214..a381da1 100644
--- a/examples/rtnl/rtnl-link-dump3.c
+++ b/examples/rtnl/rtnl-link-dump3.c
@@ -54,12 +54,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(void)
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtgenmsg *rt;
int ret;
- unsigned int seq, portid;
nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = RTM_GETLINK;
diff --git a/examples/rtnl/rtnl-neigh-dump.c b/examples/rtnl/rtnl-neigh-dump.c
index f4d5000..786e31d 100644
--- a/examples/rtnl/rtnl-neigh-dump.c
+++ b/examples/rtnl/rtnl-neigh-dump.c
@@ -99,12 +99,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(int argc, char *argv[])
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtgenmsg *rt;
int ret;
- unsigned int seq, portid;
if (argc != 2) {
fprintf(stderr, "Usage: %s <inet|inet6>\n", argv[0]);
diff --git a/examples/rtnl/rtnl-route-dump.c b/examples/rtnl/rtnl-route-dump.c
index 17da80b..02ac6b2 100644
--- a/examples/rtnl/rtnl-route-dump.c
+++ b/examples/rtnl/rtnl-route-dump.c
@@ -298,12 +298,12 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main(int argc, char *argv[])
{
+ char buf[MNL_SOCKET_DUMP_SIZE];
+ unsigned int seq, portid;
struct mnl_socket *nl;
- char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct rtmsg *rtm;
int ret;
- unsigned int seq, portid;
if (argc != 2) {
fprintf(stderr, "Usage: %s <inet|inet6>\n", argv[0]);