]> granicus.if.org Git - libnl/log
libnl
14 years agonl-qdisc-add(8), nl-qdisc-delete(8), nl-qdisc-list(8)
Thomas Graf [Thu, 21 Oct 2010 14:14:15 +0000 (16:14 +0200)]
nl-qdisc-add(8), nl-qdisc-delete(8), nl-qdisc-list(8)

14 years agonl-class-list tool
Thomas Graf [Wed, 20 Oct 2010 15:40:44 +0000 (17:40 +0200)]
nl-class-list tool

Same syntax as nl-qdisc-list

14 years agonl-class-delete tool
Thomas Graf [Wed, 20 Oct 2010 15:15:58 +0000 (17:15 +0200)]
nl-class-delete tool

Tool based on nl-qdisc-delete to delete traffic classes.

14 years agoMake nl-qdisc-delete installable
Thomas Graf [Wed, 20 Oct 2010 14:20:37 +0000 (16:20 +0200)]
Make nl-qdisc-delete installable

Fixes nl_cli_confirm() and adds a check enforcing --yes before deleting
all qdiscs on all devices.

14 years agoRemove NL_DUMP_ENV code
Thomas Graf [Wed, 20 Oct 2010 13:32:45 +0000 (15:32 +0200)]
Remove NL_DUMP_ENV code

Dumping objects as environment variables has never been implemented
completely and only increases the size of the library for no real
purpose. Integration into scripts is better achieved by implementing
a python module anyway.

14 years agomake nl-qdisc-list installable
Thomas Graf [Wed, 20 Oct 2010 13:26:06 +0000 (15:26 +0200)]
make nl-qdisc-list installable

Also improves usability of nl-qdisc-list

14 years agonl-class-add tool
Thomas Graf [Wed, 20 Oct 2010 12:57:39 +0000 (14:57 +0200)]
nl-class-add tool

Adds a cli based tool to add/update traffic classes. This tool requires
each class to be supported via the respetive qdisc module in
pkglibdir/cli/qdisc/$name.so.

Syntax:
nl-class-add --dev eth2 --parent 1: --id 1:1 htb --rate 100mbit
nl-class-add --update --dev eth2 --id 1:1 htb --rate 200mbit

14 years agopfifo/bfifo qdisc support for cli libs
Thomas Graf [Tue, 19 Oct 2010 14:51:55 +0000 (16:51 +0200)]
pfifo/bfifo qdisc support for cli libs

14 years agoremove obsolete nl-qdisc-add code
Thomas Graf [Tue, 19 Oct 2010 14:35:26 +0000 (16:35 +0200)]
remove obsolete nl-qdisc-add code

14 years agoclassid database
Thomas Graf [Tue, 19 Oct 2010 14:31:23 +0000 (16:31 +0200)]
classid database

A database to resolve qdisc/class names to classid values and vice versa.
The function rtnl_tc_handle2str() and rtnl_tc_str2handle() will resolve
names automatically.

A CLI based tool nl-classid-lookup is provided to integrate the database
into existing iproute2 scripts.

14 years agoHTB: Append TCA_OPTIONS even if no options are set
Thomas Graf [Tue, 19 Oct 2010 11:10:26 +0000 (13:10 +0200)]
HTB: Append TCA_OPTIONS even if no options are set

The kernel requires the TCA_OPTIONS{TCA_HTB_INIT} attribute to be
present even if the default values are to be used.

14 years agonl-qdisc-add tool
Thomas Graf [Tue, 19 Oct 2010 11:06:42 +0000 (13:06 +0200)]
nl-qdisc-add tool

Adds a cli based tool to add/update/replace qdiscs. This tool requires
each qdisc to be supported via a dynamic loadable module in
pkglibdir/cli/qdisc/$name.so.

So far HTB and blackhole have been implemented.

Syntax:
nl-qdisc-add --dev eth2 --parent root --id 1: htb --r2q=5
nl-qdisc-add --update-only --dev eth2 --id 1: htb --r2q=10

14 years ago- Prepare for 2.1.x tree
Thomas Graf [Thu, 14 Oct 2010 11:56:46 +0000 (13:56 +0200)]
- Prepare for 2.1.x tree
- Bump interface number, we will break API in the development tree

