summaryrefslogtreecommitdiff
path: root/src/callback.c
AgeCommit message (Collapse)Author
2011-02-03doc: don't show up EXPORT_SYMBOL in doxygenPablo Neira Ayuso
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>
2010-12-12callback: use of inline in mnl_cb_run*() functionPablo Neira Ayuso
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>
2010-11-19build: tag function headers rather than decls as exportedJan Engelhardt
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-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-22src: add const qualifiersJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2010-09-08doxygen documentationPablo Neira Ayuso
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-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-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-05more consistency name issues: rename get_data*() to get_payload*()Pablo Neira Ayuso
This includes renaming get_tail() to get_payload_tail() Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-04-04check source of the netlink message and fix sequence tracking logicPablo Neira Ayuso
This patch changes the callback handlers to include netlink portID checking. Thus, we avoid that any malicious process can spoof messages. If portid, sequence number of the message is != 0, we check if the message is what we expect. This allows to use the same netlink channel for dumps (portid, seq != 0) and event-based notifications (portid, seq == 0). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-03-28partially revert previous commitPablo Neira Ayuso
the use of unsigned int in the number of bytes affects other message handling helper function, hold on with this.
2010-03-28use `unsigned int' for number of bytes and array size in callback APIPablo Neira Ayuso
2010-03-26add COPYING filePablo Neira Ayuso
This library is distributed under GPLv2+. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2010-03-26fix mnl_cb_run() and mnl_cb_run2() return value logicPablo Neira Ayuso
2010-03-22finish API documentationPablo Neira Ayuso
This patch may contain errors but we can review them and fix them later, better to have it in the tree (to allow others to contribute) to keep it in my local tree.
2010-03-19initial libmnl importPablo Neira Ayuso