summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2010-06-25socket: remove mnl_socket_sendmsg() and mnl_socket_recvmsg()Pablo Neira Ayuso
These functions are too simple wrappers that bloat the library. We can use mnl_socket_get_fd() to obtain the file descriptor and invoke message-oriented system call instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-17nlmsg: use size_t instead of int for several input parametersPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-09add nfct-event examplePablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-09fix rtnl-link-dump3.cPablo Neira Ayuso
commit a5f25889216411ad7492047fafe6de03b8408440 introduced a minor problem in this example. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-09relax mnl_attr_type_valid() checkings and change errno valuePablo Neira Ayuso
This patch relaxes strict attribute checkings in the example files. I have also changed the errno value, now it's EOPNOTSUPP instead of EINVAL. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-07change errno values for mnl_cb_run[2]()Pablo Neira Ayuso
This patch changes the errno value of mnl_cb_run[2]() in the following two cases: * Invalid expected portID: ESRCH. * Invalid sequence number: EPROTO. I didn't find any better generic errno value. EINVAL is reserved for malformed messages, to avoid confusions. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-04statify function in nf-queue.c examplePablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-03add nf-queue.c example file for nfnetlink_queuePablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-05-03add licensing terms of example filesPablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-30add helpers to nest attributesPablo Neira Ayuso
Based on code from Jozsef Kadlecsik and its ipset-5 implementation. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-23add rtnl-route-add.c to examplesPablo Neira Ayuso
Heavily based on an example from Alejandro Castaño. Untested. Signed-off-by: Alejandro Castaño <alecastanyo@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22remove references to 'generic' in header filePablo Neira Ayuso
The term 'Generic' is used in GeNetlink, we don't want any confusion with it. Better remove it. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22fix lots of compilation warnings in example filesPablo Neira Ayuso
They have been spotted by -Wall -Wextra Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22add -Wextra -Wall for example filesPablo Neira Ayuso
AM_CFLAGS=-fPIC -Wall -Wextra -Wno-unused-parameter Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22fix warning in mnl_cb_run2()Pablo Neira Ayuso
callback.c: In function ‘mnl_cb_run2’: callback.c:106: warning: pointer targets in passing argument 2 of ‘mnl_nlmsg_next’ differ in signednes Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22remove redudant alignment in mnl_nlmsg_size()Pablo Neira Ayuso
MNL_NLMSG_HDRLEN already provides the aligned size of the netlink header. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22use size_t to indicate the buffer size in mnl_cb_run*()Pablo Neira Ayuso
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22review data types for input parameters of mnl_attr_*() functionsPablo Neira Ayuso
This patch includes the following changes: * use uint16_t for attribute types in mnl_attr_put_*() function * use uint16_t for maximun type in mnl_attr_type_valid(...) * use size_t for attribute size validation in mnl_attr_validate2(...) * use unsigned int for offset in mnl_attr_parse(...) instead of int Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-22fix mnl_attr_parse()Jozsef Kadlecsik
mnl_attr_parse does not take into account the length of the netlink message header and the offset. Thus when validating attributes, it goes over the end of the real attribute stream and catches invalid data areas. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org
2010-04-19add mnl_nlmsg_fprintf() function for debugging purposesPablo Neira Ayuso
This function is still quite preliminary, comments welcome! Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-16fix for mnl_attr_for_each_nested()Jozsef Kadlecsik
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>