14 years agoGeneric Netlink multicast groups support
dima [Wed, 13 Oct 2010 14:53:34 +0000 (17:53 +0300)]
Generic Netlink multicast groups support

I have a patch against commit d378220c96c3c8b6f27dca33e7d8ba03318f9c2d
extending libnl with a facility to receive generic netlink messages sent
to multicast groups.

Essentially it add one new function genl_ctrl_resolve_grp which
prototype looks like this
int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name,
        const char *grp_name)
It resolves  the family name and the group name to group id. Then
the returned id can be used in nl_socket_add_membership to subscribe
to multicast messages.

Besides that it adds two more functions

uint32_t nl_socket_get_peer_groups(struct nl_sock *sk)
void nl_socket_set_peer_groups(struct nl_sock *sk, uint32_t groups)

allowing to modify the socket peer groups field. So it's possible to
multicast messages from the user space using the legacy interface.
Looks like there is no way (or I was not able to find one?) to modify
the netlink socket destination group from the user space, when the
group id is greater then 32.

14 years agoDon't include pktloc_syntax.h in BUILT_SOURCES libnl2_0
Thomas Graf [Wed, 13 Oct 2010 14:50:33 +0000 (16:50 +0200)]
Don't include pktloc_syntax.h in BUILT_SOURCES

14 years agoroute_obj: don't add empty destination to nlmsg
David Lamparter [Wed, 13 Oct 2010 13:17:33 +0000 (15:17 +0200)]
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>
14 years agoautomake: add ${top_builddir}/include to AM_CFLAGS
Andreas Bießmann [Thu, 5 Aug 2010 13:19:02 +0000 (15:19 +0200)]
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>
14 years agoUse CPPFLAGS
Thomas Graf [Wed, 13 Oct 2010 12:30:50 +0000 (14:30 +0200)]
Use CPPFLAGS

14 years agoPut preprocessor definitions in AM_CPPFLAGS
Matthew L. Creech [Mon, 19 Apr 2010 15:16:30 +0000 (11:16 -0400)]
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.

14 years agoadd user data to change_func_t for caches
Andreas Fett [Wed, 22 Sep 2010 18:10:26 +0000 (20:10 +0200)]
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.

14 years agoTrivial fix for TBF memleak
Denys Fedorysychenko [Fri, 9 Jul 2010 23:48:06 +0000 (02:48 +0300)]
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.

14 years agolibnl: optionally disable cli tools.
Karl Hiramoto [Wed, 16 Jun 2010 14:33:51 +0000 (16:33 +0200)]
libnl: optionally disable cli tools.

compile and link time can reduced, most non-developers don't need these cli tools.

./configure --disable-cli
time make
real    0m40.485s
user    0m33.784s
sys     0m2.793s

./configure
time make
real    0m53.097s
user    0m42.077s
sys     0m4.396s

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
14 years agoIgnore vim swap files
Thomas Graf [Sat, 3 Jul 2010 13:56:51 +0000 (15:56 +0200)]
Ignore vim swap files

14 years agoLet git ignore generated pktloc source files
Thomas Graf [Sat, 3 Jul 2010 13:56:07 +0000 (15:56 +0200)]
Let git ignore generated pktloc source files

14 years agoFix compile warning in utils.c
Thomas Graf [Sat, 3 Jul 2010 13:17:04 +0000 (15:17 +0200)]
Fix compile warning in utils.c

14 years agoFix compile warning in nl.c
Thomas Graf [Sat, 3 Jul 2010 13:14:13 +0000 (15:14 +0200)]
Fix compile warning in nl.c

14 years agoPacket Location Interface
Thomas Graf [Fri, 2 Jul 2010 12:06:59 +0000 (14:06 +0200)]
Packet Location Interface

14 years agosrc/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE
Karl Hiramoto [Thu, 18 Mar 2010 16:50:20 +0000 (17:50 +0100)]
src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE

* Fix filename in file header

* If the kernel or netlink socket becomes over loaded,
  the kernel starts printing error messages like:

