dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

650 Commits

Author SHA1 Message Date
Jan Engelhardt f3cd3fe950 build: use AC_CONFIG_AUX_DIR
Stash all those scripts into a separate directory and ignore that.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:14 +01:00
Jan Engelhardt 9d92564566 build: resolve automake-1.12 warnings
/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libnl-cli-3.la':
linking libtool libraries using a non-POSIX archiver requires
'AM_PROG_AR' in 'configure.ac'
(one for each .la file)

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:13 +01:00
Jan Engelhardt a96a3b6828 build: rename configure.in -> .ac
"configure.in" is a very, very old, obsolete name. Newer automake
will reject it, so rename it now.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2012-11-26 21:03:13 +01:00
Thomas Graf 4149154c22 cache: only continue iterating over co_groups if it is available
A co_groups == NULL must enter the loop to trigger the initial
fill of the cache but may never bump the grp pointer as doing
so prevents the loop from being escaped correctly.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-26 11:50:56 +01:00
Thomas Graf 05a6723eb5 3.2.15 release
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 17:06:19 +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
Thomas Graf 0a9d5fcfa4 configure: Replace broken AM_PROG_LEX with AC_CHECK_PROGS
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-23 16:41:08 +01:00
Richard Marshall a2c4bd8f09 Updated configure.in to make sure bison and lex are installed.
Fixes issue #7
2012-11-19 20:33:26 -08: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 235aa7ff17 cache: hold a reference to the cache ops while a cache is provided over it
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:29:58 +01:00
Thomas Graf cb82c2a545 use safe cache lookup variants internally
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-16 00:29:58 +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 74926f92dd link: Protect registration of af and link ops with rwlock
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 22:33:23 +01:00
Thomas Graf f5af5c5ecd cache: rwlock accesses to cache operations
Puts an rwlock around 'cache_ops'.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 21:42:02 +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 3ed1f9ab5f cache: Hold cache reference while a cache is being provided
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-15 20:49:33 +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
roopa 64fcb47a36 Add AF_BRIDGE support to neigh cache
This patch adds AF_BRIDGE to the list of families
supported by the cache. Implements oo_id_attrs_get to
declare separate id attributes for AF_UNSPEC and AF_BRIDGE
neigh objects

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:43 +01:00
roopa 125119aff0 Add AF_BRIDGE support to link cache
This patch was previously submitted as the first approach in
RFC http://lists.infradead.org/pipermail/libnl/2012-November/000730.html

It adds support for AF_BRIDGE family in link cache.
And the key for link object lookups will now be ifindex and family.

This allows for AF_UNSPEC rtnl link objects to co-exist with the AF_BRIDGE
link objects in the same cache.

I have changed some of the rtnl_link api's to explicitly check for
AF_UNSPEC to not break existing apps. I will submit a new patch to
introduce equivalent rtnl_bridge_link_* api's.

We had also discussed updating the existing link objects with
AF_BRIDGE attributes, but realized that the updates to link objects will
be both AF_UNSPEC and AF_BRIDGE. And that would change link cache to always
update existing objects, resulting in comparing and updating close to
thirty attributes at cache_include time which seems like a overkill.

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-14 15:18:08 +01:00
Thomas Graf ea79a76288 addr: Support setting local/peer/anycast/multicast/broadcast address to NULL
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 23:48:02 +01:00
Thomas Graf 8ffa257bfa cache: Move nl_cache_ops_set_flags() to cache_mngt.c
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 22:07:39 +01:00
Thomas Graf 5734011228 cache: Fix typo in API doc of nl_cache_set_flags()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 22:03:22 +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
roopa 0bd14aa2d6 Add NL_CACHE_AF_ITER support during refill and resync
This patch adds support to iter over all supported families
during cache fill and resync.

The motivation for this was previously introduced at
http://lists.infradead.org/pipermail/libnl/2012-November/000734.html
In short, this patch allows caches to request dump on all supported
families instead of only AF_UNSPEC as done today.

