summaryrefslogtreecommitdiffstats
path: root/lib/route/cls/u32.c
Commit message (Collapse)AuthorAgeFilesLines
* cls: add rtnl_u32_get_classid() APICong Wang2015-03-041-0/+14
| | | | | | | | | [thaller@redhat.com: modified patch to use rtnl_tc_data_peek()] http://lists.infradead.org/pipermail/libnl/2015-March/001841.html Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/cls: minor fixes in for match mark filtersThomas Haller2014-11-231-27/+25
| | | | | | | | - whitespace - fix newline and whitespace in output of u32_dump_details() - let rtnl_u32_del_mark() clear U32_ATTR_MARK Signed-off-by: Thomas Haller <thaller@redhat.com>
* route/cls: support 'match mark' u32 filtersSagi Lowenhardt2014-11-231-5/+85
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* u32: prevent memcpy from NULLPeter Wu2014-06-251-3/+6
| | | | | | | | Found by Clang static analyzer. Fixes: 6cdc32df831a273007af7d24a3f75cd06e0ae738 Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Thomas Haller <thaller@redhat.com>
* act: grab a reference when adding an action to a filterCong Wang2014-04-301-1/+7
| | | | | | | | | | When we add an action to a filter, its lifetime becomes same with the filter. So in case user frees it before us, we could just grab a reference here. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* u32: add const to rtnl_u32_add_key_in*_addr()Cong Wang2014-03-211-2/+2
| | | | | | | Cc: Thomas Haller <thaller@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* remove some useless code in lib/route/cls/u32.cCong Wang2014-02-271-8/+0
| | | | | | Cc: Thomas Haller <thaller@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* u32: add rtnl_u32_get_key()Cong Wang2013-12-171-0/+36
| | | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Cc: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* u32: add action removal APICong Wang2013-12-091-0/+19
| | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* add u32 action supportCong Wang2013-11-091-7/+29
| | | | | Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Move private header files to <netlink-private/*>Thomas Graf2013-01-241-4/+4
| | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* "%llu" replaced with "%" PRIu64Коренберг Марк (дома)2012-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | On some architectures, uint64_t is defined as: typedef unsigned long long int __u64; on another architectures as: typedef unsigned long int __u64; So, according to man 3 printf, uint64_t should be printed as "%llu" on some architectures, and as "%lu" on another. The same for scanf. To eliminate that challenge, there is inttypes.h, in which appropriate constants are defined for current architecture. 32-bit types (and even 16 and 8 bit types) should be printed using such constants if printed variable defined as uint_XXXt or intXXXt type. But in reality 32-bit and less types does not gain run-time error (except in scanf), because they pushed to stack as 32-bit values at least. So, I decide not to fix that.
* Fix types-related warnings based on clang diagnosticsКоренберг Марк2012-06-131-1/+1
| | | | | | | | | | | | | | | | | 1. Fix some places where unsigned value compared < 0 2. Fix obsolete %Z specifier to more portable %z 3. Some erroneous types substitution 4. nl_msec2str() - 64-bit msec is now properly used, Only safe changes. I mean int <--> uint32_t and signed/unsigned fixes. Some functinos require size_t argument instead of int, but changes of signatures of that functions is terrible thing. Also, I do not pretend for a full list of fixes. Just to shut up clang -Wall -Wextra One more thing. ifindex. I don't change that because changes will be too big for simple fix.
* u32: add support for hashingAdrian Ban2012-05-081-0/+85
|
* Unified TC APIThomas Graf2011-03-211-36/+59
| | | | | | | | Finally got rid of all the qdisc/class/cls code duplication in the tc module API. The API takes care of allocation/freeing the tc object specific data. I hope I got it right this time.
* Unified TC attributes interfaceThomas Graf2010-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | So far all common tc atttributes were accessed via specific functions, i.e. rtnl_class_set_parent(), rtnl_qdisc_set_parent(), rtnl_cls_set_parent() which implied a lot of code duplication. Since all tc objects are derived from struct rtnl_tc and these common attributes are already stored in there this patch removes all type specific functions and makes rtnl_tc_* attribute functions public. rtnl_qdisc_set_parent(qdisc, 10); becomes: rtnl_tc_set_parent((struct rtnl_tc *) qdisc, 10); This patch also adds the following new attributes to tc objects therefore removing them as tc specific attributes: - mtu - mpu - overhead This allows for the rate table calculations to be unified as well taking into account the new kernel behavior to take care of overhead automatically.
* one more fix, u32.cDenys Fedoryschenko2009-12-071-2/+1
| | | | | | One more segfault, also nl-tctree-list , fix Probably need reformat for better look Patch attached
* - Reworked the classifier interface.Thomas Graf2009-09-021-92/+35
| | | | | | - Added initial ematch support - Added support for the basic classifier - Added support for the cgroup classifier
* Remove old line counting while dumpingThomas Graf2008-05-231-52/+39
|
* Remove obsolete nla_get_addr() and nla_get_data()Thomas Graf2008-05-141-4/+4
| | | | | | | | Replaces obsolete calls to nla_get_addr() and nla_get_data() with nl_addr_alloc_attr() respectively nl_data_alloc_attr(). Also fixes missing error handling while parsing routing multipath configuration.
* Thread-safe error handlingThomas Graf2008-05-141-17/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Initial importThomas Graf2007-09-141-0/+602