summaryrefslogtreecommitdiffstats
path: root/include/netlink/idiag
Commit message (Collapse)AuthorAgeFilesLines
* license: fix and add SPDX license identifiers and drop license commentsThomas Haller2020-04-165-35/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* include: restore linux header includes in public headersThomas Haller2017-03-021-0/+1
| | | | | | | | | The previous commits reorganized the public headers to drop includes of linux kernel headers. Restore the previous situation because otherwise the change might break compilation for users who rely on certain headers getting dragged in by libnl3.
* include: don't include kernel headers in public libnl3 headersThomas Haller2017-03-021-10/+9
| | | | | | | | | | | | | | | | | It would be desirable not to include kernel headers in our public libnl3 headers. As a test, remove all those includes, and fix compilation by explicitly including the kernel headers where needed. In some cases, that requires forward declaration for kernel structures, as we use them as part of our own headers. Realistically, we cannot drop those includes as it probalby breaks compilation for users that expect to get a certain kernel header when including a libnl3 header. So, this will not be done and the includes will be restored in the next commit. Do this step to show how it would be and to verify that we could build with such a change. The reason not to do this is backward compatibility (at compile-time).
* idiag/req: Add missing function prototypeTobias Klauser2017-01-201-0/+4
| | | | | | | | | | | | Add missing function prototype for idiagnl_req_parse() to the public header. This fixes the following GCC warning when compiling with -Wmissing-prototypes: idiag/idiag_req_obj.c:189:5: warning: no previous prototype for ‘idiagnl_req_parse’ [-Wmissing-prototypes] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* idiag: reorder idiagnl.h to have deprecated functions at the topThomas Haller2014-11-241-7/+14
| | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate IDIAG_TIMER_* value for IDIAGNL_TIMER_*Thomas Haller2014-11-241-6/+14
| | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate IDIAG_SS_* socket statesThomas Haller2014-11-241-14/+25
| | | | | | | | | | These values mirror TCP_* socket states from 'netinit/tcp.h'. There is no good reason to expose a copy of those values. User space should use the original values (if they care). The only value that is actually useful is IDIAGNL_SS_ALL. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate netlink message type defines in idiagnl.hThomas Haller2014-11-241-0/+3
| | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate IDIAG_ATTR_* enumerationThomas Haller2014-11-241-16/+17
| | | | | | | | | | | | | | | | | | IDIAG_ATTR_* were a copy of the INET_DIAG_* extension kernel flags. Redefining them is wrong, user space should continue to use the values provided via the kernel headers. Also they were misused as change flags (ce_mask), which they are not. Deprecate the IDIAG_ATTR_* flags and redefine them to what the originally are: INET_DIAG_*. Also deprecated idiagnl_attrs2str() because there is already idiagnl_exts2str(). idiagnl_attrs2str() in the sense of libnl change flags (ce_mask) makes no sense. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: deprecate idiagnl_msg_obj_ops variable in public APIThomas Haller2014-11-241-0/+2
| | | | | | | | | | | This internal structure should never have been exposed publically. It as introduced as public API in v3.2.23. For now, don't remove it as it would be an API/ABI break. Fixes: 81d2b1d509d91fe894e4aec0a6a76b0bf75514cd Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* idiag: add a copy of linux/sock_diag.hCong Wang2014-11-241-16/+11
| | | | | | | | | | | | | | | | | | | | When we test idiag on 3.4 kernel, we always get ERANGE. This is because libnl has its own copy for SK_MEMINFO_*, which is actually newer than 3.4, where SK_MEMINFO_VARS is larger than kernel's. We add a copy from latest kernel, so on older kernel libnl should still compile. Note, for kernel < 3.6 we don't have SK_MEMINFO_BACKLOG, we have to relax the minlen. 'sock_diag.h' comes from v3.17 kernel sources (bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9), file 'include/uapi/linux/sock_diag.h'. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* Add support for inet diag Netlink protocol.Joe Damato2013-07-195-0/+343
- Inet diag allows users to gather low-level socket information. - This library provides a higher-level API for creating inetdiag requests (via idiagnl_connect and idiagnl_send_simple) and parsing the replies (via idiagnl_msg_parse). A cache is also provided (via idiagnl_msg_alloc_cache). - Request and message objects provide APIs for accessing and setting the various properties of each. - This library also allows the user to parse the inetdiag response attributes which contain information about traffic class, TOS, congestion, socket memory info, and more depending on the kernel version used. - Includes doxygen documentation.