History log of /external/libnl/lib/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
513e45ccce5ae286fc67fde1a1bf703e9c8d83aa 13-Oct-2010 Thomas Graf <tgraf@suug.ch> Don't include pktloc_syntax.h in BUILT_SOURCES
akefile.am
2b3fabab9ef2445ab1c48de0fed82514e4eb32dc 13-Oct-2010 David Lamparter <equinox@diac24.net> route_obj: don't add empty destination to nlmsg

don't try to give the kernel an empty RTA_DST attribute. this would
previously happening on trying to delete the default route as returned
from the kernel. the kernel doesn't add a RTA_DST atttribute, so libnl
does nl_addr_alloc(0) and inserts a zero-length RTA_DST attribute into
the deletion request, which the kernel then refuses with ERANGE.

Signed-off-by: David Lamparter <equinox@diac24.net>
oute/route_obj.c
cb05bbb0e2d38f41569754e1505c22929537c17e 05-Aug-2010 Andreas Bießmann <biessmann@corscience.de> automake: add ${top_builddir}/include to AM_CFLAGS

This patch enables out-of-source builds like this
$ cd builddir && src_dir/configure && make

Before this patch there was an error about missing netlink/version.h which
is built by automake in top_builddir rather than top_srcdir which is already
in include search path.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
akefile.am
a172e3ccf0617828a23d08c8c4a8eb4825ce0ccf 19-Apr-2010 Matthew L. Creech <mlcreech@gmail.com> Put preprocessor definitions in AM_CPPFLAGS

When an alternate kernel header include directory is added in
CPPFLAGS, the libnl build fails. This is because the local copy of
kernel headers is added in AM_CFLAGS, which gets included after
CPPFLAGS in the automake-generated makefile. Switching to AM_CPPFLAGS
fixes the problems.
akefile.am
4ab22ccd47319e7d9a972bcf018e1a03870f64f0 22-Sep-2010 Andreas Fett <a.fett@gmx.de> add user data to change_func_t for caches

the patch below adds the possibility to
pass user data to callbacks of type
change_func_t when using the nl_cache_mngr_*
family of functions.

If there is any better way to do this,
without duplicating the code in
cache_mngr.c please let me know.
ache.c
ache_mngr.c
86b6f6f6291eaaec542a2f4028087fa823122082 10-Jul-2010 Denys Fedorysychenko <nuclearcat@nuclearcat.com> Trivial fix for TBF memleak

Without this patch, running alloc / free cache loop will lead to huge memory
leaks on machine with 3000 interfaces with tbf qdiscs.

Here was valgrind output:

==5580== 18,070,728 bytes in 347,514 blocks are definitely lost in loss record
32 of 32
==5580== at 0x4025485: calloc (in /lib/valgrind/vgpreload_memcheck-x86-
linux.so)
==5580== by 0x405F410: tbf_msg_parser (tbf.c:46)
==5580== by 0x405302B: qdisc_msg_parser (qdisc.c:119)
==5580== by 0x4033DC9: nl_cache_parse (cache.c:643)
==5580== by 0x4033E7C: update_msg_parser (cache.c:460)
==5580== by 0x4038A11: nl_recvmsgs (netlink-local.h:112)
==5580== by 0x4034175: __cache_pickup (cache.c:483)
==5580== by 0x40343FF: nl_cache_pickup (cache.c:516)
==5580== by 0x403447D: nl_cache_refill (cache.c:698)
==5580== by 0x4034AB7: nl_cache_alloc_and_fill (cache.c:198)
==5580== by 0x4053216: rtnl_qdisc_alloc_cache (qdisc.c:388)
==5580== by 0x80489DB: main (in /home/root/nltest)

Patch complied and tested for same test case, no more leaks anymore.
oute/sch/tbf.c
7cf52dd94b5295b0b649f6ea8b2bf4fbf35abe33 03-Jul-2010 Thomas Graf <tgraf@suug.ch> Let git ignore generated pktloc source files
oute/.gitignore
0fa04772ab1e092fce34b658d6cc4e6f6b59be1d 03-Jul-2010 Thomas Graf <tgraf@suug.ch> Fix compile warning in utils.c
tils.c
256d7e723c0ff402422d3501866e9301b3f64c0f 03-Jul-2010 Thomas Graf <tgraf@suug.ch> Fix compile warning in nl.c
l.c
db5bd57899affbcaf42ac0b93c5c7be8f51ca390 02-Jul-2010 Thomas Graf <tgr@lsx.(none)> Packet Location Interface
akefile.am
rror.c
oute/pktloc.c
oute/pktloc_grammar.l
oute/pktloc_syntax.y
3c28aa5dca309286ad9136c6d4742969b5dfde1d 07-Apr-2010 Patrick McHardy <kaber@trash.net> Fix rule attribute comparison

Rules don't have unique identifiers, so all attributes are compared
by initializing the ID mask to ~0. This doesn't work however since
nl_object_identical verifies whether the ID attributes are actually
present before comparing the objects, which is never the case.

Work around by using the intersection of present attributes when
comparing two rule objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
bject.c
0e4f54d288b8d1d06ee40122d6bf3ed971870d47 07-Apr-2010 Patrick McHardy <kaber@trash.net> addr: add NL_DUMP_ENV function

Signed-off-by: Patrick McHardy <kaber@trash.net>
oute/addr.c
f5f49c224835c555df9e2c1f79ac5adf4640f4a8 07-Apr-2010 Patrick McHardy <kaber@trash.net> addr: restore anycast functions

Seems it got lost during some cleanups.

Signed-off-by: Patrick McHardy <kaber@trash.net>
oute/addr.c
82907257184f647353a9a993caaa1ebadaee2842 07-Apr-2010 Patrick McHardy <kaber@trash.net> neigh: fix id_attrs to include ifindex

Neighbour entries for the same destination may exist on multiple
interfaces. Include the interface in the ID attributes.

