summaryrefslogtreecommitdiffstats
path: root/include/netlink/route
Commit message (Collapse)AuthorAgeFilesLines
* route/qdisc: adjust API for 64 bit rate/ceil support for htb classThomas Haller2019-09-012-6/+13
| | | | | | | | | | | | | | | | - existing API/ABI must stay unchanged. We cannot change parameter types. Ad most we can add new variants that support 64 bit integers. - rtnl_tc_calc_txtime64() and rtnl_tc_calc_bufsize64() are trivial. We should not blow up the public API of libnl for such a thing. If the users needs it, they can just reimplement it. - getters should return an error code. Especially if the return type does not support encoding an error there. - don't add separate rs_rate64/rs_ceil64 field. Instead, extend the "rs_rate" field of "struct rtnl_ratespec" to 64 bits. It's internal API.
* Add 64bit rate/ceil support for htb classd0u92019-09-012-6/+6
| | | | | Htb class has already supported 64bit rate and ceil settings for times. Now, in this patch, we grant this ability to libnl library.
* xfrmi: return error code from getters for XFRM linksThomas Haller2019-09-011-2/+2
| | | | | | | | Returning the value directly as uint32_t does not leave room for an error code. E.g. we want to indicate to the caller whether the attribute is present or not (-NLE_NOATTR). Currenlty, the code is quite unforgiving and will just crash/assert against invalid arguments. In theory, we could also be more forgiving and return a error code if the link argument is invalid.
* xfrmi: introduce XFRM interfaces supportEyal Birger2019-09-011-0/+37
| | | | | | | XFRM interfaces were introduced in kernel 4.19. This commit adds link support for these interfaces. Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
* route/link: expose IFLA_INFO_SLAVE_KINDTobias Jungel2018-10-221-0/+3
| | | | | add rtnl_link_{get,set}_slave_type functions to expose the IFLA_INFO_SLAVE_KIND attribute.
* route/act: return error code from act-vlan gettersThomas Haller2018-10-101-5/+5
| | | | | | Our API is unfortunately not consistent about this. However, in general, getters should aim to return an error code whether the attribute could be retrieved.
* route/act: style fixes in "lib/route/act/vlan.c"Thomas Haller2018-10-101-7/+6
|
* route:act: add vlan actionVolodymyr Bendiuga2018-10-101-0/+39
| | | | | | | For more information please see: http://man7.org/linux/man-pages/man8/tc-vlan.8.html Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* route/tc: return error code from rtnl_tc_get_chain()Thomas Haller2018-10-101-1/+1
| | | | | | Our API is unfortunately not consistent about this. However, in general, getters should aim to return an error code whether the attribute could be retrieved.
* route:tc: allow to set chain index for tc objectsVolodymyr Bendiuga2018-10-101-0/+2
| | | | | | This is useful when one wants to chain filters. Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* lib/qdisc: avoid BUG() in "lib/route/qdisc/mqprio.c"Thomas Haller2018-10-091-1/+1
| | | | | | | | | | BUG() raises an assertion. It seems overly harsh. For example, rtnl_tc_data() can fail if we fail to allocate memory. Asserting against that, makes libnl3 not out-of-memory safe. Just return a regular error.
* lib/qdisc: style fixes in "lib/route/qdisc/mqprio.c"Thomas Haller2018-10-091-11/+11
|
* route:qdisc: add MQPRIO QdiscVolodymyr Bendiuga2018-07-261-0/+48
| | | | | | | More about Qdisc mqprio can be found at: http://man7.org/linux/man-pages/man8/tc-mqprio.8.html Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* Add support for cloning cgroup filter object.d0u92018-06-251-0/+2
| | | | | | | | | | | In this commit, we implement ematch_tree_clone(), which is basis of cgroup_clone() interface. The whole ematch tree is deep-copied except the e_ops filed. Also, a new unit test is added for testing the interface, which named as check-ematch-tree-clone.c located in tests directory. https://github.com/thom311/libnl/pull/176
* neigh: add get/set functions for NEIGH_ATTR_MASTERTobias Jungel2018-06-251-0/+3
| | | | | | | Beeing able to set NEIGH_ATTR_MASTER hash based lookups are possible for AF_BRIDGE neighbours. https://github.com/thom311/libnl/pull/189
* route/class: add new api rtnl_class_get_by_parent()d0u92018-04-111-0/+3
| | | | | | | | This function searches a class cache previously allocated with rtnl_class_alloc_cache() and searches for a class matching the interface index and parent qdisc. https://github.com/thom311/libnl/pull/185
* route:cls: add matchall classifierVolodymyr Bendiuga2018-04-111-0/+36
| | | | | | | This simple classifier allows any traffic pass through. Useful as an example for port mirroring. Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* rule: Add support for protocol and port rangesDavid Ahern2018-04-061-0/+16
| | | | | | | Add support for recent fib rule features - specifying a protocol that installed a rule and an IP protocol plus port range for rules. Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
* lib/rtnl: rename public define RTNL_GENEVE_ID_MAXThomas Haller2018-02-121-1/+1
| | | | | Public defines must have a libnl3 related prefix. Rename GENEVE_ID_MAX to RTNL_GENEVE_ID_MAX.
* link: add Geneve support.Wang Jian2018-02-121-0/+60
| | | | Signed-off-by: Wang Jian <jianjian.wang1@gmail.com>
* route: rename rtnl_cls_cache_set_tcm_params() and fix symbol versioningThomas Haller2018-01-181-1/+1
| | | | | | | | | After rethinking, "tcm_params" doesn't seem like a good name. Change it to "tc_params". Also, an already released section in the linker file must never be modified. It defeats the purpose of symbol versioning. Move the symbol to the right section.
* Add new function for setting ifindex and parent of a classifier cache.d0u92018-01-181-0/+2
| | | | | | | It is not good to give classifier cache users only one chance to set interface index and parent handle when allocte new cache. Sometimes we want to reuse classifier cache to reduce the overhead of allocating new memory everytime a new cache is created.
* route: mark data argument for rtnl_netem_set_delay_distribution_data() as constThomas Haller2018-01-161-1/+1
|
* route: add separate function to set netem qdisc delay distributionSteffen Vogel2017-12-201-0/+1
| | | | | | | | | A new function rtnl_netem_set_delay_distribution_data() has been added to allow the user to pass the delay distribution directly without loading it from a file. In conjunction with the maketable code (see iproute2 / NISTnet) this can be used to generate and load custom delay distributions on the fly.
* route: Add support for MPLS encapDavid Ahern2017-08-181-0/+6
| | | | | | Add support for MPLS lwtunnel encapsulation. Signed-off-by: David Ahern <dsahern@gmail.com>
* route: Add support for ttl propagation in MPLS routesDavid Ahern2017-08-181-0/+3
| | | | | | | Add support for RTA_TTL_PROPAGATE attribute on a per-route basis. Used to enable/disable TTL propagation at LSP egress. Signed-off-by: David Ahern <dsahern@gmail.com>
* route: Add support for MPLS address familyDavid Ahern2017-08-181-0/+6
| | | | | | | | | | | | | | | | | Add support for route in MPLS family. New attributes: - RTA_NEWDST - label stack for a nexthop - RTA_VIA - nexthop address (e.g., IPv4 or IPv6) Other changes required: - scope has to be universe for MPLS routes so fixup rtnl_route_guess_scope - priority attribute can not be set for MPLS. Change rtnl_route_parse to not set the attribute by default for AF_MPLS. - table attribute should not be set unless something other than the default table. For MPLS this attribute can not be set. '/' is the separator in label stacks for consistency with iproute2. Signed-off-by: David Ahern <dsahern@gmail.com>
* rule: change API for setting/getting l3mdev rule propertyThomas Haller2017-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | - for rtnl_rule_set_l3mdev(), also allow unsetting the l3mdev field. In practice, kernel only allows for two options: either omit tb[FRA_L3MDEV] or set it to 1. As such, rtnl_rule_set_l3mdev() allows for both of these. In principle the setter could get extended to set other values. Such values are reserved. - for rtnl_rule_get_l3mdev() also return an error code. I think it is appropriate to mix value and negative error code, as long as the range of values cannot overlap with error codes. Arguably, the outcome is a bit awkward, as the function now is expected to return -NLE_MISSING_ATTR or 1. So, the best check is probably if (rtnl_rule_get_l3mdev(r) > 0) { ... } The reason for this change is that libnl should expose the netlink API without coercing uint8 to boolean. That way, future changes in kernel don't require update to libnl3. Signed-off-by: Thomas Haller <thaller@redhat.com>
* rule: Add support for l3mdev in FIB rulesDavid Ahern2017-05-121-0/+2
| | | | | | | | | | | | | | | | | | Add support for the l3mdev option in FIB rules. If l3mdev is set then the lookup is directed to the table associated with the l3mdev (e.g., VRF) device. If the l3mev attribute is set the table id is not, so update the table id attribute to make sure r_table is non-0. iproute2 shows the rule as: 1000: from all lookup [l3mdev-table] where [l3mdev-table] infers the dynamic nature of the table id. Keep that notation for libnl. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route: Add support for MPLS to netconfDavid Ahern2017-05-121-0/+1
| | | | | | | | | | | | Add support to netconf for MPLS address family. v2 - change get method to return 0/error and take 'int *val' which is set to the value requested - added rtnl_netconf_get_input to libnl-route-3.sym Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* route: Add support for netconfDavid Ahern2017-05-121-0/+43
| | | | | | | | | | | | Add route/netconf cache type to monitor RTM_*NETCONF messages. v2 - change get methods to return 0/error and take 'int *val' which is set to the value requested Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* Provide accessors for actions (rtnl_act).Santhosh Kumar2017-05-033-0/+3
| | | | | | Add accessor functions to retrieve actions on a tc object and provide additional function to navigate the collection of actions.
* route/link: add accessor API for IPv6 flagsMarkus Trapp2017-05-031-0/+10
| | | | | | | | Add functions to access the IPv6 specific flags of a link object. Also the functions for IPv6 link flags translation are now exported, similar to the non IPv6 specific translation functions. https://github.com/thom311/libnl/pull/136
* include: restore linux header includes in public headersThomas Haller2017-03-0214-0/+16
| | | | | | | | | The previous commits reorganized the public headers to drop includes of linux kernel headers. Restore the previous situation because otherwise the change might break compilation for users who rely on certain headers getting dragged in by libnl3.
* include: don't include kernel headers in public libnl3 headersThomas Haller2017-03-0216-16/+12
| | | | | | | | | | | | | | | | | It would be desirable not to include kernel headers in our public libnl3 headers. As a test, remove all those includes, and fix compilation by explicitly including the kernel headers where needed. In some cases, that requires forward declaration for kernel structures, as we use them as part of our own headers. Realistically, we cannot drop those includes as it probalby breaks compilation for users that expect to get a certain kernel header when including a libnl3 header. So, this will not be done and the includes will be restored in the next commit. Do this step to show how it would be and to verify that we could build with such a change. The reason not to do this is backward compatibility (at compile-time).
* link/sit: Add missing prototype for rtnl_link_is_sit()Tobias Klauser2017-01-201-0/+2
| | | | | | | | | | | Add the function prototype for rtnl_link_is_ipip() to the public header. This fixes the following GCC warning when compiling with -Wmissing-prototypes: route/link/sit.c:400:5: warning: no previous prototype for ‘rtnl_link_is_sit’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link/ipvti: Fix and add function prototypes in public headerTobias Klauser2017-01-201-4/+6
| | | | | | | | | | | | | | | | | | | Add missing "_ipvti" part to function prototypes so they match the exported name. Also add the missing prototype for rtnl_link_is_ipvti(). This fixes the following GCC warnings when compiling with -Wmissing-prototypes: route/link/ipvti.c:281:5: warning: no previous prototype for ‘rtnl_link_is_ipvti’ [-Wmissing-prototypes] route/link/ipvti.c:369:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_ikey’ [-Wmissing-prototypes] route/link/ipvti.c:403:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_okey’ [-Wmissing-prototypes] route/link/ipvti.c:437:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_local’ [-Wmissing-prototypes] route/link/ipvti.c:471:10: warning: no previous prototype for ‘rtnl_link_ipvti_get_remote’ [-Wmissing-prototypes] Also fix the corresponding names in documentation. Fixes: 8f6301426a00 ("ipvti: introduce vti tunnel support") Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link/ipip: Add missing prototype for rtnl_link_is_ipip()Tobias Klauser2017-01-201-1/+2
| | | | | | | | | | | Add the function prototype for rtnl_link_is_ipip() to the public header. This fixes the following GCC warning when compiling with -Wmissing-prototypes: route/link/ipip.c:296:5: warning: no previous prototype for ‘rtnl_link_is_ipip’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* qdisc/red: Add missing prototypes for rtnl_red_set_limit() and ↵Tobias Klauser2017-01-201-0/+3
| | | | | | | | | | | | rtnl_red_get_limit() This fixes the following GCC warnings when compiling with -Wmissing-prototypes: route/qdisc/red.c:136:6: warning: no previous prototype for ‘rtnl_red_set_limit’ [-Wmissing-prototypes] route/qdisc/red.c:152:5: warning: no previous prototype for ‘rtnl_red_get_limit’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* sriov: Add missing prototype for rtnl_link_vf_vlan_free()Tobias Klauser2017-01-201-0/+1
| | | | | | | | | | | | | Add missing function prototyoe for rtnl_link_vf_vlan_free() to the public header. This fixes the following GCC warning when compiling with -Wmissing-prototypes: route/link/sriov.c:1339:6: warning: no previous prototype for ‘rtnl_link_vf_vlan_free’ [-Wmissing-prototypes] Fixes: 5d6e43ebef12 ("lib/route: SRIOV Parse and Read support") Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* sit: Fix invalid function prototypes in public headerTobias Klauser2017-01-201-1/+1
| | | | | | | | | | Change rtnl_link_get_sit_local() rtnl_link_sit_get_local() as this is the function's exported name. This fixes a GCC -Wmissing-prototypes warning. Fixes: d715b8a5f6ec ("introduce sit tunnel support") Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link: add support for IFLA_GSO_MAX_SEGS and IFLA_GSO_MAX_SIZETobias Klauser2016-12-061-0/+4
| | | | Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link: add support for IFLA_PHYS_SWITCH_IDTobias Klauser2016-12-061-0/+2
| | | | Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link: add support for IFLA_PHYS_PORT_NAMETobias Klauser2016-12-061-0/+2
| | | | Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* link: add support for IFLA_CARRIER_CHANGESTobias Klauser2016-12-061-0/+2
| | | | | | Also expose the attribute value via link_dump_details() Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* route/act: add gact tc actionSushma Sitaram2016-12-021-0/+31
| | | | | | | Signed-off-by: Sushma Sitaram <sushma.sitaram@intel.com> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2016-November/002249.html
* lib/route: add rx_nohandler link stats fieldTobias Klauser2016-11-291-0/+1
| | | | | | | | A new counter rx_nohandler was added to the link stats in kernel commit 6e7333d315a7 ("net: add rx_nohandler stat counter"). Wire it up in the libnl link stats as well. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* route/cls: support setting of selector fieldsSushma Sitaram2016-11-281-0/+1
| | | | | | | | | | Enables to set the shift, offset, mask and flags of the position to next header http://lists.infradead.org/pipermail/libnl/2016-September/002227.html http://lists.infradead.org/pipermail/libnl/2016-October/002232.html Signed-off-by: Sushma Sitaram <sushma.sitaram@intel.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* ppp: fix API in ppp.h headerThomas Haller2016-11-281-2/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* Add PPP supportJonas Johansson2016-11-281-0/+30
| | | | | | This patch add support for kernel PPP interfaces. Signed-off-by: Jonas Johansson <jonasj76@gmail.com>