]> granicus.if.org Git - libnl/log
libnl
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

16 years agoFix error code of nl_addr_resolve()
Thomas Graf [Thu, 22 May 2008 21:49:11 +0000 (23:49 +0200)]
Fix error code of nl_addr_resolve()

16 years agoAdd rtnl_neigh_get_family()
Thomas Graf [Tue, 20 May 2008 10:14:21 +0000 (12:14 +0200)]
Add rtnl_neigh_get_family()

16 years agoReturn libnl error codes in translation routines
Thomas Graf [Tue, 20 May 2008 10:13:48 +0000 (12:13 +0200)]
Return libnl error codes in translation routines

16 years agoRemove src/f_addr.c, it's no longer used
Thomas Graf [Thu, 15 May 2008 22:41:42 +0000 (00:41 +0200)]
Remove src/f_addr.c, it's no longer used

16 years agoutility functions for address tools
Thomas Graf [Thu, 15 May 2008 18:29:08 +0000 (20:29 +0200)]
utility functions for address tools

16 years agoNew set of address management tools
Thomas Graf [Thu, 15 May 2008 18:27:50 +0000 (20:27 +0200)]
New set of address management tools

16 years agoFix library install target
Thomas Graf [Thu, 15 May 2008 18:26:37 +0000 (20:26 +0200)]
Fix library install target

16 years agoRemove references to unused attribute anycast
Thomas Graf [Thu, 15 May 2008 18:25:15 +0000 (20:25 +0200)]
Remove references to unused attribute anycast

16 years agoMove on to version 2.0 to account for the serious ABI breakage
Thomas Graf [Thu, 15 May 2008 17:29:17 +0000 (19:29 +0200)]
Move on to version 2.0 to account for the serious ABI breakage

16 years agoBuild separate libraries for each netilnk family
Thomas Graf [Thu, 15 May 2008 16:01:50 +0000 (18:01 +0200)]
Build separate libraries for each netilnk family

This reduces the footprint on systems which only require a small
subset of the library.

16 years agoAllow parser callbacks to return NL_OK, NL_SKIP, NL_EXIT
Thomas Graf [Thu, 15 May 2008 12:01:57 +0000 (14:01 +0200)]
Allow parser callbacks to return NL_OK, NL_SKIP, NL_EXIT

Obsoletes internal P_ACCEPT/P_IGNORE

16 years agoUninline various functions to save 7K code
Thomas Graf [Thu, 15 May 2008 11:56:13 +0000 (13:56 +0200)]
Uninline various functions to save 7K code

16 years agoFix memory leaks when sending of message failed
Thomas Graf [Thu, 15 May 2008 11:45:41 +0000 (13:45 +0200)]
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.

16 years agoRename struct nl_handle to struct nl_sock
Thomas Graf [Thu, 15 May 2008 11:26:32 +0000 (13:26 +0200)]
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.

16 years agoCheck length of provided address label
Thomas Graf [Wed, 14 May 2008 21:08:06 +0000 (23:08 +0200)]
Check length of provided address label

16 years agoReplace RTNL_LINK_NOT_FOUND with just 0
Thomas Graf [Wed, 14 May 2008 16:34:39 +0000 (18:34 +0200)]
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.

16 years agoRemove obsolete nla_get_addr() and nla_get_data()
Thomas Graf [Wed, 14 May 2008 16:26:47 +0000 (18:26 +0200)]
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.

16 years agoBreak API some more
Thomas Graf [Wed, 14 May 2008 15:56:22 +0000 (17:56 +0200)]
Break API some more

Since we've broken the API anyway, remove some aliases which only
exist for backwards compatibility.

16 years agoThread-safe error handling
Thomas Graf [Wed, 14 May 2008 15:49:44 +0000 (17:49 +0200)]
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!

16 years agopatch: fixed compilation problem for nl-route-get
Ben Gamsa [Thu, 8 May 2008 15:43:08 +0000 (11:43 -0400)]
patch: fixed compilation problem for nl-route-get

Fixed compilation problem for nl-route-get by adding extra parameter now
needed for nltool_alloc_route_cache() function.

16 years agopatch: fixed up support for tables in rules
Ben Gamsa [Thu, 8 May 2008 15:42:51 +0000 (11:42 -0400)]
patch: fixed up support for tables in rules

16 years agoAdded two new functions to facilitate processing the nexthop entries for routes.
Ben Gamsa [Thu, 8 May 2008 15:42:09 +0000 (11:42 -0400)]
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.

16 years agoSpeed up metrics comparison
Thomas Graf [Thu, 8 May 2008 10:47:26 +0000 (12:47 +0200)]
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.

16 years agoImprove performance by using malloc() over calloc() in critical places
Thomas Graf [Wed, 7 May 2008 11:18:30 +0000 (13:18 +0200)]
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.

16 years agoignore more temporary files
Thomas Graf [Mon, 5 May 2008 15:13:02 +0000 (17:13 +0200)]
ignore more temporary files

16 years agoFix dumping of iif route attribute
Thomas Graf [Mon, 5 May 2008 15:09:56 +0000 (17:09 +0200)]
Fix dumping of iif route attribute

16 years agoRoute cache support
Thomas Graf [Mon, 5 May 2008 15:09:25 +0000 (17:09 +0200)]
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.

16 years agoFixed netem_build_msg() delay distribution table existence test.
Tad Kollar [Wed, 30 Apr 2008 19:19:09 +0000 (15:19 -0400)]
Fixed netem_build_msg() delay distribution table existence test.

16 years agoNew netem funtionality and TBF fix
Tad Kollar [Wed, 30 Apr 2008 15:40:44 +0000 (11:40 -0400)]
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.

16 years agoRemove leftover definition of verbose errors
Thomas Graf [Wed, 30 Apr 2008 16:53:01 +0000 (18:53 +0200)]
Remove leftover definition of verbose errors

16 years agoversion.h.in should be in tree not the generated version
Thomas Graf [Wed, 30 Apr 2008 16:52:28 +0000 (18:52 +0200)]
version.h.in should be in tree not the generated version