dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

302 Commits

Author SHA1 Message Date
Patrick McHardy 6ae22c1b39 Merge /home/kaber/src/repos/libnl.git 2013-06-28 18:11:40 +02:00
Holger Eitzenberger d612180cda netfilter/queue: introduce nfnl_queue_msg_send_verdict_batch()
The batched verdict implicitely ACKs all queue packet IDs up to the
one send back, which reduces the number of verdict messages send
to the kernel.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-06-27 01:16:15 +02:00
Michael Braun c76393e203 Add macvlan support
This patch add support for kernel macvlan interfaces.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2013-05-16 17:04:08 +02:00
Thomas Graf ff567100d6 nl: Print file:line:func in debugging messages and provide --disable-debug to disable debugging
Compiling libnl with --disable-debug will result in the ignorance
of the 'NLDBG' environment variable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-04-02 11:39:30 +02:00
Patrick McHardy d2b5cbd88a Merge git://git.infradead.org/users/tgr/libnl
Signed-off-by: Patrick McHardy <kaber@trash.net>

Conflicts:
	include/linux/netlink.h
	lib/Makefile.am
	lib/error.c
	libnl-3.0.pc.in
	src/Makefile.am
2013-04-01 11:44:59 +02:00
Thomas Graf aad041c46f genl: Provide internal function to resolve name to id
Like genl_ops_resolve() but uses its own socket.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-04-01 11:14:49 +02:00
Tony Cheneau 23e26e9e05 Remove rtnl_link_free() declaration from the header file.
Reason: there is no rtnl_link_free() definition anywhere in the code.

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-03-17 17:31:53 +01:00
Tony Cheneau 4db11517fd Remove superfluous declaration of rtnl_route_put()
rtnl_route_put() is declared twice in the same header file

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-03-17 17:31:45 +01:00
Thomas Graf 88527534ba addr: improve API reference documentation for nl_addr_*()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-03-14 15:37:46 +01:00
Thomas Graf 9e6cdbf6fc attr: Add nla_nest_cancel() to remove partially added nested attributes
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-03-14 12:46:01 +01:00
Thomas Graf 1ecf98a23e bond: Provide rtnl_link_bond_alloc()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-14 12:48:00 +01:00
Thomas Graf ee4122a12e vlan: Provide rtnl_link_vlan_alloc()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-14 12:42:22 +01:00
Thomas Graf bb9911b5a3 netlink: Forward declare frequent libnl types to ease inclusion deps
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-14 12:37:10 +01:00
Thomas Graf 5a5aa73158 bridge: Provide rtnl_link_bridge_alloc()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-14 12:34:57 +01:00
Thomas Graf fd19dae352 bridge: Support the new bridging attributes
This provides support for the new bridging attributes provided
in IFLA_PROTINFO while maintaining backwards compatibility
with older kernels.

A set of new API functions are exported to access the bridging
information. rtnl_link_bridge_has_ext_info() can be used to
check whether a bridge object has been constructed based on
the newly available attributes or the old message format.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-07 11:39:27 +01:00
Thomas Graf 9f8548b551 attr: Provide nla_is_nested() function
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-05 22:31:31 +01:00
Thomas Graf 2d36371aa1 link: Keep reference to af_ops during lifetime of link object
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-05 13:18:25 +01:00
Thomas Graf 1c24480180 can: Include "linux/can/netlink.h" in the distribution
Needed to compile if local kernel headers are outdated.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-01 10:51:33 +01:00
Thomas Graf 2005c2ecac cache: Make NL_ACT_* and nl_cache_ops_(get|put)() available
Move NL_ACT_* definition and the functions nl_cache_ops_get()
and nl_cache_ops_put() into the public facing API. They can
be considered stable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-02-01 10:21:58 +01:00
Benedikt Spranger 6cc5fdc0e9 can: add helper function to get CAN bus state
Add a helper function to get the CAN bus state.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
2013-01-25 19:51:33 +01:00
Thomas Graf 776cde0a10 Remove obsolete warning from <netlink/object-api.h> as it breaks NM build
NM uses -Werror=cpp thus the build breaks if we emit #warning upon
inclusion of <netlink/object-api.h>

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-24 14:29:18 +01:00
Thomas Graf 1b9de9a49d Provide compat headers for removed private API
Some projects seem to have mistakenly included the private
API headers without actually needing them.

