summaryrefslogtreecommitdiffstats
path: root/lib/route/link/macsec.c
Commit message (Collapse)AuthorAgeFilesLines
* all: fix and enable "-Wsign-compare" warningThomas Haller2024-05-291-1/+2
|
* include: use <linux/$file> instead of <linux-private/linux/$file>Thomas Haller2023-08-081-1/+1
| | | | | | As we now copy all linux headers, and we have include/linux-private in our include search path, just include the linux headers as we commonly do.
* include: include private linux headers with explicit pathThomas Haller2023-08-031-1/+1
| | | | | | | We have copies of the linux headers in include/linux-private. For those files, include the copies explicitly. No practice there is no difference, since we build with :-Ilinux-private".
* include: drop "netlink-private/netlink.h" and move declarationsThomas Haller2023-08-021-2/+0
|
* all: cleanup includes and use "nm-default.h"Thomas Haller2023-08-021-3/+6
|
* include: split and drop "netlink-private/types.h"Thomas Haller2023-08-021-0/+2
| | | | | Move all the declarations from "netlink-private/types.h" to places closer to where they are used.
* include: move "include/netlink-private/route/link/api.h" to lib/routeThomas Haller2023-07-311-1/+2
| | | | | This header is entirely private to compiling libnl-route-3 under lib/route. Move the header there.
* base: move "netlink-private/utils.h" to "base/nl-base-utils.h"Thomas Haller2023-07-311-1/+1
| | | | | | | | | | "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.
* lib: use _nl_{init,exit} instead of __{init,exit}Thomas Haller2023-07-281-2/+2
| | | | | 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
* all: rework ATTR_DIFF() macros to not generate attribute namesThomas Haller2023-07-281-19/+24
| | | | | | | | | | 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.
* macsec: Drop offload capability validation checkEmeel Hakim2023-07-261-3/+0
| | | | | | | | | | | | | | | | | | | | | Currently, rtnl_link_macsec_set_offload rejects any value greater than 1 limiting the MACSEC_ATTR_OFFLOAD attribute to the values 0 and 1 where other values are also legal. Drop such a check since it is redundant, eventually the user will send the netlink message to kernel, and whether the message is valid depends on kernel. Fixes: b6cc13d76b29 ('Supporting Hardware offload capability for MACsec') Signed-off-by: Emeel Hakim <ehakim@nvidia.com> http://lists.infradead.org/pipermail/libnl/2023-February/002417.html http://lists.infradead.org/pipermail/libnl/2023-February/002420.html http://lists.infradead.org/pipermail/libnl/2023-February/002424.html https://github.com/thom311/libnl/pull/336 https://github.com/thom311/libnl/pull/341
* all: fix "-Wformat" warnings for nl_dump*()Thomas Haller2022-04-221-4/+8
|
* Check validation type against end of enumjauge-technica2022-03-281-1/+1
| | | | | | | | The enum macsec_validation_type in the Linux Kernel has values 0-2. With the existing check >1, value STRICT (2) cannot be set. The check should be done against the end marker of the enum instead. https://github.com/thom311/libnl/pull/304
* Supporting Hardware offload capability for MACsecJohan Alexis Duque Cadena2022-03-031-1/+41
| | | | | | [thaller@redhat.com: adjust libnl-route-3.sym file] https://github.com/thom311/libnl/pull/300
* license: fix and add SPDX license identifiers and drop license commentsThomas Haller2020-04-161-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* link/macsec: Include own public header for function prototypesTobias Klauser2017-01-201-0/+1
| | | | | | | | | 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 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* macsec: fix endianness of sci during dump()Thomas Haller2016-12-151-2/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* macsec: document byte order for the SCI and port attributesBeniamino Galvani2016-12-151-1/+63
| | | | | | | | Document that the SCI is in network order while the port is in host order. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* Revert "macsec: fix endianness of 'sci' parameter"Beniamino Galvani2016-12-151-2/+2
| | | | | | | | | | The commit changed the API from libnl 3.2.28: restore the old behavior. This reverts commit cd758fbfee07768ff200f46d7090fa8d0e6b300f. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* remove multiple implementations of htonll(), ntohll()Davide Caratti2016-09-061-15/+1
| | | | | | use a single #define in include/netlink-private/utils.h Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
* macsec: fix maximum ICV lengthDavide Caratti2016-09-051-1/+1
| | | | | | | | | Update copy of kernel header 'if_macsec.h' to Linux 4.8-rc5, so that upstream commit 2ccbe2cb79f2f74ab739252299b6f9ff27586f2c ("macsec: limit ICV length to 16 octets") is included. Return -NLE_INVAL when trying to configure an ICV length greater than 16 octets. Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
* macsec: fix endianness of 'sci' parameterDavide Caratti2016-09-051-2/+17
| | | | | | | 'sci' passed to kernel is meant to be in network byte order: use ntohll() and htonll() accordingly. Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
* lib/route: add macsec supportSabrina Dubroca2016-06-251-0/+786
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>