summaryrefslogtreecommitdiffstats
path: root/include/netlink
Commit message (Collapse)AuthorAgeFilesLines
* Remove rtnl_link_free() declaration from the header file.Tony Cheneau2013-03-171-1/+0
| | | | | | | 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>
* Remove superfluous declaration of rtnl_route_put()Tony Cheneau2013-03-171-1/+0
| | | | | | | 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>
* addr: improve API reference documentation for nl_addr_*()Thomas Graf2013-03-141-2/+2
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* attr: Add nla_nest_cancel() to remove partially added nested attributesThomas Graf2013-03-141-0/+1
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* bond: Provide rtnl_link_bond_alloc()Thomas Graf2013-02-141-1/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* vlan: Provide rtnl_link_vlan_alloc()Thomas Graf2013-02-141-1/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* netlink: Forward declare frequent libnl types to ease inclusion depsThomas Graf2013-02-141-1/+3
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* bridge: Provide rtnl_link_bridge_alloc()Thomas Graf2013-02-141-0/+2
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* bridge: Support the new bridging attributesThomas Graf2013-02-071-0/+54
| | | | | | | | | | | | | 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>
* attr: Provide nla_is_nested() functionThomas Graf2013-02-051-1/+2
| | | | Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: Make NL_ACT_* and nl_cache_ops_(get|put)() availableThomas Graf2013-02-011-0/+15
| | | | | | | | 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>
* 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-245-0/+102
| | | | | | | | | | 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-246-969/+2
| | | | | | | 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>
* 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-111-0/+7
| | | | | Signed-off-by: Flavio Leitner <fbl@redhat.com> 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>
* 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>
* cache: provide safe variant of nl_cache_mngt_require() and use itThomas Graf2012-11-161-0/+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>
* 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>
* cache: Add reference counter to cachesThomas Graf2012-11-151-0/+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>
* 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-122-0/+9
| | | | | | | | 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-092-0/+5
| | | | | | | | | | 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-262-0/+171
|\
| * Source cleanup for upstreamRich Fought2012-10-191-9/+8
| |
| * Updated nfnetlink includes; removed ifdefs; added delete exp programRich Fought2012-10-162-19/+12
| |
| * 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-081-4/+0
| |
| * "checkpoint"Rich Fought2012-10-061-16/+13
| |
| * Exp checkpointRich Fought2012-10-051-0/+145
| |
* | add missing '}' in __cplusplus namespacesThomas Graf2012-10-232-0/+7
| | | | | | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Support link groupingThomas Graf2012-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | New functions: rtnl_link_set_group(link, group) rtnl_link_get_group(link) The group identifier is printed in the brief section as "group N" Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Support IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUESThomas Graf2012-10-091-0/+6
| | | | | | | | | | | | | | | | | | | | New functions: rtnl_link_set_num_tx_queues(link, nqueues) rtnl_link_get_num_tx_queues(link) rtnl_link_set_num_rx_queues(link, nqueues) rtnl_link_get_num_rx_queues(link) Signed-off-by: Thomas Graf <tgraf@redhat.com>
* | link: Support IFLA_PROMISCUITY link attributeThomas Graf2012-10-091-1/+4
| | | | | | | | | | | | | | * read-only attribute * dumped in details sections "promisc-mode (N users)" Signed-off-by: Thomas Graf <tgraf@redhat.com>