summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-11-19build: tag function headers rather than decls as exportedJan Engelhardt
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-11-19nlmsg: remove unexisting mnl_nlmsg_total_sizePablo Neira Ayuso
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>
2010-11-19license: change licensing terms from GPLv2+ to LGPLv2.1+Pablo Neira Ayuso
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>
2010-11-16Update .gitignoreJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-11-16socket: propagate sendto/recvmsg's return typesJan Engelhardt
sendto/recvfrom return ssize_t, so libmnl should not truncate the result range. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-11-16attr: avoid multiple definition of hidden variableJan Engelhardt
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>
2010-11-15include: use C++ headers in C++ modeJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-11-15src: implement both GCC visibility support and export scriptCristian Rodríguez
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>
2010-11-11attr: remove redundant check for NULLJan Engelhardt
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>
2010-11-11nlmsg: use bool for mnl_nlmsg_ok()Jan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-11-11socket: constify a struct sockaddr_nlJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-11-07Merge branch 'master' of git://dev.medozas.de/libmnlPablo Neira Ayuso
2010-11-07nlmsg: rework mnl_nlmsg_fprintfPablo Neira Ayuso
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>
2010-11-07examples: add nflog examplePablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-11-05build: remove statements without obvious effectJan Engelhardt
2010-10-31build: remove -fPIC flagJan Engelhardt
libtool automatically adds PIC flags as needed. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-30examples: remove redundant castsJan Engelhardt
2010-10-25attr: rename str_null from NULL awayJan Engelhardt
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>
2010-10-25nlmsg: use bool return type for yes-no functionsJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-10-22include: add cplusplus guards for externJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22socket: use more appropriate types for mnl_socket_bindJan Engelhardt
groups, being a bitmask, should be unsigned; and let's also use pid_t for pid. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22callback: mnl_cb_run should use a void *Jan Engelhardt
Because in most cases, it won't be a nul-terminated string :) Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22attr: string functions should take char *Jan Engelhardt
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>
2010-10-22include: consistent usage of "extern"Jan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22doc: documentation updatesJan Engelhardt
Spelling, grammer, and synchronization of the readme. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22socket: remove statement with no effectJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22src: remove redundant castsJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22src: add const qualifiersJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22src: avoid using deprecated unspecified argument listsJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-22build: fix disable_static functionalityJan Engelhardt
Small slip on my part. AC_DISABLE_STATIC must actually come before LT_INIT to have any effect. (This is even documented.) Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-21doc: git tree update (now at netfilter.org) and fix listing in doxygenPablo Neira Ayuso
This patch update the git tree address (now at netfilter.org) and it also fixes a minor problem with the doxygen output in one of the socket helpers. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-10-21src: define MNL_SOCKET_BUFFER_SIZE to 8192ULPablo Neira Ayuso
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>
2010-10-19Add .gitignore filesJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: default to not build static librariesJan Engelhardt
Users wanting static libraries can just use ./configure --enable-static. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: remove unneeded -dynamic -ldl -nostartfiles flagsJan Engelhardt
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>
2010-10-19build: resolve compiler warningsJan Engelhardt
nlmsg.c: In function "mnl_nlmsg_fprintf": nlmsg.c:260:4: warning: format "%.3d" expects type "int", but argument 3 has type "size_t" Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: rebuild .pc files when configure status changedJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: run autoupdateJan Engelhardt
Macro usage has changed over the last few years. Update it to the current specification using autoupdate(1). Manually update INCLUDES -> CPPFLAGS, because autoupdate did not catch that. Remove $(all_includes) and $(LIBS) because it is not used anywhere. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: use subdir-objects and CC_C_OJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: automake options should be in AM_INIT_AUTOMAKEJan Engelhardt
Automake options set in Makefile.am are not always propagated to subdirecties. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: do not abuse AM_INIT_AUTOMAKE for autoconf optionsJan Engelhardt
Also rename the file to its standard designated name. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-19build: just use autoreconfJan Engelhardt
This is the recommended way to regenerate the GNU build system files these days. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-10-10add quote from Thoureau to documentationPablo Neira Ayuso
I like this quote. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-09-08doxygen documentationPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-09-08examples: put examples files into specific directoriesPablo Neira Ayuso
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>
2010-09-08add missing .gitignore file to m4/ directoryPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-09-08skip PortID and sequence checking if zeroPablo Neira Ayuso
If the portID/sequence number that we specify is zero, we skip the sequence tracking. This is useful if we use the same socket to listen to events and to send commands and receive their result. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-07-15build: add notice on how to update library API versionPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-07-10examples: fix byte-order in nfct-eventPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-07-10examples: fix rtnl-set-linkPablo Neira Ayuso
This patch fixes the example that allows to set up/down the network interface. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>