dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

103 Commits

Author SHA1 Message Date
Inaky Perez-Gonzalez ef8ba32e0c 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>
2009-05-04 14:56:24 +02:00
Pavel Roskin a8cd7b62c8 nl_object_priv() is inline, so define it in the header 2009-04-16 12:29:13 +02:00
Pavel Roskin becae5f37a Remove all versioned libraries on "make clean" 2009-04-16 12:28:58 +02:00
Pavel Roskin 1276256a72 Fix parallel build
When linking against libnl, require libnl.so to exist.  When linking
against libnl-route, require libnl-route.so to exist.
2009-04-16 12:28:48 +02:00
Thomas Graf 664e1deaeb Fix up naming changes 2008-12-10 18:16:31 +01:00
Thomas Graf 6782b6f709 restructure module documentation order
split hiearchy into one top level module per library
2008-12-10 18:12:30 +01:00
Thomas Graf 724dfa6d70 Consistent naming of socket functions 2008-12-10 18:00:11 +01:00
Thomas Graf 4fd5f7cb66 Documentation update 2008-12-03 19:58:41 +01:00
Holger Eitzenberger 72aa861c48 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>
2008-12-03 19:54:21 +01:00
Patrick McHardy 37f9855f4c libnl: add some errno codes to nl_syserr2nlerr
Signed-off-by: Patrick McHardy <kaber@trash.net>
2008-10-30 12:29:37 +01:00
Patrick McHardy 334f551c59 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>
2008-10-23 13:59:40 +02:00
Thomas Graf cfcfca0703 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.
2008-10-20 13:12:13 +02:00
Thomas Graf 2bdee95a76 Add socket flag NL_NO_AUTO_ACK to allow disabling auto ACKS 2008-10-20 13:02:38 +02:00
Thomas Graf f42f195a80 Error handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops() 2008-10-15 13:01:46 +02:00
Thomas Graf 5d92f9c03d Use 16bit ints for classifier prio/protocol 2008-10-15 12:25:26 +02:00
Thomas Graf 23ee46ef71 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.
2008-10-14 19:26:44 +02:00
Wolfgang Steudel 5702d4c1b9 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).
2008-10-10 12:32:23 +02:00
Patrick McHardy b12918df16 fix lib symlinks 2008-10-10 12:17:22 +02:00
Thomas Graf 13ab2441ce Remove XML dumping
Bloats the library, not frequently used
2008-06-17 03:04:19 +02:00
Thomas Graf ab578b9ca0 Improvements to address utilities
- Moved env var dumping to nl-addr-list.c
- support for ipv6 lifetimes
- correct and complete help texts
2008-06-17 02:52:18 +02:00
Thomas Graf 7072675b40 Improved printing of route cache entries 2008-06-16 23:59:09 +02:00
Thomas Graf c48a17694b Extend nl_time2int() and rename it to nl_str2msec()
Support parsing of more complex time duration input.
2008-06-16 13:54:57 +02:00
Thomas Graf d49018fd78 Introduce nla_strdup() to help parse strings attributes 2008-06-13 16:40:41 +02:00
Thomas Graf 5ab9421111 Properly handle addr=NULL in nl_addr2str 2008-06-13 16:39:35 +02:00
Thomas Graf d844307024 Remove old line counting while dumping 2008-05-23 23:45:14 +02:00
Thomas Graf 337fbd24ca 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.
2008-05-22 23:55:52 +02:00
Thomas Graf 531029c130 Remove change routine, works flawlessly via add() with NLM_F_REPLACE
This breaks the API but is the right thing to do.
2008-05-22 23:52:53 +02:00
Thomas Graf 18efaacc16 Improve printing of routing rules 2008-05-22 23:51:02 +02:00
Thomas Graf 566a09ecbd Family specific libraries can link to the core directly 2008-05-22 23:50:01 +02:00
Thomas Graf 304746f8d0 Fix error code of nl_addr_resolve() 2008-05-22 23:49:11 +02:00
Thomas Graf 5d82806b48 Add rtnl_neigh_get_family() 2008-05-20 12:14:21 +02:00
Thomas Graf 00466b0f95 Return libnl error codes in translation routines 2008-05-20 12:13:48 +02:00
Thomas Graf b5fa6c8b74 Fix library install target 2008-05-15 20:26:37 +02:00
Thomas Graf 0d925c5806 Remove references to unused attribute anycast 2008-05-15 20:25:15 +02:00
Thomas Graf ad2a7bd1e4 Build separate libraries for each netilnk family
This reduces the footprint on systems which only require a small
subset of the library.
2008-05-15 18:01:50 +02:00
Thomas Graf 28233246cd Allow parser callbacks to return NL_OK, NL_SKIP, NL_EXIT
Obsoletes internal P_ACCEPT/P_IGNORE
2008-05-15 14:01:57 +02:00
Thomas Graf 8cd39c9f4c Uninline various functions to save 7K code 2008-05-15 13:56:13 +02:00
Thomas Graf ef50a38fbd 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.
2008-05-15 13:45:41 +02:00
Thomas Graf 1155370f52 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.
2008-05-15 13:26:32 +02:00
Thomas Graf 0cf780859c Check length of provided address label 2008-05-14 23:08:06 +02:00
Thomas Graf b4fbe1d34d 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.
2008-05-14 18:34:39 +02:00
Thomas Graf eed2afaab7 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.
2008-05-14 18:26:47 +02:00
Thomas Graf 8a3efffa5b 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!
2008-05-14 17:49:44 +02:00
Ben Gamsa 107dc162c5 patch: fixed up support for tables in rules 2008-05-08 17:56:11 +02:00
Ben Gamsa cc9c6d6384 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.
2008-05-08 17:54:37 +02:00
Thomas Graf 48e1e5c472 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.
2008-05-08 12:47:26 +02:00
Thomas Graf b7c5bf98c4 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.
2008-05-07 13:18:30 +02:00
Thomas Graf d6cd72555d Fix dumping of iif route attribute 2008-05-05 17:09:56 +02:00
Thomas Graf 85808860b6 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.
2008-05-05 17:09:25 +02:00
Tad Kollar 861901c55b Fixed netem_build_msg() delay distribution table existence test. 2008-05-01 00:06:06 +02:00