| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
Move all the declarations from "netlink-private/types.h" to places
closer to where they are used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This also fixes a few wrong SPDX license identifiers, where the original
license comment indicates GPL-2.0-only.
This is not done manually, but by running the following script:
---
#!/bin/bash
# Tool to drop license comments, adding SPDX license identifiers, while preserving
# copyright comments. The point is not to manually do this task, but perform some
# hacked up string replacement.
_cp() {
/bin/cp "$@"
}
_cat() {
/bin/cat "$@"
}
in_file() {
local T=$(mktemp)
_cp -f "$1" "$T"
_cat "$T"
rm -f "$T"
}
out_file() {
local T=$(mktemp)
_cat - > "$T"
_cp -f "$T" "$1"
rm -f "$T"
}
join() {
_cat "$@" | awk '{ printf("%s#x#", $0)}'
}
unjoin() {
_cat - | sed 's/#x#/\n/g'
}
files_all() {
git ls-files |
grep -v '\.png$' |
grep -v '^include/linux-private/'
}
adjust() {
NEWLINES='\(#x#\)\+'
COPYRIGHTS='\(\( \* Copyright (c) 20..\(-20..\|, 20..\)\? [^#]\+#x#\)\+\( \*#x# \* \(Stolen[^#]*\|Based on [^#]*\)#x#\)\?\)'
_cat - |
\
sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' |
\
sed '1s%^/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x##x#%' |
\
sed '1s%^\(\)/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' |
\
sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU General Public License as#x# \*[ ]\+published by the Free Software Foundation version 2 of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: GPL-2.0-only \*/#x#/*#x#\2 */#x##x#%'
}
FILES=( $(files_all) )
for f in "${FILES[@]}"; do
echo "processing \"$f\"..."
in_file "$f" | join | adjust | unjoin | out_file "$f"
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Software Package Data Exchange identifiers help to detect source file
licenses and hence simplify the FOSS compliance process.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
https://github.com/thom311/libnl/pull/219
---
FILES=(
lib/addr.c
lib/attr.c
lib/cache.c
lib/cache_mngr.c
lib/cache_mngt.c
lib/data.c
lib/error.c
lib/fib_lookup/lookup.c
lib/fib_lookup/request.c
lib/genl/ctrl.c
lib/genl/family.c
lib/genl/genl.c
lib/genl/mngt.c
lib/handlers.c
lib/hash.c
lib/hashtable.c
lib/idiag/idiag.c
lib/idiag/idiag_meminfo_obj.c
lib/idiag/idiag_msg_obj.c
lib/idiag/idiag_req_obj.c
lib/idiag/idiag_vegasinfo_obj.c
lib/mpls.c
lib/msg.c
lib/netfilter/ct.c
lib/netfilter/ct_obj.c
lib/netfilter/exp.c
lib/netfilter/exp_obj.c
lib/netfilter/log.c
lib/netfilter/log_msg.c
lib/netfilter/log_msg_obj.c
lib/netfilter/log_obj.c
lib/netfilter/netfilter.c
lib/netfilter/nfnl.c
lib/netfilter/queue.c
lib/netfilter/queue_msg.c
lib/netfilter/queue_msg_obj.c
lib/netfilter/queue_obj.c
lib/nl.c
lib/object.c
lib/route/act.c
lib/route/addr.c
lib/route/class.c
lib/route/classid.c
lib/route/cls.c
lib/route/link.c
lib/route/neigh.c
lib/route/neightbl.c
lib/route/netconf.c
lib/route/nexthop.c
lib/route/nexthop_encap.c
lib/route/nh_encap_mpls.c
lib/route/pktloc.c
lib/route/qdisc.c
lib/route/route.c
lib/route/route_obj.c
lib/route/route_utils.c
lib/route/rtnl.c
lib/route/rule.c
lib/route/tc.c
lib/socket.c
lib/utils.c
lib/version.c
lib/xfrm/ae.c
lib/xfrm/lifetime.c
lib/xfrm/sa.c
lib/xfrm/selector.c
lib/xfrm/sp.c
lib/xfrm/template.c
src/genl-ctrl-list.c
src/idiag-socket-details.c
src/lib/addr.c
src/lib/class.c
src/lib/cls.c
src/lib/ct.c
src/lib/exp.c
src/lib/link.c
src/lib/neigh.c
src/lib/qdisc.c
src/lib/route.c
src/lib/rule.c
src/lib/tc.c
src/lib/utils.c
src/nf-ct-add.c
src/nf-ct-events.c
src/nf-ct-list.c
src/nf-exp-add.c
src/nf-exp-delete.c
src/nf-exp-list.c
src/nf-log.c
src/nf-monitor.c
src/nf-queue.c
src/nl-addr-add.c
src/nl-addr-delete.c
src/nl-addr-list.c
src/nl-class-add.c
src/nl-class-delete.c
src/nl-class-list.c
src/nl-classid-lookup.c
src/nl-cls-add.c
src/nl-cls-delete.c
src/nl-cls-list.c
src/nl-fib-lookup.c
src/nl-link-enslave.c
src/nl-link-ifindex2name.c
src/nl-link-list.c
src/nl-link-name2ifindex.c
src/nl-link-release.c
src/nl-link-set.c
src/nl-link-stats.c
src/nl-list-caches.c
src/nl-list-sockets.c
src/nl-monitor.c
src/nl-neigh-add.c
src/nl-neigh-delete.c
src/nl-neigh-list.c
src/nl-neightbl-list.c
src/nl-pktloc-lookup.c
src/nl-qdisc-add.c
src/nl-qdisc-delete.c
src/nl-qdisc-list.c
src/nl-route-add.c
src/nl-route-delete.c
src/nl-route-get.c
src/nl-route-list.c
src/nl-rule-list.c
src/nl-tctree-list.c
src/nl-util-addr.c
)
sed '1s#^#/* SPDX-License-Identifier: LGPL-2.1-only */\n#' "${FILES[@]}" -i
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This clarifies the seperation between public and private
header files.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Mostly killing doxygen warnings, some doc updates to caching
|
|
|
|
|
| |
This changeset ensures that internal code properly synchronizes to
ACKs if ACKs are enabled and otherwise return immediately.
|
|
|
|
| |
Obsoletes internal P_ACCEPT/P_IGNORE
|
|
|
|
|
|
|
|
| |
The idea of a common handle is long revised and only misleading,
nl_handle really represents a socket with some additional
action handlers assigned to it.
Alias for nl_handle is kept for backwards compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order for the interface to become more thread safe, the error
handling was revised to no longer depend on a static errno and
error string buffer.
This patch converts all error paths to return a libnl specific
error code which can be translated to a error message using
nl_geterror(int error). The functions nl_error() and
nl_get_errno() are therefore obsolete.
This change required various sets of function prototypes to be
changed in order to return an error code, the most prominent
are:
struct nl_cache *foo_alloc_cache(...);
changed to:
int foo_alloc_cache(..., struct nl_cache **);
struct nl_msg *foo_build_request(...);
changed to:
int foo_build_request(..., struct nl_msg **);
struct foo *foo_parse(...);
changed to:
int foo_parse(..., struct foo **);
This pretty much only leaves trivial allocation functions to
still return a pointer object which can still return NULL to
signal out of memory.
This change is a serious API and ABI breaker, sorry!
|
|
|
|
|
|
| |
This changesets adds the possibility to fill a nl_cache with
the contents of the route cache. It also adds the possibility
to limit route caches to certain address families.
|
|
|
|
|
|
|
|
|
|
| |
Adds all missing routing attributes and brings the routing
related code to a working state. In the process the API
was broken several times with the justification that nobody
is using this code yet.
The changes include new example code which is also a prototype
for how plain CLI tools could look like to control routes.
|
|
|
|
|
|
|
|
|
|
| |
So far the destination address for default routes was NULL
which complicated the handling of routes in general. By
assigning a address of length zero they can be compared
to each other.
This allows the cache manager to properly handle default
routes.
|
|
|
|
| |
The reference created by the parsers was never given back.
|
|
|
|
|
|
|
|
|
|
| |
This interface was internal so far which required all code defining
caches to be compiled with the sources available.
In order to simplify the interface, the co_msg_parser prototype was
changed to take the struct nl_parser_param directly instead of a
void *. It used to be void * because the co_msg_parser was directly
passed as the NL_CB_VALID callback function.
|
|
|