nf_queue: full at 1024 entries, dropping packets(s). Dropped: 1
nf_queue: full at 1024 entries, dropping packets(s). Dropped: 2
nf_queue: full at 1024 entries, dropping packets(s). Dropped: 3

So detect out of order packet ID's and set the NF_ACCEPT verdictÂ,
so they will be removed from the kernel queue.

* increase socket buffer to improve performance

without these changes sending more than 100 KB/s over tcp HTTP lo(localhost)
was difficult on my core2 duo machine, due to so many dropped packets.
After these changes over 150 MB/s was easy.

* improve help text

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
14 years agoDon't install private header files.
Thomas Graf [Mon, 19 Apr 2010 10:56:31 +0000 (12:56 +0200)]
Don't install private header files.

14 years agoobject: fix attribute comparison
Patrick McHardy [Wed, 7 Apr 2010 17:15:40 +0000 (19:15 +0200)]
object: fix attribute comparison

Currently two attributes are regarded as different if they are absent in
both objects to be compared. This is obviously incorrect, change to
regard objects as different if an attribute is only present on one of
them or if the attribute data differs.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoFix rule attribute comparison
Patrick McHardy [Wed, 7 Apr 2010 17:21:47 +0000 (19:21 +0200)]
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>
14 years agoaddr: add NL_DUMP_ENV function
Patrick McHardy [Wed, 7 Apr 2010 17:20:21 +0000 (19:20 +0200)]
addr: add NL_DUMP_ENV function

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoaddr: restore anycast functions
Patrick McHardy [Wed, 7 Apr 2010 17:19:14 +0000 (19:19 +0200)]
addr: restore anycast functions

Seems it got lost during some cleanups.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoneigh: fix id_attrs to include ifindex
Patrick McHardy [Wed, 7 Apr 2010 17:17:42 +0000 (19:17 +0200)]
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>
14 years agocache: properly invoke change_cb for deleted objects in nl_cache_resync()
Patrick McHardy [Wed, 7 Apr 2010 17:16:22 +0000 (19:16 +0200)]
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>
14 years agoFix a bug when calculating ticks_per_usec
Jose Ignacio Naranjo Hernández [Thu, 14 Jan 2010 17:10:10 +0000 (18:10 +0100)]
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.

14 years agonew function nfnl_queue_msg_send_verdict_payload()
Karl Hiramoto [Wed, 24 Feb 2010 20:29:14 +0000 (21:29 +0100)]
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>
14 years agonew feature nl_send_iovec(), nl_auto_complete() and code refactoring.
Karl Hiramoto [Wed, 24 Feb 2010 20:29:13 +0000 (21:29 +0100)]
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>
14 years agoCLI - Command Line Interface Library
Thomas Graf [Wed, 16 Dec 2009 15:20:46 +0000 (16:20 +0100)]
CLI - Command Line Interface Library

Moved common code in src/ used by CLI tools to src/lib/ for possible use
by other CLI tools. Just link to libnl-cli.{so|la}

14 years agoone more fix, u32.c
Denys Fedoryschenko [Sat, 14 Nov 2009 19:10:18 +0000 (21:10 +0200)]
one more fix, u32.c

One more segfault, also nl-tctree-list , fix
Probably need reformat for better look
Patch attached

14 years agoinvalid comma cause segfault for nl-tctree-list, tbf.c
Denys Fedoryschenko [Sat, 14 Nov 2009 18:59:49 +0000 (20:59 +0200)]
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.

14 years agolibnl: add ERANGE to errno translation
Patrick McHardy [Thu, 5 Nov 2009 12:38:26 +0000 (13:38 +0100)]
libnl: add ERANGE to errno translation

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agolibnl: fix automake breakage
Patrick McHardy [Thu, 5 Nov 2009 12:38:00 +0000 (13:38 +0100)]
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>
15 years ago- Compile with _GNU_SOURCE
Thomas Graf [Wed, 2 Sep 2009 22:01:33 +0000 (00:01 +0200)]
- Compile with _GNU_SOURCE
- Fixed classifier.c -> cls.c

15 years agoMerge branch 'master' of git://dev.medozas.de/libnl
Thomas Graf [Wed, 2 Sep 2009 21:41:03 +0000 (23:41 +0200)]
Merge branch 'master' of git://dev.medozas.de/libnl

