summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* utils: add _NL_AUTO_DEFINE_FCN_STRUCT() macroThomas Haller2022-05-061-0/+8
|
* utils: add _nl_thread_local macroThomas Haller2022-05-061-0/+17
|
* netlink/utils.h: mark nl_dump() with __attribute__((format(printf,a,b)))Thomas Haller2022-04-221-2/+2
|
* netlink/utils.h: add internal _nl_attribute_printf macro for public headersThomas Haller2022-04-221-0/+6
|
* netlink/private: add internal helper utilsThomas Haller2022-04-221-0/+73
| | | | | | | | | | | | inet_ntop() is documented to fail, so we have various places with pointless (and wrong) error checking. Well, it can fail if we pass an unexpected address family (which we must not and assert against that), or if we pass an invalid string buffer (which we must not, and cannot meaningfully assert for that). So it can only fail in case of a bug and there is no need for error checking. Yes, libc could theoretically fail, but if it fails on such a function that requires no memory allocation, then it really needs to be fixed.
* route/mdb: add _nl_auto_rtnl_mdb cleanup macroThomas Haller2022-04-221-0/+5
|
* libnl-3.6.0 releaselibnl3_6_0Thomas Haller2022-04-141-0/+6
|
* route/mdb: add support for MAC multicast entriesJoachim Wiberg2022-03-301-0/+1
| | | | | | | | | | | | | | | | The kernel bridge now support (permanent) forwarding of MAC multicast using the MDB. Internally the kernel use AF_UNSPEC, but we remap this here to AF_LLC for the benefit for nl_addrs. To test, put `nl-monitor mdb` in the background. Then, with a bridge and at least one port, run the following command: # nl-monitor mdb & # bridge mdb add dev br0 port eth0 grp 01:02:03:c0:ff:ee vid 1 permanent dev 9 port 3 vid 1 proto 0x0000 address 01:02:03:c0:ff:ee Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
* route/link: add VLAN bridge binding flagJoachim Wiberg2022-03-281-4/+5
| | | | | | | | | | | | Adds support for the new VLAN_FLAG_BRIDGE_BINDING, for VLAN interfaces created on top of a VLAN aware bridge. For details, see the kernel patch: https://lore.kernel.org/netdev/20190418173535.22925-1-mmanning@vyatta.att-mail.com/ Signed-off-by: Joachim Wiberg <troglobit@gmail.com> https://github.com/thom311/libnl/pull/303
* utils: add internal _nl_memdup() helperThomas Haller2022-03-161-0/+20
|
* lib: add rtnl_link_info_ops_get() and take lock for rtnl_link_info_ops's ↵Thomas Haller2022-03-161-0/+1
| | | | io_refcnt
* lib: include <netlink-private/utils.h> in <netlink-private/netlink.h>Thomas Haller2022-03-161-0/+1
| | | | | | We have a base-set of tools, under netlink-private. It should not be necessary to include all the bits individually. Just drag this all in. Only downside is that the compiler has more to parse.
* netlink: add _NL_N_ELEMENTS() macroThomas Haller2022-03-161-0/+4
|
* netlink: add _nl_streq()/_nl_streq0() helperThomas Haller2022-03-161-0/+12
|
* netlink: add _nl_auto_nl_socket cleanup macroThomas Haller2022-03-161-0/+5
|
* lib: add _nl_close() helperThomas Haller2022-03-161-0/+12
| | | | | | Closing an invalid filedescriptor is a serious bug, because we need to know whether an integer at hand is valid or not (cannot close arbitrary files). Add _nl_close() wrapper, which asserts against EBADF.
* route/cls: adjust whitspace/indentationThomas Haller2022-03-151-20/+20
|
* route/cls: use SPDX-License-IdentifierThomas Haller2022-03-151-7/+1
|
* 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-152-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: make argument of rtnl_link_can_set_{bittiming,data_bittiming}() constThomas Haller2022-03-151-2/+2
| | | | | | 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-151-0/+2
| | | | | 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-151-6/+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-151-2/+2
| | | | | | rtnl_link_can_get_data_bittiming_const() It seems more consistent with the other names.
* route: fix indentationThomas Haller2022-03-151-6/+6
|
* route/link: add CAN FD supportAnders Piniesjö2022-03-151-0/+13
| | | | | | | 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: drop extra MDB attributes and rework mdb_compare()Thomas Haller2022-03-141-1/+0
| | | | | | | | | | | | | | | | | | - 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-141-2/+0
| | | | | | | | | | | "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: 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".
* mdb: support bridge multicast database notificationRubens Figueiredo2022-03-143-0/+72
| | | | | | | | | | | 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: rename rtnl_cls_get{,_by_prio}() API to ↵Thomas Haller2022-03-141-4/+4
| | | | | | | 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-141-0/+4
| | | | | | | | API: rtnl_cls_get() rtnl_cls_get_by_prio() These functions search for classifiers in classifier cache.
* license: use SPDX license identifiers and drop license commentsThomas Haller2022-03-111-8/+1
|
* ip6vti: Add fwmark APIThomas Winter2022-03-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+3
| | | | | | 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-111-0/+44
| | | | | | | 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-112-15/+2
|
* route/route: support FIB lookups using rtnlTobias Waldekranz2022-03-111-0/+3
| | | | | | | 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.
* route/link: add support for team deviceJonas Johansson2022-03-101-0/+32
| | | | Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
* route/qdisc: allow fetching qdiscs by their kindVolodymyr Bendiuga2022-03-101-0/+2
| | | | | | | | | | | | 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
* nflog:add conntrack flag and enable flags for nflogMichael Braun2022-03-091-0/+1
| | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
* nflog: add CT supportMichael Braun2022-03-093-0/+13
| | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
* nflog: add mac_header supportMichael Braun2022-03-092-0/+16
| | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
* nflog: add vlan attributeMichael Braun2022-03-092-0/+12
| | | | | | | Signed-off-by: Michael Braun <michael-dev@fami-braun.de> -- v2: use new kernel api like for nfqueue