summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* include: copy entire pkt_cls.h from linuxVolodymyr Bendiuga2018-04-111-78/+182
| | | | Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* rule: Add support for protocol and port rangesDavid Ahern2018-04-062-0/+22
| | | | | | | 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>
* Update fib_rules.h to latest kernelDavid Ahern2018-04-061-4/+22
| | | | | | | Update fib_rules.h to kernel as of bfff4862653b ("net: fib_rules: support for match on ip_proto, sport and dport") 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>
* Fix for cgroup filter addition problem.d0u92018-01-231-0/+1
| | | | | | | | | | Currently, due to the incomplete netlink datagram sent by libnl, cgroup filter addition is not fully functional. The datagram generated by `tc` command includes an empty attribute section, which is stripped off in the libnl counterpart. In this commit, a new `interface nla_nest_end_keep_empty()` is added. This function closes attribute without stripping off empty attribute.
* 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.
* Change rtnl_link_af_ops.ao_override_rtm behaviorJef Oliver2017-11-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rtnl_link_af_ops.ao_override_rtm allows for a link module to override the change request type being sent to the kernel. More specifically, the default change request type is RTM_NEWLINK. Some link change requests require the reqeust type to be set to RTM_SETLINK. This is the case for IFLA_PROTINFO specific attributes for a link that is slave to a bridge. Currently, ao_override_rtm is static to the address family type. So, all changes submitted to AF_BRIDGE override the link change request type. The override only needs to happen if IFLA_PROTINFO attributes are appended to the link change request. This patch changes ao_override_rtm from a const integer to a function pointer that allows for a link module to determine if the override needs to actually happen. Currently, only the bridge module uses this functionality. If bridge flags are applied to a link (bdpu blocking, learning, fast leave, etc...), these flags are nested in IFLA_PROTINFO. If the flags are present, the link change request type will be overridden as RTM_SETLINK. This fixes the ability to set a bridge link up or down by using the correct RTM_NEWLINK link change request type. $ sudo src/nl-link-set -n br2 --state=down Changed bridge br2 ether a6:e6:94:8c:61:ec <broadcast,multicast,up,running,lowerup> group 0 $ ip link show br2: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000 $ sudo src/nl-link-set -n br2 --state=up Changed bridge br2 ether a6:e6:94:8c:61:ec <broadcast,multicast> group 0 $ ip link show br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 Signed-off-by: Jef Oliver <jef.oliver@intel.com> Fixes: 55bc931a7272e6ac8f555bcc2a373eb2b6b58377 http://lists.infradead.org/pipermail/libnl/2017-November/002382.html http://lists.infradead.org/pipermail/libnl/2017-November/002385.html
* route/vlan: add capability to indicate heap overflow fix in ↵Thomas Haller2017-10-231-0/+8
| | | | | | | rtnl_link_vlan_set_egress_map() Without this fix/capablity, adding more then 4 mappings in rtnl_link_vlan_set_egress_map() overflows the heap.
* nl: add "const" specifier for nla_policy argument of parse functionsThomas Haller2017-10-094-7/+7
| | | | | | | | | | | Adding const to a function argument is generally not an API break (at least, if the argument is a struct, like in this case). Usually we declare the policy as static variables. The user should be able to mark them as "const", so that the linker makes the policy array read-only. Adjust the API to allow for that. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl-3.4.0 releaselibnl3_4_0Thomas Haller2017-10-091-0/+6
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: include sys/select.h for select(2)Tobias Klauser2017-09-071-0/+1
| | | | | | | | | | | | | | | | | Some of the cli tools use select(2) and its man page states: /* According to POSIX.1-2001, POSIX.1-2008 */ #include <sys/select.h> Do so and explicitly #include <sys/select.h> in <netlink/cli/utils.h> instead of relying of getting select(2) via implicit includes. This is also needed to make libnl compile for Android. Based on a previous patch by Fredrik Fornwall. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> https://github.com/thom311/libnl/pull/151
* route: Add support for MPLS encapDavid Ahern2017-08-182-0/+11
| | | | | | Add support for MPLS lwtunnel encapsulation. Signed-off-by: David Ahern <dsahern@gmail.com>
* route: Add support for lwtunnel encapsulationsDavid Ahern2017-08-182-0/+38
| | | | | | | | | | Add framework to support lwtunnel encapsulations per nexthop. Encapsulations types are expected to fill in the nh_encap_ops for building and parsing messages, compare encapsulations in routes, dumping the encapsulations and freeing memory. Signed-off-by: David Ahern <dsahern@gmail.com>
* Import lwtunnel encap files from kernelDavid Ahern2017-08-182-0/+99
| | | | | | | Import lwtunnel and mpls_iptunnel.h from net-next tree as of commit b217566a525ff24334d17635a865f44b68c2c583 Signed-off-by: David Ahern <dsahern@gmail.com>
* route: Add support for ttl propagation in MPLS routesDavid Ahern2017-08-182-0/+4
| | | | | | | 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-182-0/+8
| | | | | | | | | | | | | | | | | 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>
* addr: Add implementations for mpls_ntop and mpls_ptonDavid Ahern2017-08-181-0/+15
| | | | | | Implementations of mpls_ntop and mpls_pton taken from iproute2. Signed-off-by: David Ahern <dsahern@gmail.com>
* Import mpls header from kernel treeDavid Ahern2017-08-181-0/+76
| | | | | | | Add include/uapi/linux/mpls.h from net-next tree as of commit b217566a525ff24334d17635a865f44b68c2c583 Signed-off-by: David Ahern <dsahern@gmail.com>
* Update rtnetlink.h from kernel treeDavid Ahern2017-08-181-1/+17
| | | | | | | Update to rtnetlink.h to top of net-next tree as of commit b217566a525ff24334d17635a865f44b68c2c583 Signed-off-by: David Ahern <dsahern@gmail.com>
* genl: drop usage of GENL_ID_GENERATETobias Klauser2017-05-291-1/+5
| | | | | | | | | | | | After kernel commit a07ea4d9941a ("genetlink: no longer support using static family IDs"), GENL_ID_GENERATE is no longer exposed to userspace (and actually should never have been). Update the private header copy of linux/genetlink.h accordingly. And replace the two occurences of GENL_ID_GENERATE. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> https://github.com/thom311/libnl/pull/144
* build: allow building cli without dynamic librarires supportThomas Haller2017-05-121-1/+0
| | | | | | | | | | | | | | Commit 3cb28534d34392ceec4adead0cfa97039796ccb7 enables building of cli always as part of `make check`. As cli previously always included <dlfcn.h>, this broke tests for building with toolchains that don't support dynamic library loading. Add a configure check and disable dlopen() based on whether <dlfcn.h> is available. Signed-off-by: Thomas Haller <thaller@redhat.com> https://github.com/thom311/libnl/pull/141
* 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-122-1/+3
| | | | | | | | | | | | | | | | | | 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>
* Update fib_rules.h to latest kernelDavid Ahern2017-05-121-0/+3
| | | | | 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-124-0/+8
| | | | | | | | | | | | 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-123-0/+72
| | | | | | | | | | | | 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
* libnl-3.3.0 releaselibnl3_3_0Thomas Haller2017-05-031-0/+6
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: don't use math.h or link with libm.soThomas Haller2017-03-231-1/+0
|
* include: restore linux header includes in public headersThomas Haller2017-03-0225-0/+31
| | | | | | | | | 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-0233-41/+38
| | | | | | | | | | | | | | | | | 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).
* xfrm: allow quering optional arguments from xfrmnl_sp_get_sec_ctx()Thomas Haller2017-02-271-0/+7
| | | | | | | | | | The previous API of xfrmnl_sp_get_sec_ctx() is totally broken, as it requires all out-arguments to be set. The user can thus not know how large the ctx_str buffer must be. Fix the API by allowing all arguments to be optional. Thus, a user can first query the size only, and then in a second step query the ctx_str. Previous version are broken.
* route: neigh: use NDA_MASTER for neigh->n_master if availableRoopa Prabhu2017-02-271-0/+4
| | | | | | | | | | | | | | fdb cache is per bridge and hence hashed by: <bridge_ifindex, family, mac> newer kernels send bridge ifindex in NDA_MASTER. Use NDA_MASTER for neigh->n_master when available. Also imports a few more NDA_* attributes from upstream to keep linux/neighbour.h NDA_* attributes in sync with upstream. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
* build: merge include/Makefile.am into top-level makefileThomas Haller2017-02-271-182/+0
|
* all: merge branch 'tklauser-missing-prototypes'Thomas Haller2017-01-2010-8/+33
|\ | | | | | | https://github.com/thom311/libnl/pull/125
| * xfrm/sa: Include own public header for function prototypesTobias Klauser2017-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Include the own public header in order to get function prototypes for all public functions defined in this module. This fixes GCC -Wmissing-prototype warnings. Also adjust the function prototype of xfrmnl_sa_get_sec_ctx() to match the definition. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
| * idiag/req: Add missing function prototypeTobias Klauser2017-01-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add missing function prototype for idiagnl_req_parse() to the public header. This fixes the following GCC warning when compiling with -Wmissing-prototypes: idiag/idiag_req_obj.c:189:5: warning: no previous prototype for ‘idiagnl_req_parse’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
| * netfilter/exp: Add missing function prototypesTobias Klauser2017-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing function prototypes for nfnl_exp_unset_flags(), nfnl_exp_flags2str() and nfnl_exp_str2flags() to the public header. This fixes the following GCC warnings when compiling with -Wmissing-prototypes: netfilter/exp_obj.c:458:6: warning: no previous prototype for ‘nfnl_exp_unset_flags’ [-Wmissing-prototypes] netfilter/exp_obj.c:475:8: warning: no previous prototype for ‘nfnl_exp_flags2str’ [-Wmissing-prototypes] netfilter/exp_obj.c:481:5: warning: no previous prototype for ‘nfnl_exp_str2flags’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
| * netfilter/queue: Add missing prototype for nfnl_queue_msg_build_verdict_batch()Tobias Klauser2017-01-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the function prototype for nfnl_queue_msg_build_verdict_batch() to the public header. This fixes the following GCC warning when building with -Wmissing-prototypes: netfilter/queue_msg.c:190:1: warning: no previous prototype for ‘nfnl_queue_msg_build_verdict_batch’ [-Wmissing-prototypes] Fixes: d612180cda43 ("netfilter/queue: introduce nfnl_queue_msg_send_verdict_batch()") Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
| * 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>
| * fib_lookup: Add missing prototypes to public headerTobias Klauser2017-01-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the function prototypes for the struct flnl_result attribute access functions to the public header fib_lookup/lookup.h This fixes the following GCC warnings when compiling with -Wmissing-prototypes: fib_lookup/lookup.c:284:5: warning: no previous prototype for ‘flnl_result_get_table_id’ [-Wmissing-prototypes] fib_lookup/lookup.c:289:5: warning: no previous prototype for ‘flnl_result_get_prefixlen’ [-Wmissing-prototypes] fib_lookup/lookup.c:294:5: warning: no previous prototype for ‘flnl_result_get_nexthop_sel’ [-Wmissing-prototypes] fib_lookup/lookup.c:299:5: warning: no previous prototype for ‘flnl_result_get_type’ [-Wmissing-prototypes] fib_lookup/lookup.c:304:5: warning: no previous prototype for ‘flnl_result_get_scope’ [-Wmissing-prototypes] fib_lookup/lookup.c:309:5: warning: no previous prototype for ‘flnl_result_get_error’ [-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>