summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* can: add helper function to get CAN bus stateBenedikt Spranger2013-01-251-0/+1
| | | | | | Add a helper function to get the CAN bus state. Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
* Remove obsolete warning from <netlink/object-api.h> as it breaks NM buildThomas Graf2013-01-241-2/+0
| | | | | | | 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>
* Provide compat headers for removed private APIThomas Graf2013-01-246-1/+109
| | | | | | | | | | 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>
* Move private header files to <netlink-private/*>Thomas Graf2013-01-2411-53/+33
| | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* fix includes after removing some headersJiri Pirko2013-01-236-12/+14
| | | | | | | | | | | | | | | commit f20bbe1f07fcff1509425884f5ed72ca8d5fb6ab 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>
* No longer install module API headersThomas Graf2013-01-231-6/+6
| | | | | | | | | | | | | | | 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>
* Add new rtnl_link_af_data_compare function to compare af_dataroopa2013-01-181-0/+3
| | | | | | | | 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>
* link af ops: Add new ao_compare op to compare link af_dataroopa2013-01-121-0/+13
| | | | | | | | | | | | | | 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>
* cache: Add new nl_cache_find apiroopa2013-01-111-0/+1
| | | | | | | | | | | | | | | | | 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>
* link: add carrier supportFlavio Leitner2013-01-114-0/+15
| | | | | Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* fix include/Makefile.amThomas Graf2013-01-081-2/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* build: Fix distribution to include 'nfnetlink_conntrack.h'Otavio Salvador2013-01-081-1/+2
| | | | | | | | 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>
* Add <netlink/route/link/can.h> to dist targetThomas Graf2013-01-041-0/+1
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Merge branch 'aligned_be64' of https://github.com/rmfought/libnlThomas Graf2012-12-172-0/+8
|\
| * Re-adding #defines for __aligned_be64 for older kernelsRich Fought2012-12-132-0/+8
| |
* | Included defs.h so DISABLE_PTHREADS is visible.Rich Fought2012-12-131-0/+2
|/
* netfilter: update local header filesThomas Graf2012-12-115-280/+425
| | | | | | Needed to NF_CT_EXPECT_PERMANENT etc. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* can: provide local copy of <linux/can/netlink.h>Thomas Graf2012-12-111-0/+122
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* link: socket-CAN helper functionsBenedikt Spranger2012-11-291-0/+27
| | | | | | | 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>
* link: basic socket-CAN supportBenedikt Spranger2012-11-291-0/+32
| | | | | | | | | | | | | 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>
* Include the newly added header files in next releaseThomas Graf2012-11-231-0/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: reserve room in cache_ops to avoid breaking module ABI too frequentlyThomas Graf2012-11-231-0/+9
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Bug Fix: Add new fill socket to cache managerroopa2012-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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-162-8/+2
| | | | | | | | 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-151-6/+6
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Provide safe versions of nl_cache_ops_associate() and ↵Thomas Graf2012-11-151-0/+2
| | | | | | nl_cache_ops_lookup() Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Add reference counter to cache operationsThomas Graf2012-11-151-0/+6
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* lock abstraction layerThomas Graf2012-11-151-0/+50
| | | | | | Hide pthread availability and enablement behind internal API Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Add reference counter to cachesThomas Graf2012-11-152-0/+2
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add master support to rtnl_neigh for AF_BRIDGE objectsroopa2012-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | 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>
* 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>
* New cache manager add cache apiroopa2012-11-121-0/+3
| | | | | | | | | | | | | | | | | | | 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-123-0/+10
| | | | | | | | 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>
* Hash: Properly prefix hash functionsThomas Graf2012-11-101-4/+4
| | | | | | Do not pollute public namespace with unprefixed functions. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add hash support in cache mngrroopa2012-11-093-0/+7
| | | | | | | | | | 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-093-0/+64
| | | | | | | | | | | 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-091-0/+69
| | | | | | | | | | | | | | | | | | | | 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>
* Add support for updating objects in the cacheroopa2012-11-052-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to update a cache object during cache_include instead of the current approach of deleting the original object and adding a new one. This operation is conditional on the object implementing the operation. If the update is not successful, cache_include falls back to the existing cache inclusion process of deleting and adding the object. It adds a new object operation called oo_update. oo_update takes two objects as arguments, first being the existing cache object that needs update, the second argument being the new object. Currently it is left to the implementor to use the msg type to decide wether to delete or add the new object attributes to the old one. But the operation type or msg type can be easily made part of the object arguments. The motivation for this change is explained below in the context of including support for AF_BRIDGE objects into the link cache. libnl today deletes an object before it includes an identical object. But for some objects like the AF_BRIDGE objects this does not work well. link cache uses the ifindex as its key in object searches. If link cache were to support AF_BRIDGE family objects, todays implementation, - will replace the original link object with the bridge port link object for add notifications - And a bridge port delete notification from kernel would delete the link object from the cache leaving the cache without the link object until the kernel sends another notification for that link The bridge port link notification contains some base link object attributes plus bridge specific protocol info attributes. In such cases we think an operation to update the existing object in place in cache might be useful. This can be made to work for AF_INET6 link objects too. 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>
* Add new object op oo_id_attrs_getroopa2012-11-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current oo_id_attrs nl_object op allows a fixed id attribute list for an cache. But a cache with multiple families may need to specify different id attributes for different families. An example for this is the bridge fdb entries in the neigh cache: neigh entries belonging to the AF_UNSPEC family use (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY) as id attributes. AF_BRIDGE fdb entries which also support the same msg type, will need to use (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY) as id attributes. Today you cannot specify different set of attributes to two families belonging to the same cache. This patch adds a new object function oo_id_attrs_get to get the attributes. An example implementation of oo_id_attrs_get for the neigh cache will look like: static uint32_t neigh_id_attrs_get(struct nl_object *obj) { struct rtnl_neigh *neigh = (struct rtnl_neigh *)obj; if (neigh->n_family == AF_BRIDGE) return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY); else return (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY); } 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>
* Merge branch 'master' of https://github.com/rmfought/libnlThomas Graf2012-10-268-194/+556
|\
| * Source cleanup for upstreamRich Fought2012-10-192-39/+38
| |
| * Updated nfnetlink includes; removed ifdefs; added delete exp programRich Fought2012-10-166-213/+352
| |
| * define advanced attributes outRich Fought2012-10-131-5/+27
| |
| * bugfixesRich Fought2012-10-091-0/+1
| |
| * Starting CLI workRich Fought2012-10-091-0/+30
| |
| * Successful compilation of libnl-nf with expectationRich Fought2012-10-081-20/+8
| |
| * Checkpoint before compilation attemptRich Fought2012-10-082-4/+1
| |
| * "checkpoint"Rich Fought2012-10-062-20/+17
| |
| * Checkpoint: compare functionRich Fought2012-10-051-3/+25
| |
| * Exp checkpointRich Fought2012-10-052-0/+167
| |