Conflicts:
lib/Makefile
src/Makefile

15 years agoAdd support for getting and deleting queueing classes.
olc [Mon, 20 Jul 2009 13:56:30 +0000 (15:56 +0200)]
Add support for getting and deleting queueing classes.

15 years agoFix rtnl_addr caching
Dan Winship [Thu, 20 Aug 2009 13:29:26 +0000 (09:29 -0400)]
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.

15 years agoPatch for unexpectedly aligned messages
Marc de Kruijf [Wed, 26 Aug 2009 21:28:01 +0000 (16:28 -0500)]
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.

15 years ago- Reworked the classifier interface.
Thomas Graf [Wed, 2 Sep 2009 16:31:14 +0000 (18:31 +0200)]
- Reworked the classifier interface.
- Added initial ematch support
- Added support for the basic classifier
- Added support for the cgroup classifier

15 years agonl_object_clone: properly clone ce_mask field
Alexander Sack [Sat, 4 Jul 2009 23:56:31 +0000 (01:56 +0200)]
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.

15 years agoDeclare struct ucred in handlers.h and netlink.h
Pavel Roskin [Mon, 6 Jul 2009 19:13:28 +0000 (15:13 -0400)]
Declare struct ucred in handlers.h and netlink.h

Both files refer to it.  The sources including those files are not
guaranteed to include sys/socket.h to ensure that struct ucred is
defined.

15 years agobuild: make use of library dependencies
Jan Engelhardt [Sun, 5 Jul 2009 16:00:41 +0000 (18:00 +0200)]
build: make use of library dependencies

15 years agoMove to automake-based build
Jan Engelhardt [Mon, 22 Jun 2009 23:12:53 +0000 (01:12 +0200)]
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>
15 years agorelease_local_port: properly compute the bitmap position
Inaky Perez-Gonzalez [Mon, 27 Apr 2009 21:46:08 +0000 (14:46 -0700)]
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>
15 years agoSeparate compiling from linking
Pavel Roskin [Tue, 7 Apr 2009 21:04:10 +0000 (17:04 -0400)]
Separate compiling from linking

This helps users understand where possible warnings come from.
It also allows more find-grained control over the build flags.

15 years agonl_object_priv() is inline, so define it in the header
Pavel Roskin [Tue, 7 Apr 2009 21:04:04 +0000 (17:04 -0400)]
nl_object_priv() is inline, so define it in the header

15 years agoRemove all versioned libraries on "make clean"
Pavel Roskin [Tue, 7 Apr 2009 21:03:58 +0000 (17:03 -0400)]
Remove all versioned libraries on "make clean"

15 years agoFix parallel build
Pavel Roskin [Tue, 7 Apr 2009 21:03:52 +0000 (17:03 -0400)]
Fix parallel build

When linking against libnl, require libnl.so to exist.  When linking
against libnl-route, require libnl-route.so to exist.

15 years agoInclude limits.h to fix undefined ULONG_MAX in src/utils.c
Pavel Roskin [Tue, 7 Apr 2009 21:03:46 +0000 (17:03 -0400)]
Include limits.h to fix undefined ULONG_MAX in src/utils.c

15 years agolibnl: fix socket function rename related build failure
Patrick McHardy [Wed, 21 Jan 2009 07:06:13 +0000 (08:06 +0100)]
libnl: fix socket function rename related build failure

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoFix up naming changes
Thomas Graf [Wed, 10 Dec 2008 17:16:31 +0000 (18:16 +0100)]
Fix up naming changes

15 years agorestructure module documentation order
Thomas Graf [Wed, 10 Dec 2008 17:12:30 +0000 (18:12 +0100)]
restructure module documentation order

split hiearchy into one top level module per library

15 years agoRemove obsoleted struct nl_handle definition
Thomas Graf [Wed, 10 Dec 2008 17:02:25 +0000 (18:02 +0100)]
Remove obsoleted struct nl_handle definition

15 years agoConsistent naming of socket functions
Thomas Graf [Wed, 10 Dec 2008 17:00:11 +0000 (18:00 +0100)]
Consistent naming of socket functions

