Age | Commit message (Collapse) | Author |
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
values.h is not present on other systems, and the glibc copy reads
right away: Old compatibility names for <limits.h> and <float.h>
constants.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Patrick reports that the doxygen output shows up EXPORT_SYMBOL
and tells how to fix this:
> I just noticed the EXPORT_SYMBOLs in libmnl showing up in
> the doxygen output. Just in case you want to avoid this,
> what I'm doing in libdect is (besides the appopriate linker
> flags):
>
> #define __visible __attribute__((visibility("default")))
>
> #define EXPORT_SYMBOL(x) typeof(x) (x) __visible
>
>
> This allows to use EXPORT_SYMBOL as in the kernel, IOW
> after the function definition.
This patch also removes -Wredundant-decls to avoid a warning in every
single use of this new approach.
Now, this looks more like the Linux kernel way of exporting symbols.
Reported-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
The usage text already specified [family] as optional, now implement it :-)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Running `genl-family-get VFS_DQUOT` forgets to print a newline.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
|
|
Calculating AC_CANONICAL_TARGET is superfluous, because libmnl
is not a code generator.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
This patch fixes the following warnings:
netlink.c:121: warning: pointer of type ‘void *’ used in arithmetic
netlink.c:121: warning: pointer of type ‘void *’ used in subtraction
We cannot use type void * for pointer arithmetic operations.
This was introduced in 478dc5f4ab8d0a639d1bafe3bd53ff3309727836
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This patch fixes the following compilation warning:
warning: comparison between signed and unsigned integer expressions
warning: signed and unsigned type in conditional expression
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Davem suggested to add a copy of linux/netlink.h to avoid compilation
problems in all cases scenarios.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
When a project uses MNL_SOCKET_BUFFER_SIZE without having included
unistd.h, it gets:
mystuff.c:36:2: warning: implicit declaration of function "getpagesize"
It is libmnl's job to include this, since mystuff.c did not use
getpagesize anywhere.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
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>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
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>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This system call returns PAGE_SIZE which depends on the
architecture. See linux/netlink.h for more information
on the appropriate datagram size for netlink.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This patch adds a set of function that allows to check the
size of the buffer. This is useful for attribute batching.
This is strongly based on a patch from Jozsef.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This patch defines a new function __mnl_cb_run() which is inlined in
mnl_cb_run() and mnl_cb_run2(). This patch increases the size of the
library in ~1KB. IIRC, Davem suggested this during the Netfilter
Workshop.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This patch adds MNL_ARRAY_SIZE(x) which likely to defined over
and over again if you use mnl_cb_run2(...).
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This patch adds mnl_attr_nest_cancel() that allows to cancel the
current nest that we are building.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
This fixes `make distcheck'.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
With the new CFLAGS, a notification pops up:
nlmsg.c:64:8: warning: no previous prototype for "mnl_nlmsg_aligned_size"
Marking it thus as static reveals it can be removed.
nlmsg.c:64:15: warning: "mnl_nlmsg_aligned_size" defined but not used
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Remove function whose implementation does not exist. It seems to me
like a leftover from the early days of the library.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Existing contributors ACK'ed the license change via email:
* Jozsef Kadlecsik
* Jan Engelhardt
* Cristian Rodríguez
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
sendto/recvfrom return ssize_t, so libmnl should not truncate the
result range.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
When nesting two mnl_attr_for_each loops, the __len__ variable will be
declared twice, eliciting a warning when -Wshadow is turned on. There
can also be warnings in pre-C99 because declarations and code are
mixed. Do without any temporaries that are not explicitly specified as
macro parameters.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Read "How to write shared libraries" from Ulrich Drepper for more
information on this patch. Specifically section 2.2: Export control
and section 3: Maintaining APIs and ABIs.
Signed-off-by: Cristian Rodríguez <cristian.rodriguez@opensuse.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Calling mnl_attr_parse with cb==NULL is pointless, because the
function will do nothing else.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
|
This patch reworks mnl_nlmsg_fprintf. It breaks backward compatibility
of this function, there was no way to improve it without doing so
(and we are still in time to break thing, BTW).
Signed-off-bu: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
|
libtool automatically adds PIC flags as needed.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
|
|
A small little pedantism: NULL (as in, the pointer) isn't NUL (as in,
the character with value zero, '\0'). I propose to rename it to strz,
for the zero-terminated string (sometimes referred to as ASCIZ string,
but of course C isn't tied to ASCII).
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
groups, being a bitmask, should be unsigned; and let's also use pid_t
for pid.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
Because in most cases, it won't be a nul-terminated string :)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|
|
I do not quite see the point of using strlen in conjunction with
non-string data; so let's use char * as argument types to catch
misuses.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
|