summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* lib: use getprotobyname_r(), getprotobynumber_r() if availableThomas Haller2023-08-181-0/+4
| | | | Avoid non-threadsafe libc API.
* route: fix documentation comment for nl_nh_group_infoThomas Haller2023-08-171-2/+2
| | | | | | https://github.com/thom311/libnl/issues/356 Fixes: 780d06ae8bee ('route: add nh type')
* clang-format: reformat files with new formatThomas Haller2023-08-172-222/+222
| | | | $ ./tools/clang-format.sh
* include/linux: add all linux headers that we useThomas Haller2023-08-0825-0/+4266
| | | | | | | | | | | | | | | | | | | | | | | It doesn't work well, to only include some parts of the linux headers. For example, <linux/ipv6.h> includes <linux/stddef.h>, which previously wasn't copied. Worse, <linux/ipv6.h> depends on some recent defines in <linux/stddef.h>, so we cannot just mix kernel headers from different versions. Import all the used <linux/*> kernel headers. Note that architecture specific headers from "<asm/*" and "<asm-generic/*" are not copied. Taken from v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1). Reimport via cd /data/src/linux make headers_install ARCH=i386 INSTALL_HDR_PATH=/tmp/Linux/ cd /data/src/libnl3 for h in $(cd include/linux-private/; git ls-files .); do \ /bin/cp /tmp/Linux/include/$h include/linux-private/$h ; \ done
* include/linux: update all linux headersThomas Haller2023-08-0833-157/+1974
| | | | Taken from v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1).
* include: add missing "extern "C"" specifier to public headersThomas Haller2023-08-076-0/+49
|
* all: drop "extern "C"" from internal codeThomas Haller2023-08-072-16/+0
| | | | | libnl3 itself needs to be build with a C compiler. Drop the unnecessary "extern "C"" parts from internal code.
* include: fix headers "include/netlink/route/{netconf.h,route/qdisc/red.h}" ↵Thomas Haller2023-08-072-0/+3
| | | | to be self-contained
* route/nh: drop not implemented "nh" API from headersThomas Haller2023-08-031-5/+0
| | | | Fixes: 780d06ae8bee ('route: add nh type')
* include: drop "netlink-private/netlink.h" and move declarationsThomas Haller2023-08-025-244/+167
|
* include: add "nl-default.h" headerThomas Haller2023-08-022-2/+12
| | | | | | | | | | | | | In an autotools project, <config.h> should be included as very first thing in almost all cases. We also want include other stuff, in particular "include/base", which contains our own extensions on top of plain C (it is thus applicable to all our C modules). Add a "nl-default.h", which can be included as first and prepares a base for each C source. Additionally, since header files are never compiled directly (only indirectly by being included), they can rely that "nl-default.h" is always available.
* build: move "lib/defs.h" to "include/config.h"Thomas Haller2023-08-021-1/+1
| | | | | | | It seems "config.h" is the more common name for the autotools generated header. In any case, it should not be under "lib", because lib is specifically about libnl-3 and similar libraries. It's awkward for modules under src to include from lib.
* include: split and drop "netlink-private/types.h"Thomas Haller2023-08-026-1469/+131
| | | | | Move all the declarations from "netlink-private/types.h" to places closer to where they are used.
* include: rename "nl-shared-core" to "nl-priv-dynamic-core"Thomas Haller2023-08-025-4/+4
| | | | | Naming is just so important to understand what this is. This name is better.
* include: rename "nl-hidden-route" to "nl-priv-dynamic-route"Thomas Haller2023-08-022-2/+2
| | | | | Naming is just so important to understand what this is. This name is better.
* include: rename "nl-intern-route" to "nl-priv-static-route"Thomas Haller2023-08-022-2/+2
| | | | | Naming is just so important to understand what this is. This name is better.
* include: make "netlink/route/link/{inet,inet6}.h" self-containedThomas Haller2023-08-022-0/+2
|
* lib: move "include/netlink-private/object-api" to include/nl-shared-coreThomas Haller2023-08-013-2/+2
|
* lib: move "include/netlink-private/cache-api" to include/nl-shared-coreThomas Haller2023-08-013-1/+9
|
* route: move "include/netlink-private/route/link/sriov.h" to ↵Thomas Haller2023-08-012-29/+1
| | | | lib/route/link-sriov.h
* lib: move "include/netlink-private/socket.h" to lib/nl-core.hThomas Haller2023-08-011-25/+0
|
* route: move "include/netlink-private/route/nexthop-encap.h" to lib/routeThomas Haller2023-08-012-36/+0
|
* route: merge "include/netlink-private/tc.h" to lib/route/tc-api.hThomas Haller2023-08-011-48/+0
| | | | | It's a private header only for lib/route (libnl-route-3). We already have a similar header. Move the content to "lib/route/tc-api.h".
* route: move rtnl_tc_build_rate_table() to "tc-api.h"Thomas Haller2023-08-011-4/+0
| | | | | | This symbols is (wronly) exposed on the ABI of libnl-route-3. Move the declaration to "tc-api.h", where there are similar symbols of this kind.
* route: move "include/netlink-private/route/tc-api.h" to lib/routeThomas Haller2023-08-013-66/+10
| | | | | | | | This header is entirely private to lib/route (libnl-route-3). Move the header there, it should not be used by anybody else. Note that libnl-route-3 exports symbols from this private header. That is ugly, make that clearer by adding comments.
* route: move hidden symbols from "include/netlink-private/route/tc-api.h"Thomas Haller2023-08-012-66/+76
| | | | | | | | | | | To new header "include/nl-hidden-route/nl-hidden-route.h". libnl-route-3 exports some symbols that are no in public headers. They are however used by other internal users in the source tree. Such usage seems bad. We should clearly see where this is done. Move the symbols to a separate header, where it's clear who may use this header, and what's its purpose.
* include: move "include/netlink-private/route/link/api.h" to lib/routeThomas Haller2023-07-311-194/+0
| | | | | This header is entirely private to compiling libnl-route-3 under lib/route. Move the header there.
* include: move "include/netlink-private/route/utils.h" to nl-intern-routeThomas Haller2023-07-312-0/+7
| | | | | | | | | | | | | | | | This header has a very specific purpose. To give access to the unit tests to some internals. It only is usable to parts that statically link with libnl-route-3 sources (e.g. "tests/check-direct") and libnl-route-3 itself. The point is that the symbol there is not exported by the libnl-route-3 shared library, so a test that dynamically links against libnl-route-3 couldn't access them. Hence the internal purpose of static linking the test with libnl-route-3 sources, and a special header for that. Move "include/netlink-private/route/utils.h" to a separate place, to make that usage clearer.
* include: move "include/netlink-private/route/mpls.h" to "lib/mpls.h"Thomas Haller2023-07-311-15/+0
|
* include: move "include/netlink-private/genl.h" to "lib/genl/nl-priv-genl.h"Thomas Haller2023-07-311-16/+0
| | | | | | | | | | This header is entirely private to the source files in "lib/genl". It's confusing to keep it separate. Place it beside the source files, which can use it. I guess, I just disagree with this notion, that all headers must be under "include/" directory. Not, if the header is entirely local to one module.
* nl-aux: add "include/nl-aux-{core,route}" headersThomas Haller2023-07-315-34/+74
| | | | | | | | | | | | | | | | | | | We have "include/netlink-private/netlink.h", which is private API used internally. However, it's confusing where "include/netlink-private/netlink.h" can be used. For example, it contains some "libnl-route-3.so" specific extensions like "link_lookup()", hence you would think that it can only be used with libraries that also use "libnl-route-3.so". Well, since it's a header, you actually can also use it for example under "lib/xfrm/", you couldn't just use those declarations because they are implemented and accessible only under "lib/route/" In a first step to clean this up, and move helper to separate headers, add "include/nl-aux-{core,route}" headers with certain clear usage. Clear in the sense who may use those headers, and what the implementation of those headers may use.
* base: move "netlink-private/utils.h" to "base/nl-base-utils.h"Thomas Haller2023-07-314-5/+20
| | | | | | | | | | "base/nl-base-utils.h" (formerly "netlink-private/utils.h") contains no libnl3 specific references, just a bunch of C helpers. It's also a header-only "library", so it can be freely used by all our C-code. Move it to a separate directory, to make that clear.
* include/utils: move nl-auto base defines to "utils.h"Thomas Haller2023-07-313-30/+32
| | | | | | | | "utils.h" will become the internal helper "library" at the lowest level. While "nl-auto.h" contains libnl3 specific functions, "utils.h" does not. Move libnl3 specific helpers from "nl-auto.h" to "utils.h".
* clang-format: reformat "include/netlink-private/nl-auto.h"Thomas Haller2023-07-311-36/+48
|
* cli: add nl-nh-list utilityStanislav Zaikin2023-07-311-0/+30
|
* route: add nh typeStanislav Zaikin2023-07-313-0/+85
|
* neigh: add support of NHID attributeStanislav Zaikin2023-07-312-0/+4
|
* include: import kernel headers "linux/{neighbour,nexthop,rtnetlink}.h"Stanislav Zaikin2023-07-313-38/+271
| | | | Taken from kernel v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1).
* utils: add static-assert for signedness of arguments of _NL_CMP_DIRECT() macroThomas Haller2023-07-311-0/+2
|
* lib: use _nl_{init,exit} instead of __{init,exit}Thomas Haller2023-07-281-3/+0
| | | | | We should have things with "nl" prefix in our headers. Also, netlink-private/netlink.h is not header-only, preferably header-only stuff is in netlink-private/utils.h
* include/private: add _nl_init/_nl_exit macrosThomas Haller2023-07-281-0/+2
|
* include/private: drop unused __deprecated macroThomas Haller2023-07-281-2/+0
| | | | Also, there is _nl_deprecated instead.
* all: rework ATTR_DIFF() macros to not generate attribute namesThomas Haller2023-07-281-3/+3
| | | | | | | | | | I find macros that stitch together names like "FAMILY_ATTR_##ATTR" very confusing, because we no longer see where a certain name is used. It breaks grepping for symbols, and it breaks cscope. Yes, it's more verbose to not do that. If you really think that those names are too verbose, then maybe they should get a shorter name. And not use macros to make them palatable.
* include: drop now unused min()/max()/min_t()/max_t() macrosThomas Haller2023-07-281-17/+0
|
* utils: add various helpers to "include/netlink-private/utils.h"Thomas Haller2023-07-281-11/+299
| | | | | These are taken from NetworkManager code and renamed. The original code is LGPL-2.1-or-later licensed, so we are good.
* style: format "include/netlink-private/utils.h" with clang-formatThomas Haller2023-07-282-121/+123
|
* route/bond: Add support for link_info for bondMallikarjun Nemagoudar2023-07-271-0/+3
| | | | | | | | | | | | | following API has been added to bonding bond_alloc bond_free rtnl_link_bond_set_activeslave rtnl_link_bond_set_mode bond_put_attrs Signed-off-by: Mallikarjun Nemagoudar <MallikarjunRamappa.Nemagoudar@infineon.com> https://github.com/thom311/libnl/pull/349
* include/linux: update copy of kernel header "linux/ipv6.h"Thomas Haller2023-07-241-3/+14
| | | | | | | The point is to bump DEVCONF_MAX. Taken from upstream kernel commit 6995e2de6891c724bfeb2db33d7b87775f913ad1 (v6.4).
* route/link: remove rtnl_link_inet6_set_conf() APIThomas Haller2023-07-241-4/+0
| | | | | | | | | | | | | | It's not clear how this API is useful. I don't think that kernel accepts netlink requests to change the settings. So constructing a libnl3 object in the user application seems not useful. Also, because of the difficulty that DEVCONF_MAX is depending on the current kernel, and changing. We need to improve how to handle the option, and a rtnl_link_inet6_set_conf() only makes that more confusing. The same is the case for rtnl_link_inet6_set_flags(), but that API already exists, while rtnl_link_inet6_set_conf() is still new and unreleased.
* route/link: various fixes for rtnl_link_inet6_get_conf() APIThomas Haller2023-07-241-2/+2
|