Provide dummy headers referring to the real headers to
provide backwards compatibility.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-24 14:03:52 +01:00
Thomas Graf 9680f910f4 Move private header files to <netlink-private/*>
This clarifies the seperation between public and private
header files.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-24 13:51:24 +01:00
Jiri Pirko 1419851eb4 fix includes after removing some headers
commit f20bbe1f07
Author: Thomas Graf <tgraf@suug.ch>
Date:   Tue Jan 22 19:10:38 2013 +0100

    No longer install module API headers

This commit causes a regression so no app using libnl can be compiled
against it. This patch fixes it by removing includes of no-longe
existing headers.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-23 13:37:29 +01:00
Thomas Graf f20bbe1f07 No longer install module API headers
Various header files providing an API to implement own cache and
object types or implement link types have been available in the
past. Their API is marked unstable in the documentation and nobody
is using them so far.

Technically they have been causing ABI breakages in at least two
3.2.x releases. In order to avoid future accidental breakage, no
longer install these and require module developers to clone the
git tree and build modules off the git tree directly to make sure
that the API is unstable at this point.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-23 11:02:44 +01:00
roopa 99399ca9c0 Add new rtnl_link_af_data_compare function to compare af_data
This patch adds a new api rtnl_linl_af_data_compare to
compare link af_data

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-18 14:41:58 +01:00
roopa 09213ee5ee link af ops: Add new ao_compare op to compare link af_data
This patch adds new operation to compare link af_data.
ao_compare is similar to object oo_compare operation.
This op can be used when two links are compared
 for their af data. It takes two link objects in
question, an object specific bitmask defining which
attributes should be compared and flags to control
the behaviour. The function must return a bitmask
with the relevant bit set for each attribute that mismatches.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-12 11:37:32 +01:00
roopa b1ebda9241 cache: Add new nl_cache_find api
This patch adds new cache find api

nl_cache_find api was suggested by Thomas.

Unlike nl_cache_search, this patch uses
nl_object_match_filter() to look for an
object match.

Am not sure this matches what was decided
on the list few weeks back. I will be happy
to make any changes.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-11 13:52:50 +01:00
Flavio Leitner 3540e44b15 link: add carrier support
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-11 13:44:47 +01:00
Thomas Graf 383ff943b4 fix include/Makefile.am
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-08 14:44:47 +01:00
Otavio Salvador de5744fb65 build: Fix distribution to include 'nfnetlink_conntrack.h'
The header has not been included in the headers list so it has been
been distributed in the tarball making it fail to build in old kernels.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-08 14:38:49 +01:00
Thomas Graf 00a5879e6e Add <netlink/route/link/can.h> to dist target
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-04 17:44:43 +01:00
Thomas Graf 52b635f1f7 Merge branch 'aligned_be64' of https://github.com/rmfought/libnl 2012-12-17 09:18:47 +01:00
Rich Fought 89e1b30256 Included defs.h so DISABLE_PTHREADS is visible. 2012-12-13 15:56:04 -08:00
Rich Fought 25c407c71f Re-adding #defines for __aligned_be64 for older kernels 2012-12-13 14:23:28 -08:00
Thomas Graf 7c85b8a53b netfilter: update local header files
Needed to NF_CT_EXPECT_PERMANENT etc.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-11 18:06:29 +01:00
Thomas Graf 913a689de3 can: provide local copy of <linux/can/netlink.h>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-12-11 17:59:30 +01:00
Benedikt Spranger c86088ff01 link: socket-CAN helper functions
Add helper functions to make socket-CAN configuration easy.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-29 22:17:58 +01:00
Benedikt Spranger 5251188673 link: basic socket-CAN support
Controller Area Network (CAN) is a networking technology which has
widespread use in automation, embedded devices and automotive fields.
The socket-CAN package is an implementation of CAN protocols for Linux.

All socket-CAN related configurations are carried out through Netlink.
Add basic socket-CAN support to libnl to be able to configure CAN devices
with libnl.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-29 22:17:58 +01:00
Thomas Graf ed3d7066f7 Include the newly added header files in next release
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 17:06:15 +01:00
Thomas Graf 3163fa707b cache: reserve room in cache_ops to avoid breaking module ABI too frequently
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 16:50:06 +01:00
roopa 4d94ed5f6b Bug Fix: Add new fill socket to cache manager
This patch adds a new socket to cache manager to request fill's on.
cache manager today uses cm_sock to request dump from
the kernel. It also listens to netlink async events on the same sock.
The problem with this is that when libnl is waiting to process the
response to get dump request sent to the kernel during fill,
it may receive an async event, resulting in libnl complaining about
unexpected msg

This is usually reproducible when there is heavy netlink async event
traffic during nl_cache_mngr_add.

This patch adds a new cm_sync_sock to use for fill during cache manager
add cache.

The other option is to provide an api to set the cm_sync_sock. But since
this is a bug fix its probably better to fix the cache manager add api
like this patch does. Please suggest otherwise.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-19 10:15:04 +01:00
Thomas Graf 00132b4696 cache: provide safe variant of nl_cache_mngt_require() and use it
This makes runtime removal of cache operations possible if non-safe
API is not in use by application. The non-safe API will be removed
in the next major version.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 01:11:55 +01:00
Thomas Graf 23c4ef67c7 Use NL_DBG() instead of printing warnings and errors to stderr
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:42:34 +01:00
Thomas Graf 2b3912a320 cache: Provide safe versions of nl_cache_ops_associate() and nl_cache_ops_lookup()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:19:38 +01:00
Thomas Graf 1a2c3e36a8 cache: Add reference counter to cache operations
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:17:50 +01:00
Thomas Graf 20efa14e5c lock abstraction layer
Hide pthread availability and enablement behind internal API

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 21:30:57 +01:00
Thomas Graf c658a6eef8 cache: Add reference counter to caches
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 20:45:44 +01:00
roopa cb25338ac3 Add master support to rtnl_neigh for AF_BRIDGE objects
AF_BRIDGE neigh objects can be uniquely identified by
the family, lladdr and bridge ifindex. This patch adds
bridge ifindex to AF_BRIDGE neigh objects.

Things will be ok even without this patch with just family and
lladdr if we assume that we will have unique lladdr's
accross bridges in a system.

Kernel does not send the bridge ifindex in the AF_BRIDGE
fdb/neigh message. This patch tries to get that info by a
link cache lookup and adds it to the bridge neigh object

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 19:42:47 +01:00
Thomas Graf ce72565f26 cache: Move NL_CACHE_AF_ITER to <netlink/cache.h>
<netlink/cache-api.h> alreay requires <netlink/cache.h> anyway.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 21:59:54 +01:00