15 years agoUpdate doc style sheet to latest default
Thomas Graf [Wed, 3 Dec 2008 19:00:03 +0000 (20:00 +0100)]
Update doc style sheet to latest default

15 years agoDocumentation update
Thomas Graf [Wed, 3 Dec 2008 18:58:41 +0000 (19:58 +0100)]
Documentation update

15 years agoAllow to pass multiple group values to membership functions
Holger Eitzenberger [Mon, 1 Dec 2008 13:38:06 +0000 (14:38 +0100)]
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>
15 years agolibnl: add some errno codes to nl_syserr2nlerr
Patrick McHardy [Fri, 24 Oct 2008 04:50:21 +0000 (06:50 +0200)]
libnl: add some errno codes to nl_syserr2nlerr

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agolibnl: nfqueue: add nfqueue specific socket allocation function
Patrick McHardy [Thu, 23 Oct 2008 11:47:08 +0000 (13:47 +0200)]
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>
16 years agoAdd internal wait_for_ack() which only waits for ACK if !NL_NO_AUTO_ACK
Thomas Graf [Mon, 20 Oct 2008 11:12:13 +0000 (13:12 +0200)]
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.

16 years agoAdd socket flag NL_NO_AUTO_ACK to allow disabling auto ACKS
Thomas Graf [Mon, 20 Oct 2008 11:02:38 +0000 (13:02 +0200)]
Add socket flag NL_NO_AUTO_ACK to allow disabling auto ACKS

16 years agoError handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops()
Thomas Graf [Wed, 15 Oct 2008 11:01:46 +0000 (13:01 +0200)]
Error handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops()

16 years agoUse 16bit ints for classifier prio/protocol
Thomas Graf [Wed, 15 Oct 2008 10:25:26 +0000 (12:25 +0200)]
Use 16bit ints for classifier prio/protocol

16 years agoReplace NL_KEEP code with proper message reference counting
Thomas Graf [Tue, 14 Oct 2008 17:26:44 +0000 (19:26 +0200)]
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.

16 years agoOnly include local addr as peer addr if provided
Wolfgang Steudel [Tue, 7 Oct 2008 04:43:59 +0000 (06:43 +0200)]
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).

16 years agofix lib symlinks
Patrick McHardy [Fri, 5 Sep 2008 14:30:58 +0000 (16:30 +0200)]
fix lib symlinks

16 years agoFrom: Kees Cook <kees@outflux.net>
Thomas Graf [Fri, 10 Oct 2008 10:13:52 +0000 (12:13 +0200)]
From: Kees Cook <kees@outflux.net>
Hello!  It seems that libnl is missing an include for limits.h, which
causes it to FTBFS when glibc 2.8 is installed (currently in
experimental, so I left this bug severity at "normal").

16 years agotest updates
Thomas Graf [Wed, 20 Aug 2008 10:01:50 +0000 (12:01 +0200)]
test updates

16 years agoadapt configure to generate libnl-2.0.pc
Thomas Graf [Mon, 18 Aug 2008 23:48:50 +0000 (01:48 +0200)]
adapt configure to generate libnl-2.0.pc

16 years agoChanged libnl-1.pc.in to libnl-2.0.pc.in
James J. Dines [Tue, 1 Jul 2008 01:53:06 +0000 (21:53 -0400)]
Changed libnl-1.pc.in to libnl-2.0.pc.in

(Also changed top level Makefile to reflect the change in libnl version)

16 years agolibnl: fix about 100 warnings
Holger Schurig [Thu, 14 Aug 2008 09:53:38 +0000 (11:53 +0200)]
libnl: fix about 100 warnings

In file included from addr.c:28:
../include/netlink-local.h:119:1: warning: "__deprecated" redefined
In file included from /usr/include/linux/stddef.h:4,
                 from /usr/include/linux/posix_types.h:4,
                 from /usr/include/linux/types.h:8,
                 from ../include/netlink-local.h:37,
                 from addr.c:28:
/usr/include/linux/compiler.h:45:1: warning: this is the location of the previous definition

This happens about 100 times. Suggested patch:

