summaryrefslogtreecommitdiffstats
path: root/lib/route/nexthop.c
Commit message (Collapse)AuthorAgeFilesLines
* route: cache and object changes to support non-exclusive and append routesRoopa Prabhu2016-07-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Problem (ipv4 only): Todays libnl route cache looks at prefix + tos + priority to lookup a route object. To support route append operation, where routes with same prefix + tos + priority but different nexthop information can co-exist, we need to also look at nexthop info. Else we will wrongly store only one route for all appended routes. This happens Because the libnl cache inclusion process looks up a route by prefix + tos + priority and replaces it with the new object with the same prefix + tos + priority. Only adding nexthop attribute during lookup does not solve the whole problem. Because NLM_F_REPLACE of objects needs special handling. This patch implements route cache callback .co_cache_search_attrs_get and route object callback .oo_hash_attrs_get to return appropriate attributes for searching route objects depending on type of route and the netlink message flags (NLM_F_APPEND or NLM_F_REPLACE). This is used during cache inclusion process. Also adds ROUTE_ATTR_MULTIPATH to the list of route attribute keys to search. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
* style: require comma after __ADD() macroThomas Haller2014-07-271-3/+3
| | | | | | | $ sed -i 's/^\([\t ]\+\<__ADD\> \?([^)]\+)\) *$/\1,/' `git grep -w -l __ADD` Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* Move private header files to <netlink-private/*>Thomas Graf2013-01-241-1/+1
| | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* cache: provide safe variant of nl_cache_mngt_require() and use itThomas Graf2012-11-161-2/+8
| | | | | | | | 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>
* route: Add FIXME to rtnl_route_nh_set_gateway() to fix return valueThomas Graf2012-05-091-0/+1
| | | | Reported-by: Justin Mayfield <jmayfield@cradlepoint.com>
* constify struct trans_tblThomas Graf2010-11-171-1/+1
|
* Remove NL_DUMP_ENV codeThomas Graf2010-10-201-40/+0
| | | | | | | Dumping objects as environment variables has never been implemented completely and only increases the size of the library for no real purpose. Integration into scripts is better achieved by implementing a python module anyway.
* Remove old line counting while dumpingThomas Graf2008-05-231-3/+3
|
* Thread-safe error handlingThomas Graf2008-05-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for the interface to become more thread safe, the error handling was revised to no longer depend on a static errno and error string buffer. This patch converts all error paths to return a libnl specific error code which can be translated to a error message using nl_geterror(int error). The functions nl_error() and nl_get_errno() are therefore obsolete. This change required various sets of function prototypes to be changed in order to return an error code, the most prominent are: struct nl_cache *foo_alloc_cache(...); changed to: int foo_alloc_cache(..., struct nl_cache **); struct nl_msg *foo_build_request(...); changed to: int foo_build_request(..., struct nl_msg **); struct foo *foo_parse(...); changed to: int foo_parse(..., struct foo **); This pretty much only leaves trivial allocation functions to still return a pointer object which can still return NULL to signal out of memory. This change is a serious API and ABI breaker, sorry!
* Big routing code rework (API/ABI BREAK!)Thomas Graf2008-04-291-27/+208
| | | | | | | | | | Adds all missing routing attributes and brings the routing related code to a working state. In the process the API was broken several times with the justification that nobody is using this code yet. The changes include new example code which is also a prototype for how plain CLI tools could look like to control routes.
* Initial importThomas Graf2007-09-141-0/+151