summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * route/cls: reorder fields in "struct rtnl_flower" and adjust indentationThomas Haller2022-03-151-13/+13
| | | | | | | | Minimize the padding inthe struct.
| * route/cls: add flower classifierVolodymyr Bendiuga2022-03-155-0/+826
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a subset of functions. Implemented api: rtnl_flower_set_proto; rtnl_flower_get_proto; rtnl_flower_set_vlan_id; rtnl_flower_get_vlan_id; rtnl_flower_set_vlan_prio; rtnl_flower_get_vlan_prio; rtnl_flower_set_vlan_ethtype; rtnl_flower_set_dst_mac; rtnl_flower_get_dst_mac; rtnl_flower_set_src_mac; rtnl_flower_get_src_mac; rtnl_flower_set_ip_dscp; rtnl_flower_get_ip_dscp; rtnl_flower_set_flags; rtnl_flower_append_action; rtnl_flower_del_action; rtnl_flower_get_action; [thaller@redhat.com: squashed commit "route:cls:flower: use parentheses in macro definitions"] [thaller@redhat.com: squashed commit "cls:flower: add TCA_FLOWER_FLAGS to flower_policy"] [thaller@redhat.com: squashed commit "cls:flower: vlan priority is uint8_t, not uint16_t"] [thaller@redhat.com: squashed commit "route:cls:flower: substitute nl_data* with uint8_t mac[ETH_ALEN]"] [thaller@redhat.com: drop non-existing TCA_FLOWER_POLICE. That was never merged to upstream kernel. While at it, use decimal numbers for the bitshift.] [thaller@redhat.com: fix build by including <linux/if_ether.h> in "types.h".] Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se>
* route: merge branch 'pugo:master'Thomas Haller2022-03-153-4/+140
|\ | | | | | | https://github.com/thom311/libnl/pull/274
| * route: make argument of rtnl_link_can_set_{bittiming,data_bittiming}() constThomas Haller2022-03-152-4/+4
| | | | | | | | | | | | The argument of the setters does not get modified. Make it const. This change does not break API/ABI.
| * route: add rtnl_link_can_set_data_bittiming_const()Thomas Haller2022-03-153-0/+25
| | | | | | | | | | In can_put_attrs(), we also put ci_data_bittiming_const. It is thus necessary to be able to set it.
| * route: drop bitrate,sample-point getters/setters from can linkThomas Haller2022-03-153-94/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These accessor functions just get/set a field of ci_data_bittiming, which can already be get/set as a whole. It seems redundant, so drop it. It's really important that things are principle at all (like, setting ci_data_bittiming). It's not clear that we need such convenience functions, if you can achieve the same result otherwise. Yes, we have similar accessors already. I think that is not a good approach though. If they turn out very useful, we can still revert this patch.
| * route: rename rtnl_link_can_get_data_bt_const() to ↵Thomas Haller2022-03-153-5/+5
| | | | | | | | | | | | rtnl_link_can_get_data_bittiming_const() It seems more consistent with the other names.
| * route: fix adding rtnl_link_can_* symbols to symbol fileThomas Haller2022-03-151-0/+7
| |
| * route: fix indentationThomas Haller2022-03-152-31/+32
| |
| * route/link: add CAN FD supportAnders Piniesjö2022-03-152-15/+212
|/ | | | | | | Add CAN FD support analog to the normal CAN support. [thaller@redhat.com: second part of original commit. The first part was merged as commit 5d925168a459]
* route/mdb: merge branch 'rubensfig:mdb'Thomas Haller2022-03-147-0/+527
|\ | | | | | | https://github.com/thom311/libnl/pull/234
| * route/mdb: drop setting ifindex in mdb_clone()Thomas Haller2022-03-141-3/+0
| | | | | | | | | | | | | | The default implementation of oo_clone() already clones the object using memcpy(). So simple fields (like ifindex) are correct. What is not correct (and for what we need the oo_clone() implementation) are pointer values which require a deep clone.
| * route/mdb: minor cleanup in "mdb.c"Thomas Haller2022-03-141-34/+31
| |
| * route/mdb: drop extra MDB attributes and rework mdb_compare()Thomas Haller2022-03-142-27/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - a `struct rtnl_mdb` has a list of `struct rtnl_mdb_entry`. An attribute like MDB_ATTR_PORT is not really an attribute of the MDB struct, but rather of one entry. It makes no sense to mangle these. Having MDB_ATTR_PORT set in the change flags would mean that at least one entry has the port set. Instead, add MDB_ATTR_ENTRIES which is about the list of entries. - drop unused `ce_mask` in `struct rtnl_mdb_entry`. - rework mdb_compare(). When we compare the two lists of entries, it's not right to have two nested loops. You can either iterate both lists in step, and compare each element to do a comparison that honors the order of the elements. Or, you can compare the two lists accepting any order. The latter is more complicated, and does not seem right. So do the former.
| * route/mdb: hide rtnl_mdb_entry_alloc() from public APIThomas Haller2022-03-142-3/+3
| | | | | | | | | | | | | | | | | | | | | | "struct rtnl_mdb_entry" is a relatively simple object that keeps a few data fields. But there are no public setters in the API, so it's not useful to be able to allocate such an entry. Hide from public API. Also, it was already not listed in libnl-route-3.sym, and thus the symbol was hidden anyway.
| * route/mdb: reorder fields in "rtnl_mdb_entry" for tighther packingThomas Haller2022-03-141-5/+3
| |
| * route/mdb: use nl_list_for_each_entry_safe() for destroying list in ↵Thomas Haller2022-03-141-8/+6
| | | | | | | | | | | | | | | | | | mdb_free_data() I think this was wrong before. We cannot use mdb_free_data() and free the current element. Use nl_list_for_each_entry_safe() and properly unlink the element.
| * route/mdb: cleanup mdb.h headerThomas Haller2022-03-141-26/+27
| | | | | | | | | | | | | | | | | | | | - drop leading tabs. Yes, it's inside an extern C block, but so is all our code in public headers. That should not by default increase the indentation level. - drop unused rtnl_mdb_add(). - forward declare "struct rtnl_mdb".
| * build: sort file names in Makefile.amThomas Haller2022-03-141-2/+2
| |
| * mdb: support bridge multicast database notificationRubens Figueiredo2022-03-147-0/+538
|/ | | | | | | | | | | The Linux kernel has a notification system via Netlink that reports the changes in the multicast database over the RTNLGRP_MDB multicast socket. As such notifications such as RTM_NEWMDB, RTM_GETMDB can be processed in userspace. libnl must support the capability of processing these messages, e.g. RTM_GETMDB. This commit adds a new rtnl_mdb object as well as a route/mdb cache, in order to expose the contents of the multicast database.
* route/cls: merge branch 'westermo:classifier-api-extension'Thomas Haller2022-03-143-2/+80
|\ | | | | | | https://github.com/thom311/libnl/pull/243
| * route/cls: rename rtnl_cls_get{,_by_prio}() API to ↵Thomas Haller2022-03-143-10/+10
| | | | | | | | | | | | | | rtnl_cls_find_by{handle,prio}() The functions return the first matching object (of potentially several). Rename them to "find", so that this is a bit clearer.
| * route/cls: allow fetching of classifiers from cacheVolodymyr Bendiuga2022-03-143-2/+80
|/ | | | | | | | API: rtnl_cls_get() rtnl_cls_get_by_prio() These functions search for classifiers in classifier cache.
* route: merge branch 'TummyFish:master'Thomas Haller2022-03-1117-0/+1044
|\ | | | | | | https://github.com/thom311/libnl/pull/194
| * license: use SPDX license identifiers and drop license commentsThomas Haller2022-03-112-16/+2
| |
| * ip6vti: Add fwmark APIThomas Winter2022-03-114-0/+63
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ip6gre: Add fwmark APIThomas Winter2022-03-114-0/+63
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * sit: Add fwmark APIThomas Winter2022-03-114-0/+60
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ipip: Add fwmark APIThomas Winter2022-03-114-0/+64
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ip6_tnl: Add fwmark APIThomas Winter2022-03-114-0/+64
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ipvti: Add fwmark APIThomas Winter2022-03-114-0/+64
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ipgre: Add fwmark APIThomas Winter2022-03-114-0/+64
| | | | | | | | | | | | This is a new option that was added in Linux v4.12. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
| * ip6vti: Add IPv6 VTI supportThomas Winter2022-03-115-0/+616
|/ | | | | | | This patch adds support for IPv6 VTI tunneling that uses the vti6 kernel module. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
* license: use SPDX license identifiers and drop license commentsThomas Haller2022-03-114-30/+4
|
* route: merge branch 'westermo:fib-lookup'Thomas Haller2022-03-113-0/+31
|\ | | | | | | https://github.com/thom311/libnl/pull/242
| * route/route: don't report failure when we receive a route in rtnl_route_lookup()Thomas Haller2022-03-112-7/+7
| | | | | | | | | | | | | | | | | | - when we received a route and set `*result`, we should not return an error. That means, ignore the result of wait_for_ack(). - use _nl_auto* cleanup macros. - move new symbols to linker version for the upcoming release.
| * route/route: support FIB lookups using rtnlTobias Waldekranz2022-03-113-0/+31
|/ | | | | | | Using the flnl_* family of functions to perform FIB lookups is rather limited. In particular, there seems to be no way of resolving the nexthop. By hooking into RTM_GETROUTE, a regular rtnl route object is returned instead.
* build: sort files in Makefile.amThomas Haller2022-03-101-4/+4
|
* route/link: merge branch 'westermo:team-support'Thomas Haller2022-03-104-0/+145
|\ | | | | | | https://github.com/thom311/libnl/pull/239
| * build: fix new symbols in "libnl-route-3.sym"Thomas Haller2022-03-101-2/+2
| |
| * route/link: add support for team deviceJonas Johansson2022-03-104-0/+145
|/ | | | Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
* route/link: Move LINK_ATTR_IFNAME to a proper locationGreger Wrang2022-03-101-2/+2
| | | | | | | | It should be set right where link name is set. Signed-off-by: Greger Wrang <greger.wrang@westermo.se> https://github.com/thom311/libnl/pull/237
* route/netconf: full API exportVolodymyr Bendiuga2022-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | The following functions have been implemented but not exported: rtnl_netconf_alloc_cache() rtnl_netconf_get_proxy_neigh() rtnl_netconf_get_ignore_routes_linkdown() Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se> [thaller@redhat.com: modified original patch. A symbol version that is already released must not be modified on another release. New symbols must always get the version of the next upcoming release. That is also in this case where we forgot to export the symbols in an older version. The old version just has a bug, and it's fixed in the next release. We cannot fix it for what is already released.] https://github.com/thom311/libnl/pull/236
* build: add Libs.private field in libnl pkg-config fileFabrice Fontaine2022-03-101-0/+1
| | | | | | | | | | | | | | | | | | In order to support static linking, the libnl pkg-config file should indicate in its Libs.private field the libraries that libnl-3.0.a requires. The LIBS variable contains the appropriate list of libraries: -lm in all cases, and -lpthread when pthread support is enabled. This allows to statically link applications against libnl properly. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [Retrieved from: https://git.buildroot.net/buildroot/tree/package/libnl/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch] Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> [thaller@redhat.com: btw, "-lm" is not used anymore] https://github.com/thom311/libnl/pull/229
* route/qdisc: allow fetching qdiscs by their kindVolodymyr Bendiuga2022-03-103-0/+35
| | | | | | | | | | | | API: rtnl_qdisc_get_by_kind() This function allows getting qdisc based on its kind, i.e. tbf, htb, cbq, etc. Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se> https://github.com/thom311/libnl/pull/244
* netlink: merge branch 'michael-dev:feature/nflog-vlan-v3'Thomas Haller2022-03-0912-24/+417
|\ | | | | | | https://github.com/thom311/libnl/pull/251
| * nflog: add recent missing symbols to "libnl-nf-3.sym"Thomas Haller2022-03-091-0/+16
| | | | | | | | | | | | | | This API was just added in the patches before. Expose the symbols of the library. Based-on-patch-by: Michael Braun <michael-dev@fami-braun.de>
| * nflog: add missing symbols to "libnl-nf-3.sym"Thomas Haller2022-03-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | This API was added a long time ago, but it didn't work because the symbols were hidden. Fix that. Note that despite the API was added in the headers of older versions of the library, the linker symbol version is about the upcoming 3.6 release. Based-on-patch-by: Michael Braun <michael-dev@fami-braun.de>
| * nflog:add conntrack flag and enable flags for nflogMichael Braun2022-03-093-0/+12
| | | | | | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
| * nflog: add CT supportMichael Braun2022-03-097-24/+145
| | | | | | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de>