16 years agoExplicitely link to nl-route when linking nf apps.
Thomas Graf [Mon, 18 Aug 2008 23:35:01 +0000 (01:35 +0200)]
Explicitely link to nl-route when linking nf apps.

ld won't resolve its own deps in -L../lib/ for some
reason.

16 years agoRemove XML dumping
Thomas Graf [Tue, 17 Jun 2008 01:04:19 +0000 (03:04 +0200)]
Remove XML dumping

Bloats the library, not frequently used

16 years agoFix compile errors when linking against libnl-genl
Thomas Graf [Tue, 17 Jun 2008 00:57:33 +0000 (02:57 +0200)]
Fix compile errors when linking against libnl-genl

16 years agoImprovements to address utilities
Thomas Graf [Tue, 17 Jun 2008 00:52:18 +0000 (02:52 +0200)]
Improvements to address utilities

- Moved env var dumping to nl-addr-list.c
- support for ipv6 lifetimes
- correct and complete help texts

16 years ago<netlink/addr.h> requires <netdb.h>
Thomas Graf [Tue, 17 Jun 2008 00:09:38 +0000 (02:09 +0200)]
<netlink/addr.h> requires <netdb.h>

16 years agoNeed <linux/in_route.h>
Thomas Graf [Mon, 16 Jun 2008 22:00:05 +0000 (00:00 +0200)]
Need <linux/in_route.h>

16 years agoImproved printing of route cache entries
Thomas Graf [Mon, 16 Jun 2008 21:59:09 +0000 (23:59 +0200)]
Improved printing of route cache entries

16 years agoExtend nl_time2int() and rename it to nl_str2msec()
Thomas Graf [Mon, 16 Jun 2008 11:54:57 +0000 (13:54 +0200)]
Extend nl_time2int() and rename it to nl_str2msec()

Support parsing of more complex time duration input.

16 years agoIntroduce nla_strdup() to help parse strings attributes
Thomas Graf [Fri, 13 Jun 2008 14:40:41 +0000 (16:40 +0200)]
Introduce nla_strdup() to help parse strings attributes

16 years agoProperly handle addr=NULL in nl_addr2str
Thomas Graf [Fri, 13 Jun 2008 14:39:35 +0000 (16:39 +0200)]
Properly handle addr=NULL in nl_addr2str

16 years agoRemove unused dp_dump_line()
Thomas Graf [Mon, 26 May 2008 13:11:08 +0000 (15:11 +0200)]
Remove unused dp_dump_line()

16 years agoUpdate linux/rtnetlink.h to upstream version
Thomas Graf [Mon, 26 May 2008 13:10:36 +0000 (15:10 +0200)]
Update linux/rtnetlink.h to upstream version

16 years agoRemove old line counting while dumping
Thomas Graf [Fri, 23 May 2008 21:45:14 +0000 (23:45 +0200)]
Remove old line counting while dumping

16 years agoNew set of libnl tools
Thomas Graf [Thu, 22 May 2008 22:02:02 +0000 (00:02 +0200)]
New set of libnl tools

Converts all tools to the API changes and improves the useability by
introducing regular options and long options.

16 years agoPresent port and icmp values in host byte order and beautify printing
Thomas Graf [Thu, 22 May 2008 21:55:52 +0000 (23:55 +0200)]
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.

16 years agoDon't build tests on 'make all'
Thomas Graf [Thu, 22 May 2008 21:53:16 +0000 (23:53 +0200)]
Don't build tests on 'make all'

16 years agoRemove change routine, works flawlessly via add() with NLM_F_REPLACE
Thomas Graf [Thu, 22 May 2008 21:52:53 +0000 (23:52 +0200)]
Remove change routine, works flawlessly via add() with NLM_F_REPLACE

This breaks the API but is the right thing to do.

16 years agoImprove printing of routing rules
Thomas Graf [Thu, 22 May 2008 21:51:02 +0000 (23:51 +0200)]
Improve printing of routing rules

16 years agoFamily specific libraries can link to the core directly
Thomas Graf [Thu, 22 May 2008 21:50:01 +0000 (23:50 +0200)]
Family specific libraries can link to the core directly