summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Updated configure.in to make sure bison and lex are installed.baserock/morphRichard Marshall2012-11-191-1/+14
| | | | Fixes issue #7
* Bug Fix: Add new fill socket to cache managerroopa2012-11-192-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cache: provide safe variant of nl_cache_mngt_require() and use itThomas Graf2012-11-1614-26/+75
| | | | | | | | 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>
* Use NL_DBG() instead of printing warnings and errors to stderrThomas Graf2012-11-166-15/+15
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: hold a reference to the cache ops while a cache is provided over itThomas Graf2012-11-161-4/+16
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* use safe cache lookup variants internallyThomas Graf2012-11-164-11/+24
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Provide safe versions of nl_cache_ops_associate() and ↵Thomas Graf2012-11-162-18/+78
| | | | | | nl_cache_ops_lookup() Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Add reference counter to cache operationsThomas Graf2012-11-162-3/+35
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link: Protect registration of af and link ops with rwlockThomas Graf2012-11-151-17/+57
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: rwlock accesses to cache operationsThomas Graf2012-11-151-8/+46
| | | | | | Puts an rwlock around 'cache_ops'. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* lock abstraction layerThomas Graf2012-11-152-22/+56
| | | | | | Hide pthread availability and enablement behind internal API Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Hold cache reference while a cache is being providedThomas Graf2012-11-151-2/+6
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Add reference counter to cachesThomas Graf2012-11-153-7/+29
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add master support to rtnl_neigh for AF_BRIDGE objectsroopa2012-11-152-2/+23
| | | | | | | | | | | | | | | | | | | | 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>
* Add AF_BRIDGE support to neigh cacheroopa2012-11-151-10/+36
| | | | | | | | | | | | | 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>
* Add AF_BRIDGE support to link cacheroopa2012-11-141-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* addr: Support setting local/peer/anycast/multicast/broadcast address to NULLThomas Graf2012-11-121-20/+40
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Move nl_cache_ops_set_flags() to cache_mngt.cThomas Graf2012-11-122-10/+13
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Fix typo in API doc of nl_cache_set_flags()Thomas Graf2012-11-121-1/+1
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Move NL_CACHE_AF_ITER to <netlink/cache.h>Thomas Graf2012-11-122-5/+6
| | | | | | <netlink/cache-api.h> alreay requires <netlink/cache.h> anyway. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add NL_CACHE_AF_ITER support during refill and resyncroopa2012-11-121-19/+41
| | | | | | | | | | | | | | | 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>
* New cache manager add cache apiroopa2012-11-122-21/+68
| | | | | | | | | | | | | | | | | | | 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>
* Add support for per cache flagsroopa2012-11-124-0/+31
| | | | | | | | 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>
* doc: Revert to default stylesheetThomas Graf2012-11-121-157/+453
| | | | | | | 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>
* addr: rtnl_addr_set_peer() is limited to IPv4Thomas Graf2012-11-111-0/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* addr: Return -NLE_AF_NOSUPPORT when trying to set unsupported attributesThomas Graf2012-11-111-1/+14
| | | | | | | - multicast and anycast address only supported with IPv6 - brodcast address only supported with IPv4 Signed-off-by: Thomas Graf <tgraf@suug.ch>
* doc: update Doxygen layout file to latest formatThomas Graf2012-11-111-12/+15
| | | | Sigend-off-by: Thomas Graf <tgraf@suug.ch>
* hashtable: remove doc section crashing doxygenThomas Graf2012-11-111-7/+0
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* hashtable: Fix reference leak in nl_hashtable_free()Thomas Graf2012-11-101-0/+3
| | | | | | | 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>
* hashtable: Add API reference documentationThomas Graf2012-11-101-1/+61
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Hash: Properly prefix hash functionsThomas Graf2012-11-103-6/+6
| | | | | | Do not pollute public namespace with unprefixed functions. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add hash support to route cacheroopa2012-11-101-0/+47
| | | | | | | | | | 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>
* Add hash support to neigh cacheroopa2012-11-101-0/+46
| | | | | | | | | | 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>
* Add hash support to link cacheroopa2012-11-101-0/+23
| | | | | | | | | | 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>
* Add hash support in cache mngrroopa2012-11-104-3/+75
| | | | | | | | | | 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>
* Add nl hashtable structures and access functionsroopa2012-11-106-1/+227
| | | | | | | | | | | 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>
* Add hash functionroopa2012-11-103-1/+552
| | | | | | | | | | | | | | | | | | | | 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>
* nl: Improve API doc of nl_send_simple()Thomas Graf2012-11-081-11/+16
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: Improve API doc of nl_connect() and nl_close()Thomas Graf2012-11-081-9/+23
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: Allow to overwrite nl_send()Thomas Graf2012-11-081-11/+17
| | | | | | | | 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>
* nl: improve API doc of transmit functionsThomas Graf2012-11-084-53/+164
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* doc: increase dot max graph nodes to 100Thomas Graf2012-11-081-1/+1
|
* nl: improve nl_sendto() docs and error checksThomas Graf2012-11-061-5/+27
| | | | | | | Make nl_sendto() return NLE_INVAL if provided buffer is NULL and make it return NLE_BAD_SOCK if the socket is not connected. Add note in docs about lack of NL_CB_MSG_OUT invokation
* socket: document nl_socket_get_fd()Thomas Graf2012-11-061-0/+9
|
* nl_recv: fix indent styleThomas Graf2012-11-061-9/+11
|
* nl_recv: return NLE_INVAL if socket address pointer is NULLThomas Graf2012-11-061-1/+1
|
* nl_recv: return NLE_INVAL if buf is NULLThomas Graf2012-11-061-0/+3
|
* nl_recv: improve function documentationThomas Graf2012-11-061-13/+33
|
* nl_recv: Don't update *buf in error pathThomas Graf2012-11-061-3/+2
| | | | iov.iov_base is either NULL or invalid
* Document buffer size limitations of nl_recv()Thomas Graf2012-11-061-0/+7
|