Thomas Graf [Tue, 13 Sep 2011 20:58:08 +0000 (22:58 +0200)]
Switch to libtool versioning system
It has been a request that multiple libnl versions should be installabe
in parallel.
In order to achieve this, the basename of the library was changed to
libnl-3 which reflects the 3rd generation of libnl APIs. It also means
that release based library versioning is left behind and libtool
versioning is used instead.
Projects using pkgconfig will automatically link against the new library
basename and will not notice a difference.
The SO versioning is based on the glib model:
current := 100 * minor + micro - revision
revision := revision
age := age (number of backwards compatible versions)
Jan Engelhardt [Wed, 24 Aug 2011 10:09:46 +0000 (12:09 +0200)]
build: always install files into /etc/libnl
I observed that with the RedHat build target in the Open Build
Service, files were put into /etc rather than /etc/libnl.
Self-referential variables are a bad idea, and so just avoid this.
Thomas Graf [Tue, 13 Sep 2011 09:48:18 +0000 (11:48 +0200)]
Install headers in ${includedir}/libnl3
This allows for multiple major versions to be installed in parallel. Pkg-config
files are adapted to provide appropriate cflags to find new header locations.
Thomas Graf [Thu, 8 Sep 2011 13:03:25 +0000 (15:03 +0200)]
fix license of lib/route/pktloc.c
As Jan Engelhardt pointed out, pktloc.c is currently licenses under the GPL
rather than the LGPL. This is a result of its previous existance in src/
which is GPL licensed. I missed to change its license when moving it to
lib/. Since I am the only contributor to the code, I am changing the license
hereby.
Bryan Phillippe [Wed, 31 Aug 2011 18:11:59 +0000 (11:11 -0700)]
64bit unaligned access
This patch fixes an unaligned access for IPv6. On systems with strict alignment requirements, the unaligned access will either result in garbage data or a crash.
Jiri Pirko [Wed, 31 Aug 2011 09:14:43 +0000 (11:14 +0200)]
genl: genl_ctrl_grp_by_name: fix retval in case group id not found
Now the return value in case group id is not find is 0. Change it to
return -NLE_OBJ_NOTFOUND which makes more sense. This should not break
anything because genl_ctrl_grp_by_name is static and called only from
genl_ctrl_resolve_grp. genl_ctrl_resolve_grp already might return
-NLE_OBJ_NOTFOUND.
Thomas Graf [Thu, 21 Jul 2011 14:24:31 +0000 (16:24 +0200)]
more documentation updates
- improved stylesheets for both doxygen and asciidoc
- use of xml doxygen layout
- python script to resolve <<foo>> asciidoc references to
<<foo, title>> based on the target caption
- graphics for netlink and netlink error headers
- more link documentation
Thomas Graf [Wed, 13 Apr 2011 14:42:34 +0000 (16:42 +0200)]
Improve rtnl_link_change() behaviour
- avoid unncessary name change requests
The kernel does not check if the specified IFNAME is different
from the current name. It assumes that if IFNAME and ifindex
are both specified, a name change is requested. Therefore avoid
specyfing IFNAME if ifindex is provided and original and new
name are identical.
- move link building to own function (to allow link add later on)
- error if immutable changes have been made
- better documentation
Thomas Graf [Mon, 11 Apr 2011 10:34:01 +0000 (12:34 +0200)]
API to issue direct GET requests to the kernel
Provide nl_pickup() to pick up an answer from a netlink request and parse
it using the supplied parser.
Add rtnl_link_get_kernel() which sends an RTM_GETLINK to the kernel to
fetch a single link directly from the kernel. This can be faster than
dumping the whole table, especially if lots of links are configured.
Thomas Graf [Thu, 31 Mar 2011 12:25:57 +0000 (14:25 +0200)]
Move to asciidoc
The core library documentation has been converted to use asciidoc. It
provides better flexibility in creating documentation such as tables
and more powerful formatting rules.
The doxygen based API reference remains and three scripts have been
added to:
- gen-tags.sh: extract tag information from doxygen reference
- tags2dict.sh: generate a name=link dictionary file
- doxygen-link.py: replace all references in the asciidoc documentation
refering to API functions, struct, etc. with a link
into the doxygen API reference.
'make gendoc' continue to generate all documentation.
The following tools are required to generate documentation:
- asciidoc
- mscgen
- asciidoc mscgen plugin
- pygments
- xmlstarlet
Thomas Graf [Tue, 29 Mar 2011 10:41:59 +0000 (12:41 +0200)]
trafic class/classifer API improvements and documentation
- removed dead functions in header files
- deprecated rtnl_class_foreach_*() functions due to their missing
handling possibility of OOM situations
- improved API documentation
Thomas Graf [Fri, 25 Mar 2011 17:13:19 +0000 (18:13 +0100)]
Qdisc API improvements and documentation
Deprecated the functions rtnl_qdisc_change() and
rtnl_qdisc_build_change_request() for their lack of being able to
specify flags. The new functions rtnl_qdisc_update() and
rtnl_qdisc_build_update_request() may be used instead. The old
functions are still available though. However, rtnl_qdisc_update()
no longer implies NLM_F_REPLACE, it has to specified implicitely
to allow updating a qdisc without risking to replace another qdisc.
Included detailed documentation of qdisc addition/update/deletion.
Introduced APPBUG() macro to let application developer know of
API abuse.
Nicolas Sitbon [Fri, 25 Mar 2011 14:07:23 +0000 (15:07 +0100)]
correctly handle the object not found case
Removing non existent route (both ipv4 and ipv6) using
rtnl_route_delete return NLE_FAILURE generic error code. After
investigation, it seems the linux kernel return -ESRCH in that case
(see http://lxr.linux.no/linux+v2.6.38/net/ipv6/route.c#L1367). Same
behaviour apply for removing non existent address. The function
nl_syserr2nlerr (lib/error.c) which is responsible for translating
from kernel error to libnl error doesn't handle ESRCH.
Thomas Graf [Thu, 24 Mar 2011 21:50:11 +0000 (22:50 +0100)]
Deprecate rtnl_qdisc_foreach_child() and rtnl_qdisc_foreach_cls()
Their usage is not completely safe, it is not possible to handle
the out of memory situation of the allocate filter. It is very
unlikely for this to cause any problem though.
The functions are still accessible but gcc will warn about their
deprecation.
Thierry Reding [Wed, 23 Mar 2011 14:57:52 +0000 (15:57 +0100)]
Fix "make distcheck".
This commit adds some missing files (some header files, the files below
/etc and the bison/flex files) to the distribution tarball to ensure
that libnl can be built from the tarballs created using "make dist".
It also adds some incantations to properly generate the flex and bison
output since the generated output is no longer shipped in the tarball.
Thierry Reding [Fri, 14 Jan 2011 10:38:05 +0000 (11:38 +0100)]
Fix out-of-tree build.
This patch fixes out-of-tree build, that is, when building with
$builddir != $srcdir. In such a case, some generated header files are
not found because they live in a different tree and can be fixed by
adding the directories to the compiler's include search path.