Signed-off-by: Patrick McHardy <kaber@trash.net>
oute/neigh.c
ba1bd9050d0373239dfc400815e275d169dee415 07-Apr-2010 Patrick McHardy <kaber@trash.net> cache: properly invoke change_cb for deleted objects in nl_cache_resync()

When resyncing a cache, there are no delete messages, so they need to
be synthesized for deleted objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
ache.c
52d6b8b9ee21b4bc112cc8a5d6f440536dd7fde0 14-Jan-2010 Jose Ignacio Naranjo Hernández <joseignacio.naranjo@gmail.com> Fix a bug when calculating ticks_per_usec

I've noticed a wrong behavior when setting up some delays in a netem
qdisc. I will try to make the things easier for the reader describing
the calls path.

To set up a delay (or jitter...) I use 'rtnl_netem_set_delay' which
requires an int parameter that tells the delay in micro seconds. Inside
this func, the delay is set up with the help of 'nl_us2ticks', which is
just an arithmetic operation (us * ticks_per_usec), where us is the
input parameter and ticks_per_usec is a global variable initialized in
'get_psched_settings'. And here is the problem:

If this variable is going to be calculated using '/proc/net/psched', I
think the file scan is not done properly.

I don't understand what the meaning of the asterisk is here:

int r = fscanf(fd, "%08x%08x%08x%*08x", &tick, &us, &nom);
if (4 == r && nom == 1000000 && !got_tick)
ticks_per_usec = (double)tick/(double)us;