With feedback from thomas this patch makes the iter over all families
conditional on per cache flag NL_CACHE_AF_ITER

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 21:51:07 +01:00
roopa 30d862650b New cache manager add cache api
This patch is an attempt to add a new nl_cache_mngr_add_cache api
to allow adding an existing cache to cache manager.

Since the new api is similar to nl_cache_mngr_add
except for allocating the cache, the patch moves most of the
nl_cache_mngr_add code to nl_cache_mngr_add_cache and changes
nl_cache_mngr_add to call nl_cache_mngr_add_cache.

One use case for this api as pointed out by thomas would be to set cache
flags before associating the cache with a cache manager.

nl_cache_alloc_name("route/link", &cache);
nl_cache_set_flags(cache, NL_CACHE_AF_ITER);
nl_cache_mngr_add_cache(mngr, cache, ...);

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 21:51:03 +01:00
roopa dd8a87da96 Add support for per cache flags
This patch adds support for per cache flags
and adds a flag NL_CACHE_AF_ITER to iter over all
supported families when filling the cache.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 21:51:02 +01:00
Thomas Graf c83ecb38c1 doc: Revert to default stylesheet
Use of a custom stylesheet breaks with almost every release of doxygen
and is thus completely unuseable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-12 10:26:38 +01:00
Thomas Graf 3132db5162 addr: rtnl_addr_set_peer() is limited to IPv4
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-11 21:01:19 +01:00
Thomas Graf 5a0476032e addr: Return -NLE_AF_NOSUPPORT when trying to set unsupported attributes
- multicast and anycast address only supported with IPv6
- brodcast address only supported with IPv4

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-11 16:36:29 +01:00
Thomas Graf 7e075c600d doc: update Doxygen layout file to latest format
Sigend-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-11 11:21:34 +01:00
Thomas Graf b66d26711a hashtable: remove doc section crashing doxygen
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-11 11:21:10 +01:00
Thomas Graf 59a6b003a9 hashtable: Fix reference leak in nl_hashtable_free()
The reference counter of the linked object must be dec'ed
before freeing the node or the reference is leaked.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 10:52:26 +01:00
Thomas Graf ae1e236809 hashtable: Add API reference documentation
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 10:50:16 +01:00
Thomas Graf 5641c0ea61 Hash: Properly prefix hash functions
Do not pollute public namespace with unprefixed functions.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 10:22:26 +01:00
roopa a2207c7beb Add hash support to route cache
This patch adds keygen function to route object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:13:05 +01:00
roopa 6f24cf12ca Add hash support to neigh cache
This patch adds keygen function to the neigh object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:12:57 +01:00
roopa e16e8fdcdb Add hash support to link cache
This patch adds keygen function to link cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:12:51 +01:00
roopa 55c0e036b0 Add hash support in cache mngr
This patch adds support to create, delete modify hash table for a cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:12:44 +01:00
roopa c6f89ed02f Add nl hashtable structures and access functions
This patch adds the required structures and access functions to create
and manage hashtables for netlink cache objects

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:12:36 +01:00
roopa a8741fab8e Add hash function
This patch adds a hash function for hashing libnl objects.

This hash function is from:
http://ccodearchive.net/info/hash.html

The original code was modified to remove unwanted dependencies,
unwanted code and fixes to header file locations

One requirement with this hash function is, hashing over multiple fields of an
un-packed struct requires that the struct be zeroed, otherwise random padding
bytes will change the hash.

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-11-10 00:12:08 +01:00
Thomas Graf 665464cde5 nl: Improve API doc of nl_send_simple()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-11-08 21:17:32 +01:00
Thomas Graf b28c25eb23 nl: Improve API doc of nl_connect() and nl_close()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-11-08 13:41:54 +01:00
Thomas Graf fd6f205f8a nl: Allow to overwrite nl_send()
Up to now only calls to nl_send_auto() could be overwritten with
nl_cb_overwrite_send(). This patch extends the capability to
nl_send()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-11-08 13:19:07 +01:00
Thomas Graf b132ee7e27 nl: improve API doc of transmit functions
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-11-08 01:29:12 +01:00
Thomas Graf a721c1d445 doc: increase dot max graph nodes to 100 2012-11-08 00:11:13 +01:00