The execution path never gets in the if statement, because r is always
3, and if the fourth parameter is read (avoiding the asterisk), there is
no variable to store it in, so it comes a segv. In my opinion we can get
rid of the if statement, because I think the proc psched file has always
a fixed format of 4 parameters, and 'nom' is always 1000000
(http://lxr.linux.no/#linux+v2.6.32/net/sched/sch_api.c#L1678).

Find attached a patch I did, if I am correct.
tils.c
cafdaa4e065a2ee658d7e361158100f4c7abe445 24-Feb-2010 Karl Hiramoto <karl@hiramoto.org> new function nfnl_queue_msg_send_verdict_payload()

nfnl_queue_msg_send_verdict_payload() will to send the verdict, mark,
and possibly changed payload through the netlink socket.

Add a few docbook comments in other funcs.

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
etfilter/queue_msg.c
etfilter/queue_msg_obj.c
27c505eb89f7a689416f822e26c0ccea0b351ba3 24-Feb-2010 Karl Hiramoto <karl@hiramoto.org> new feature nl_send_iovec(), nl_auto_complete() and code refactoring.

Create new function nl_send_iovec() to be used to send multiple 'struct iovec'
through the netlink socket. This will be used for NF_QUEUE, to send
packet payload of a modified packet.

Refactor nl_send() to use nl_send_iovec() sending a single struct iovec.

Create new function nl_auto_complete() by refactoring nl_send_auto_complete(),
so other functions that call nl_send may also use nl_auto_complete()

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
l.c
ff76549013c31082d303b3feef755bbd35e13ec6 14-Nov-2009 Denys Fedoryschenko <denys@visp.net.lb> one more fix, u32.c

One more segfault, also nl-tctree-list , fix
Probably need reformat for better look
Patch attached
oute/cls/u32.c
52510e7d394a1c8ee0a3aaf046db6199f0558c78 14-Nov-2009 Denys Fedoryschenko <denys@visp.net.lb> invalid comma cause segfault for nl-tctree-list, tbf.c

I notice segfault while running nl-tctree-list for tbf qdisc.

Patch that fix this typo is attached.
oute/sch/tbf.c
8d2bb90726f75dfaf752de599886cb8bf15391bd 05-Nov-2009 Patrick McHardy <kaber@trash.net> libnl: add ERANGE to errno translation

Signed-off-by: Patrick McHardy <kaber@trash.net>
rror.c
fed168212ecfd179691813b67959fa20593d23dd 05-Nov-2009 Patrick McHardy <kaber@trash.net> libnl: fix automake breakage

libnl-route must be handled before libnl-nf in lib_LTLIBRARIES since
the later depends on the former. Additionally nf-monitor, nl-list-caches,
nl-list-sockets and nl-util-addr have been dropped from the Makefile.

Signed-off-by: Patrick McHardy <kaber@trash.net>
akefile.am
dc273a12da9f0116e80fa81d63beb820e632dd17 03-Sep-2009 Thomas Graf <tgr@lsx.localdomain> - Compile with _GNU_SOURCE
- Fixed classifier.c -> cls.c
akefile.am
f946cfaa3a45e4c5752e3930e8383196aae85399 02-Sep-2009 Thomas Graf <tgr@lsx.localdomain> Merge branch 'master' of git://dev.medozas.de/libnl

Conflicts:
lib/Makefile
src/Makefile
2ead49f0d5873628156e50dfed7da14619a4172d 20-Jul-2009 olc <olc@satem.(none)> Add support for getting and deleting queueing classes.
oute/class.c
e0af9e1802d4f0c49e838ff94a187f590eb9e2cd 20-Aug-2009 Dan Winship <danw@redhat.com> Fix rtnl_addr caching

addr_obj.ops.oo_id_attrs included ADDR_ATTR_PEER, so any address that
didn't have a peer address set would compare as unequal to itself,
meaning it could never be removed from a cache after it was added, etc.
oute/addr.c
1ed227d3a9684e84b1c19e083850d5f10e94348b 26-Aug-2009 Marc de Kruijf <mdekruijf@gmail.com> Patch for unexpectedly aligned messages

I found the following bug, where nlmsg_ok() in lib/msg.c would
incorrectly return 'true' when the input argument 'remaining' was a negative
number. This happens when the message is not aligned the way that libnl
expects (although it is still legal).

In the comparison of the signed and unsigned numbers on line 284, the signed
number gets converted to an unsigned number, which is unexpected and
naturally produces a bug. My patch is below. The cast is ugly, but it
fixes the problem.
sg.c
ef858fb492dfe98e3ae194264fbc73649cf8493a 02-Sep-2009 Thomas Graf <tgr@lsx.localdomain> - Reworked the classifier interface.
- Added initial ematch support
- Added support for the basic classifier
- Added support for the cgroup classifier
akefile
oute/classifier.c
oute/cls.c
oute/cls/basic.c
oute/cls/cgroup.c
oute/cls/ematch.c
oute/cls/ematch/cmp.c
oute/cls/ematch/container.c
oute/cls/fw.c
oute/cls/u32.c
oute/cls_obj.c
7d249fc2e1d0cb06cd4a4dfcc0a3c425ce63def7 05-Jul-2009 Alexander Sack <asac@ubuntu.com> nl_object_clone: properly clone ce_mask field

based on my finding, ce_mask needs to be identical on clones; otherwise
some functions (like "dump") will treat clones differently.
bject.c
a73e5f92c378e96458ae88a3dc07514ee5856987 05-Jul-2009 Jan Engelhardt <jengelh@medozas.de> build: make use of library dependencies
akefile.am
bf4fd3acee4e611afee20025f55454e37813f8ca 23-Jun-2009 Jan Engelhardt <jengelh@medozas.de> Move to automake-based build

Issues solved:
* PACKAGE_VERSION was abused for SOVERSION
* unneeded DEP stage
* did not support out-of-tree builds
* no way to turn off silent mode
* overriding CFLAGS at make time was not supported
* no static libs were provided

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
akefile
akefile.am
efs.h.in
ef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25 27-Apr-2009 Inaky Perez-Gonzalez <inaky@linux.intel.com> release_local_port: properly compute the bitmap position

Current calculation is always off, not reflecting the right position
in the bitmap, which results in failures due to conflicts (detected at
the kernel level) when trying to open a new handle.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
ocket.c
a8cd7b62c86127e2c946373d50efac9d2ed8da38 07-Apr-2009 Pavel Roskin <proski@gnu.org> nl_object_priv() is inline, so define it in the header
bject.c
becae5f37af86c1503e4afc7ef84876c2bb53c3c 07-Apr-2009 Pavel Roskin <proski@gnu.org> Remove all versioned libraries on "make clean"
akefile
1276256a72265145e5d1aae3fa223c94ccc3515d 07-Apr-2009 Pavel Roskin <proski@gnu.org> Fix parallel build

When linking against libnl, require libnl.so to exist. When linking
against libnl-route, require libnl-route.so to exist.
akefile
664e1deaeb59ad9db0b2eeec613cf8a93551f567 10-Dec-2008 Thomas Graf <tgr@plip.localdomain> Fix up naming changes
ache_mngr.c
l.c
6782b6f709d03877a5661a4c8d8f8bd1b461f43f 10-Dec-2008 Thomas Graf <tgr@plip.localdomain> restructure module documentation order

split hiearchy into one top level module per library
ddr.c
ache_mngt.c
ata.c
amily.c
ib_lookup/lookup.c
enl/genl.c
andlers.c
sg.c
etfilter/nfnl.c
l.c
oute/rtnl.c
ocket.c
tils.c
724dfa6d70943e0d4e3c8e54bff43050828a64d0 10-Dec-2008 Thomas Graf <tgr@plip.localdomain> Consistent naming of socket functions
ocket.c
4fd5f7cb6627a22bd9f228b4259d5106ae39d535 03-Dec-2008 Thomas Graf <tgr@plip.localdomain> Documentation update
oc.c
andlers.c
l.c
ocket.c
72aa861c48b6876e94d07470025155a6924a6983 01-Dec-2008 Holger Eitzenberger <heitzenberger@astaro.com> Allow to pass multiple group values to membership functions

Instead of calling the membership functions several times it is
helpfull to extend the API and make the single group functions a
special case.

The value 0 (NFNLGRP_NONE) terminates this list.

Example use:

nl_socket_add_memberships(sock, group_1, group_2, 0);
nl_socket_drop_memberships(sock, group_1, group_2, 0);

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
ocket.c
37f9855f4c02960b483d4d992771837c5906405e 24-Oct-2008 Patrick McHardy <kaber@trash.net> libnl: add some errno codes to nl_syserr2nlerr

Signed-off-by: Patrick McHardy <kaber@trash.net>
rror.c
334f551c5994f7a5a2163fd73ca20d201c7e7bf0 23-Oct-2008 Patrick McHardy <kaber@trash.net> libnl: nfqueue: add nfqueue specific socket allocation function

commit e92539843a0c7e5116254382626cce226bf2135e
Author: Patrick McHardy <kaber@trash.net>
Date: Thu Oct 23 13:46:16 2008 +0200

libnl: nfqueue: add nfqueue specific socket allocation function

nfqueue users usually send verdict messages from the receive callback.
When waiting for ACKs, the receive callback might be called again
recursively until the stack blows up.

Add a nfqueue specific socket allocation function that automatically
disables ACKing for the socket.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/queue.c
cfcfca070355b246028df60da79813f09ed65755 20-Oct-2008 Thomas Graf <tgr@plip.localdomain> Add internal wait_for_ack() which only waits for ACK if !NL_NO_AUTO_ACK

This changeset ensures that internal code properly synchronizes to
ACKs if ACKs are enabled and otherwise return immediately.
etfilter/ct.c
etfilter/log.c
etfilter/queue.c
etfilter/queue_msg.c
oute/addr.c
oute/class.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
oute/route.c
oute/rule.c
2bdee95a765457fe4206b89d51974ae56e75c588 20-Oct-2008 Thomas Graf <tgr@plip.localdomain> Add socket flag NL_NO_AUTO_ACK to allow disabling auto ACKS
l.c
ocket.c
f42f195a80ffb7a5dcc355a56b8fe229692718e5 15-Oct-2008 Thomas Graf <tgr@plip.localdomain> Error handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops()
oute/cls_obj.c
5d92f9c03d85cefee5afe7f40d7ea69dfde4cf77 15-Oct-2008 Thomas Graf <tgr@plip.localdomain> Use 16bit ints for classifier prio/protocol
oute/cls_obj.c
23ee46ef7115c2e311c36e43a833e6c3deada18a 14-Oct-2008 Thomas Graf <tgr@plip.localdomain> Replace NL_KEEP code with proper message reference counting

Adds reference counting to netlink messages so callbacks
can hold on to a message without using the broken keep
message flag.
sg.c
l.c
5702d4c1b97616f5212da31db01a2f3c79c15b7c 07-Oct-2008 Wolfgang Steudel <Wolfgang.Steudel@Stud.TU-Ilmenau.de> Only include local addr as peer addr if provided

we're using libnl-1.1 for a project. When trying to delete all
addresses of an interface by only setting interface index and
address family of an rtnl_addr and executing rtnl_addr_delete()
we received some error (I don't remember what it was).

The bug(?) is in build_addr_msg() in lib/route/addr.c:
IFA_ADDRESS is set to a_local when a_peer is not set,
without checking if a_local was set. We just added
if (tmpl->ce_mask & ADDR_ATTR_LOCAL)
after the "else" (line 496 in the current git).
oute/addr.c
b12918df16598506efa63ccbb78657c51f0a28a2 05-Sep-2008 Patrick McHardy <kaber@trash.net> fix lib symlinks
akefile
13ab2441ced84cfc093734b257c43fa468cb22fd 17-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Remove XML dumping

Bloats the library, not frequently used
enl/family.c
oute/addr.c
oute/link.c
oute/neigh.c
oute/rule.c
ab578b9ca00b19ad6b66283ec08d004f9fc391d6 17-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Improvements to address utilities

- Moved env var dumping to nl-addr-list.c
- support for ipv6 lifetimes
- correct and complete help texts
oute/addr.c
7072675b40b611279466756ef800cc5dbee92c54 16-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Improved printing of route cache entries
oute/route_obj.c
c48a17694b6719606fa76fdad8a5cef3289cb42c 16-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Extend nl_time2int() and rename it to nl_str2msec()

Support parsing of more complex time duration input.
tils.c
d49018fd789d96ec3fa90e41af24fd2796bac9fe 13-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Introduce nla_strdup() to help parse strings attributes
ttr.c
5ab9421111f6473af871f4678d5b93b21f50028d 13-Jun-2008 Thomas Graf <tgr@lsx.localdomain> Properly handle addr=NULL in nl_addr2str
ddr.c
d84430702496f617c01c5e2d27d0e82e02390bb7 23-May-2008 Thomas Graf <tgr@lsx.localdomain> Remove old line counting while dumping
ache.c
ib_lookup/lookup.c
enl/family.c
etfilter/ct_obj.c
etfilter/log_msg_obj.c
etfilter/log_obj.c
etfilter/queue_msg_obj.c
etfilter/queue_obj.c
oute/addr.c
oute/class_obj.c
oute/cls/fw.c
oute/cls/u32.c
oute/cls_obj.c
oute/link.c
oute/link/vlan.c
oute/neigh.c
oute/neightbl.c
oute/nexthop.c
oute/qdisc_obj.c
oute/route_obj.c
oute/rule.c
oute/sch/cbq.c
oute/sch/dsmark.c
oute/sch/fifo.c
oute/sch/htb.c
oute/sch/netem.c
oute/sch/prio.c
oute/sch/red.c
oute/sch/sfq.c
oute/sch/tbf.c
oute/tc.c
tils.c
337fbd24cad1f5cf9c8b4287a75f2c69f088adce 22-May-2008 Thomas Graf <tgr@lsx.localdomain> Present port and icmp values in host byte order and beautify printing

This changes make nfnl_ct_get_src_port() and others return the value
in host byte order rather than in network byte order.

Also splits printing into details and statistical section and
improves readability.
etfilter/ct.c
etfilter/ct_obj.c
531029c130db95a82c9f2121e59698e86cd84e79 22-May-2008 Thomas Graf <tgr@lsx.localdomain> Remove change routine, works flawlessly via add() with NLM_F_REPLACE

This breaks the API but is the right thing to do.
oute/neigh.c
18efaacc169635f891b0c9b869f4e0db18584258 22-May-2008 Thomas Graf <tgr@lsx.localdomain> Improve printing of routing rules
oute/rule.c
566a09ecbd0f69ad277246780ee92584c7e2fbfd 22-May-2008 Thomas Graf <tgr@lsx.localdomain> Family specific libraries can link to the core directly
akefile
304746f8d06a14bc911a2b58cf1c2398b02ead0a 22-May-2008 Thomas Graf <tgr@lsx.localdomain> Fix error code of nl_addr_resolve()
ddr.c
5d82806b48959e4726ae3913ae0b3ce279c4c04a 20-May-2008 Thomas Graf <tgr@lsx.localdomain> Add rtnl_neigh_get_family()
oute/neigh.c
00466b0f95af19623c6536edafca6904945ced83 20-May-2008 Thomas Graf <tgr@lsx.localdomain> Return libnl error codes in translation routines
tils.c
b5fa6c8b74790b7ca80a58afcd36e63c5d363a2c 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Fix library install target
akefile
0d925c58069b2d29f17c2bde14192b6f35ccac4d 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Remove references to unused attribute anycast
oute/addr.c
ad2a7bd1e4ccb3171ed0d4c694d8bcd300553247 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Build separate libraries for each netilnk family

This reduces the footprint on systems which only require a small
subset of the library.
gitignore
akefile
28233246cd8fad47613e7ffd85ea0b1d69c0f8c2 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Allow parser callbacks to return NL_OK, NL_SKIP, NL_EXIT

Obsoletes internal P_ACCEPT/P_IGNORE
enl/ctrl.c
etfilter/ct.c
etfilter/log_msg.c
etfilter/queue_msg.c
oute/addr.c
oute/class.c
oute/classifier.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
oute/route.c
oute/rule.c
8cd39c9f4ca8731279ea6467a9d489902fcae7f9 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Uninline various functions to save 7K code
tils.c
ef50a38fbd8682a5c9efd559e7db68664977f080 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Fix memory leaks when sending of message failed

Various callers of nl_send_auto_complete() failed to
free the allocated message when an error was reported.
oute/class.c
oute/classifier.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
1155370f520cb64657e25153255cf7dc1424317f 15-May-2008 Thomas Graf <tgr@lsx.localdomain> Rename struct nl_handle to struct nl_sock

The idea of a common handle is long revised and only misleading,
nl_handle really represents a socket with some additional
action handlers assigned to it.

Alias for nl_handle is kept for backwards compatibility.
ache.c
ache_mngr.c
oc.c
ib_lookup/lookup.c
enl/ctrl.c
enl/genl.c
enl/mngt.c
andlers.c
etfilter/ct.c
etfilter/log.c
etfilter/nfnl.c
etfilter/queue.c
etfilter/queue_msg.c
l.c
oute/addr.c
oute/class.c
oute/classifier.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
oute/route.c
oute/rtnl.c
oute/rule.c
ocket.c
0cf780859cbce363a6e2cd4b8d19c5498a3530f5 14-May-2008 Thomas Graf <tgr@lsx.localdomain> Check length of provided address label
oute/addr.c
b4fbe1d34d6f54045b5c6236d86aacd4340ec83d 14-May-2008 Thomas Graf <tgr@lsx.localdomain> Replace RTNL_LINK_NOT_FOUND with just 0

The interface index 0 is reserved and can be safely used to
signal that the device does not exist.
oute/addr.c
oute/link.c
oute/neigh.c
oute/tc.c
eed2afaab7aa72fae393a395a8879b91a922ff5e 14-May-2008 Thomas Graf <tgr@lsx.localdomain> Remove obsolete nla_get_addr() and nla_get_data()

Replaces obsolete calls to nla_get_addr() and nla_get_data()
with nl_addr_alloc_attr() respectively nl_data_alloc_attr().

Also fixes missing error handling while parsing routing multipath
configuration.
ddr.c
ttr.c
ata.c
etfilter/ct.c
oute/addr.c
oute/cls/fw.c
oute/cls/u32.c
oute/link.c
oute/neigh.c
oute/route_obj.c
oute/rule.c
oute/tc.c
8a3efffa5b3fde252675239914118664d36a2c24 14-May-2008 Thomas Graf <tgr@lsx.localdomain> Thread-safe error handling

In order for the interface to become more thread safe, the error
handling was revised to no longer depend on a static errno and
error string buffer.

This patch converts all error paths to return a libnl specific
error code which can be translated to a error message using
nl_geterror(int error). The functions nl_error() and
nl_get_errno() are therefore obsolete.

This change required various sets of function prototypes to be
changed in order to return an error code, the most prominent
are:

struct nl_cache *foo_alloc_cache(...);
changed to:
int foo_alloc_cache(..., struct nl_cache **);

struct nl_msg *foo_build_request(...);
changed to:
int foo_build_request(..., struct nl_msg **);

struct foo *foo_parse(...);
changed to:
int foo_parse(..., struct foo **);

This pretty much only leaves trivial allocation functions to
still return a pointer object which can still return NULL to
signal out of memory.

This change is a serious API and ABI breaker, sorry!
ddr.c
ttr.c
ache.c
ache_mngr.c
ache_mngt.c
ata.c
rror.c
ib_lookup/lookup.c
ib_lookup/request.c
enl/ctrl.c
enl/family.c
enl/genl.c
enl/mngt.c
andlers.c
sg.c
etfilter/ct.c
etfilter/ct_obj.c
etfilter/log.c
etfilter/log_msg.c
etfilter/log_msg_obj.c
etfilter/nfnl.c
etfilter/queue.c
etfilter/queue_msg.c
etfilter/queue_msg_obj.c
l.c
bject.c
oute/addr.c
oute/class.c
oute/class_api.c
oute/classifier.c
oute/cls/fw.c
oute/cls/u32.c
oute/cls_api.c
oute/link.c
oute/link/api.c
oute/link/vlan.c
oute/neigh.c
oute/neightbl.c
oute/nexthop.c
oute/qdisc.c
oute/qdisc_api.c
oute/route.c
oute/route_obj.c
oute/rule.c
oute/sch/cbq.c
oute/sch/dsmark.c
oute/sch/fifo.c
oute/sch/netem.c
oute/sch/prio.c
oute/sch/red.c
oute/sch/sfq.c
oute/sch/tbf.c
oute/tc.c
ocket.c
tils.c
107dc162c56ace6eea5a167b7881520e6cecb831 08-May-2008 Ben Gamsa <ben@somanetworks.com> patch: fixed up support for tables in rules
oute/rule.c
cc9c6d63848400b77906a4a9df0be826dfc21b72 08-May-2008 Ben Gamsa <ben@somanetworks.com> Added two new functions to facilitate processing the nexthop entries for routes.

Added rtnl_route_foreach_nexthop() to walk the list of nexthops invoking a
caller-provided callback for each nexthop entry, and added rtnl_route_nexthop_n()
to retrieve the Nth nexthop entry in the list.
oute/route_obj.c
48e1e5c4720094f60494ee55c2a22230ac986ad3 08-May-2008 Thomas Graf <tgr@lsx.localdomain> Speed up metrics comparison

Using rtnl_route_get_metric() for route comparison became a bottleneck
because each metric which was not available resulted in the generation
of an error message. This changeset avoids this by accessing rt_metrics
and rt_metrics_mask directly while comparing route objects.
oute/route_obj.c
b7c5bf98c4079304f78242d8b3c65451efc12b77 07-May-2008 Thomas Graf <tgr@lsx.localdomain> Improve performance by using malloc() over calloc() in critical places

As pointed out by Regis Hanna, a considerable performance gain can be
achieved by using malloc() over calloc() when allocating netlink message
buffers. This is likely due to the fact that we use a complete page for
each message.
sg.c
l.c
d6cd72555d1e0334567d213eb84547758aef6255 05-May-2008 Thomas Graf <tgr@lsx.localdomain> Fix dumping of iif route attribute
oute/route_obj.c
85808860b6174aecc901c34c90968911ad013280 05-May-2008 Thomas Graf <tgr@lsx.localdomain> Route cache support

This changesets adds the possibility to fill a nl_cache with
the contents of the route cache. It also adds the possibility
to limit route caches to certain address families.
oute/route.c
861901c55bd9e2f84e7c8de0da5ea6179867907d 30-Apr-2008 Tad Kollar <Thaddeus.J.Kollar@nasa.gov> Fixed netem_build_msg() delay distribution table existence test.
oute/sch/netem.c
241b2b83ba5672f5c86154d29eeb8ef4c7c6e9b4 30-Apr-2008 Tad Kollar <Thaddeus.J.Kollar@nasa.gov> New netem funtionality and TBF fix

New netem-related functionality:
Added ability to save new settings to the kernel. In netem.c, the
netem_get_opts() stub has been replaced with netem_build_msg() which
manipulates the nl_msg data directly and returns an error code instead
of a new nl_msg. Modifications to qdisc_build() in qdisc.c and struct
rtnl_qdisc_ops were necessary for this.
Added support for getting/setting corruption probability/correlation.
Added support for setting a delay distribution.

Fixed tbf_msg_parser() to call tbf_alloc() instead of tbf_qdisc() to
prevent a seg fault.
oute/qdisc.c
oute/sch/netem.c
oute/sch/tbf.c
5c92c656cc6d1197c66d8876a17189926dfbc343 30-Apr-2008 Thomas Graf <tgr@lsx.localdomain> Remove leftover definition of verbose errors
efs.h.in
32000e8e9c275fac8933880350291cf642662349 29-Apr-2008 Inaky Perez-Gonzalez <inaky@linux.intel.com> libnl: recvmsgs doesn't necessarily free the message data

I stepped over libnl always freeing the messages and it
kind of made it awkward to reuse the message data without
reallocating.

The basic idea is: if a callback return value has a bit set,
don't free that message. The calling application owns it.
By default, things stay as before (messages are freed).

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
l.c
535e83162249ed6274ba46bc72d8cc683ba20e17 29-Apr-2008 Thomas Graf <tgr@lsx.localdomain> Big routing code rework (API/ABI BREAK!)

Adds all missing routing attributes and brings the routing
related code to a working state. In the process the API
was broken several times with the justification that nobody
is using this code yet.

The changes include new example code which is also a prototype
for how plain CLI tools could look like to control routes.
etfilter/ct_obj.c
bject.c
oute/addr.c
oute/link.c
oute/neigh.c
oute/nexthop.c
oute/route.c
oute/route_obj.c
oute/route_utils.c
oute/rule.c
662887c052f0fcd98287e2a7fa5843a4f66ca256 29-Apr-2008 Thomas Graf <tgr@lsx.localdomain> Export nl_dump_line() and automatically count lines while dumping
tils.c
5ab64d5173acee3b28d993321372211605fdbf4c 29-Apr-2008 Thomas Graf <tgr@lsx.localdomain> Define datarootdir to silent autoconf
akefile
f4f7704b0d119ddf9672d81b1d7f76347dbf7a1f 29-Apr-2008 Thomas Graf <tgr@lsx.localdomain> Ignore NULL pointers passed to nl_cache_free()
ache.c
0ca291d9e4ca1a9fd75982e7edb43325b40f5f10 31-Mar-2008 Thomas Graf <tgr@lsx.localdomain> Fix 64bit alignment issue on x86_64.
oute/link.c
0c2cb97924c4ab22f525d2419cf2e8ed9927541c 10-Mar-2008 Thomas Graf <tgr@lsx.localdomain> libnl: fix policy check for NFQA_HWADDR

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
etfilter/queue_msg.c
358e44efa4b6791943acd26d4f9ad85771c6830c 05-Mar-2008 Thomas Graf <tgr@deb.localdomain> Optimize nl_cache_ops_associate by checking protocol early
ache_mngt.c
6a7606fa293dbf0679e53fda164cde35c35a449f 05-Mar-2008 Thomas Graf <tgr@deb.localdomain> Initialize message type list to avoid overrun
etfilter/log.c
etfilter/queue.c
4be02ace482616f9d1104526dac6cde808ee24c6 22-Feb-2008 Thomas Graf <tgr@deb.localdomain> Be liberal when receiving an empty nested attribute

No longer enforce at least one attribute in a container of nested
attributes. The application may do so itself by setting minlen
to NLA_HDRLEN.
ttr.c
ca0988a2a793bf06381ef1237178df6115b34c80 24-Jan-2008 Patrick McHardy <kaber@trash.net> Fix nfnl_queue_msg_get_packetid() return type

[LIBNL]: Fix nfnl_queue_msg_get_packetid() return type

The packet-ID is a 32 bit value, but nfnl_queue_msg_get_packetid() returns
an uint16_t. Makes queueing fail after 2^16 packets.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/queue_msg_obj.c
596d3bc2e9a55d36667abc9b1339b875abd4e11a 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: Support conntrack add/delete/query requests

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/ct.c
2f4f8a5094b56c460f4b5bb1b62b7ec8f624942c 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: Split up nfnetlink_log into log and msg objects

Split the nfnetlink_log code into two seperate objects, "netfilter/log"
to represent logging instances and "netfilter/log_msg" to represent
log messages. Also perform some function name unification for consistency
with other libnl object types, mainly renaming nfnl_log_build_*_msg
to nfnl_log_build_*_request.

This changes the API in an incompatible way, but since this feature is
new and the libnl netfilter headers haven't been installed so far,
there shouldn't be any users affected by this.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/log.c
etfilter/log_msg.c
etfilter/log_msg_obj.c
etfilter/log_obj.c
3f48e49102f3967e87b98b66721c35aefcc299ca 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: nfnetlink_log: support NUFLA_GID attribute

The NUFLA_GID attribute (currently only in net-2.6.25) contains the
gid of the sending process for locally generated packets.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/log.c
etfilter/log_obj.c
5618ea8f5a1cf417fec434788b4b14cc7fcbe246 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: nfnetlink_log: only set hwproto if not zero

The hwproto doesn't have its own attribute and is also present when
not set. Don't set the attribute if its value is zero.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/log.c
e72cb033f2f7323b63f3e640a37e7a75558ab128 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: Add nfnetlink_queue support

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/queue.c
etfilter/queue_msg.c
etfilter/queue_msg_obj.c
etfilter/queue_obj.c
665b757809844950b277756bd2249ad7acbe443f 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: Generic netfilter stuff

Add some generic helper functions for netfilter.

Signed-off-by: Patrick McHardy <kaber@trash.net>
etfilter/netfilter.c
b64f15d6f947839236fa276d473d238f8c9b9d57 18-Jan-2008 Patrick McHardy <kaber@trash.net> [LIBNL]: Fix minor memleaks on exit

Make valgrind happy ...

Signed-off-by: Patrick McHardy <kaber@trash.net>
oute/route_utils.c
7f6b7a8eea0334b34d58dec72c66121a76f08958 07-Feb-2008 Thomas Graf <tgr@deb.localdomain> Improve readability of link statistics output
oute/link.c
080727d90b62418cb103f5b0fc6ccecdf8317009 05-Feb-2008 Thomas Graf <tgr@deb.localdomain> Free associated caches when freeing cache manager

Caches allocated by the cache manager must be freed again when the cache
manager itself is freed. However, the netlink socket is allocated
indepdently so it should not be freed.
ache_mngr.c
dbcdf91a99d0e12d012308328bc6e1894403a99b 30-Jan-2008 Thomas Graf <tgr@deb.localdomain> Detailed attribute documentation

This patch extends and reorganizes the existing attribute documentation
and includes various verbose examples.
ttr.c
0fa6756cca2444ddf665cc140585822d6c04507a 30-Jan-2008 Thomas Graf <tgr@deb.localdomain> Abstract address allocation based on netlink attribute
ddr.c
3607dbfa54e7ca775a89078f64bdcb150ea9306b 30-Jan-2008 Thomas Graf <tgr@deb.localdomain> Abstract data allocation based on netlink attribute
ata.c
75a26f3fc5a306e39f5244ee24e69936c4b5146d 14-Jan-2008 Thomas Graf <tgr@deb.localdomain> Improve message/attribute construction documentation and add nlmsg_expand()
ttr.c
sg.c
dbefb734d37208547e2d09f6bedd88b962f0a2bc 14-Jan-2008 Thomas Graf <tgr@deb.localdomain> Fix documentation of cache manager.
ache_mngr.c
6de17f3308cfd53ad922d144a1b28ddd962d6678 14-Jan-2008 Thomas Graf <tgr@deb.localdomain> Fix stale data pointers when constructing messages

Patrick McHardy reported a problem where pointers to the
payload of a netlink message as returned by f.e. the
nesting helpers become stale when the payload data
chunk is reallocated.

In order to avoid further problems, the payload chunk is
no longer extended on the fly. Instead the allocation is
made during netlink message object allocation time with
a default size of a page which should be fine for the
majority of all users. Additionally the functions
nlmsg_alloc_size() and nlmsg_set_default_size() have been
added to allocate messages of a particular length and to
modify the default message size.
ttr.c
sg.c
l.c
13c85b663390547d8787aa8f45fbd009f4f8a332 10-Jan-2008 Thomas Graf <tgr@deb.localdomain> Add missing @{ for doxygen to build genl documentation
enl/genl.c
aa00f82a7b25518b9b2f973b1ff182c142055f6b 10-Jan-2008 Thomas Graf <tgr@deb.localdomain> Remove lib/defs.h from repository
efs.h
c6609efc0fdcb1705cf157b4f383152edb7505c6 09-Jan-2008 Patrick McHardy <kaber@trash.net> [PATCH] libnl cache management leak
ache.c
c8a0a5cdfba51f7de5d203aa13a97377b215515a 10-Jan-2008 Thomas Graf <tgr@deb.localdomain> Added additional parsing and validation functions for generic netlink

Also adds better example documentation for generic netlink
ache.c
efs.h
enl/genl.c
sg.c
373bc7854537cf931a73b18ea126e75fd2f13935 09-Jan-2008 Thomas Graf <tgr@deb.localdomain> Tell git to ignore temporary files and push to pre9
gitignore
ddbe8f6c417ddba11f32e1f36bbfbdee8a598a36 08-Jan-2008 Thomas Graf <tgr@deb.localdomain> Make vlan_put_attrs() available
oute/link/vlan.c
a7469ce758fac3631df6ce72eb3f89150070e7f8 08-Jan-2008 Thomas Graf <tgr@deb.localdomain> Link info interface and vlan support

Adds an external interface to implement link info types and
implements the type vlan.
akefile
oute/link.c
oute/link/api.c
oute/link/vlan.c
195241473723527e2f30ac120087f106c607ce3e 19-Dec-2007 Thomas Graf <tgr@deb.localdomain> Add support for the IFF_ECHO flag
oute/link.c
3ad4665be2f192291238cbe78118a57ec42436c6 19-Dec-2007 Thomas Graf <tgr@deb.localdomain> Support link operstate and linkmode
ddr.c
oute/link.c
464988628802b76d5b3e50af99158413ac28bd18 19-Dec-2007 Thomas Graf <tgr@deb.localdomain> Represent default route with destination address length zero

So far the destination address for default routes was NULL
which complicated the handling of routes in general. By
assigning a address of length zero they can be compared
to each other.

This allows the cache manager to properly handle default
routes.
oute/route.c
oute/route_obj.c
680c54fd4616649763a50b122df6cff53b9e62bd 18-Dec-2007 Thomas Graf <tgr@deb.localdomain> Support defining the default callback handler with an environment variable
ocket.c
3c56ed5787481a06703ffb25561df3dd56b447bd 18-Dec-2007 Thomas Graf <tgr@deb.localdomain> Read debugging environment variable when initializing the library
tils.c
3f0f32bf79612931c37505862fd330bc79758432 17-Dec-2007 Thomas Graf <tgr@deb.localdomain> Fix nl_msg_parse() to not give back a reference it does not own
sg.c
12ed4a03d302c2ba02799c3b2e4166dee7f9142a 17-Dec-2007 Thomas Graf <tgr@deb.localdomain> Fix cache manager to not give back a reference it does not own
ache_mngr.c
155ad439a49df034ec58ee4218834bc5b0120515 17-Dec-2007 Thomas Graf <tgr@deb.localdomain> Fix memory leak when parsing netlink messages into caches

The reference created by the parsers was never given back.
ib_lookup/lookup.c
enl/ctrl.c
etfilter/ct.c
etfilter/log.c
oute/addr.c
oute/class.c
oute/classifier.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
oute/route.c
oute/rule.c
ocket.c
91c330aae51cd6cd44ad730e10dc82724998c810 17-Dec-2007 Thomas Graf <tgr@deb.localdomain> Fix creation and destruction of sockets

Fixes an off-by-one when releasing local ports. Fixes nl_connect()
to properly close the socket upon failure. Return EBADFD if
operations are performed on unconnected sockets where appropriate.
Makes nl_handle_alloc() return an error if all local ports are
used up.
l.c
ocket.c
936c9844b0ff4aab06301f18fe31e08b1818d0a2 13-Dec-2007 Patrick McHardy <kaber@trash.net> [LIBNL]: Fix format strings

Use %td for ptrdiff_t and %zu for size_t.

Signed-off-by: Patrick McHardy <kaber@trash.net>
ttr.c
sg.c
e166565121f24705f6269b9bec1c8de0bce465ea 21-Nov-2007 Thomas Graf <tgr@deb.localdomain> Pushed to pre8 due to wrong version string in pre7
efs.h
d36d396fd0ae94aa2269546a02b5973b4ec27775 11-Oct-2007 Thomas Graf <tgraf@suug.ch> Cache message type association interface cleanups
ache_mngt.c
sg.c
cbe8902265ccc9f6aa6453aeb3a2a4631ed0eb01 18-Sep-2007 Philip Craig <philipc@snapgear.com> Allow filtering by name for conntrack status flags
etfilter/ct_obj.c
104e158bd578bceacf37ba24dd1a1a907fc53d05 18-Sep-2007 Philip Craig <philipc@snapgear.com> Fix typo in conntrack object compare
etfilter/ct_obj.c
3040a1d6254465bed9e44e4d1bf279c2c50cd16a 17-Sep-2007 Thomas Graf <tgraf@suug.ch> Export interface to define caches

This interface was internal so far which required all code defining
caches to be compiled with the sources available.

In order to simplify the interface, the co_msg_parser prototype was
changed to take the struct nl_parser_param directly instead of a
void *. It used to be void * because the co_msg_parser was directly
passed as the NL_CB_VALID callback function.
ib_lookup/lookup.c
enl/mngt.c
etfilter/ct.c
etfilter/log.c
oute/addr.c
oute/class.c
oute/classifier.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/qdisc.c
oute/route.c
oute/rule.c
3d8efba91778b65a40d50ca0b6ba91d4071564c5 17-Sep-2007 Thomas Graf <tgraf@suug.ch> Check for availability of request_update()

The implementation of this function is optional if a cache wishes to
be updated by notifications only.
ache.c
508685c269275cb7ba3471c75abc689b4e3839b1 15-Sep-2007 Thomas Graf <tgraf@suug.ch> Export interface to define objects

This interface was internal so far which required all code defining
objects to be compiled with the sources available.

This change exposes struct nl_object_ops which seems safe as it
is not supposed to be embedded in other structures.

Patch contains extensive documentation to help with the creation
of own object implementations.
tils.c
44d362409d5469aed47d19e7908d19bd194493a4 15-Sep-2007 Thomas Graf <tgraf@suug.ch> Initial import
akefile
ddr.c
ttr.c
ache.c
ache_mngr.c
ache_mngt.c
ata.c
efs.h
efs.h.in
oc.c
amily.c
ib_lookup/lookup.c
ib_lookup/request.c
enl/ctrl.c
enl/family.c
enl/genl.c
enl/mngt.c
andlers.c
sg.c
etfilter/ct.c
etfilter/ct_obj.c
etfilter/log.c
etfilter/log_obj.c
etfilter/nfnl.c
l.c
bject.c
oute/addr.c
oute/class.c
oute/class_api.c
oute/class_obj.c
oute/classifier.c
oute/cls/fw.c
oute/cls/police.c
oute/cls/u32.c
oute/cls_api.c
oute/cls_obj.c
oute/link.c
oute/neigh.c
oute/neightbl.c
oute/nexthop.c
oute/qdisc.c
oute/qdisc_api.c
oute/qdisc_obj.c
oute/route.c
oute/route_obj.c
oute/route_utils.c
oute/rtnl.c
oute/rule.c
oute/sch/blackhole.c
oute/sch/cbq.c
oute/sch/dsmark.c
oute/sch/fifo.c
oute/sch/htb.c
oute/sch/netem.c
oute/sch/prio.c
oute/sch/red.c
oute/sch/sfq.c
oute/sch/tbf.c
oute/tc.c
ocket.c
tils.c