Projects
openEuler:Mainline
libnl3
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:libnl3.spec
Changed
@@ -1,20 +1,10 @@ Name: libnl3 -Version: 3.5.0 -Release: 6 +Version: 3.7.0 +Release: 1 Summary: Providing APIs to netlink protocol based Linux kernel interfaces License: LGPLv2 URL: http://www.infradead.org/~tgr/libnl/ -Source: https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz - -Patch6000: backport-lib-add-include-netlink-private-nl-auto-h-header.patch -Patch6001: backport-lib-use-proper-int-type-for-id-attributes-in-nl_object_identical.patch -Patch6002: backport-route-link-add-RTNL_LINK_REASM_OVERLAPS-stat.patch -Patch6003: backport-route-link-Check-for-null-pointer-in-macvlan.patch -Patch6004: backport-rtnl-link-fix-leaking-rtnl_link_af_ops-in-link_msg_parser.patch -Patch6005: backport-rtnl-route-fix-NLE_NOMEM-handling-in-parse_multipath.patch -Patch9000: solve-redefinition-of-struct-ipv6_mreq.patch -Patch9001: add-a-test-test-add-route.patch -Patch9002: add-some-tests-about-addr-class-rule-neigh-qdisc.patch +Source: https://github.com/thom311/libnl/releases/download/libnl3_7_0/libnl-3.7.0.tar.gz BuildRequires: flex bison libtool autoconf automake swig Requires: %{name} = %{version}-%{release} @@ -99,6 +89,12 @@ %{python3_sitearch}/netlink-*.egg-info %changelog +* Wed Nov 9 2022 chengyechun <chengyechun1@huawei.com> - 3.7.0-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update to libnl-3.7.0 + * Sat Dec 18 2021 chengyechun <chengyechun1@huawei.com> - 3.5.0-6 - Type:bugfix - ID:NA
View file
_service:tar_scm:add-a-test-test-add-route.patch
Deleted
@@ -1,44 +0,0 @@ -From 92d64e75d74aa7343769f9923d0a9294caa0cadd Mon Sep 17 00:00:00 2001 -From: chengyechun <chengyechun1@huawei.com> -Date: Thu, 16 Dec 2021 22:13:04 +0800 -Subject: PATCH add a test:test add route - ---- - tests/test-add-route.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - create mode 100644 tests/test-add-route.c - -diff --git a/tests/test-add-route.c b/tests/test-add-route.c -new file mode 100644 -index 0000000..b93db60 ---- /dev/null -+++ b/tests/test-add-route.c -@@ -0,0 +1,25 @@ -+#include <netlink/cli/utils.h> -+#include <netlink/cli/route.h> -+#include <netlink/cli/link.h> -+#include <linux/netlink.h> -+ -+ -+int main(int argc, char *argv) -+{ -+ struct nl_sock *sk; -+ struct rtnl_route *route; -+ struct nl_cache *link_cache, *route_cache; -+ char dst_addr = "10.10.10.0/23"; -+ char nexthop = "dev=eth0, via=10.10.10.10.1"; -+ int err; -+ sk = nl_cli_alloc_socket(); -+ nl_cli_connect(sk, NETLINK_ROUTE); -+ link_cache = nl_cli_link_alloc_cache(sk); -+ route_cache = nl_cli_route_alloc_cache(sk); -+ route = nl_cli_route_alloc(); -+ nl_Cli_route_parse_dst(route, dst_addr); -+ nl_cli_route_parse_nexthop(route, nexthop, link_cache); -+ if ((err = rtnl_route_add(sk, route, NLM_F_EXCL)) < 0) -+ nl_cli_fatal(err, "Unable to add route: %s", nl_geterror(err)); -+ return 0; -+} --- -2.23.0 -
View file
_service:tar_scm:add-some-tests-about-addr-class-rule-neigh-qdisc.patch
Deleted
@@ -1,533 +0,0 @@ -From f595a06ee2e7048b02bbdd4d69a9dd160f1819ef Mon Sep 17 00:00:00 2001 -From: chengyechun <chengyechun1@huawei.com> -Date: Sat, 18 Dec 2021 22:03:11 +0800 -Subject: PATCH add some tests - ---- - test-add-rule.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++ - test-addr-add.c | 23 ++++++++++++++++++++ - test-addr-delete.c | 23 ++++++++++++++++++++ - test-class-add.c | 40 +++++++++++++++++++++++++++++++++++ - test-class-delete.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - test-genl-connect.c | 29 ++++++++++++++++++++++++++ - test-link.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ - test-neigh-add.c | 26 +++++++++++++++++++++++ - test-neigh-delete.c | 26 +++++++++++++++++++++++ - test-qdisc-add.c | 35 +++++++++++++++++++++++++++++++ - test-qdisc-delete.c | 35 +++++++++++++++++++++++++++++++ - test-route-delete.c | 25 ++++++++++++++++++++++ - 13 files changed, 434 insertions(+), 1 deletion(-) - create mode 100644 test-add-rule.c - create mode 100644 test-addr-add.c - create mode 100644 test-addr-delete.c - create mode 100644 test-class-add.c - create mode 100644 test-class-delete.c - create mode 100644 test-genl-connect.c - create mode 100644 test-link.c - create mode 100644 test-neigh-add.c - create mode 100644 test-neigh-delete.c - create mode 100644 test-qdisc-add.c - create mode 100644 test-qdisc-delete.c - create mode 100644 test-route-delete.c - -diff --git a/test-add-rule.c b/test-add-rule.c -new file mode 100644 -index 0000000..f18a520 ---- /dev/null -+++ b/test-add-rule.c -@@ -0,0 +1,54 @@ -+#include <netlink/route/rule.h> -+#include <netlink/netlink.h> -+#include <linux/netlink.h> -+ -+ -+#define IPv6 -+ -+int main(int argc, char *argv) -+{ -+ struct nl_sock *sk; -+ struct rtnl_rule *rule; -+ struct nl_addr *src, *dst; -+ char baddr4 = { 0x1, 0x2, 0x3, 0x4 }; -+ char baddr26 = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 }; -+ int err; -+ -+ src = nl_addr_build(AF_UNSPEC, baddr, 4); -+ dst = nl_addr_build(AF_UNSPEC, baddr2, 6); -+ -+ sk = nl_socket_alloc(); -+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) { -+ nl_perror(err, "Unable to connect socket"); -+ return err; -+ } -+ rule = rtnl_rule_alloc(); -+ rtnl_rule_set_family(rule, AF_INET); -+ rtnl_rule_set_prio(rule, 12); -+ rtnl_rule_set_mark(rule, 12); -+ rtnl_rule_set_mask(rule, 16); -+ rtnl_rule_set_table(rule, 254); -+ rtnl_rule_set_dsfield(rule, 4); -+ rtnl_rule_set_src(rule, src); -+ rtnl_rule_set_dst(rule, dst); -+ rtnl_rule_set_iif(rule, "enp2s2"); -+ rtnl_rule_set_oif(rule, "enp2s7") -+ rtnl_rule_set_action(rule, 2); -+ rtnl_rule_set_l3mdev(rule, 1); -+ rtnl_rule_set_protocol(rule, 4); -+ rtnl_rule_get_family(rule); -+ rtnl_rule_get_prio(rule); -+ rtnl_rule_get_mark(rule); -+ rtnl_rule_get_mask(rule); -+ rtnl_rule_get_table(rule); -+ rtnl_rule_get_dsfield(rule); -+ rtnl_rule_get_src(rule); -+ rtnl_rule_get_dst(rule); -+ rtnl_rule_get_iif(rule); -+ rtnl_rule_get_oif(rule) -+ rtnl_rule_get_action(rule); -+ rtnl_rule_get_l3mdev(rule); -+ rtnl_rule_get_protocol(rule); -+ rtnl_rule_add(sk, rule, 4); -+ return 0; -+} -diff --git a/test-addr-add.c b/test-addr-add.c -new file mode 100644 -index 0000000..e7a8483 ---- /dev/null -+++ b/test-addr-add.c -@@ -0,0 +1,23 @@ -+#include <netlink/cli/utils.h> -+#include <netlink/cli/addr.h> -+#include <netlink/cli/link.h> -+#include <linux/netlink.h> -+ -+ -+int main(int argc, char *argv) -+{ -+ struct nl_sock *sock; -+ struct rtnl_addr *addr; -+ struct nl_cache *link_cache; -+ int err, nlflags = NLM_F_CREATE; -+ sock = nl_cli_alloc_socket(); -+ nl_cli_connect(sock, NETLINK_ROUTE); -+ link_cache = nl_cli_link_alloc_cache(sock); -+ addr = nl_cli_addr_alloc(); -+ nl_cli_addr_parse_local(addr, "10.10.16.2"); -+ nl_cli_addr_parse_dev(addr, link_cache, "eth0"); -+ nl_cli_addr_parse_family(addr, "AF_INET"); -+ if ((err = rtnl_addr_add(sock, addr, nlflags)) < 0) -+ nl_cli_fatal(err, "Unable to add address: %s", nl_geterror(err)); -+ return 0; -+} -diff --git a/test-addr-delete.c b/test-addr-delete.c -new file mode 100644 -index 0000000..e1e392b ---- /dev/null -+++ b/test-addr-delete.c -@@ -0,0 +1,23 @@ -+#include <netlink/cli/utils.h> -+#include <netlink/cli/addr.h> -+#include <netlink/cli/link.h> -+#include <linux/netlink.h> -+ -+ -+int main(int argc, char *argv) -+{ -+ struct nl_sock *sock; -+ struct rtnl_addr *addr; -+ struct nl_cache *link_cache; -+ int err, nlflags = NLM_F_CREATE; -+ sock = nl_cli_alloc_socket(); -+ nl_cli_connect(sock, NETLINK_ROUTE); -+ link_cache = nl_cli_link_alloc_cache(sock); -+ addr = nl_cli_addr_alloc(); -+ nl_cli_addr_parse_local(addr, "10.10.16.2"); -+ nl_cli_addr_parse_dev(addr, link_cache, "eth0"); -+ nl_cli_addr_parse_family(addr, "AF_INET"); -+ if ((err = rtnl_addr_delete(sock, addr, nlflags)) < 0) -+ nl_cli_fatal(err, "Unable to delete address: %s", nl_geterror(err)); -+ return 0; -+} -diff --git a/test-class-add.c b/test-class-add.c -new file mode 100644 -index 0000000..3ab3449 ---- /dev/null -+++ b/test-class-add.c -@@ -0,0 +1,40 @@ -+#include <netlink/cli/utils.h> -+#include <netlink/cli/tc.h> -+#include <netlink/cli/qdisc.h> -+#include <netlink/cli/link.h> -+#include <netlink-private/route/tc-api.h> -+#include <linux/netlink.h> -+ -+ -+int main(int argc, char *argv) -+{ -+ struct nl_sock *sk; -+ struct rtnl_class *class; -+ struct rtnl_tc *tc; -+ struct nl_cache *link_cache; -+ struct nl_cli_tc_module *tm; -+ struct rtnl_tc_ops *ops; -+ int err, flags = NLM_C_CREATE | NLM_F_EXCL; -+ char kind = "htb"; -+ char *rate = {"--rate=100mbit"}; -+ sk = nl_cli_alloc_socket(); -+ nl_cli_connect(sk, NETLINK_ROUTE); -+ link_cache = nl_cli_link_alloc_cache(sk); -+ class = nl_cli_class_alloc(); -+ tc = (struct rtnl_tc *) class; -+ nl_cli_tc_prase_dev(tc, link_cache, "eth0"); -+ nl_cli_tc_parse_parent(tc, "root"); -+ if (!rtnl_tc_get_ifindex(tc)) -+ nl_cli_fatal(EINVAL, "You must specify a network device XXX"); -+ if (!rtnl_tc_get_parent(tc)) -+ nl_cli_fatal(EINVAL, "You must specify a parent XXX"); -+ rtnl_tc_set_kind(tc, kind); -+ if (!(ops = rtnl_tc_get_ops(tc))) -+ nl_cli_fatal(ENOENT, "Unknown class %s", kind); -+ if (!(tm = nl_cli_tc_lookup(ops))) -+ nl_cli_fatal(ENOTSUP, "class type %s not supported", kind); -+ tm->tm_parse_argv(tc, 1, rate); -+ if ((err = rtnl_class_add(sk, class, flags)) < 0) -+ nl_cli_fatal(EINVAL, "Unable to add class: %s", nl_geterror(err)); -+ return 0; -+} -diff --git a/test-class-delete.c b/test-class-delete.c -new file mode 100644 -index 0000000..0443b96
View file
_service:tar_scm:backport-lib-add-include-netlink-private-nl-auto-h-header.patch
Deleted
@@ -1,123 +0,0 @@ -From abb7391f38893af7d6108f97ac8597468f113a41 Mon Sep 17 00:00:00 2001 -From: Thomas Haller <thaller@redhat.com> -Date: Wed, 15 Apr 2020 12:42:05 +0200 -Subject: PATCH lib: add "include/netlink-private/nl-auto.h" header - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/abb7391f38893af7d6108f97ac8597468f113a41 - ---- - Makefile.am | 1 + - include/netlink-private/nl-auto.h | 60 +++++++++++++++++++++++++++++++ - include/netlink-private/utils.h | 14 ++------ - 3 files changed, 63 insertions(+), 12 deletions(-) - create mode 100644 include/netlink-private/nl-auto.h - -diff --git a/Makefile.am b/Makefile.am -index b2e87379..085da53f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -261,6 +261,7 @@ noinst_HEADERS = \ - include/netlink-private/cache-api.h \ - include/netlink-private/genl.h \ - include/netlink-private/netlink.h \ -+ include/netlink-private/nl-auto.h \ - include/netlink-private/object-api.h \ - include/netlink-private/route/link/api.h \ - include/netlink-private/route/link/sriov.h \ -diff --git a/include/netlink-private/nl-auto.h b/include/netlink-private/nl-auto.h -new file mode 100644 -index 00000000..7b923f26 ---- /dev/null -+++ b/include/netlink-private/nl-auto.h -@@ -0,0 +1,60 @@ -+// SPDX-License-Identifier: LGPL-2.1+ -+ -+#ifndef NETLINK_NL_AUTO_H_ -+#define NETLINK_NL_AUTO_H_ -+ -+#define _nl_auto(fcn) __attribute__ ((__cleanup__(fcn))) -+ -+#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \ -+static inline void name(void *v) \ -+{ \ -+ if (*((CastType *) v)) \ -+ func(*((CastType *) v)); \ -+} -+ -+#define _NL_AUTO_DEFINE_FCN_TYPED0(CastType, name, func) \ -+static inline void name(CastType *v) \ -+{ \ -+ if (*v) \ -+ func(*v); \ -+} -+ -+#define _nl_auto_free _nl_auto(_nl_auto_free_fcn) -+_NL_AUTO_DEFINE_FCN_VOID0(void *, _nl_auto_free_fcn, free) -+ -+struct nl_addr; -+void nl_addr_put(struct nl_addr *); -+#define _nl_auto_nl_addr _nl_auto(_nl_auto_nl_addr_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_addr *, _nl_auto_nl_addr_fcn, nl_addr_put) -+ -+struct nl_msg; -+void nlmsg_free(struct nl_msg *); -+#define _nl_auto_nl_msg _nl_auto(_nl_auto_nl_msg_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_msg *, _nl_auto_nl_msg_fcn, nlmsg_free) -+ -+struct rtnl_link; -+void rtnl_link_put(struct rtnl_link *); -+#define _nl_auto_rtnl_link _nl_auto(_nl_auto_rtnl_link_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link *, _nl_auto_rtnl_link_fcn, rtnl_link_put) -+ -+struct rtnl_route; -+void rtnl_route_put(struct rtnl_route *); -+#define _nl_auto_rtnl_route _nl_auto(_nl_auto_rtnl_route_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_route *, _nl_auto_rtnl_route_fcn, rtnl_route_put) -+ -+struct rtnl_nexthop; -+void rtnl_route_nh_free(struct rtnl_nexthop *); -+#define _nl_auto_rtnl_nexthop _nl_auto(_nl_auto_rtnl_nexthop_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_nexthop *, _nl_auto_rtnl_nexthop_fcn, rtnl_route_nh_free) -+ -+struct nl_cache; -+void nl_cache_put(struct nl_cache *); -+#define _nl_auto_nl_cache _nl_auto(_nl_auto_nl_cache_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_cache *, _nl_auto_nl_cache_fcn, nl_cache_put) -+ -+struct rtnl_link_af_ops; -+void rtnl_link_af_ops_put(struct rtnl_link_af_ops *); -+#define _nl_auto_rtnl_link_af_ops _nl_auto(_nl_auto_rtnl_link_af_ops_fcn) -+_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link_af_ops *, _nl_auto_rtnl_link_af_ops_fcn, rtnl_link_af_ops_put) -+ -+#endif /* NETLINK_NL_AUTO_H_ */ -diff --git a/include/netlink-private/utils.h b/include/netlink-private/utils.h -index 9c5a3d82..46e77451 100644 ---- a/include/netlink-private/utils.h -+++ b/include/netlink-private/utils.h -@@ -85,18 +85,6 @@ - - /*****************************************************************************/ - --#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \ --static inline void name (void *v) \ --{ \ -- if (*((CastType *) v)) \ -- func (*((CastType *) v)); \ --} -- --#define _nl_auto_free _nl_auto(_nl_auto_free_fcn) --_NL_AUTO_DEFINE_FCN_VOID0 (void *, _nl_auto_free_fcn, free) -- --/*****************************************************************************/ -- - extern const char *nl_strerror_l(int err); - - /*****************************************************************************/ -@@ -222,4 +210,6 @@ _nl_strncpy(char *dst, const char *src, size_t len) - return dst; - } - -+#include "nl-auto.h" -+ - #endif
View file
_service:tar_scm:backport-lib-use-proper-int-type-for-id-attributes-in-nl_object_identical.patch
Deleted
@@ -1,29 +0,0 @@ -From f9d0181ceb2fc7c54abf89eff4c6b57e8fe6dd97 Mon Sep 17 00:00:00 2001 -From: Thomas Haller <thaller@redhat.com> -Date: Fri, 17 Apr 2020 16:31:10 +0200 -Subject: PATCH lib: use proper int type for id attributes in - nl_object_identical() - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/f9d0181ceb2fc7c54abf89eff4c6b57e8fe6dd97 - ---- - lib/object.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/lib/object.c b/lib/object.c -index d15cd152..07a21d22 100644 ---- a/lib/object.c -+++ b/lib/object.c -@@ -314,8 +314,9 @@ int nl_object_identical(struct nl_object *a, struct nl_object *b) - return 0; - - if (ops->oo_id_attrs_get) { -- int req_attrs_a = ops->oo_id_attrs_get(a); -- int req_attrs_b = ops->oo_id_attrs_get(b); -+ uint32_t req_attrs_a = ops->oo_id_attrs_get(a); -+ uint32_t req_attrs_b = ops->oo_id_attrs_get(b); -+ - if (req_attrs_a != req_attrs_b) - return 0; - req_attrs = req_attrs_a;
View file
_service:tar_scm:backport-route-link-Check-for-null-pointer-in-macvlan.patch
Deleted
@@ -1,30 +0,0 @@ -From 01ea9a6224b77292e8506bf179729aeeaac30398 Mon Sep 17 00:00:00 2001 -From: Jan Slomski <jan.slomski@westermo.se> -Date: Wed, 21 Mar 2018 10:23:57 +0100 -Subject: PATCH route/link: Check for null pointer in macvlan - -In cases where link->l_info is not set, a null-ptr-exception -will be invoked. - -https://github.com/thom311/libnl/pull/238 - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/01ea9a6224b77292e8506bf179729aeeaac30398 -Reference:https://github.com/thom311/libnl/commit/9cc38dcaeb55b5729c6c97b47884cebbda72b693 ---- - lib/route/link/macvlan.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/route/link/macvlan.c b/lib/route/link/macvlan.c -index a23fe6d8..3ccebf45 100644 ---- a/lib/route/link/macvlan.c -+++ b/lib/route/link/macvlan.c -@@ -149,6 +149,8 @@ static void macvlan_free(struct rtnl_link *link) - uint32_t i; - - mvi = link->l_info; -+ if (!mvi) -+ return; - - for (i = 0; i < mvi->mvi_maccount; i++) - nl_addr_put(mvi->mvi_macaddri);
View file
_service:tar_scm:backport-route-link-add-RTNL_LINK_REASM_OVERLAPS-stat.patch
Deleted
@@ -1,66 +0,0 @@ -From bab9e77c87d3b596e77d669b0a827b50e725bb62 Mon Sep 17 00:00:00 2001 -From: Ilya Pronin <ipronin@twitter.com> -Date: Fri, 3 Apr 2020 20:00:37 -0700 -Subject: PATCH route/link: add RTNL_LINK_REASM_OVERLAPS stat - -The new stat exposes IPSTATS_MIB_REASM_OVERLAPS link stat. However, the -original motivation for this change was fixing the issue with missing RX -packets link stat. - -The regression was introduced in version 3.5.0 with commit 73c1d047, -that added a new enum constant IPSTATS_MIB_REASM_OVERLAPS. Without this -patch, IPSTATS_MIB_REASM_OVERLAPS is missing from -map_stat_id_from_IPSTATS_MIB_v2 and is mapped by it to 0. This tricks -inet6_parse_protinfo() into erroneously overwriting RTNL_LINK_RX_PACKETS -stat, which happens to have value 0, when it tries to set -IPSTATS_MIB_REASM_OVERLAPS. - -Fixes: 73c1d0479643 ('Sync linux headers to 4.19.66') - -https://github.com/thom311/libnl/pull/235 - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/bab9e77c87d3b596e77d669b0a827b50e725bb62 - ---- - include/netlink/route/link.h | 1 + - lib/route/link.c | 1 + - lib/route/link/inet6.c | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/include/netlink/route/link.h b/include/netlink/route/link.h -index 516d8e16..d0d6d2b5 100644 ---- a/include/netlink/route/link.h -+++ b/include/netlink/route/link.h -@@ -93,6 +93,7 @@ typedef enum { - RTNL_LINK_IP6_ECT0PKTS, /*!< IPv6 SNMP InECT0Pkts */ - RTNL_LINK_IP6_CEPKTS, /*!< IPv6 SNMP InCEPkts */ - RTNL_LINK_RX_NOHANDLER, /*!< Received packets dropped on inactive device */ -+ RTNL_LINK_REASM_OVERLAPS, /*!< SNMP ReasmOverlaps */ - __RTNL_LINK_STATS_MAX, - } rtnl_link_stat_id_t; - -diff --git a/lib/route/link.c b/lib/route/link.c -index 9439fe6d..ed6f4558 100644 ---- a/lib/route/link.c -+++ b/lib/route/link.c -@@ -3007,6 +3007,7 @@ static const struct trans_tbl link_stats = { - __ADD(RTNL_LINK_IP6_ECT0PKTS, Ip6_InECT0Pkts), - __ADD(RTNL_LINK_IP6_CEPKTS, Ip6_InCEPkts), - __ADD(RTNL_LINK_RX_NOHANDLER, rx_nohandler), -+ __ADD(RTNL_LINK_REASM_OVERLAPS, ReasmOverlaps), - }; - - char *rtnl_link_stat2str(int st, char *buf, size_t len) -diff --git a/lib/route/link/inet6.c b/lib/route/link/inet6.c -index c977b617..1ad49bf1 100644 ---- a/lib/route/link/inet6.c -+++ b/lib/route/link/inet6.c -@@ -135,6 +135,7 @@ static const uint8_t map_stat_id_from_IPSTATS_MIB_v2__IPSTATS_MIB_MAX = { - 33 = RTNL_LINK_IP6_ECT1PKTS, /* IPSTATS_MIB_ECT1PKTS */ - 34 = RTNL_LINK_IP6_ECT0PKTS, /* IPSTATS_MIB_ECT0PKTS */ - 35 = RTNL_LINK_IP6_CEPKTS, /* IPSTATS_MIB_CEPKTS */ -+ 36 = RTNL_LINK_REASM_OVERLAPS, /* IPSTATS_MIB_REASM_OVERLAPS */ - }; - - static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr,
View file
_service:tar_scm:backport-rtnl-link-fix-leaking-rtnl_link_af_ops-in-link_msg_parser.patch
Deleted
@@ -1,25 +0,0 @@ -From 2957d8f6c8bf1189545a7b0c1a49c4ccb26984a1 Mon Sep 17 00:00:00 2001 -From: Thomas Haller <thaller@redhat.com> -Date: Wed, 15 Apr 2020 14:01:09 +0200 -Subject: PATCH rtnl/link: fix leaking rtnl_link_af_ops in link_msg_parser() - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/2957d8f6c8bf1189545a7b0c1a49c4ccb26984a1 - ---- - lib/route/link.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/route/link.c b/lib/route/link.c -index 0ce4b0ab..b73a8c5f 100644 ---- a/lib/route/link.c -+++ b/lib/route/link.c -@@ -722,6 +722,8 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who, - int remaining; - - nla_for_each_nested(af_attr, tbIFLA_AF_SPEC, remaining) { -+ _nl_auto_rtnl_link_af_ops struct rtnl_link_af_ops *af_ops = NULL; -+ - af_ops = af_lookup_and_alloc(link, nla_type(af_attr)); - if (af_ops && af_ops->ao_parse_af) { - char *af_data = link->l_af_datanla_type(af_attr);
View file
_service:tar_scm:backport-rtnl-route-fix-NLE_NOMEM-handling-in-parse_multipath.patch
Deleted
@@ -1,40 +0,0 @@ -From fca338b9f453295037f96e8fe9236ebb4763dd25 Mon Sep 17 00:00:00 2001 -From: Thomas Haller <thaller@redhat.com> -Date: Wed, 15 Apr 2020 13:17:40 +0200 -Subject: PATCH rtnl/route: fix NLE_NOMEM handling in parse_multipath() - -Conflict:NA -Reference:https://github.com/thom311/libnl/commit/fca338b9f453295037f96e8fe9236ebb4763dd25 - ---- - lib/route/route_obj.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c -index b5cc4ed4..de56a76b 100644 ---- a/lib/route/route_obj.c -+++ b/lib/route/route_obj.c -@@ -1072,8 +1072,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) - - addr = nl_addr_alloc_attr(ntbRTA_NEWDST, - route->rt_family); -- if (!addr) -+ if (!addr) { -+ err = -NLE_NOMEM; - goto errout; -+ } - - err = rtnl_route_nh_set_newdst(nh, addr); - nl_addr_put(addr); -@@ -1085,8 +1087,10 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) - struct nl_addr *addr; - - addr = rtnl_route_parse_via(ntbRTA_VIA); -- if (!addr) -+ if (!addr) { -+ err = -NLE_NOMEM; - goto errout; -+ } - - err = rtnl_route_nh_set_via(nh, addr); - nl_addr_put(addr);
View file
_service:tar_scm:solve-redefinition-of-struct-ipv6_mreq.patch
Deleted
@@ -1,12 +0,0 @@ -diff -uNrp libnl-3.2.28/include/linux-private/linux/if_bridge.h libnl-3.2.28-new//include/linux-private/linux/if_bridge.h ---- libnl-3.2.28/include/linux-private/linux/if_bridge.h 2016-06-29 17:04:28.000000000 +0800 -+++ libnl-3.2.28-new//include/linux-private/linux/if_bridge.h 2016-11-26 13:46:11.000000000 +0800 -@@ -15,7 +15,7 @@ - - #include <linux/types.h> - #include <linux/if_ether.h> --#include <linux/in6.h> -+#include <netinet/in.h> - - #define SYSFS_BRIDGE_ATTR "bridge" - #define SYSFS_BRIDGE_FDB "brforward"
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/libnl3.git</param> - <param name="revision">46ec537afacce1eba7d12aa81ac7703df4dd8210</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/check-addr.c
Deleted
@@ -1,214 +0,0 @@ -/* - * tests/check-addr.c nl_addr unit tests - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> - */ - -#include <check.h> -#include <netlink/addr.h> - -#include "util.h" - -START_TEST(addr_alloc) -{ - struct nl_addr *addr; - - addr = nl_addr_alloc(16); - fail_if(addr == NULL, - "Allocation should not return NULL"); - - fail_if(nl_addr_iszero(addr) == 0, - "New empty address should be all zeros"); - - fail_if(nl_addr_get_family(addr) != AF_UNSPEC, - "New empty address should have family AF_UNSPEC"); - - fail_if(nl_addr_get_prefixlen(addr) != 0, - "New empty address should have prefix length 0"); - - fail_if(nl_addr_shared(addr), - "New empty address should not be shared"); - - fail_if(nl_addr_get(addr) != addr, - "nl_addr_get() should return pointer to address"); - - fail_if(nl_addr_shared(addr) == 0, - "Address should be shared after call to nl_addr_get()"); - - nl_addr_put(addr); - - fail_if(nl_addr_shared(addr), - "Address should not be shared after call to nl_addr_put()"); - - fail_if(nl_addr_fill_sockaddr(addr, NULL, 0) == 0, - "Socket address filling should fail for empty address"); - - nl_addr_put(addr); -} -END_TEST - -START_TEST(addr_binary_addr) -{ - struct nl_addr *addr, *addr2; - char baddr4 = { 0x1, 0x2, 0x3, 0x4 }; - char baddr26 = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 }; - - addr = nl_addr_alloc(4); - fail_if(addr == NULL, - "Allocation should not return NULL"); - - fail_if(nl_addr_set_binary_addr(addr, baddr, 4) < 0, - "Valid binary address should be settable"); - - fail_if(nl_addr_get_prefixlen(addr) != 0, - "Prefix length should be unchanged after nl_addr_set_binary_addr()"); - - fail_if(nl_addr_get_len(addr) != 4, - "Address length should be 4"); - - fail_if(nl_addr_set_binary_addr(addr, baddr2, 6) == 0, - "Should not be able to set binary address exceeding maximum length"); - - fail_if(nl_addr_get_len(addr) != 4, - "Address length should still be 4"); - - fail_if(nl_addr_guess_family(addr) != AF_INET, - "Binary address of length 4 should be guessed as AF_INET"); - - fail_if(memcmp(baddr, nl_addr_get_binary_addr(addr), 4) != 0, - "Binary address mismatches"); - - addr2 = nl_addr_build(AF_UNSPEC, baddr, 4); - fail_if(addr2 == NULL, - "Building of address should not fail"); - - nl_addr_set_prefixlen(addr, 32); - fail_if(nl_addr_get_prefixlen(addr) != 32, - "Prefix length should be successful changed after nl_addr_set_prefixlen()"); - - fail_if(nl_addr_cmp(addr, addr2), - "Addresses built from same binary address should match"); - - nl_addr_put(addr); - nl_addr_put(addr2); -} -END_TEST - -START_TEST(addr_parse4) -{ - struct nl_addr *addr4, *clone; - struct sockaddr_in sin; - socklen_t len = sizeof(sin); - char *addr_str = "10.0.0.1/16"; - char buf128; - - fail_if(nl_addr_parse(addr_str, AF_INET6, &addr4) == 0, - "Should not be able to parse IPv4 address in IPv6 mode"); - - fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr4) != 0, - "Should be able to parse \"%s\"", addr_str); - - fail_if(nl_addr_get_family(addr4) != AF_INET, - "Address family should be AF_INET"); - - fail_if(nl_addr_get_prefixlen(addr4) != 16, - "Prefix length should be 16"); - - fail_if(nl_addr_iszero(addr4), - "Address should not be all zeroes"); - - clone = nl_addr_clone(addr4); - fail_if(clone == NULL, - "Cloned address should not be NULL"); - - fail_if(nl_addr_cmp(addr4, clone) != 0, - "Cloned address should not mismatch original"); - - fail_if(nl_addr_fill_sockaddr(addr4, (struct sockaddr *) &sin, &len) != 0, - "Should be able to fill socketaddr"); - - fail_if(strcmp(nl_addr2str(addr4, buf, sizeof(buf)), addr_str), - "Address translated back to string does not match original"); - - nl_addr_put(addr4); - nl_addr_put(clone); -} -END_TEST - -START_TEST(addr_parse6) -{ - struct nl_addr *addr6, *clone; - struct sockaddr_in6 sin; - socklen_t len = sizeof(sin); - char *addr_str = "2001:1:2::3/64"; - char buf128; - - fail_if(nl_addr_parse(addr_str, AF_INET, &addr6) == 0, - "Should not be able to parse IPv6 address in IPv4 mode"); - - fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr6) != 0, - "Should be able to parse \"%s\"", addr_str); - - fail_if(nl_addr_get_family(addr6) != AF_INET6, - "Address family should be AF_INET6"); - - fail_if(nl_addr_get_prefixlen(addr6) != 64, - "Prefix length should be 64"); - - fail_if(nl_addr_iszero(addr6), - "Address should not be all zeroes"); - - clone = nl_addr_clone(addr6); - fail_if(clone == NULL, - "Cloned address should not be NULL"); - - fail_if(nl_addr_cmp(addr6, clone) != 0, - "Cloned address should not mismatch original"); - - fail_if(nl_addr_fill_sockaddr(addr6, (struct sockaddr *) &sin, &len) != 0, - "Should be able to fill socketaddr"); - - fail_if(strcmp(nl_addr2str(addr6, buf, sizeof(buf)), addr_str), - "Address translated back to string does not match original"); - - nl_addr_put(addr6); - nl_addr_put(clone); -} -END_TEST - -START_TEST(addr_info) -{ - struct nl_addr *addr; - char *addr_str = "127.0.0.1"; - struct addrinfo *result; - - fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr) != 0, - "Parsing of valid address should not fail"); - - fail_if(nl_addr_info(addr, &result) != 0, - "getaddrinfo() on loopback address should work"); - - freeaddrinfo(result); - nl_addr_put(addr); -} -END_TEST
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/check-attr.c
Deleted
@@ -1,90 +0,0 @@ -/* - * tests/check-attr.c nla_attr unit tests - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * - * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> - */ - -#include "util.h" -#include <netlink/attr.h> -#include <netlink/msg.h> - -#include <linux/netlink.h> - -START_TEST(attr_size) -{ - fail_if(nla_attr_size(0) != NLA_HDRLEN, - "Length of empty attribute should match header size"); - fail_if(nla_attr_size(1) != NLA_HDRLEN + 1, - "Length of 1 bytes payload should be NLA_HDRLEN + 1"); - fail_if(nla_attr_size(2) != NLA_HDRLEN + 2, - "Length of 2 bytes payload should be NLA_HDRLEN + 2"); - fail_if(nla_attr_size(3) != NLA_HDRLEN + 3, - "Length of 3 bytes payload should be NLA_HDRLEN + 3"); - fail_if(nla_attr_size(4) != NLA_HDRLEN + 4, - "Length of 4 bytes payload should be NLA_HDRLEN + 4"); - - fail_if(nla_total_size(1) != NLA_HDRLEN + 4, - "Total size of 1 bytes payload should result in 8 bytes"); - fail_if(nla_total_size(2) != NLA_HDRLEN + 4, - "Total size of 2 bytes payload should result in 8 bytes"); - fail_if(nla_total_size(3) != NLA_HDRLEN + 4, - "Total size of 3 bytes payload should result in 8 bytes"); - fail_if(nla_total_size(4) != NLA_HDRLEN + 4, - "Total size of 4 bytes payload should result in 8 bytes"); - - fail_if(nla_padlen(1) != 3, - "2 bytes of payload should result in 3 padding bytes"); - fail_if(nla_padlen(2) != 2, - "2 bytes of payload should result in 2 padding bytes"); - fail_if(nla_padlen(3) != 1, - "3 bytes of payload should result in 1 padding bytes"); - fail_if(nla_padlen(4) != 0, - "4 bytes of payload should result in 0 padding bytes"); - fail_if(nla_padlen(5) != 3, - "5 bytes of payload should result in 3 padding bytes"); -} -END_TEST - -START_TEST(msg_construct) -{ - struct nl_msg *msg; - struct nlmsghdr *nlh; - struct nlattr *a; - int i, rem; - - msg = nlmsg_alloc(); - fail_if(!msg, "Unable to allocate netlink message"); - - for (i = 1; i < 256; i++) { - fail_if(nla_put_u32(msg, i, i+1) != 0, - "Unable to add attribute %d", i); - } - - nlh = nlmsg_hdr(msg); - i = 1; - nlmsg_for_each_attr(a, nlh, 0, rem) { - fail_if(nla_type(a) != i, "Expected attribute %d", i); - i++; - fail_if(nla_get_u32(a) != i, "Expected attribute value %d", i); - } - - nlmsg_free(msg); -} -END_TEST - -Suite *make_nl_attr_suite(void) -{ - Suite *suite = suite_create("Netlink attributes"); - - TCase *nl_attr = tcase_create("Core"); - tcase_add_test(nl_attr, attr_size); - tcase_add_test(nl_attr, msg_construct); - suite_add_tcase(suite, nl_attr); - - return suite; -}
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/check-ematch-tree-clone.c
Deleted
@@ -1,143 +0,0 @@ -#include <netlink-private/types.h> -#include <netlink/route/cls/ematch.h> - -#include <linux/netlink.h> - -#include <stdio.h> -#include <time.h> - -#include <check.h> -#include "util.h" - -#define MAX_DEPTH 6 -#define MAX_CHILDREN 5 - -static int current_depth = 0; -static int id = 1; -static long long array_size = 0; - -static int *src_result = NULL, *dst_result = NULL; - -static long long my_pow(long long x, long long y) -{ - int ret = x; - - if (y == 0) - return 1; - - if (y < 0 || x == 0) - return 0; - - while(--y) { - ret *= x; - } - - return ret; -} - -static long int generate_random(long int max) -{ - srandom(time(NULL) + id); - return (random() % max); -} - -static int build_children(struct nl_list_head *parent) -{ - int i, num = 0; - struct rtnl_ematch *child = NULL; - - if (!parent) - return 0; - - if (++current_depth > MAX_DEPTH) { - --current_depth; - return 0; - } - - num = generate_random(MAX_CHILDREN + 1); - for (i = 0; i < num; ++i) { - child = rtnl_ematch_alloc(); - if (!child) { - printf("Mem alloc error\n"); - exit(1); - } - build_children(&child->e_childs); - child->e_id = id++; - nl_list_add_tail(&child->e_list, parent); - } - - --current_depth; - return 0; -} - -static void build_src_cgroup(struct rtnl_ematch_tree *tree) -{ - build_children(&tree->et_list); -} - -static void dump_ematch_list(struct nl_list_head *head, int *result, int *index) -{ - struct rtnl_ematch *pos = NULL; - - nl_list_for_each_entry(pos, head, e_list) { - if (!nl_list_empty(&pos->e_childs)) - dump_ematch_list(&pos->e_childs, result, index); - result*index = pos->e_id; - (*index)++; - } -} - -static void dump_ematch_tree(struct rtnl_ematch_tree *tree, int *result, int *index) -{ - if (!tree) - return; - - dump_ematch_list(&tree->et_list, result, index); -} - -static int compare(int *r1, int *r2, int len) -{ - int i = 0; - for (i = 0; i < len; ++i) { - if (r1i != r2i) - return -1; - } - return 0; -} - -START_TEST(ematch_tree_clone) -{ - struct rtnl_ematch_tree *src = NULL, *dst = NULL; - int i = 0, j = 0; - - array_size = (MAX_DEPTH * my_pow(MAX_CHILDREN, MAX_DEPTH)) / 2; - src_result = calloc(4, array_size); - dst_result = calloc(4, array_size); - - src = rtnl_ematch_tree_alloc(2); - - build_src_cgroup(src); - dump_ematch_tree(src, src_result, &i); - - dst = rtnl_ematch_tree_clone(src); - dump_ematch_tree(dst, dst_result, &j); - - fail_if(!dst); - fail_if(i != j); - fail_if(compare(src_result, dst_result, i)); - - free(src_result); - free(dst_result); -} -END_TEST - -Suite *make_nl_ematch_tree_clone_suite(void) -{ - Suite *suite = suite_create("Clone ematch tree"); - - TCase *ematch_tree = tcase_create("Core"); - tcase_add_test(ematch_tree, ematch_tree_clone); - suite_add_tcase(suite, ematch_tree); - - return suite; -}
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/util.h
Deleted
@@ -1,10 +0,0 @@ -#include <check.h> - -#define nl_fail_if(condition, error, message) \ - fail_if((condition), "nlerr=%d (%s): %s", \ - (error), nl_geterror(error), (message)) - -Suite *make_nl_attr_suite(void); -Suite *make_nl_addr_suite(void); -Suite *make_nl_ematch_tree_clone_suite(void); -
View file
_service:tar_scm:libnl-3.5.0.tar.gz/ChangeLog -> _service:tar_scm:libnl-3.7.0.tar.gz/ChangeLog
Changed
@@ -1,5 +1,5 @@ ChangeLog discontinued, git history can be found here: -http://git.infradead.org/users/tgr/libnl.git +https://github.com/thom311/libnl Summary of Changes from 1.0-pre6 to 1.0-pre7 ================================================ @@ -42,7 +42,7 @@ NL_SKIP o Fixed nl_recvmsgs() to stop reading after parsing if not in the middle of a multipart message. - o Fixed nl_recvmsgs() to not stop after receving an ACK + o Fixed nl_recvmsgs() to not stop after receiving an ACK o Fixed nl_recvmsgs() to not blindly discard remaining messages if a NLMSG_DONE message is received. @@ -205,7 +205,7 @@ o Removed non-reentrant translation routines, only bloating the code and too risky. o Fixed wrong version number from 1.0-pre1. - o Reenabled unfinished policer module. + o Re-enabled unfinished policer module. o Reworked TBF module, automatic caluclation of transmit times, limit setable via latency, automatic cell size calculation, options TLV generation. (untested) @@ -219,7 +219,7 @@ o Add empty install target to src/Makefile Simon Stelling <blubb@gentoo.org> - o Use LIBDIR instead of $(prefix)/lib for users to alllow librariers + o Use LIBDIR instead of $(prefix)/lib for users to allow librariers into $(prefix)/lib64. Summary of Changes from 0.5.0 to 1.0-pre1 @@ -231,7 +231,7 @@ Petr Gotthard <petr.gotthard@siemens.com>, Siemens AG Oesterreich o added class_build, rtnl_class_build_add_request, rtnl_class_add - o added HTB (Hierachical Token Bucket) class support + o added HTB (Hierarchical Token Bucket) class support o added nl_xmittime, nl_build_rtable o added nl_data_append to realloc a nl_data structure o added rtnl_rcopy_ratespec as reverse to rtnl_copy_ratespec @@ -248,9 +248,9 @@ o nl_cache_filter to manually filter on a object o partial routing support o routing rules support - o Propely set address family when setting addresses + o Properly set address family when setting addresses o debug flag and some rare messages, more to come - o make error mesage verboseness configureable + o make error message verboseness configurable o tc fixes to wait for ack o cleanup and adaption of address code to latest internal API o various cleanups
View file
_service:tar_scm:libnl-3.5.0.tar.gz/Makefile.am -> _service:tar_scm:libnl-3.7.0.tar.gz/Makefile.am
Changed
@@ -105,6 +105,7 @@ include/netlink/route/class.h \ include/netlink/route/classifier.h \ include/netlink/route/link.h \ + include/netlink/route/mdb.h \ include/netlink/route/neighbour.h \ include/netlink/route/neightbl.h \ include/netlink/route/netconf.h \ @@ -121,6 +122,7 @@ libnlinclude_netlink_route_act_HEADERS = \ include/netlink/route/act/gact.h \ include/netlink/route/act/mirred.h \ + include/netlink/route/act/nat.h \ include/netlink/route/act/skbedit.h \ include/netlink/route/act/vlan.h \ $(NULL) @@ -129,6 +131,7 @@ include/netlink/route/cls/basic.h \ include/netlink/route/cls/cgroup.h \ include/netlink/route/cls/ematch.h \ + include/netlink/route/cls/flower.h \ include/netlink/route/cls/fw.h \ include/netlink/route/cls/matchall.h \ include/netlink/route/cls/police.h \ @@ -151,7 +154,9 @@ include/netlink/route/link/inet.h \ include/netlink/route/link/inet6.h \ include/netlink/route/link/info-api.h \ + include/netlink/route/link/ip6gre.h \ include/netlink/route/link/ip6tnl.h \ + include/netlink/route/link/ip6vti.h \ include/netlink/route/link/ipgre.h \ include/netlink/route/link/ipip.h \ include/netlink/route/link/ipvlan.h \ @@ -162,6 +167,7 @@ include/netlink/route/link/ppp.h \ include/netlink/route/link/sit.h \ include/netlink/route/link/sriov.h \ + include/netlink/route/link/team.h \ include/netlink/route/link/veth.h \ include/netlink/route/link/vlan.h \ include/netlink/route/link/vrf.h \ @@ -203,6 +209,7 @@ include/netlink/cli/ct.h \ include/netlink/cli/exp.h \ include/netlink/cli/link.h \ + include/netlink/cli/mdb.h \ include/netlink/cli/neigh.h \ include/netlink/cli/qdisc.h \ include/netlink/cli/route.h \ @@ -253,6 +260,7 @@ include/linux-private/linux/socket.h \ include/linux-private/linux/tc_act/tc_gact.h \ include/linux-private/linux/tc_act/tc_mirred.h \ + include/linux-private/linux/tc_act/tc_nat.h \ include/linux-private/linux/tc_act/tc_skbedit.h \ include/linux-private/linux/tc_act/tc_vlan.h \ include/linux-private/linux/tc_ematch/tc_em_meta.h \ @@ -261,12 +269,14 @@ include/netlink-private/cache-api.h \ include/netlink-private/genl.h \ include/netlink-private/netlink.h \ + include/netlink-private/nl-auto.h \ include/netlink-private/object-api.h \ include/netlink-private/route/link/api.h \ include/netlink-private/route/link/sriov.h \ include/netlink-private/route/mpls.h \ include/netlink-private/route/nexthop-encap.h \ include/netlink-private/route/tc-api.h \ + include/netlink-private/route/utils.h \ include/netlink-private/socket.h \ include/netlink-private/tc.h \ include/netlink-private/types.h \ @@ -371,6 +381,7 @@ lib/route/act.c \ lib/route/act/gact.c \ lib/route/act/mirred.c \ + lib/route/act/nat.c \ lib/route/act/skbedit.c \ lib/route/act/vlan.c \ lib/route/addr.c \ @@ -385,6 +396,7 @@ lib/route/cls/ematch/meta.c \ lib/route/cls/ematch/nbyte.c \ lib/route/cls/ematch/text.c \ + lib/route/cls/flower.c \ lib/route/cls/fw.c \ lib/route/cls/mall.c \ lib/route/cls/police.c \ @@ -399,7 +411,9 @@ lib/route/link/ifb.c \ lib/route/link/inet.c \ lib/route/link/inet6.c \ + lib/route/link/ip6gre.c \ lib/route/link/ip6tnl.c \ + lib/route/link/ip6vti.c \ lib/route/link/ipgre.c \ lib/route/link/ipip.c \ lib/route/link/ipvlan.c \ @@ -409,11 +423,13 @@ lib/route/link/ppp.c \ lib/route/link/sit.c \ lib/route/link/sriov.c \ + lib/route/link/team.c \ lib/route/link/veth.c \ lib/route/link/vlan.c \ lib/route/link/vrf.c \ lib/route/link/vxlan.c \ lib/route/link/xfrmi.c \ + lib/route/mdb.c \ lib/route/neigh.c \ lib/route/neightbl.c \ lib/route/netconf.c \ @@ -832,7 +848,25 @@ lib/libnl-3.la \ lib/libnl-nf-3.la \ lib/libnl-genl-3.la \ - lib/libnl-route-3.la + lib/libnl-route-3.la \ + $(NULL) + +if WITH_CHECK +check_LTLIBRARIES += tests/libnl-test-util.la +endif + +tests_libnl_test_util_la_SOURCES = \ + tests/nl-test-util.h \ + tests/nl-test-util.c \ + $(NULL) +tests_libnl_test_util_la_CPPFLAGS = \ + $(tests_cppflags) \ + $(CHECK_CFLAGS) \ + $(NULL) +tests_libnl_test_util_la_LIBADD = \ + $(tests_ldadd) \ + $(CHECK_LIBS) \ + $(NULL) check_PROGRAMS += \ tests/test-complex-HTB-with-hash-filters \ @@ -913,11 +947,13 @@ check_PROGRAMS += \ tests/test-cache-mngr \ tests/test-genl \ - tests/test-nf-cache-mngr + tests/test-nf-cache-mngr \ + $(NULL) tests_cli_ldadd = \ $(tests_ldadd) \ - src/lib/libnl-cli-3.la + src/lib/libnl-cli-3.la \ + $(NULL) tests_test_cache_mngr_CPPFLAGS = $(tests_cppflags) tests_test_cache_mngr_LDADD = $(tests_cli_ldadd) @@ -932,11 +968,12 @@ endif tests_check_all_SOURCES = \ - tests/check-addr.c \ tests/check-all.c \ - tests/check-attr.c \ - tests/check-ematch-tree-clone.c \ - tests/util.h \ + tests/cksuite-all-addr.c \ + tests/cksuite-all-attr.c \ + tests/cksuite-all-ematch-tree-clone.c \ + tests/cksuite-all-netns.c \ + tests/cksuite-all.h \ $(NULL) tests_check_all_CPPFLAGS = \ @@ -945,7 +982,34 @@ tests_check_all_LDADD = \ $(tests_ldadd) \ - $(CHECK_LIBS) + tests/libnl-test-util.la \ + $(CHECK_LIBS) \ + $(NULL) + +if WITH_CHECK +if ENABLE_STATIC +check_programs += tests/check-direct +endif +endif + +tests_check_direct_SOURCES = \ + tests/check-direct.c \ + $(NULL) + +tests_check_direct_CPPFLAGS = \ + $(tests_cppflags) \ + $(CHECK_CFLAGS) \ + $(NULL) + +tests_check_direct_LDFLAGS = \ + -static \ + $(NULL)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/Makefile.in -> _service:tar_scm:libnl-3.7.0.tar.gz/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -117,11 +117,11 @@ tests/test-socket-creation$(EXEEXT) \ tests/test-u32-filter-with-actions$(EXEEXT) \ tests/test-cache-mngr$(EXEEXT) tests/test-genl$(EXEEXT) \ - tests/test-nf-cache-mngr$(EXEEXT) $(am__EXEEXT_5) + tests/test-nf-cache-mngr$(EXEEXT) $(am__EXEEXT_6) bin_PROGRAMS = $(am__EXEEXT_2) -sbin_PROGRAMS = $(am__EXEEXT_7) -noinst_PROGRAMS = $(am__EXEEXT_6) -TESTS = $(am__EXEEXT_5) +sbin_PROGRAMS = $(am__EXEEXT_8) +noinst_PROGRAMS = $(am__EXEEXT_7) +TESTS = $(am__EXEEXT_6) @ENABLE_CLI_FALSE@am__append_1 = $(lib_cli_ltlibraries_cls) \ @ENABLE_CLI_FALSE@ $(lib_cli_ltlibraries_qdisc) \ @ENABLE_CLI_FALSE@ src/lib/libnl-cli-3.la @@ -131,8 +131,10 @@ @ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_TRUE@@ENABLE_CLI_TRUE@am__append_5 = $(cli_programs) @ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_FALSE@@ENABLE_CLI_TRUE@am__append_6 = $(cli_programs) @ENABLE_CLI_FALSE@am__append_7 = $(cli_programs) -@WITH_CHECK_TRUE@am__append_8 = tests/check-all -@ENABLE_CLI_TRUE@am__append_9 = libnl-cli-3.0.pc +@WITH_CHECK_TRUE@am__append_8 = tests/libnl-test-util.la +@WITH_CHECK_TRUE@am__append_9 = tests/check-all +@ENABLE_STATIC_TRUE@@WITH_CHECK_TRUE@am__append_10 = tests/check-direct +@ENABLE_CLI_TRUE@am__append_11 = libnl-cli-3.0.pc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ @@ -209,9 +211,10 @@ "$(DESTDIR)$(libnlinclude_netlink_xfrmdir)" @ENABLE_CLI_FALSE@am__EXEEXT_3 = $(am__EXEEXT_1) @WITH_CHECK_TRUE@am__EXEEXT_4 = tests/check-all$(EXEEXT) -am__EXEEXT_5 = $(am__EXEEXT_4) -@ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_FALSE@@ENABLE_CLI_TRUE@am__EXEEXT_6 = $(am__EXEEXT_1) -@ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_TRUE@@ENABLE_CLI_TRUE@am__EXEEXT_7 = $(am__EXEEXT_1) +@ENABLE_STATIC_TRUE@@WITH_CHECK_TRUE@am__EXEEXT_5 = tests/check-direct$(EXEEXT) +am__EXEEXT_6 = $(am__EXEEXT_4) $(am__EXEEXT_5) +@ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_FALSE@@ENABLE_CLI_TRUE@am__EXEEXT_7 = $(am__EXEEXT_1) +@ENABLE_CLI_INSTALL_BIN_FALSE@@ENABLE_CLI_INSTALL_SBIN_TRUE@@ENABLE_CLI_TRUE@am__EXEEXT_8 = $(am__EXEEXT_1) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -413,6 +416,7 @@ lib/route/libnl_route_3_la-act.lo \ lib/route/act/libnl_route_3_la-gact.lo \ lib/route/act/libnl_route_3_la-mirred.lo \ + lib/route/act/libnl_route_3_la-nat.lo \ lib/route/act/libnl_route_3_la-skbedit.lo \ lib/route/act/libnl_route_3_la-vlan.lo \ lib/route/libnl_route_3_la-addr.lo \ @@ -427,6 +431,7 @@ lib/route/cls/ematch/libnl_route_3_la-meta.lo \ lib/route/cls/ematch/libnl_route_3_la-nbyte.lo \ lib/route/cls/ematch/libnl_route_3_la-text.lo \ + lib/route/cls/libnl_route_3_la-flower.lo \ lib/route/cls/libnl_route_3_la-fw.lo \ lib/route/cls/libnl_route_3_la-mall.lo \ lib/route/cls/libnl_route_3_la-police.lo \ @@ -441,7 +446,9 @@ lib/route/link/libnl_route_3_la-ifb.lo \ lib/route/link/libnl_route_3_la-inet.lo \ lib/route/link/libnl_route_3_la-inet6.lo \ + lib/route/link/libnl_route_3_la-ip6gre.lo \ lib/route/link/libnl_route_3_la-ip6tnl.lo \ + lib/route/link/libnl_route_3_la-ip6vti.lo \ lib/route/link/libnl_route_3_la-ipgre.lo \ lib/route/link/libnl_route_3_la-ipip.lo \ lib/route/link/libnl_route_3_la-ipvlan.lo \ @@ -451,11 +458,13 @@ lib/route/link/libnl_route_3_la-ppp.lo \ lib/route/link/libnl_route_3_la-sit.lo \ lib/route/link/libnl_route_3_la-sriov.lo \ + lib/route/link/libnl_route_3_la-team.lo \ lib/route/link/libnl_route_3_la-veth.lo \ lib/route/link/libnl_route_3_la-vlan.lo \ lib/route/link/libnl_route_3_la-vrf.lo \ lib/route/link/libnl_route_3_la-vxlan.lo \ lib/route/link/libnl_route_3_la-xfrmi.lo \ + lib/route/libnl_route_3_la-mdb.lo \ lib/route/libnl_route_3_la-neigh.lo \ lib/route/libnl_route_3_la-neightbl.lo \ lib/route/libnl_route_3_la-netconf.lo \ @@ -524,282 +533,304 @@ $(LDFLAGS) -o $@ @ENABLE_CLI_FALSE@am_src_lib_libnl_cli_3_la_rpath = @ENABLE_CLI_TRUE@am_src_lib_libnl_cli_3_la_rpath = -rpath $(libdir) +am__DEPENDENCIES_1 = lib/libnl-3.la lib/libnl-nf-3.la \ + lib/libnl-genl-3.la lib/libnl-route-3.la +am__DEPENDENCIES_2 = +tests_libnl_test_util_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +am_tests_libnl_test_util_la_OBJECTS = \ + tests/libnl_test_util_la-nl-test-util.lo +tests_libnl_test_util_la_OBJECTS = \ + $(am_tests_libnl_test_util_la_OBJECTS) +@WITH_CHECK_TRUE@am_tests_libnl_test_util_la_rpath = src_genl_ctrl_list_SOURCES = src/genl-ctrl-list.c src_genl_ctrl_list_OBJECTS = \ src/genl_ctrl_list-genl-ctrl-list.$(OBJEXT) -am__DEPENDENCIES_1 = src/lib/libnl-cli-3.la lib/libnl-3.la \ +am__DEPENDENCIES_3 = src/lib/libnl-cli-3.la lib/libnl-3.la \ lib/libnl-nf-3.la lib/libnl-genl-3.la lib/libnl-route-3.la \ lib/libnl-idiag-3.la -src_genl_ctrl_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_genl_ctrl_list_DEPENDENCIES = $(am__DEPENDENCIES_3) src_idiag_socket_details_SOURCES = src/idiag-socket-details.c src_idiag_socket_details_OBJECTS = \ src/idiag_socket_details-idiag-socket-details.$(OBJEXT) -src_idiag_socket_details_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_idiag_socket_details_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_ct_add_SOURCES = src/nf-ct-add.c src_nf_ct_add_OBJECTS = src/nf_ct_add-nf-ct-add.$(OBJEXT) -src_nf_ct_add_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_ct_add_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_ct_events_SOURCES = src/nf-ct-events.c src_nf_ct_events_OBJECTS = src/nf_ct_events-nf-ct-events.$(OBJEXT) -src_nf_ct_events_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_ct_events_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_ct_list_SOURCES = src/nf-ct-list.c src_nf_ct_list_OBJECTS = src/nf_ct_list-nf-ct-list.$(OBJEXT) -src_nf_ct_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_ct_list_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_exp_add_SOURCES = src/nf-exp-add.c src_nf_exp_add_OBJECTS = src/nf_exp_add-nf-exp-add.$(OBJEXT) -src_nf_exp_add_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_exp_add_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_exp_delete_SOURCES = src/nf-exp-delete.c src_nf_exp_delete_OBJECTS = src/nf_exp_delete-nf-exp-delete.$(OBJEXT) -src_nf_exp_delete_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_exp_delete_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_exp_list_SOURCES = src/nf-exp-list.c src_nf_exp_list_OBJECTS = src/nf_exp_list-nf-exp-list.$(OBJEXT) -src_nf_exp_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_exp_list_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_log_SOURCES = src/nf-log.c src_nf_log_OBJECTS = src/nf_log-nf-log.$(OBJEXT) -src_nf_log_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_log_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_monitor_SOURCES = src/nf-monitor.c src_nf_monitor_OBJECTS = src/nf_monitor-nf-monitor.$(OBJEXT) -src_nf_monitor_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_monitor_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nf_queue_SOURCES = src/nf-queue.c src_nf_queue_OBJECTS = src/nf_queue-nf-queue.$(OBJEXT) -src_nf_queue_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nf_queue_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_addr_add_SOURCES = src/nl-addr-add.c src_nl_addr_add_OBJECTS = src/nl_addr_add-nl-addr-add.$(OBJEXT) -src_nl_addr_add_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_addr_add_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_addr_delete_SOURCES = src/nl-addr-delete.c src_nl_addr_delete_OBJECTS = \ src/nl_addr_delete-nl-addr-delete.$(OBJEXT) -src_nl_addr_delete_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_addr_delete_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_addr_list_SOURCES = src/nl-addr-list.c src_nl_addr_list_OBJECTS = src/nl_addr_list-nl-addr-list.$(OBJEXT) -src_nl_addr_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_addr_list_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_class_add_SOURCES = src/nl-class-add.c src_nl_class_add_OBJECTS = src/nl_class_add-nl-class-add.$(OBJEXT) -src_nl_class_add_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_class_add_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_class_delete_SOURCES = src/nl-class-delete.c src_nl_class_delete_OBJECTS = \ src/nl_class_delete-nl-class-delete.$(OBJEXT) -src_nl_class_delete_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_class_delete_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_class_list_SOURCES = src/nl-class-list.c src_nl_class_list_OBJECTS = src/nl_class_list-nl-class-list.$(OBJEXT) -src_nl_class_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_class_list_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_classid_lookup_SOURCES = src/nl-classid-lookup.c src_nl_classid_lookup_OBJECTS = \ src/nl_classid_lookup-nl-classid-lookup.$(OBJEXT) -src_nl_classid_lookup_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_classid_lookup_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_cls_add_SOURCES = src/nl-cls-add.c src_nl_cls_add_OBJECTS = src/nl_cls_add-nl-cls-add.$(OBJEXT) -src_nl_cls_add_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_cls_add_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_cls_delete_SOURCES = src/nl-cls-delete.c src_nl_cls_delete_OBJECTS = src/nl_cls_delete-nl-cls-delete.$(OBJEXT) -src_nl_cls_delete_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_cls_delete_DEPENDENCIES = $(am__DEPENDENCIES_3) src_nl_cls_list_SOURCES = src/nl-cls-list.c src_nl_cls_list_OBJECTS = src/nl_cls_list-nl-cls-list.$(OBJEXT) -src_nl_cls_list_DEPENDENCIES = $(am__DEPENDENCIES_1) +src_nl_cls_list_DEPENDENCIES = $(am__DEPENDENCIES_3)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/aclocal.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/aclocal.m4
Changed
@@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,8 +14,8 @@ m4_ifndef(AC_CONFIG_MACRO_DIRS, m4_defun(_AM_CONFIG_MACRO_DIRS, )m4_defun(AC_CONFIG_MACRO_DIRS, _AM_CONFIG_MACRO_DIRS($@))) m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl -m4_if(m4_defn(AC_AUTOCONF_VERSION), 2.69,, -m4_warning(this file was generated for autoconf 2.69. +m4_if(m4_defn(AC_AUTOCONF_VERSION), 2.71,, +m4_warning(this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.)) @@ -364,7 +364,7 @@ AC_DEFINE(HAVE_$1, 1, Enable m4_tolower($1) support)) )dnl PKG_HAVE_DEFINE_WITH_MODULES -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -379,7 +379,7 @@ am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.16.1, , +m4_if($1, 1.16.5, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -395,12 +395,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.16.1)dnl +AM_AUTOMAKE_VERSION(1.16.5)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -462,7 +462,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -514,7 +514,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -545,7 +545,7 @@ Usually this means the macro was only invoked conditionally.) fi)) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -736,7 +736,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -775,7 +775,9 @@ done if test $am_rc -ne 0; then AC_MSG_FAILURE(Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).) fi @@ -802,7 +804,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -830,6 +832,10 @@ # release and drop the old call support. AC_DEFUN(AM_INIT_AUTOMAKE, AC_PREREQ(2.65)dnl +m4_ifdef(_$0_ALREADY_INIT, + m4_fatal($0 expanded multiple times +m4_defn(_$0_ALREADY_INIT)), + m4_define(_$0_ALREADY_INIT, m4_expansion_stack))dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow(^AM_A-Z+FLAGS$)dnl @@ -866,7 +872,7 @@ _AM_SET_OPTIONS($1)dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef(AC_PACKAGE_NAME, ok):m4_ifdef(AC_PACKAGE_VERSION, ok), + m4_ifset(AC_PACKAGE_NAME, ok):m4_ifset(AC_PACKAGE_VERSION, ok), ok:ok,, m4_fatal(AC_INIT should be called with package and version arguments))dnl AC_SUBST(PACKAGE, 'AC_PACKAGE_TARNAME')dnl @@ -918,6 +924,20 @@ m4_define(AC_PROG_OBJCXX, m4_defn(AC_PROG_OBJCXX)_AM_DEPENDENCIES(OBJCXX)))dnl ) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST(CTAGS) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST(ETAGS) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST(CSCOPE) + AC_REQUIRE(AM_SILENT_RULES)dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -999,7 +1019,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1020,7 +1040,7 @@ fi AC_SUBST(install_sh)) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1041,7 +1061,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1084,7 +1104,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1105,12 +1125,7 @@ AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl AC_REQUIRE_AUX_FILE(missing)dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/ar-lib -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/ar-lib
Changed
@@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2012-03-01.08; # UTC +scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2018 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin <peda@lysator.liu.se>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -65,7 +65,7 @@ mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin) + cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) @@ -224,10 +224,11 @@ esac done else - $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member - do - $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? - done + $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \ + | while read member + do + $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? + done fi elif test -n "$quick$replace"; then
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/compile -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/compile
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/config.guess -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/config.guess
Changed
@@ -1,12 +1,14 @@ -#! /bin/sh +#!/usr/bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2018-08-29' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-05-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -27,11 +29,19 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to <config-patches@gnu.org>. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -50,7 +60,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,6 +94,9 @@ exit 1 fi +# Just in case it came from the environment. +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,12 +109,13 @@ tmp= # shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 + # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || @@ -111,7 +125,7 @@ ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -132,14 +146,12 @@ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" @@ -148,24 +160,37 @@ LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include <stdarg.h> + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if "$LIBC" = unknown && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if "$LIBC" = unknown ; then + LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -177,12 +202,12 @@ # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; @@ -191,13 +216,13 @@ earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv0-9\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -218,7 +243,7 @@ ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv0-9/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` @@ -229,7 +254,7 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu'
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/config.sub -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/config.sub
Changed
@@ -1,12 +1,14 @@ -#! /bin/sh +#!/usr/bin/sh # Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2018-08-29' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -33,7 +35,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -67,7 +76,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,7 +98,7 @@ - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) @@ -111,9 +120,12 @@ esac # Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <<EOF +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <<EOF $1 EOF +IFS=$saved_IFS # Separate into logical components for further validation case $1 in @@ -123,37 +135,36 @@ ;; *-*-*-*) basic_machine=$field1-$field2 - os=$field3-$field4 + basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 - os=$maybe_os + basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=linux-android + basic_os=linux-android ;; *) basic_machine=$field1-$field2 - os=$field3 + basic_os=$field3 ;; esac ;; *-*) - # A lone config we happen to match not fitting any patern + # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec - os= + basic_os= ;; *-*) # Second component is usually, but not always the OS @@ -161,7 +172,11 @@ # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 - os=$field2 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ @@ -174,11 +189,11 @@ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 - os= + basic_os= ;; *) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; esac ;; @@ -190,450 +205,451 @@ case $field1 in 386bsd) basic_machine=i386-pc - os=bsd + basic_os=bsd ;; a29khif) basic_machine=a29k-amd - os=udi + basic_os=udi ;; adobe68k) basic_machine=m68010-adobe - os=scout + basic_os=scout ;; alliant) basic_machine=fx80-alliant - os= + basic_os= ;; altos | altos3068) basic_machine=m68k-altos - os= + basic_os= ;; am29k) basic_machine=a29k-none - os=bsd + basic_os=bsd ;; amdahl) basic_machine=580-amdahl - os=sysv + basic_os=sysv ;; amiga) basic_machine=m68k-unknown - os= + basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown - os=amigaos + basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown - os=sysv4 + basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/depcomp -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/depcomp
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/install-sh -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *23672367) mkdir_umask=$umask;; - .*00202 | .0202 | .02) mkdir_umask=22;; - - *0-7) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ fi posix_mkdir=false - case $umask in - *1235670-70-7) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ then : else - # The umask is ridiculous, or mkdir does not conform to POSIX,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/ltmain.sh -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/ltmain.sh
Changed
@@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> ## ------ ## @@ -139,9 +130,12 @@ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ s/\\(^$_G_bs\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ } -# func_quote_for_eval ARG...
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/missing -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/missing
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify
View file
_service:tar_scm:libnl-3.5.0.tar.gz/build-aux/test-driver -> _service:tar_scm:libnl-3.7.0.tar.gz/build-aux/test-driver
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ { cat <<END Usage: - test-driver --test-name=NAME --log-file=PATH --trs-file=PATH - --expect-failure={yes|no} --color-tests={yes|no} - --enable-hard-errors={yes|no} -- + test-driver --test-name NAME --log-file PATH --trs-file PATH + --expect-failure {yes|no} --color-tests {yes|no} + --enable-hard-errors {yes|no} -- TEST-SCRIPT TEST-SCRIPT-ARGUMENTS + The '--test-name', '--log-file' and '--trs-file' options are mandatory. +See the GNU Automake documentation for information. END } @@ -103,8 +105,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name"
View file
_service:tar_scm:libnl-3.5.0.tar.gz/configure -> _service:tar_scm:libnl-3.7.0.tar.gz/configure
Changed
@@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libnl 3.5.0. +# Generated by GNU Autoconf 2.71 for libnl 3.7.0. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -14,14 +15,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -31,46 +34,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -79,13 +82,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -94,8 +90,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -107,30 +107,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -152,20 +132,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #(
View file
_service:tar_scm:libnl-3.5.0.tar.gz/configure.ac -> _service:tar_scm:libnl-3.7.0.tar.gz/configure.ac
Changed
@@ -1,18 +1,12 @@ -# -# configure.in -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation version 2.1 -# of the License. +# SPDX-License-Identifier: LGPL-2.1-only + # # Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> # - # copied from glib m4_define(libnl_major_version, 3) -m4_define(libnl_minor_version, 5) +m4_define(libnl_minor_version, 7) m4_define(libnl_micro_version, 0) m4_define(libnl_git_sha, m4_esyscmd( ( -d ./.git/ && "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" && git rev-parse --verify -q HEAD 2>/dev/null ) || true )) @@ -113,6 +107,8 @@ AC_CHECK_LIB(pthread, pthread_mutex_lock, , AC_MSG_ERROR(libpthread is required)) fi +AM_CONDITIONAL(ENABLE_STATIC, test "$enable_static" != "no") + AC_ARG_ENABLE(debug, AS_HELP_STRING(--disable-debug, Do not include debugging statements), enable_debug="$enableval", enable_debug="yes")
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/linux-private/linux/if_bridge.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/linux-private/linux/if_bridge.h
Changed
@@ -243,6 +243,7 @@ union { __be32 ip4; struct in6_addr ip6; + unsigned char mac_addrETH_ALEN; } u; __be16 proto; } addr;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/linux-private/linux/if_link.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/linux-private/linux/if_link.h
Changed
@@ -455,6 +455,7 @@ IFLA_MACSEC_REPLAY_PROTECT, IFLA_MACSEC_VALIDATION, IFLA_MACSEC_PAD, + IFLA_MACSEC_OFFLOAD, __IFLA_MACSEC_MAX, };
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/linux-private/linux/if_vlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/linux-private/linux/if_vlan.h
Changed
@@ -32,10 +32,11 @@ }; enum vlan_flags { - VLAN_FLAG_REORDER_HDR = 0x1, - VLAN_FLAG_GVRP = 0x2, - VLAN_FLAG_LOOSE_BINDING = 0x4, - VLAN_FLAG_MVRP = 0x8, + VLAN_FLAG_REORDER_HDR = 0x1, + VLAN_FLAG_GVRP = 0x2, + VLAN_FLAG_LOOSE_BINDING = 0x4, + VLAN_FLAG_MVRP = 0x8, + VLAN_FLAG_BRIDGE_BINDING = 0x10, }; enum vlan_name_types {
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/linux-private/linux/netfilter/nfnetlink_log.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/linux-private/linux/netfilter/nfnetlink_log.h
Changed
@@ -33,6 +33,15 @@ __aligned_be64 usec; }; +enum nfulnl_vlan_attr { + NFULA_VLAN_UNSPEC, + NFULA_VLAN_PROTO, /* __be16 skb vlan_proto */ + NFULA_VLAN_TCI, /* __be16 skb htons(vlan_tci) */ + __NFULA_VLAN_MAX, +}; + +#define NFULA_VLAN_MAX (__NFULA_VLAN_MAX + 1) + enum nfulnl_attr_type { NFULA_UNSPEC, NFULA_PACKET_HDR, @@ -54,6 +63,8 @@ NFULA_HWLEN, /* hardware header length */ NFULA_CT, /* nf_conntrack_netlink.h */ NFULA_CT_INFO, /* enum ip_conntrack_info */ + NFULA_VLAN, /* nested attribute: packet vlan info */ + NFULA_L2HDR, /* full L2 header */ __NFULA_MAX };
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/linux-private/linux/tc_act/tc_nat.h
Added
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef __LINUX_TC_NAT_H +#define __LINUX_TC_NAT_H + +#include <linux/pkt_cls.h> +#include <linux/types.h> + +enum { + TCA_NAT_UNSPEC, + TCA_NAT_PARMS, + TCA_NAT_TM, + TCA_NAT_PAD, + __TCA_NAT_MAX +}; +#define TCA_NAT_MAX (__TCA_NAT_MAX - 1) + +#define TCA_NAT_FLAG_EGRESS 1 + +struct tc_nat { + tc_gen; + __be32 old_addr; + __be32 new_addr; + __be32 mask; + __u32 flags; +}; + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/cache-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/cache-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/cache-api.h Caching API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/genl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/genl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/genl.h Local Generic Netlink Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/netlink.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/netlink.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/netlink.h Local Netlink Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */ @@ -65,6 +59,7 @@ #include <netlink-private/object-api.h> #include <netlink-private/cache-api.h> #include <netlink-private/types.h> +#include <netlink-private/utils.h> #define NSEC_PER_SEC 1000000000L
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/nl-auto.h
Added
@@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef NETLINK_NL_AUTO_H_ +#define NETLINK_NL_AUTO_H_ + +#include <stdlib.h> + +#define _nl_auto(fcn) __attribute__ ((__cleanup__(fcn))) + +#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \ +static inline void name(void *v) \ +{ \ + if (*((CastType *) v)) \ + func(*((CastType *) v)); \ +} \ +struct _nl_dummy_for_tailing_semicolon + +#define _NL_AUTO_DEFINE_FCN_STRUCT(CastType, name, func) \ +static inline void name(CastType *v) \ +{ \ + if (v) \ + func(v); \ +} \ +struct _nl_dummy_for_tailing_semicolon + +#define _NL_AUTO_DEFINE_FCN_TYPED0(CastType, name, func) \ +static inline void name(CastType *v) \ +{ \ + if (*v) \ + func(*v); \ +} \ +struct _nl_dummy_for_tailing_semicolon + +#define _nl_auto_free _nl_auto(_nl_auto_free_fcn) +_NL_AUTO_DEFINE_FCN_VOID0(void *, _nl_auto_free_fcn, free); + +struct nl_addr; +void nl_addr_put(struct nl_addr *); +#define _nl_auto_nl_addr _nl_auto(_nl_auto_nl_addr_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_addr *, _nl_auto_nl_addr_fcn, nl_addr_put); + +struct nl_data; +void nl_data_free(struct nl_data *data); +#define _nl_auto_nl_data _nl_auto(_nl_auto_nl_data_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_data *, _nl_auto_nl_data_fcn, nl_data_free); + +struct nl_msg; +void nlmsg_free(struct nl_msg *); +#define _nl_auto_nl_msg _nl_auto(_nl_auto_nl_msg_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_msg *, _nl_auto_nl_msg_fcn, nlmsg_free); + +struct rtnl_link; +void rtnl_link_put(struct rtnl_link *); +#define _nl_auto_rtnl_link _nl_auto(_nl_auto_rtnl_link_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link *, _nl_auto_rtnl_link_fcn, rtnl_link_put); + +struct rtnl_route; +void rtnl_route_put(struct rtnl_route *); +#define _nl_auto_rtnl_route _nl_auto(_nl_auto_rtnl_route_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_route *, _nl_auto_rtnl_route_fcn, rtnl_route_put); + +struct rtnl_mdb; +void rtnl_mdb_put(struct rtnl_mdb *); +#define _nl_auto_rtnl_mdb _nl_auto(_nl_auto_rtnl_mdb_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_mdb *, _nl_auto_rtnl_mdb_fcn, rtnl_mdb_put); + +struct rtnl_nexthop; +void rtnl_route_nh_free(struct rtnl_nexthop *); +#define _nl_auto_rtnl_nexthop _nl_auto(_nl_auto_rtnl_nexthop_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_nexthop *, _nl_auto_rtnl_nexthop_fcn, rtnl_route_nh_free); + +struct nl_cache; +void nl_cache_put(struct nl_cache *); +#define _nl_auto_nl_cache _nl_auto(_nl_auto_nl_cache_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_cache *, _nl_auto_nl_cache_fcn, nl_cache_put); + +struct rtnl_link_af_ops; +void rtnl_link_af_ops_put(struct rtnl_link_af_ops *); +#define _nl_auto_rtnl_link_af_ops _nl_auto(_nl_auto_rtnl_link_af_ops_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_link_af_ops *, _nl_auto_rtnl_link_af_ops_fcn, rtnl_link_af_ops_put); + +struct rtnl_act; +void rtnl_act_put(struct rtnl_act *); +#define _nl_auto_rtnl_act _nl_auto(_nl_auto_rtnl_act_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_act *, _nl_auto_rtnl_act_fcn, rtnl_act_put); + +struct rtnl_ematch_tree; +void rtnl_ematch_tree_free(struct rtnl_ematch_tree *); +#define _nl_auto_rtnl_ematch_tree _nl_auto(_nl_auto_rtnl_ematch_tree_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_ematch_tree *, _nl_auto_rtnl_ematch_tree_fcn, rtnl_ematch_tree_free); + +struct rtnl_cls; +void rtnl_cls_put(struct rtnl_cls *); +#define _nl_auto_rtnl_cls _nl_auto(_nl_auto_rtnl_cls_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct rtnl_cls *, _nl_auto_rtnl_cls_fcn, rtnl_cls_put); + +struct nl_sock; +void nl_socket_free(struct nl_sock *); +#define _nl_auto_nl_socket _nl_auto(_nl_auto_nl_socket_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(struct nl_sock *, _nl_auto_nl_socket_fcn, nl_socket_free); + +#endif /* NETLINK_NL_AUTO_H_ */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/object-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/object-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/object-api.c Object API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/route/link/api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/route/link/api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/route/link/api.h Link Modules API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */ @@ -68,6 +62,7 @@ }; extern struct rtnl_link_info_ops *rtnl_link_info_ops_lookup(const char *); +extern void rtnl_link_info_ops_get(struct rtnl_link_info_ops *); extern void rtnl_link_info_ops_put(struct rtnl_link_info_ops *); extern int rtnl_link_register_info(struct rtnl_link_info_ops *); extern int rtnl_link_unregister_info(struct rtnl_link_info_ops *);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/route/link/sriov.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/route/link/sriov.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * include/netlink-private/route/link/sriov.h SRIOV VF Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Intel Corp. All rights reserved. * Copyright (c) 2016 Jef Oliver <jef.oliver@intel.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/route/tc-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/route/tc-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/route/tc-api.h Traffic Control API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/route/utils.h
Added
@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef NETLINK_ROUTE_UTILS_PRIV_H_ +#define NETLINK_ROUTE_UTILS_PRIV_H_ + +extern const uint8_t *const _nltst_map_stat_id_from_IPSTATS_MIB_v2; + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/socket.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/socket.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/socket.h Private declarations for socket - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/tc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/tc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/tc.h Local Traffic Control Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/types.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/types.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/types.h Netlink Types (Private) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */ @@ -33,6 +27,9 @@ #include <linux/tc_act/tc_vlan.h> #include <linux/sock_diag.h> #include <linux/fib_rules.h> +#include <linux/if_ether.h> + +#include <netinet/in.h> #define NL_SOCK_PASSCRED (1<<1) #define NL_OWN_PORT (1<<2) @@ -616,6 +613,27 @@ int m_mask; }; +struct rtnl_flower +{ + struct rtnl_act *cf_act; + int cf_mask; + uint32_t cf_flags; + uint16_t cf_proto; + uint16_t cf_vlan_id; + uint16_t cf_vlan_ethtype; + uint8_t cf_vlan_prio; + uint8_t cf_src_macETH_ALEN; + uint8_t cf_src_mac_maskETH_ALEN; + uint8_t cf_dst_macETH_ALEN; + uint8_t cf_dst_mac_maskETH_ALEN; + in_addr_t cf_ipv4_src; + in_addr_t cf_ipv4_src_mask; + in_addr_t cf_ipv4_dst; + in_addr_t cf_ipv4_dst_mask; + uint8_t cf_ip_dscp; + uint8_t cf_ip_dscp_mask; +}; + struct rtnl_cgroup { struct rtnl_ematch_tree *cg_ematch; @@ -1015,6 +1033,14 @@ uint32_t log_msg_gid; uint32_t log_msg_seq; uint32_t log_msg_seq_global; + uint16_t log_msg_hwtype; + uint16_t log_msg_hwlen; + void * log_msg_hwheader; + int log_msg_hwheader_len; + uint16_t log_msg_vlan_tag; + uint16_t log_msg_vlan_proto; + uint32_t log_msg_ct_info; + struct nfnl_ct * log_msg_ct; }; struct nfnl_queue { @@ -1237,6 +1263,11 @@ struct nl_addr* encap_oa; }; +struct xfrmnl_user_offload { + int ifindex; + uint8_t flags; +}; + struct xfrmnl_sa { NLHDR_COMMON @@ -1266,6 +1297,7 @@ struct xfrmnl_replay_state replay_state; struct xfrmnl_replay_state_esn* replay_state_esn; uint8_t hard; + struct xfrmnl_user_offload* user_offload; }; struct xfrmnl_usersa_flush { @@ -1338,4 +1370,19 @@ uint32_t v_flags; }; +struct rtnl_mdb { + NLHDR_COMMON + uint32_t ifindex; + + struct nl_list_head mdb_entry_list; +}; + +struct rtnl_mdb_entry { + struct nl_list_head mdb_list; + struct nl_addr *addr; + uint32_t ifindex; + uint16_t vid; + uint16_t proto; + uint8_t state; +}; #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink-private/utils.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink-private/utils.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink-private/utils.h Local Utility Functions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -13,6 +7,13 @@ #define NETLINK_UTILS_PRIV_H_ #include <byteswap.h> +#include <assert.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> +#include <stdbool.h> +#include <netinet/in.h> +#include <arpa/inet.h> #if __BYTE_ORDER == __BIG_ENDIAN #define ntohll(x) (x) @@ -71,6 +72,23 @@ /*****************************************************************************/ +#ifdef thread_local +#define _nl_thread_local thread_local +/* + * Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ + * see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 + */ +#elif __STDC_VERSION__ >= 201112L && \ + !(defined(__STDC_NO_THREADS__) || \ + (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && \ + __GLIBC_MINOR__ < 16)) +#define _nl_thread_local _Thread_local +#else +#define _nl_thread_local __thread +#endif + +/*****************************************************************************/ + #define _NL_STATIC_ASSERT(cond) ((void) sizeof (char(cond) ? 1 : -1)) /*****************************************************************************/ @@ -81,17 +99,45 @@ #define _nl_assert(cond) do { if (0) { assert(cond); } } while (0) #endif +#define _nl_assert_not_reached() assert(0) + /*****************************************************************************/ -#define _NL_AUTO_DEFINE_FCN_VOID0(CastType, name, func) \ -static inline void name (void *v) \ -{ \ - if (*((CastType *) v)) \ - func (*((CastType *) v)); \ -} +#define _nl_assert_addr_family_or_unspec(addr_family) \ + do { \ + typeof(addr_family) _addr_family = (addr_family); \ + \ + _nl_assert(_addr_family == AF_UNSPEC || \ + _addr_family == AF_INET || \ + _addr_family == AF_INET6); \ + } while (0) + +#define _nl_assert_addr_family(addr_family) \ + do { \ + typeof(addr_family) _addr_family = (addr_family); \ + \ + _nl_assert(_addr_family == AF_INET || \ + _addr_family == AF_INET6); \ + } while (0) + +/*****************************************************************************/ + +#define _NL_SWAP(pa, pb) \ + do { \ + typeof(*(pa)) *_pa = (pa); \ + typeof(*(pb)) *_pb = (pb); \ + typeof(*_pa) _tmp; \ + \ + _nl_assert(_pa); \ + _nl_assert(_pb); \ + _tmp = *_pa; \ + *_pa = *_pb; \ + *_pb = _tmp; \ + } while (0) + +/*****************************************************************************/ -#define _nl_auto_free _nl_auto(_nl_auto_free_fcn) -_NL_AUTO_DEFINE_FCN_VOID0 (void *, _nl_auto_free_fcn, free) +#define _NL_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)0)) /*****************************************************************************/ @@ -163,11 +209,21 @@ /*****************************************************************************/ +static inline bool _nl_streq(const char *a, const char *b) +{ + return !strcmp(a, b); +} + +static inline bool _nl_streq0(const char *a, const char *b) +{ + return a == b || (a && b && _nl_streq(a, b)); +} + static inline char * _nl_strncpy_trunc(char *dst, const char *src, size_t len) { /* we don't use/reimplement strlcpy(), because we want the fill-all-with-NUL - * behavior of strncpy(). This is just strncpy() with gracefully handling trunction + * behavior of strncpy(). This is just strncpy() with gracefully handling truncation * (and disabling the "-Wstringop-truncation" warning). * * Note that truncation is silently accepted. @@ -192,32 +248,146 @@ } static inline char * -_nl_strncpy(char *dst, const char *src, size_t len) +_nl_strncpy_assert(char *dst, const char *src, size_t len) { /* we don't use/reimplement strlcpy(), because we want the fill-all-with-NUL - * behavior of strncpy(). This is just strncpy() with gracefully handling trunction + * behavior of strncpy(). This is just strncpy() with assertion against truncation * (and disabling the "-Wstringop-truncation" warning). * * Note that truncation is still a bug and there is an _nl_assert() * against that. */ + _NL_PRAGMA_WARNING_DISABLE ("-Wstringop-truncation"); + _NL_PRAGMA_WARNING_DISABLE ("-Wstringop-overflow"); + if (len > 0) { _nl_assert(dst); _nl_assert(src); strncpy(dst, src, len); - /* Truncation is a bug and we assert against it. But note that this - * assertion is disabled by default because we cannot be sure that - * there are not wrong uses of _nl_strncpy() where truncation might - * happen (wrongly!!). */ - _nl_assert (memchr(dst, '\0', len)); + _nl_assert (dstlen - 1 == '\0'); dstlen - 1 = '\0'; } + _NL_PRAGMA_WARNING_REENABLE; + _NL_PRAGMA_WARNING_REENABLE; + return dst; } +#include "nl-auto.h" + +#define _NL_RETURN_ON_ERR(cmd) \ + do { \ + int _err; \ + \ + _err = (cmd); \ + if (_err < 0) \ + return _err; \ + } while (0) + +#define _NL_RETURN_E_ON_ERR(e, cmd) \ + do { \ + int _err; \ + \ + _err = (cmd); \ + if (_err < 0) { \ + _NL_STATIC_ASSERT((e) > 0); \ + return -(e); \ + } \ + } while (0) + +/* _NL_RETURN_ON_PUT_ERR() shall only be used with a put command (nla_put or nlmsg_append). + * These commands can either fail with a regular error code (which gets propagated) + * or with -NLE_NOMEM. However, they don't really try to allocate memory, so we don't + * want to propagate -NLE_NOMEM. Instead, we coerce such failure to -NLE_MSGSIZE. */ +#define _NL_RETURN_ON_PUT_ERR(put_cmd) \ + do { \ + int _err; \ + \ + _err = (put_cmd); \
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/addr.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/addr.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/addr.h Abstract Address - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/attr.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/attr.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/attr.h Netlink Attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cache-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cache-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cache-api.h Caching API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cache.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cache.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cache.h Caching Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/addr.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/addr.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/addr.h CLI Address Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -14,6 +8,10 @@ #include <netlink/route/addr.h> +#ifdef __cplusplus +extern "C" { +#endif + #define nl_cli_addr_alloc_cache(sk) \ nl_cli_alloc_cache((sk), "address", rtnl_addr_alloc_cache) @@ -29,4 +27,8 @@ extern void nl_cli_addr_parse_preferred(struct rtnl_addr *, char *); extern void nl_cli_addr_parse_valid(struct rtnl_addr *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/class.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/class.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/class.h CLI Class Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */ @@ -15,7 +9,15 @@ #include <netlink/route/class.h> #include <netlink/cli/tc.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct rtnl_class *nl_cli_class_alloc(void); extern struct nl_cache *nl_cli_class_alloc_cache(struct nl_sock *, int); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/cls.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/cls.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/cls.h CLI Classifier Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */ @@ -15,10 +9,18 @@ #include <netlink/route/classifier.h> #include <netlink/cli/tc.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct rtnl_cls * nl_cli_cls_alloc(void); extern struct nl_cache * nl_cli_cls_alloc_cache(struct nl_sock *, int, uint32_t); extern void nl_cli_cls_parse_proto(struct rtnl_cls *, char *); extern struct rtnl_ematch_tree *nl_cli_cls_parse_ematch(struct rtnl_cls *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/ct.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/ct.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/ct.h CLI Conntrack Helper - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -15,6 +9,10 @@ #include <netlink/netfilter/ct.h> #include <linux/netfilter/nf_conntrack_common.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct nfnl_ct *nl_cli_ct_alloc(void); extern struct nl_cache *nl_cli_ct_alloc_cache(struct nl_sock *); @@ -32,4 +30,8 @@ extern void nl_cli_ct_parse_status(struct nfnl_ct *, char *); extern void nl_cli_ct_parse_zone(struct nfnl_ct *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/exp.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/exp.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/exp.h CLI Expectation Helper - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Rich Fought <Rich.Fought@watchguard.com> * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -16,6 +10,10 @@ #include <netlink/netfilter/exp.h> #include <linux/netfilter/nf_conntrack_common.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct nfnl_exp *nl_cli_exp_alloc(void); extern struct nl_cache *nl_cli_exp_alloc_cache(struct nl_sock *); @@ -38,5 +36,8 @@ extern void nl_cli_exp_parse_icmp_type(struct nfnl_exp *, int, char *); extern void nl_cli_exp_parse_icmp_code(struct nfnl_exp *, int, char *); +#ifdef __cplusplus +} +#endif #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/link.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/link.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/link.h CLI Link Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */ @@ -15,6 +9,10 @@ #include <netlink/route/link.h> #include <netlink/cli/utils.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct rtnl_link *nl_cli_link_alloc(void); extern struct nl_cache *nl_cli_link_alloc_cache_family(struct nl_sock *, int); extern struct nl_cache *nl_cli_link_alloc_cache_family_flags(struct nl_sock *, int, @@ -31,4 +29,8 @@ extern void nl_cli_link_parse_weight(struct rtnl_link *, char *); extern void nl_cli_link_parse_ifalias(struct rtnl_link *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/mdb.h
Added
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef __NETLINK_CLI_MDB_H_ +#define __NETLINK_CLI_MDB_H_ + +#include <netlink/route/mdb.h> + +#define nl_cli_mdb_alloc_cache(sk) \ + nl_cli_alloc_cache_flags((sk), "mdb", NL_CACHE_AF_ITER, rtnl_mdb_alloc_cache) + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/neigh.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/neigh.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/neighbour.h CLI Neighbour Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -14,6 +8,10 @@ #include <netlink/route/neighbour.h> +#ifdef __cplusplus +extern "C" { +#endif + #define nl_cli_neigh_alloc_cache(sk) \ nl_cli_alloc_cache_flags((sk), "neighbour", NL_CACHE_AF_ITER, \ rtnl_neigh_alloc_cache_flags) @@ -25,4 +23,8 @@ extern void nl_cli_neigh_parse_family(struct rtnl_neigh *, char *); extern void nl_cli_neigh_parse_state(struct rtnl_neigh *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/qdisc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/qdisc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/qdisc.h CLI QDisc Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2011 Thomas Graf <tgraf@suug.ch> */ @@ -14,10 +8,18 @@ #include <netlink/route/qdisc.h> +#ifdef __cplusplus +extern "C" { +#endif + #define nl_cli_qdisc_alloc_cache(sk) \ nl_cli_alloc_cache((sk), "queueing disciplines", \ rtnl_qdisc_alloc_cache) extern struct rtnl_qdisc *nl_cli_qdisc_alloc(void); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/route.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/route.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli//route.h CLI Route Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -14,6 +8,10 @@ #include <netlink/route/route.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct rtnl_route *nl_cli_route_alloc(void); extern struct nl_cache *nl_cli_route_alloc_cache(struct nl_sock *, int); @@ -31,4 +29,8 @@ extern void nl_cli_route_parse_type(struct rtnl_route *, char *); extern void nl_cli_route_parse_iif(struct rtnl_route *, char *, struct nl_cache *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/rule.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/rule.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/rule.h CLI Routing Rule Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */ @@ -14,8 +8,16 @@ #include <netlink/route/rule.h> +#ifdef __cplusplus +extern "C" { +#endif + extern struct rtnl_rule *nl_cli_rule_alloc(void); extern struct nl_cache *nl_cli_rule_alloc_cache(struct nl_sock *); extern void nl_cli_rule_parse_family(struct rtnl_rule *, char *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/tc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/tc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/cli/tc.h CLI Traffic Control Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */ @@ -14,6 +8,10 @@ #include <netlink/route/tc.h> +#ifdef __cplusplus +extern "C" { +#endif + struct rtnl_tc_ops; extern void nl_cli_tc_parse_dev(struct rtnl_tc *, struct nl_cache *, char *); @@ -38,4 +36,8 @@ extern void nl_cli_tc_register(struct nl_cli_tc_module *); extern void nl_cli_tc_unregister(struct nl_cli_tc_module *); +#ifdef __cplusplus +} +#endif + #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/cli/utils.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/cli/utils.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/utils.h Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/data.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/data.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/data.h Abstract Data - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/errno.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/errno.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/errno.h Error Numbers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/fib_lookup/lookup.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/fib_lookup/lookup.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/fib_lookup/fib_lookup.h FIB Lookup - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/fib_lookup/request.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/fib_lookup/request.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/fib_lookup/request.h FIB Lookup Request - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/genl/ctrl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/genl/ctrl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/genl/ctrl.h Generic Netlink Controller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/genl/family.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/genl/family.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/genl/family.h Generic Netlink Family - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/genl/genl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/genl/genl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/genl/genl.h Generic Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/genl/mngt.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/genl/mngt.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/genl/mngt.h Generic Netlink Management - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/handlers.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/handlers.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/handlers.c default netlink message handlers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */ @@ -39,7 +33,7 @@ * nl_recvmsgs() callback for message processing customization * @ingroup cb * @arg msg netlink message being processed - * @arg arg argument passwd on through caller + * @arg arg argument passed on through caller */ typedef int (*nl_recvmsg_msg_cb_t)(struct nl_msg *msg, void *arg); @@ -60,7 +54,7 @@ * @ingroup cb */ enum nl_cb_action { - /** Proceed with wathever would come next */ + /** Proceed with whatever would come next */ NL_OK, /** Skip this message */ NL_SKIP, @@ -99,7 +93,7 @@ NL_CB_OVERRUN, /** Message wants to be skipped */ NL_CB_SKIPPED, - /** Message is an acknowledge */ + /** Message is an acknowledgement */ NL_CB_ACK, /** Called for every message received */ NL_CB_MSG_IN,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/hashtable.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/hashtable.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/hashtable.h Netlink hashtable Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Cumulus Networks, Inc */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/idiag/idiagnl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/idiag/idiagnl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/idiag/idiagnl.h Inetdiag Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/idiag/meminfo.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/idiag/meminfo.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/idiag/meminfo.h Inetdiag Netlink Memory Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/idiag/msg.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/idiag/msg.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/idiag/msg.h Inetdiag Netlink Message - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/idiag/req.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/idiag/req.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/idiag/req.h Inetdiag Netlink Request - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/idiag/vegasinfo.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/idiag/vegasinfo.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/idiag/vegasinfo.h Inetdiag Netlink TCP Vegas Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/list.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/list.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/list.h Netlink List Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/msg.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/msg.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/msg.c Netlink Messages Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/ct.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/ct.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/ct.h Conntrack - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -18,6 +12,7 @@ #include <netlink/addr.h> #include <netlink/cache.h> #include <netlink/msg.h> +#include <netlink/attr.h> #ifdef __cplusplus extern "C" { @@ -37,6 +32,7 @@ extern int nfnlmsg_ct_group(struct nlmsghdr *); extern int nfnlmsg_ct_parse(struct nlmsghdr *, struct nfnl_ct **); +extern int nfnlmsg_ct_parse_nested(struct nlattr *, struct nfnl_ct **); extern void nfnl_ct_get(struct nfnl_ct *); extern void nfnl_ct_put(struct nfnl_ct *);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/exp.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/exp.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/exp.h Conntrack Expectation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/log.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/log.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/log.h Netfilter Log - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -36,6 +30,7 @@ enum nfnl_log_flags { NFNL_LOG_FLAG_SEQ = 0x1, NFNL_LOG_FLAG_SEQ_GLOBAL = 0x2, + NFNL_LOG_FLAG_CONNTRACK = 0x4, }; /* General */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/log_msg.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/log_msg.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/log_msg.h Netfilter Log Message - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -23,6 +17,7 @@ struct nlmsghdr; struct nfnl_log_msg; +struct nfnl_ct; extern struct nl_object_ops log_msg_obj_ops; @@ -90,6 +85,36 @@ extern int nfnl_log_msg_test_seq_global(const struct nfnl_log_msg *); extern uint32_t nfnl_log_msg_get_seq_global(const struct nfnl_log_msg *); +extern void nfnl_log_msg_set_hwtype(struct nfnl_log_msg *, uint16_t); +extern int nfnl_log_msg_test_hwtype(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_hwtype(const struct nfnl_log_msg *); + +extern void nfnl_log_msg_set_hwlen(struct nfnl_log_msg *, uint16_t); +extern int nfnl_log_msg_test_hwlen(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_hwlen(const struct nfnl_log_msg *); + +extern int nfnl_log_msg_set_hwheader(struct nfnl_log_msg *, void *, int); +extern int nfnl_log_msg_test_hwheader(const struct nfnl_log_msg *); +extern const void * nfnl_log_msg_get_hwheader(const struct nfnl_log_msg *, int *); + +extern void nfnl_log_msg_set_vlan_proto(struct nfnl_log_msg *, uint16_t); +extern int nfnl_log_msg_test_vlan_proto(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_vlan_proto(const struct nfnl_log_msg *); +extern void nfnl_log_msg_set_vlan_tag(struct nfnl_log_msg *, uint16_t); +extern int nfnl_log_msg_test_vlan_tag(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_vlan_tag(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_vlan_id(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_vlan_cfi(const struct nfnl_log_msg *); +extern uint16_t nfnl_log_msg_get_vlan_prio(const struct nfnl_log_msg *); + +extern void nfnl_log_msg_set_ct_info(struct nfnl_log_msg *, uint32_t); +extern int nfnl_log_msg_test_ct_info(const struct nfnl_log_msg *); +extern uint32_t nfnl_log_msg_get_ct_info(const struct nfnl_log_msg *); + +extern void nfnl_log_msg_set_ct(struct nfnl_log_msg *, struct nfnl_ct *); +extern int nfnl_log_msg_test_ct(const struct nfnl_log_msg *); +extern struct nfnl_ct * nfnl_log_msg_get_ct(const struct nfnl_log_msg *); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/netfilter.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/netfilter.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/netfilter.h Netfilter generic functions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/nfnl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/nfnl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/nfnl/nfnl.h Netfilter Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/queue.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/queue.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/queue.h Netfilter Queue - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netfilter/queue_msg.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netfilter/queue_msg.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netfilter/queue_msg.h Netfilter Queue Messages - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netlink-compat.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netlink-compat.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netlink-compat.h Netlink Compatability - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/netlink.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/netlink.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/netlink.h Netlink Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/object-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/object-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/object-api.h Object API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/object.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/object.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/object.c Generic Cacheable Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/act/gact.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/act/gact.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/act/gact.h gact action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Sushma Sitaram <sushma.sitaram@intel.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/act/mirred.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/act/mirred.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/mirred.h mirred action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/act/nat.h
Added
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2016 Magnus Öberg <magnus.oberg@westermo.se> + */ + +#ifndef NETLINK_NAT_H_ +#define NETLINK_NAT_H_ + +#include <netlink/netlink.h> +#include <netlink/cache.h> +#include <netlink/route/action.h> +#include <linux/tc_act/tc_nat.h> + +#include <netinet/in.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int rtnl_nat_set_old_addr(struct rtnl_act *act, in_addr_t addr); +extern int rtnl_nat_get_old_addr(struct rtnl_act *act, in_addr_t *addr); +extern int rtnl_nat_set_new_addr(struct rtnl_act *act, in_addr_t addr); +extern int rtnl_nat_get_new_addr(struct rtnl_act *act, in_addr_t *addr); +extern int rtnl_nat_set_mask(struct rtnl_act *act, in_addr_t bitmask); +extern int rtnl_nat_get_mask(struct rtnl_act *act, in_addr_t *bitmask); +extern int rtnl_nat_set_flags(struct rtnl_act *act, uint32_t flags); +extern int rtnl_nat_get_flags(struct rtnl_act *act, uint32_t *flags); +extern int rtnl_nat_set_action(struct rtnl_act *act, int action); +extern int rtnl_nat_get_action(struct rtnl_act *act, int *action); + +#ifdef __cplusplus +} +#endif + +#endif /* NETLINK_NAT_H */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/act/skbedit.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/act/skbedit.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/act/skbedit.h skbedit action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/act/vlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/act/vlan.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/act/vlan.h vlan action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/action.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/action.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/action.h Actions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/addr.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/addr.h
Changed
@@ -1,14 +1,8 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/addr.c rtnetlink addr layer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> - * Copyright (c) 2003-2006 Baruch Even <baruch@ev-en.org>, - * Mediatrix Telecom, inc. <ericb@mediatrix.com> + * Copyright (c) 2003-2006 Baruch Even <baruch@ev-en.org> + * Copyright (c) 2003-2006 Mediatrix Telecom, inc. <ericb@mediatrix.com> */ #ifndef NETADDR_ADDR_H_
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/class.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/class.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/class.h Traffic Classes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/classifier.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/classifier.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/classifier.h Classifiers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -26,6 +20,10 @@ extern int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t, struct nl_cache **); +extern struct rtnl_cls *rtnl_cls_find_by_handle(struct nl_cache *cache, int ifindex, + uint32_t parent, uint32_t handle); +extern struct rtnl_cls *rtnl_cls_find_by_prio(struct nl_cache *cache, int ifindex, + uint32_t parent, uint16_t prio); extern void rtnl_cls_cache_set_tc_params(struct nl_cache *, int, uint32_t);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/basic.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/basic.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/basic.h Basic Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/cgroup.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/cgroup.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/cgroup.h Control Groups Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2009-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/ematch.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/ematch.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/ematch.h Extended Matches - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/ematch/cmp.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/ematch/cmp.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/ematch/cmp.h Simple Comparison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/ematch/meta.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/ematch/meta.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/ematch/meta.h Metadata Match - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/ematch/nbyte.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/ematch/nbyte.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/ematch/nbyte.h N-Byte Comparison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/ematch/text.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/ematch/text.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/ematch/text.h Text Search - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/flower.h
Added
@@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se> + */ + +#ifndef NETLINK_FLOWER_H_ +#define NETLINK_FLOWER_H_ + +#include <netlink/netlink.h> +#include <netlink/cache.h> +#include <netlink/route/classifier.h> +#include <netlink/route/action.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int rtnl_flower_set_proto(struct rtnl_cls *cls, uint16_t); +extern int rtnl_flower_get_proto(struct rtnl_cls *cls, uint16_t *); + +extern int rtnl_flower_set_vlan_id(struct rtnl_cls *, uint16_t); +extern int rtnl_flower_get_vlan_id(struct rtnl_cls *, uint16_t *); + +extern int rtnl_flower_set_vlan_prio(struct rtnl_cls *, uint8_t); +extern int rtnl_flower_get_vlan_prio(struct rtnl_cls *, uint8_t *); + +extern int rtnl_flower_set_vlan_ethtype(struct rtnl_cls *, uint16_t); + +extern int rtnl_flower_set_dst_mac(struct rtnl_cls *, unsigned char *, + unsigned char *); +extern int rtnl_flower_get_dst_mac(struct rtnl_cls *, unsigned char *, + unsigned char *); + +extern int rtnl_flower_set_src_mac(struct rtnl_cls *, unsigned char *, + unsigned char *); +extern int rtnl_flower_get_src_mac(struct rtnl_cls *, unsigned char *, + unsigned char *); + +extern int rtnl_flower_set_ip_dscp(struct rtnl_cls *, uint8_t, uint8_t); +extern int rtnl_flower_get_ip_dscp(struct rtnl_cls *, uint8_t *, uint8_t *); + +extern int rtnl_flower_set_ipv4_src(struct rtnl_cls *, in_addr_t, in_addr_t); +extern int rtnl_flower_get_ipv4_src(struct rtnl_cls *, in_addr_t *, + in_addr_t *); +extern int rtnl_flower_set_ipv4_dst(struct rtnl_cls *, in_addr_t, in_addr_t); +extern int rtnl_flower_get_ipv4_dst(struct rtnl_cls *, in_addr_t *, + in_addr_t *); + +extern int rtnl_flower_set_flags(struct rtnl_cls *, int); + +extern int rtnl_flower_append_action(struct rtnl_cls *, struct rtnl_act *); +extern int rtnl_flower_del_action(struct rtnl_cls *, struct rtnl_act *); +extern struct rtnl_act* rtnl_flower_get_action(struct rtnl_cls *); + +#ifdef __cplusplus +} +#endif + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/fw.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/fw.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/fw.h fw classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2006 Petr Gotthard <petr.gotthard@siemens.com> * Copyright (c) 2006 Siemens AG Oesterreich
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/matchall.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/matchall.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/matchall.h matchall classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2017 Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/police.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/police.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/police.h Policer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/cls/u32.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/cls/u32.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/cls/u32.h u32 classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link.h Links (Interfaces) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -35,70 +29,71 @@ * @ingroup link */ typedef enum { - RTNL_LINK_RX_PACKETS, /*!< Packets received */ - RTNL_LINK_TX_PACKETS, /*!< Packets sent */ - RTNL_LINK_RX_BYTES, /*!< Bytes received */ - RTNL_LINK_TX_BYTES, /*!< Bytes sent */ - RTNL_LINK_RX_ERRORS, /*!< Receive errors */ - RTNL_LINK_TX_ERRORS, /*!< Send errors */ - RTNL_LINK_RX_DROPPED, /*!< Received packets dropped */ - RTNL_LINK_TX_DROPPED, /*!< Packets dropped during transmit */ - RTNL_LINK_RX_COMPRESSED, /*!< Compressed packets received */ - RTNL_LINK_TX_COMPRESSED, /*!< Compressed packets sent */ - RTNL_LINK_RX_FIFO_ERR, /*!< Receive FIFO errors */ - RTNL_LINK_TX_FIFO_ERR, /*!< Send FIFO errors */ - RTNL_LINK_RX_LEN_ERR, /*!< Length errors */ - RTNL_LINK_RX_OVER_ERR, /*!< Over errors */ - RTNL_LINK_RX_CRC_ERR, /*!< CRC errors */ - RTNL_LINK_RX_FRAME_ERR, /*!< Frame errors */ - RTNL_LINK_RX_MISSED_ERR, /*!< Missed errors */ - RTNL_LINK_TX_ABORT_ERR, /*!< Aborted errors */ - RTNL_LINK_TX_CARRIER_ERR, /*!< Carrier errors */ - RTNL_LINK_TX_HBEAT_ERR, /*!< Heartbeat errors */ - RTNL_LINK_TX_WIN_ERR, /*!< Window errors */ - RTNL_LINK_COLLISIONS, /*!< Send collisions */ - RTNL_LINK_MULTICAST, /*!< Multicast */ - RTNL_LINK_IP6_INPKTS, /*!< IPv6 SNMP InReceives */ - RTNL_LINK_IP6_INHDRERRORS, /*!< IPv6 SNMP InHdrErrors */ - RTNL_LINK_IP6_INTOOBIGERRORS, /*!< IPv6 SNMP InTooBigErrors */ - RTNL_LINK_IP6_INNOROUTES, /*!< IPv6 SNMP InNoRoutes */ - RTNL_LINK_IP6_INADDRERRORS, /*!< IPv6 SNMP InAddrErrors */ - RTNL_LINK_IP6_INUNKNOWNPROTOS, /*!< IPv6 SNMP InUnknownProtos */ - RTNL_LINK_IP6_INTRUNCATEDPKTS, /*!< IPv6 SNMP InTruncatedPkts */ - RTNL_LINK_IP6_INDISCARDS, /*!< IPv6 SNMP InDiscards */ - RTNL_LINK_IP6_INDELIVERS, /*!< IPv6 SNMP InDelivers */ - RTNL_LINK_IP6_OUTFORWDATAGRAMS, /*!< IPv6 SNMP OutForwDatagrams */ - RTNL_LINK_IP6_OUTPKTS, /*!< IPv6 SNMP OutRequests */ - RTNL_LINK_IP6_OUTDISCARDS, /*!< IPv6 SNMP OutDiscards */ - RTNL_LINK_IP6_OUTNOROUTES, /*!< IPv6 SNMP OutNoRoutes */ - RTNL_LINK_IP6_REASMTIMEOUT, /*!< IPv6 SNMP ReasmTimeout */ - RTNL_LINK_IP6_REASMREQDS, /*!< IPv6 SNMP ReasmReqds */ - RTNL_LINK_IP6_REASMOKS, /*!< IPv6 SNMP ReasmOKs */ - RTNL_LINK_IP6_REASMFAILS, /*!< IPv6 SNMP ReasmFails */ - RTNL_LINK_IP6_FRAGOKS, /*!< IPv6 SNMP FragOKs */ - RTNL_LINK_IP6_FRAGFAILS, /*!< IPv6 SNMP FragFails */ - RTNL_LINK_IP6_FRAGCREATES, /*!< IPv6 SNMP FragCreates */ - RTNL_LINK_IP6_INMCASTPKTS, /*!< IPv6 SNMP InMcastPkts */ - RTNL_LINK_IP6_OUTMCASTPKTS, /*!< IPv6 SNMP OutMcastPkts */ - RTNL_LINK_IP6_INBCASTPKTS, /*!< IPv6 SNMP InBcastPkts */ - RTNL_LINK_IP6_OUTBCASTPKTS, /*!< IPv6 SNMP OutBcastPkts */ - RTNL_LINK_IP6_INOCTETS, /*!< IPv6 SNMP InOctets */ - RTNL_LINK_IP6_OUTOCTETS, /*!< IPv6 SNMP OutOctets */ - RTNL_LINK_IP6_INMCASTOCTETS, /*!< IPv6 SNMP InMcastOctets */ - RTNL_LINK_IP6_OUTMCASTOCTETS, /*!< IPv6 SNMP OutMcastOctets */ - RTNL_LINK_IP6_INBCASTOCTETS, /*!< IPv6 SNMP InBcastOctets */ - RTNL_LINK_IP6_OUTBCASTOCTETS, /*!< IPv6 SNMP OutBcastOctets */ - RTNL_LINK_ICMP6_INMSGS, /*!< ICMPv6 SNMP InMsgs */ - RTNL_LINK_ICMP6_INERRORS, /*!< ICMPv6 SNMP InErrors */ - RTNL_LINK_ICMP6_OUTMSGS, /*!< ICMPv6 SNMP OutMsgs */ - RTNL_LINK_ICMP6_OUTERRORS, /*!< ICMPv6 SNMP OutErrors */ - RTNL_LINK_ICMP6_CSUMERRORS, /*!< ICMPv6 SNMP InCsumErrors */ - RTNL_LINK_IP6_CSUMERRORS, /*!< IPv6 SNMP InCsumErrors */ - RTNL_LINK_IP6_NOECTPKTS, /*!< IPv6 SNMP InNoECTPkts */ - RTNL_LINK_IP6_ECT1PKTS, /*!< IPv6 SNMP InECT1Pkts */ - RTNL_LINK_IP6_ECT0PKTS, /*!< IPv6 SNMP InECT0Pkts */ - RTNL_LINK_IP6_CEPKTS, /*!< IPv6 SNMP InCEPkts */ - RTNL_LINK_RX_NOHANDLER, /*!< Received packets dropped on inactive device */ + RTNL_LINK_RX_PACKETS, /*!< Packets received */ + RTNL_LINK_TX_PACKETS, /*!< Packets sent */ + RTNL_LINK_RX_BYTES, /*!< Bytes received */ + RTNL_LINK_TX_BYTES, /*!< Bytes sent */ + RTNL_LINK_RX_ERRORS, /*!< Receive errors */ + RTNL_LINK_TX_ERRORS, /*!< Send errors */ + RTNL_LINK_RX_DROPPED, /*!< Received packets dropped */ + RTNL_LINK_TX_DROPPED, /*!< Packets dropped during transmit */ + RTNL_LINK_RX_COMPRESSED, /*!< Compressed packets received */ + RTNL_LINK_TX_COMPRESSED, /*!< Compressed packets sent */ + RTNL_LINK_RX_FIFO_ERR, /*!< Receive FIFO errors */ + RTNL_LINK_TX_FIFO_ERR, /*!< Send FIFO errors */ + RTNL_LINK_RX_LEN_ERR, /*!< Length errors */ + RTNL_LINK_RX_OVER_ERR, /*!< Over errors */ + RTNL_LINK_RX_CRC_ERR, /*!< CRC errors */ + RTNL_LINK_RX_FRAME_ERR, /*!< Frame errors */ + RTNL_LINK_RX_MISSED_ERR, /*!< Missed errors */ + RTNL_LINK_TX_ABORT_ERR, /*!< Aborted errors */ + RTNL_LINK_TX_CARRIER_ERR, /*!< Carrier errors */ + RTNL_LINK_TX_HBEAT_ERR, /*!< Heartbeat errors */ + RTNL_LINK_TX_WIN_ERR, /*!< Window errors */ + RTNL_LINK_COLLISIONS, /*!< Send collisions */ + RTNL_LINK_MULTICAST, /*!< Multicast */ + RTNL_LINK_IP6_INPKTS, /*!< IPv6 SNMP InReceives */ + RTNL_LINK_IP6_INHDRERRORS, /*!< IPv6 SNMP InHdrErrors */ + RTNL_LINK_IP6_INTOOBIGERRORS, /*!< IPv6 SNMP InTooBigErrors */ + RTNL_LINK_IP6_INNOROUTES, /*!< IPv6 SNMP InNoRoutes */ + RTNL_LINK_IP6_INADDRERRORS, /*!< IPv6 SNMP InAddrErrors */ + RTNL_LINK_IP6_INUNKNOWNPROTOS, /*!< IPv6 SNMP InUnknownProtos */ + RTNL_LINK_IP6_INTRUNCATEDPKTS, /*!< IPv6 SNMP InTruncatedPkts */ + RTNL_LINK_IP6_INDISCARDS, /*!< IPv6 SNMP InDiscards */ + RTNL_LINK_IP6_INDELIVERS, /*!< IPv6 SNMP InDelivers */ + RTNL_LINK_IP6_OUTFORWDATAGRAMS, /*!< IPv6 SNMP OutForwDatagrams */ + RTNL_LINK_IP6_OUTPKTS, /*!< IPv6 SNMP OutRequests */ + RTNL_LINK_IP6_OUTDISCARDS, /*!< IPv6 SNMP OutDiscards */ + RTNL_LINK_IP6_OUTNOROUTES, /*!< IPv6 SNMP OutNoRoutes */ + RTNL_LINK_IP6_REASMTIMEOUT, /*!< IPv6 SNMP ReasmTimeout */ + RTNL_LINK_IP6_REASMREQDS, /*!< IPv6 SNMP ReasmReqds */ + RTNL_LINK_IP6_REASMOKS, /*!< IPv6 SNMP ReasmOKs */ + RTNL_LINK_IP6_REASMFAILS, /*!< IPv6 SNMP ReasmFails */ + RTNL_LINK_IP6_FRAGOKS, /*!< IPv6 SNMP FragOKs */ + RTNL_LINK_IP6_FRAGFAILS, /*!< IPv6 SNMP FragFails */ + RTNL_LINK_IP6_FRAGCREATES, /*!< IPv6 SNMP FragCreates */ + RTNL_LINK_IP6_INMCASTPKTS, /*!< IPv6 SNMP InMcastPkts */ + RTNL_LINK_IP6_OUTMCASTPKTS, /*!< IPv6 SNMP OutMcastPkts */ + RTNL_LINK_IP6_INBCASTPKTS, /*!< IPv6 SNMP InBcastPkts */ + RTNL_LINK_IP6_OUTBCASTPKTS, /*!< IPv6 SNMP OutBcastPkts */ + RTNL_LINK_IP6_INOCTETS, /*!< IPv6 SNMP InOctets */ + RTNL_LINK_IP6_OUTOCTETS, /*!< IPv6 SNMP OutOctets */ + RTNL_LINK_IP6_INMCASTOCTETS, /*!< IPv6 SNMP InMcastOctets */ + RTNL_LINK_IP6_OUTMCASTOCTETS, /*!< IPv6 SNMP OutMcastOctets */ + RTNL_LINK_IP6_INBCASTOCTETS, /*!< IPv6 SNMP InBcastOctets */ + RTNL_LINK_IP6_OUTBCASTOCTETS, /*!< IPv6 SNMP OutBcastOctets */ + RTNL_LINK_ICMP6_INMSGS, /*!< ICMPv6 SNMP InMsgs */ + RTNL_LINK_ICMP6_INERRORS, /*!< ICMPv6 SNMP InErrors */ + RTNL_LINK_ICMP6_OUTMSGS, /*!< ICMPv6 SNMP OutMsgs */ + RTNL_LINK_ICMP6_OUTERRORS, /*!< ICMPv6 SNMP OutErrors */ + RTNL_LINK_ICMP6_CSUMERRORS, /*!< ICMPv6 SNMP InCsumErrors */ + RTNL_LINK_IP6_CSUMERRORS, /*!< IPv6 SNMP InCsumErrors */ + RTNL_LINK_IP6_NOECTPKTS, /*!< IPv6 SNMP InNoECTPkts */ + RTNL_LINK_IP6_ECT1PKTS, /*!< IPv6 SNMP InECT1Pkts */ + RTNL_LINK_IP6_ECT0PKTS, /*!< IPv6 SNMP InECT0Pkts */ + RTNL_LINK_IP6_CEPKTS, /*!< IPv6 SNMP InCEPkts */ + RTNL_LINK_RX_NOHANDLER, /*!< Received packets dropped on inactive device */ + RTNL_LINK_REASM_OVERLAPS, /*!< SNMP ReasmOverlaps */ __RTNL_LINK_STATS_MAX, } rtnl_link_stat_id_t; @@ -107,156 +102,156 @@ extern struct nla_policy rtln_link_policy; extern struct rtnl_link *rtnl_link_alloc(void); -extern void rtnl_link_put(struct rtnl_link *); +extern void rtnl_link_put(struct rtnl_link *); -extern int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **); -extern int rtnl_link_alloc_cache_flags(struct nl_sock *, int, - struct nl_cache **, - unsigned int flags); +extern int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **); +extern int rtnl_link_alloc_cache_flags(struct nl_sock *, int, + struct nl_cache **, + unsigned int flags); extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int); extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *); -extern int rtnl_link_build_add_request(struct rtnl_link *, int, - struct nl_msg **); -extern int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int); -extern int rtnl_link_build_change_request(struct rtnl_link *, - struct rtnl_link *, int, - struct nl_msg **); -extern int rtnl_link_change(struct nl_sock *, struct rtnl_link *, - struct rtnl_link *, int); +extern int rtnl_link_build_add_request(struct rtnl_link *, int, + struct nl_msg **); +extern int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int); +extern int rtnl_link_build_change_request(struct rtnl_link *, + struct rtnl_link *, int, + struct nl_msg **); +extern int rtnl_link_change(struct nl_sock *, struct rtnl_link *, + struct rtnl_link *, int); -extern int rtnl_link_build_delete_request(const struct rtnl_link *, - struct nl_msg **); -extern int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *); -extern int rtnl_link_build_get_request(int, const char *, - struct nl_msg **); -extern int rtnl_link_get_kernel(struct nl_sock *, int, const char *, - struct rtnl_link **); +extern int rtnl_link_build_delete_request(const struct rtnl_link *, + struct nl_msg **); +extern int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *); +extern int rtnl_link_build_get_request(int, const char *, + struct nl_msg **); +extern int rtnl_link_get_kernel(struct nl_sock *, int, const char *, + struct rtnl_link **);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/api.h Link Modules API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/bonding.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/bonding.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/bonding.h Bonding Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/bridge.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/bridge.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/bridge.h Bridge - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/can.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/can.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/can.h CAN interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Benedikt Spranger <b.spranger@linutronix.de> */ @@ -38,11 +32,11 @@ extern int rtnl_link_can_berr(struct rtnl_link *, struct can_berr_counter *); extern int rtnl_link_can_get_bt_const(struct rtnl_link *, - struct can_bittiming_const *); + struct can_bittiming_const *); extern int rtnl_link_can_get_bittiming(struct rtnl_link *, - struct can_bittiming *); + struct can_bittiming *); extern int rtnl_link_can_set_bittiming(struct rtnl_link *, - struct can_bittiming *); + const struct can_bittiming *); extern int rtnl_link_can_get_bitrate(struct rtnl_link *, uint32_t *); extern int rtnl_link_can_set_bitrate(struct rtnl_link *, uint32_t); @@ -57,6 +51,15 @@ extern int rtnl_link_can_set_ctrlmode(struct rtnl_link *, uint32_t); extern int rtnl_link_can_unset_ctrlmode(struct rtnl_link *, uint32_t); +extern int rtnl_link_can_get_data_bittiming_const(struct rtnl_link *, + struct can_bittiming_const *); +extern int rtnl_link_can_set_data_bittiming_const(struct rtnl_link *, + const struct can_bittiming_const *); +extern int rtnl_link_can_get_data_bittiming(struct rtnl_link *, + struct can_bittiming *); +extern int rtnl_link_can_set_data_bittiming(struct rtnl_link *, + const struct can_bittiming *); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/geneve.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/geneve.h
Changed
@@ -1,10 +1,4 @@ -/* - * netlink/route/link/geneve.h GENEVE interface - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - */ +/* SPDX-License-Identifier: LGPL-2.1-only */ #ifndef NETLINK_LINK_GENEVE_H_ #define NETLINK_LINK_GENEVE_H_
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/inet.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/inet.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/inet.h INET Link Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/inet6.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/inet6.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/inet6.h INET6 Link Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Dan Williams <dcbw@redhat.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/info-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/info-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/info-api.h Link Modules API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ip6gre.h
Added
@@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef NETLINK_LINK_IP6GRE_H_ +#define NETLINK_LINK_IP6GRE_H_ + +#include <netlink/netlink.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + + extern int rtnl_link_is_ip6gre(struct rtnl_link *link); + + extern struct rtnl_link *rtnl_link_ip6gre_alloc(void); + extern int rtnl_link_ip6gre_add(struct nl_sock *sk, const char *name); + + extern int rtnl_link_ip6gre_set_link(struct rtnl_link *link, uint32_t index); + extern int rtnl_link_ip6gre_get_link(struct rtnl_link *link, uint32_t *index); + + extern int rtnl_link_ip6gre_set_iflags(struct rtnl_link *link, uint16_t iflags); + extern int rtnl_link_ip6gre_get_iflags(struct rtnl_link *link, uint16_t *iflags); + + extern int rtnl_link_ip6gre_set_oflags(struct rtnl_link *link, uint16_t oflags); + extern int rtnl_link_ip6gre_get_oflags(struct rtnl_link *link, uint16_t *oflags); + + extern int rtnl_link_ip6gre_set_ikey(struct rtnl_link *link, uint32_t ikey); + extern int rtnl_link_ip6gre_get_ikey(struct rtnl_link *link, uint32_t *ikey); + + extern int rtnl_link_ip6gre_set_okey(struct rtnl_link *link, uint32_t okey); + extern int rtnl_link_ip6gre_get_okey(struct rtnl_link *link, uint32_t *okey); + + extern int rtnl_link_ip6gre_set_local(struct rtnl_link *link, struct in6_addr *local); + extern int rtnl_link_ip6gre_get_local(struct rtnl_link *link, struct in6_addr *local); + + extern int rtnl_link_ip6gre_set_remote(struct rtnl_link *link, struct in6_addr *remote); + extern int rtnl_link_ip6gre_get_remote(struct rtnl_link *link, struct in6_addr *remote); + + extern int rtnl_link_ip6gre_set_ttl(struct rtnl_link *link, uint8_t ttl); + extern int rtnl_link_ip6gre_get_ttl(struct rtnl_link *link, uint8_t *ttl); + + extern int rtnl_link_ip6gre_set_encaplimit(struct rtnl_link *link, uint8_t encaplimit); + extern int rtnl_link_ip6gre_get_encaplimit(struct rtnl_link *link, uint8_t *encaplimit); + + extern int rtnl_link_ip6gre_set_flowinfo(struct rtnl_link *link, uint32_t flowinfo); + extern int rtnl_link_ip6gre_get_flowinfo(struct rtnl_link *link, uint32_t *flowinfo); + + extern int rtnl_link_ip6gre_set_flags(struct rtnl_link *link, uint32_t flags); + extern int rtnl_link_ip6gre_get_flags(struct rtnl_link *link, uint32_t *flags); + + extern int rtnl_link_ip6gre_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ip6gre_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + +#ifdef __cplusplus +} +#endif + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ip6tnl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ip6tnl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ip6tnl.h IP6TNL interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -51,6 +45,9 @@ extern int rtnl_link_ip6_tnl_set_proto(struct rtnl_link *link, uint8_t proto); extern uint8_t rtnl_link_ip6_tnl_get_proto(struct rtnl_link *link); + extern int rtnl_link_ip6_tnl_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ip6_tnl_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ip6vti.h
Added
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef NETLINK_LINK_IP6VTI_H_ +#define NETLINK_LINK_IP6VTI_H_ + +#include <netlink/netlink.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + + int rtnl_link_is_ip6vti(struct rtnl_link *link); + + extern struct rtnl_link *rtnl_link_ip6vti_alloc(void); + extern int rtnl_link_ip6vti_add(struct nl_sock *sk, const char *name); + + extern int rtnl_link_ip6vti_set_link(struct rtnl_link *link, uint32_t index); + extern int rtnl_link_ip6vti_get_link(struct rtnl_link *link, uint32_t *index); + + extern int rtnl_link_ip6vti_set_ikey(struct rtnl_link *link, uint32_t ikey); + extern int rtnl_link_ip6vti_get_ikey(struct rtnl_link *link, uint32_t *ikey); + + extern int rtnl_link_ip6vti_set_okey(struct rtnl_link *link, uint32_t okey); + extern int rtnl_link_ip6vti_get_okey(struct rtnl_link *link, uint32_t *okey); + + extern int rtnl_link_ip6vti_set_local(struct rtnl_link *link, struct in6_addr *local); + extern int rtnl_link_ip6vti_get_local(struct rtnl_link *link, struct in6_addr *remote); + + extern int rtnl_link_ip6vti_set_remote(struct rtnl_link *link, struct in6_addr *remote); + extern int rtnl_link_ip6vti_get_remote(struct rtnl_link *link, struct in6_addr *remote); + + extern int rtnl_link_ip6vti_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ip6vti_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + +#ifdef __cplusplus +} +#endif + +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ipgre.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ipgre.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ip_gre.h IPGRE interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -57,6 +51,9 @@ extern int rtnl_link_ipgre_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc); extern uint8_t rtnl_link_ipgre_get_pmtudisc(struct rtnl_link *link); + extern int rtnl_link_ipgre_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ipgre_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ipip.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ipip.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ipip.h IPIP interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -41,6 +35,9 @@ extern int rtnl_link_ipip_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc); extern uint8_t rtnl_link_ipip_get_pmtudisc(struct rtnl_link *link); + extern int rtnl_link_ipip_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ipip_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ipvlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ipvlan.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ipvlan.h IPVLAN interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cong Wang <cwang@twopensource.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ipvti.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ipvti.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ipvti.h IPVTI interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -38,6 +32,9 @@ extern int rtnl_link_ipvti_set_remote(struct rtnl_link *link, uint32_t addr); extern uint32_t rtnl_link_ipvti_get_remote(struct rtnl_link *link); + extern int rtnl_link_ipvti_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_ipvti_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/macsec.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/macsec.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/macsec.h MACsec Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Sabrina Dubroca <sd@queasysnail.net> */ @@ -43,6 +37,9 @@ int rtnl_link_macsec_set_encrypt(struct rtnl_link *, uint8_t); int rtnl_link_macsec_get_encrypt(struct rtnl_link *, uint8_t *); +int rtnl_link_macsec_set_offload(struct rtnl_link *, uint8_t); +int rtnl_link_macsec_get_offload(struct rtnl_link *, uint8_t *); + int rtnl_link_macsec_set_encoding_sa(struct rtnl_link *, uint8_t); int rtnl_link_macsec_get_encoding_sa(struct rtnl_link *, uint8_t *);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/macvlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/macvlan.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/macvlan.h MACVLAN interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Michael Braun <michael-dev@fami-braun.de> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/macvtap.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/macvtap.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/macvtap.h MACVTAP interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Beniamino Galvani <bgalvani@redhat.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/ppp.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/ppp.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/ppp.h PPP Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Jonas Johansson <jonasj76@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/sit.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/sit.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/sit.h SIT interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -60,6 +54,9 @@ int rtnl_link_sit_set_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t prefix); int rtnl_link_sit_get_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t *prefix); + extern int rtnl_link_sit_set_fwmark(struct rtnl_link *link, uint32_t fwmark); + extern int rtnl_link_sit_get_fwmark(struct rtnl_link *link, uint32_t *fwmark); + #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/sriov.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/sriov.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * include/netlink/route/link/sriov.h SRIOV VF Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Intel Corp. All rights reserved. * Copyright (c) 2016 Jef Oliver <jef.oliver@intel.com> */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/team.h
Added
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2015 Jonas Johansson <jonasj76@gmail.com> + */ + +#ifndef NETLINK_LINK_TEAM_H_ +#define NETLINK_LINK_TEAM_H_ + +#include <netlink/netlink.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern struct rtnl_link *rtnl_link_team_alloc(void); + +extern int rtnl_link_team_add(struct nl_sock *, const char *, + struct rtnl_link *); + +#ifdef __cplusplus +} +#endif + +#endif +
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/veth.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/veth.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/veth.h VETH interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/vlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/vlan.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/vlan.h VLAN interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/vrf.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/vrf.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/vrf.h VRF interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cumulus Networks. All rights reserved. * Copyright (c) 2015 David Ahern <dsa@cumulusnetworks.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/vxlan.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/vxlan.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/vxlan.h VXLAN interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Yasunobu Chiba <yasu@dsl.gr.jp> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/link/xfrmi.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/link/xfrmi.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/link/xfrmi.h XFRMI interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2019 Eyal Birger <eyal.birger@gmail.com> * * Based on netlink/route/link/ipvti.h
View file
_service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/mdb.h
Added
@@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef NETLINK_MDB_H_ +#define NETLINK_MDB_H_ + +#include <netlink/netlink.h> +#include <netlink/cache.h> +#include <netlink/route/link.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct rtnl_mdb; +struct rtnl_mdb_entry; + +struct rtnl_mdb *rtnl_mdb_alloc(void); +void rtnl_mdb_put(struct rtnl_mdb *mdb); + +int rtnl_mdb_alloc_cache(struct nl_sock *sk, struct nl_cache **result); +int rtnl_mdb_alloc_cache_flags(struct nl_sock *sock, + struct nl_cache **result, + unsigned int flags); + +uint32_t rtnl_mdb_get_ifindex(struct rtnl_mdb *mdb); +void rtnl_mdb_add_entry(struct rtnl_mdb *mdb, + struct rtnl_mdb_entry *_entry); + +void rtnl_mdb_foreach_entry(struct rtnl_mdb *mdb, + void (*cb)(struct rtnl_mdb_entry *, void *), + void *arg); + +int rtnl_mdb_entry_get_ifindex(struct rtnl_mdb_entry *mdb_entry); +int rtnl_mdb_entry_get_vid(struct rtnl_mdb_entry *mdb_entry); +int rtnl_mdb_entry_get_state(struct rtnl_mdb_entry *mdb_entry); +struct nl_addr *rtnl_mdb_entry_get_addr(struct rtnl_mdb_entry + *mdb_entry); +uint16_t rtnl_mdb_entry_get_proto(struct rtnl_mdb_entry *mdb_entry); +#ifdef __cplusplus +} +#endif +#endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/neighbour.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/neighbour.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/neighbour.h Neighbours - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/neightbl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/neightbl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/neightbl.h Neighbour Tables - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/netconf.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/netconf.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/netconf.h rtnetlink netconf layer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2017 David Ahern <dsa@cumulusnetworks.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/nexthop.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/nexthop.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/nexthop.h Routing Nexthop - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -70,6 +64,8 @@ extern int rtnl_route_nh_encap_mpls(struct rtnl_nexthop *nh, struct nl_addr *addr, uint8_t ttl); +extern struct nl_addr * rtnl_route_nh_get_encap_mpls_dst(struct rtnl_nexthop *); +extern uint8_t rtnl_route_nh_get_encap_mpls_ttl(struct rtnl_nexthop *); #ifdef __cplusplus } #endif
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/pktloc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/pktloc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/pktloc.h Packet Location Aliasing - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/qdisc.h Queueing Disciplines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -33,6 +27,8 @@ extern struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t); +extern struct rtnl_qdisc *rtnl_qdisc_get_by_kind(struct nl_cache *cache, + int ifindex, char *kind); extern int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int, struct nl_msg **);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/cbq.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/cbq.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/cbq.h Class Based Queueing - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/dsmark.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/dsmark.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/dsmark.h DSMARK - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/fifo.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/fifo.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/fifo.c FIFO Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/fq_codel.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/fq_codel.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/fq_codel.h fq_codel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/hfsc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/hfsc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/hfsc.h HFSC Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/htb.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/htb.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/htb.h HTB Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2005 Petr Gotthard <petr.gotthard@siemens.com> * Copyright (c) 2005 Siemens AG Oesterreich
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/mqprio.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/mqprio.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/mqprio.c MQPRIO Qdisc/Class - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/netem.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/netem.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/netem.h Network Emulator Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/plug.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/plug.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/qdisc/plug.c PLUG Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Shriram Rajagopalan <rshriram@cs.ubc.ca> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/prio.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/prio.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/prio.c PRIO Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/red.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/red.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/red.h RED Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/sfq.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/sfq.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/sfq.c SFQ Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/qdisc/tbf.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/qdisc/tbf.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/sch/tbf.h TBF Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/route.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/route.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/route.h Routes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -58,6 +52,9 @@ extern int rtnl_route_parse(struct nlmsghdr *, struct rtnl_route **); extern int rtnl_route_build_msg(struct nl_msg *, struct rtnl_route *); +extern int rtnl_route_lookup(struct nl_sock *sk, struct nl_addr *dst, + struct rtnl_route **result); + extern int rtnl_route_build_add_request(struct rtnl_route *, int, struct nl_msg **); extern int rtnl_route_add(struct nl_sock *, struct rtnl_route *, int);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/rtnl.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/rtnl.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/rtnl.h Routing Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/rule.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/rule.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/rule.h Rules - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/tc-api.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/tc-api.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/tc-api.h Traffic Control API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/route/tc.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/route/tc.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/route/tc.h Traffic Control - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/socket.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/socket.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/socket.h Netlink Socket - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/types.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/types.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/types.h Definition of public types - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/utils.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/utils.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/utils.h Utility Functions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -19,6 +13,12 @@ extern "C" { #endif +#if defined(__GNUC__) && __GNUC__ > 5 +#define _nl_attribute_printf(a, b) __attribute__((__format__(printf, a, b))) +#else +#define _nl_attribute_printf(a, b) +#endif + /** * @name Probability Constants * @{ @@ -76,8 +76,8 @@ /* Dumping helpers */ extern void nl_new_line(struct nl_dump_params *); -extern void nl_dump(struct nl_dump_params *, const char *, ...); -extern void nl_dump_line(struct nl_dump_params *, const char *, ...); +extern void nl_dump(struct nl_dump_params *, const char *, ...) _nl_attribute_printf(2, 3); +extern void nl_dump_line(struct nl_dump_params *, const char *, ...) _nl_attribute_printf(2, 3); enum { NL_CAPABILITY_NONE, @@ -300,6 +300,25 @@ NL_CAPABILITY_VERSION_3_5_0 = 30, #define NL_CAPABILITY_VERSION_3_5_0 NL_CAPABILITY_VERSION_3_5_0 + /** + * nl_object_identical() can consider objects identical, if they both lack the same + * set of ID attributes. + */ + NL_CAPABILITY_NL_OBJECT_IDENTICAL_PARTIAL = 31, +#define NL_CAPABILITY_NL_OBJECT_IDENTICAL_PARTIAL NL_CAPABILITY_NL_OBJECT_IDENTICAL_PARTIAL + + /** + * The library version is libnl3 3.6.0 or newer. This capability should never be backported. + */ + NL_CAPABILITY_VERSION_3_6_0 = 32, +#define NL_CAPABILITY_VERSION_3_6_0 NL_CAPABILITY_VERSION_3_6_0 + + /** + * The library version is libnl3 3.7.0 or newer. This capability should never be backported. + */ + NL_CAPABILITY_VERSION_3_7_0 = 33, +#define NL_CAPABILITY_VERSION_3_7_0 NL_CAPABILITY_VERSION_3_7_0 + __NL_CAPABILITY_MAX, NL_CAPABILITY_MAX = (__NL_CAPABILITY_MAX - 1), #define NL_CAPABILITY_MAX NL_CAPABILITY_MAX
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/version.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/version.h
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/version.h Versioning Information - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2011 Thomas Graf <tgraf@suug.ch> */ @@ -14,11 +8,11 @@ /* Compile Time Versioning Information */ -#define LIBNL_STRING "libnl 3.5.0" -#define LIBNL_VERSION "3.5.0" +#define LIBNL_STRING "libnl 3.7.0" +#define LIBNL_VERSION "3.7.0" #define LIBNL_VER_MAJ 3 -#define LIBNL_VER_MIN 5 +#define LIBNL_VER_MIN 7 #define LIBNL_VER_MIC 0 #define LIBNL_VER(maj,min) ((maj) << 8 | (min)) #define LIBNL_VER_NUM LIBNL_VER(LIBNL_VER_MAJ, LIBNL_VER_MIN)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/version.h.in -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/version.h.in
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/version.h Versioning Information - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/include/netlink/xfrm/sa.h -> _service:tar_scm:libnl-3.7.0.tar.gz/include/netlink/xfrm/sa.h
Changed
@@ -164,6 +164,9 @@ unsigned int, unsigned int, unsigned int, unsigned int, unsigned int*); +extern int xfrmnl_sa_get_user_offload (struct xfrmnl_sa*, int*, uint8_t *); +extern int xfrmnl_sa_set_user_offload (struct xfrmnl_sa*, int, uint8_t); + extern int xfrmnl_sa_is_expiry_reached (struct xfrmnl_sa*); extern int xfrmnl_sa_is_hardexpiry_reached (struct xfrmnl_sa*);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/addr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/addr.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/addr.c Network Address - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/attr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/attr.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/attr.c Netlink Attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */ @@ -257,7 +250,7 @@ if (policy) { err = validate_nla(nla, maxtype, policy); if (err < 0) - goto errout; + return err; } if (tbtype) @@ -267,13 +260,12 @@ tbtype = nla; } - if (rem > 0) + if (rem > 0) { NL_DBG(1, "netlink: %d bytes leftover after parsing " "attributes.\n", rem); + } - err = 0; -errout: - return err; + return 0; } /**
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cache.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cache.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cache.c Caching Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -51,6 +44,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/utils.h> #include <netlink/netlink.h> #include <netlink/cache.h> #include <netlink/object.h> @@ -757,7 +751,10 @@ * @arg cache Cache to put items into. * * Waits for netlink messages to arrive, parses them and puts them into - * the specified cache. + * the specified cache. If an old object with same key attributes is + * present in the cache, it is replaced with the new object. + * If the old object type supports an update operation, an update is + * attempted before a replace. * * @return 0 on success or a negative error code. */ @@ -772,10 +769,7 @@ * @arg cache Cache to put items into. * * Waits for netlink messages to arrive, parses them and puts them into - * the specified cache. If an old object with same key attributes is - * present in the cache, it is replaced with the new object. - * If the old object type supports an update operation, an update is - * attempted before a replace. + * the specified cache. * * @return 0 on success or a negative error code. */ @@ -1208,7 +1202,7 @@ /** * Dump all elements of a cache (filtered). * @arg cache cache to dump - * @arg params dumping parameters (optional) + * @arg params dumping parameters * @arg filter filter object * * Dumps all elements of the \a cache to the file descriptor \a fd @@ -1218,13 +1212,30 @@ struct nl_dump_params *params, struct nl_object *filter) { - int type = params ? params->dp_type : NL_DUMP_DETAILS; + struct nl_dump_params params_copy; struct nl_object_ops *ops; struct nl_object *obj; + int type; NL_DBG(2, "Dumping cache %p <%s> with filter %p\n", cache, nl_cache_name(cache), filter); + if (!params) { + /* It doesn't really make sense that @params is an optional parameter. In the + * past, nl_cache_dump() was documented that the @params would be optional, so + * try to save it. + * + * Note that this still isn't useful, because we don't set any dump option. + * It only exists not to crash applications that wrongly pass %NULL here. */ + _nl_assert_not_reached (); + params_copy = (struct nl_dump_params) { + .dp_type = NL_DUMP_DETAILS, + }; + params = ¶ms_copy; + } + + type = params->dp_type; + if (type > NL_DUMP_MAX || type < 0) BUG(); @@ -1235,7 +1246,7 @@ if (!ops->oo_dumptype) return; - if (params && params->dp_buf) + if (params->dp_buf) memset(params->dp_buf, 0, params->dp_buflen); nl_list_for_each_entry(obj, &cache->c_items, ce_list) {
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cache_mngr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cache_mngr.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cache_mngr.c Cache Manager - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cache_mngt.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cache_mngt.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cache_mngt.c Cache Management - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/cls/basic.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/cls/basic.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/cls/basic.c basic classifier module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/cls/cgroup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/cls/cgroup.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/cls/cgroup.c cgroup classifier module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/bfifo.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/bfifo.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/bfifo.c bfifo module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/blackhole.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/blackhole.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/blackhole.c Blackhole module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/fq_codel.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/fq_codel.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/qdisc/fq_codel.c fq_codel module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/hfsc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/hfsc.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/cli/qdisc/hfsc.c HFSC module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/htb.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/htb.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/htb.c HTB module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/ingress.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/ingress.c
Changed
@@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/ingress.c ingress module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/pfifo.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/pfifo.c
Changed
@@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/pfifo.c pfifo module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/cli/qdisc/plug.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/cli/qdisc/plug.c
Changed
@@ -1,12 +1,5 @@ - +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/cli/qdisc/plug.c plug module for CLI lib - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Shriram Rajagopalan <rshriram@cs.ubc.ca> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/data.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/data.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/data.c Abstract Data - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/defs.h.in -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/defs.h.in
Changed
@@ -12,12 +12,12 @@ /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -66,7 +66,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/error.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/error.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/error.c Error Handling - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/fib_lookup/lookup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/fib_lookup/lookup.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/fib_lookup/lookup.c FIB Lookup - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -62,11 +55,13 @@ struct flnl_result *dst = nl_object_priv(_dst); struct flnl_result *src = nl_object_priv(_src); - if (src->fr_req) - if (!(dst->fr_req = (struct flnl_request *) - nl_object_clone(OBJ_CAST(src->fr_req)))) + dst->fr_req = NULL; + + if (src->fr_req) { + if (!(dst->fr_req = (struct flnl_request *) nl_object_clone(OBJ_CAST(src->fr_req)))) return -NLE_NOMEM; - + } + return 0; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/fib_lookup/request.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/fib_lookup/request.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/fib_lookup/request.c FIB Lookup Request - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -47,9 +40,12 @@ struct flnl_request *dst = nl_object_priv(_dst); struct flnl_request *src = nl_object_priv(_src); - if (src->lr_addr) + dst->lr_addr = NULL; + + if (src->lr_addr) { if (!(dst->lr_addr = nl_addr_clone(src->lr_addr))) return -NLE_NOMEM; + } return 0; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/genl/ctrl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/genl/ctrl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/genl/ctrl.c Generic Netlink Controller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/genl/family.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/genl/family.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/genl/family.c Generic Netlink Family - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -74,6 +67,9 @@ struct genl_family_grp *grp; int err; + nl_init_list_head(&dst->gf_ops); + nl_init_list_head(&dst->gf_mc_grps); + nl_list_for_each_entry(ops, &src->gf_ops, o_list) { err = genl_family_add_op(dst, ops->o_id, ops->o_flags); if (err < 0) @@ -260,7 +256,7 @@ */ void genl_family_set_name(struct genl_family *family, const char *name) { - strncpy(family->gf_name, name, GENL_NAMSIZ-1); + _nl_strncpy_trunc(family->gf_name, name, GENL_NAMSIZ); family->ce_mask |= FAMILY_ATTR_NAME; } @@ -380,7 +376,7 @@ return -NLE_NOMEM; grp->id = id; - _nl_strncpy(grp->name, name, GENL_NAMSIZ); + _nl_strncpy_assert(grp->name, name, GENL_NAMSIZ); nl_list_add_tail(&grp->list, &family->gf_mc_grps);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/genl/genl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/genl/genl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/genl/genl.c Generic Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/genl/mngt.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/genl/mngt.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/genl/mngt.c Generic Netlink Management - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -133,13 +126,13 @@ cmd = &ops->o_cmdsi; if (cmd->c_id == op) { - strncpy(buf, cmd->c_name, len - 1); + _nl_strncpy_trunc(buf, cmd->c_name, len); return buf; } } } - strncpy(buf, "unknown", len - 1); + _nl_strncpy_trunc(buf, "unknown", len); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/handlers.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/handlers.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/handlers.c default netlink message handlers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/hashtable.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/hashtable.c
Changed
@@ -1,14 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * netlink/hashtable.c Netlink hashtable Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Cumulus Networks, Inc */ + #include <string.h> #include <netlink-private/netlink.h> #include <netlink/object.h> @@ -59,15 +53,15 @@ int i; for(i = 0; i < ht->size; i++) { - nl_hash_node_t *node = ht->nodesi; - nl_hash_node_t *saved_node; - - while (node) { - saved_node = node; - node = node->next; - nl_object_put(saved_node->obj); - free(saved_node); - } + nl_hash_node_t *node = ht->nodesi; + nl_hash_node_t *saved_node; + + while (node) { + saved_node = node; + node = node->next; + nl_object_put(saved_node->obj); + free(saved_node); + } } free(ht->nodes); @@ -94,9 +88,9 @@ node = ht->nodeskey_hash; while (node) { - if (nl_object_identical(node->obj, obj)) - return node->obj; - node = node->next; + if (nl_object_identical(node->obj, obj)) + return node->obj; + node = node->next; } return NULL; @@ -124,11 +118,11 @@ node = ht->nodeskey_hash; while (node) { - if (nl_object_identical(node->obj, obj)) { - NL_DBG(2, "Warning: Add to hashtable found duplicate...\n"); - return -NLE_EXIST; - } - node = node->next; + if (nl_object_identical(node->obj, obj)) { + NL_DBG(2, "Warning: Add to hashtable found duplicate...\n"); + return -NLE_EXIST; + } + node = node->next; } NL_DBG (5, "adding cache entry of obj %p in table %p, with hash 0x%x\n", @@ -168,20 +162,20 @@ prev = node = ht->nodeskey_hash; while (node) { - if (nl_object_identical(node->obj, obj)) { - nl_object_put(obj); + if (nl_object_identical(node->obj, obj)) { + nl_object_put(obj); - NL_DBG (5, "deleting cache entry of obj %p in table %p, with" - " hash 0x%x\n", obj, ht, key_hash); + NL_DBG (5, "deleting cache entry of obj %p in table %p, with" + " hash 0x%x\n", obj, ht, key_hash); - if (node == ht->nodeskey_hash) - ht->nodeskey_hash = node->next; - else - prev->next = node->next; + if (node == ht->nodeskey_hash) + ht->nodeskey_hash = node->next; + else + prev->next = node->next; - free(node); + free(node); - return 0; + return 0; } prev = node; node = node->next;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/idiag/idiag.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/idiag/idiag.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/idiag/idiag.c Inet Diag Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/idiag/idiag_meminfo_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/idiag/idiag_meminfo_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/idiag/idiagnl_meminfo_obj.c Inet Diag Meminfo Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/idiag/idiag_msg_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/idiag/idiag_msg_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/idiag/idiagnl_msg_obj.c Inet Diag Message Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */ @@ -629,9 +622,9 @@ struct idiagnl_msg *dst = (struct idiagnl_msg *) _dst; struct idiagnl_msg *src = (struct idiagnl_msg *) _src; - dst->idiag_cong = NULL; dst->idiag_src = NULL; dst->idiag_dst = NULL; + dst->idiag_cong = NULL; dst->idiag_meminfo = NULL; dst->idiag_vegasinfo = NULL; dst->ce_mask &= ~(IDIAGNL_ATTR_CONG |
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/idiag/idiag_req_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/idiag/idiag_req_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/idiag/idiagnl_req_obj.c Inet Diag Request Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */ @@ -176,6 +169,9 @@ struct idiagnl_req *dst = (struct idiagnl_req *) _dst; struct idiagnl_req *src = (struct idiagnl_req *) _src; + src->idiag_src = NULL; + src->idiag_dst = NULL; + if (src->idiag_src) if (!(dst->idiag_src = nl_addr_clone(src->idiag_src))) return -NLE_NOMEM;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/idiag/idiag_vegasinfo_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/idiag/idiag_vegasinfo_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/idiag/idiagnl_vegasinfo_obj.c Inet Diag TCP Vegas Info Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/msg.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/msg.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/msg.c Netlink Messages Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/ct.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/ct.c
Changed
@@ -1,16 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/ct.c Conntrack - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation - * Copyright (c= 2008 Patrick McHardy <kaber@trash.net> + * Copyright (c) 2008 Patrick McHardy <kaber@trash.net> */ /** @@ -315,40 +308,25 @@ return 0; } -int nfnlmsg_ct_parse(struct nlmsghdr *nlh, struct nfnl_ct **result) +static int _nfnlmsg_ct_parse(struct nlattr **tb, struct nfnl_ct *ct) { - struct nfnl_ct *ct; - struct nlattr *tbCTA_MAX+1; int err; - ct = nfnl_ct_alloc(); - if (!ct) - return -NLE_NOMEM; - - ct->ce_msgtype = nlh->nlmsg_type; - - err = nlmsg_parse(nlh, sizeof(struct nfgenmsg), tb, CTA_MAX, - ct_policy); - if (err < 0) - goto errout; - - nfnl_ct_set_family(ct, nfnlmsg_family(nlh)); - if (tbCTA_TUPLE_ORIG) { err = ct_parse_tuple(ct, 0, tbCTA_TUPLE_ORIG); if (err < 0) - goto errout; + return err; } if (tbCTA_TUPLE_REPLY) { err = ct_parse_tuple(ct, 1, tbCTA_TUPLE_REPLY); if (err < 0) - goto errout; + return err; } if (tbCTA_PROTOINFO) { err = ct_parse_protoinfo(ct, tbCTA_PROTOINFO); if (err < 0) - goto errout; + return err; } if (tbCTA_STATUS) @@ -367,24 +345,80 @@ if (tbCTA_COUNTERS_ORIG) { err = ct_parse_counters(ct, 0, tbCTA_COUNTERS_ORIG); if (err < 0) - goto errout; + return err; } if (tbCTA_COUNTERS_REPLY) { err = ct_parse_counters(ct, 1, tbCTA_COUNTERS_REPLY); if (err < 0) - goto errout; + return err; } if (tbCTA_TIMESTAMP) { err = ct_parse_timestamp(ct, tbCTA_TIMESTAMP); if (err < 0) - goto errout; + return err; } + return 0; +} + +int nfnlmsg_ct_parse(struct nlmsghdr *nlh, struct nfnl_ct **result) +{ + struct nfnl_ct *ct; + struct nlattr *tbCTA_MAX+1; + int err; + + ct = nfnl_ct_alloc(); + if (!ct) + return -NLE_NOMEM; + + ct->ce_msgtype = nlh->nlmsg_type; + + err = nlmsg_parse(nlh, sizeof(struct nfgenmsg), tb, CTA_MAX, + ct_policy); + if (err < 0) + goto errout; + + nfnl_ct_set_family(ct, nfnlmsg_family(nlh)); + + err = _nfnlmsg_ct_parse(tb, ct); + if (err < 0) + goto errout; + *result = ct; return 0; +errout: + nfnl_ct_put(ct); + return err; +} + +int nfnlmsg_ct_parse_nested(struct nlattr *attr, struct nfnl_ct **result) +{ + struct nfnl_ct *ct; + struct nlattr *tbCTA_MAX+1; + int err; + + ct = nfnl_ct_alloc(); + if (!ct) + return -NLE_NOMEM; + + // msgtype not given for nested + //ct->ce_msgtype = nlh->nlmsg_type; + err = nla_parse_nested(tb, CTA_MAX, attr, ct_policy); + if (err < 0) + goto errout; + + // family not known + //nfnl_ct_set_family(ct, nfnlmsg_family(nlh)); + + err = _nfnlmsg_ct_parse(tb, ct); + if (err < 0) + goto errout; + + *result = ct; + return 0; errout: nfnl_ct_put(ct); return err; @@ -508,20 +542,24 @@ { struct nl_msg *msg; int err; + int reply = 0; msg = nfnlmsg_alloc_simple(NFNL_SUBSYS_CTNETLINK, cmd, flags, nfnl_ct_get_family(ct), 0); if (msg == NULL) return -NLE_NOMEM; - if ((err = nfnl_ct_build_tuple(msg, ct, 0)) < 0) - goto err_out; - - /* REPLY tuple is optional, dont add unless at least src/dst specified */ - - if ( nfnl_ct_get_src(ct, 1) && nfnl_ct_get_dst(ct, 1) ) + /* We use REPLY || ORIG, depending on requests. */ + if (nfnl_ct_get_src(ct, 1) || nfnl_ct_get_dst(ct, 1)) { + reply = 1; if ((err = nfnl_ct_build_tuple(msg, ct, 1)) < 0) goto err_out; + } + + if (!reply || nfnl_ct_get_src(ct, 0) || nfnl_ct_get_dst(ct, 0)) { + if ((err = nfnl_ct_build_tuple(msg, ct, 0)) < 0) + goto err_out; + } if (nfnl_ct_test_status(ct)) NLA_PUT_U32(msg, CTA_STATUS, htonl(nfnl_ct_get_status(ct)));
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/ct_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/ct_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/ct_obj.c Conntrack Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -75,6 +68,11 @@ struct nfnl_ct *src = (struct nfnl_ct *) _src; struct nl_addr *addr; + dst->ct_orig.src = NULL; + dst->ct_orig.dst = NULL; + dst->ct_repl.src = NULL; + dst->ct_repl.dst = NULL; + if (src->ct_orig.src) { addr = nl_addr_clone(src->ct_orig.src); if (!addr) @@ -206,7 +204,7 @@ delta_time /= NSEC_PER_SEC; else delta_time = 0; - nl_dump(p, "delta-time %llu ", delta_time); + nl_dump(p, "delta-time %llu ", (long long unsigned)delta_time); } nl_dump(p, "\n"); @@ -221,8 +219,9 @@ ct_dump_line(a, p); nl_dump(p, " id 0x%x ", ct->ct_id); - nl_dump_line(p, "family %s ", - nl_af2str(ct->ct_family, buf, sizeof(buf))); + if (ct->ce_mask & CT_ATTR_FAMILY) + nl_dump_line(p, "family %s ", + nl_af2str(ct->ct_family, buf, sizeof(buf))); if (nfnl_ct_test_use(ct)) nl_dump(p, "refcnt %u ", nfnl_ct_get_use(ct));
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/exp.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/exp.c
Changed
@@ -1,16 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/exp.c Conntrack Expectation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation - * Copyright (c= 2008 Patrick McHardy <kaber@trash.net> + * Copyright (c) 2008 Patrick McHardy <kaber@trash.net> * Copyright (c) 2012 Rich Fought <rich.fought@watchguard.com> */ @@ -423,7 +416,6 @@ static int nfnl_exp_build_nat(struct nl_msg *msg, const struct nfnl_exp *exp) { struct nlattr *nat; - int err; nat = nla_nest_start(msg, CTA_EXPECT_NAT); @@ -432,7 +424,7 @@ nfnl_exp_get_nat_dir(exp)); } - if ((err = nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_NAT)) < 0) + if (nfnl_exp_build_tuple(msg, exp, CTA_EXPECT_NAT) < 0) goto nla_put_failure; nla_nest_end(msg, nat);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/exp_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/exp_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/exp_obj.c Conntrack Expectation Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -88,7 +81,17 @@ struct nfnl_exp *src = (struct nfnl_exp *) _src; struct nl_addr *addr; - // Expectation + dst->exp_helper_name = NULL; + dst->exp_fn = NULL; + dst->exp_expect.src = NULL; + dst->exp_expect.dst = NULL; + dst->exp_master.src = NULL; + dst->exp_master.dst = NULL; + dst->exp_mask.src = NULL; + dst->exp_mask.dst = NULL; + dst->exp_nat.src = NULL; + dst->exp_nat.dst = NULL; + if (src->exp_expect.src) { addr = nl_addr_clone(src->exp_expect.src); if (!addr) @@ -103,7 +106,6 @@ dst->exp_expect.dst = addr; } - // Master CT if (src->exp_master.src) { addr = nl_addr_clone(src->exp_master.src); if (!addr) @@ -118,7 +120,6 @@ dst->exp_master.dst = addr; } - // Mask if (src->exp_mask.src) { addr = nl_addr_clone(src->exp_mask.src); if (!addr) @@ -133,7 +134,6 @@ dst->exp_mask.dst = addr; } - // NAT if (src->exp_nat.src) { addr = nl_addr_clone(src->exp_nat.src); if (!addr) @@ -218,7 +218,7 @@ } if (nfnl_exp_test_nat_dir(exp)) - nl_dump(p, "nat dir %s ", exp->exp_nat_dir); + nl_dump(p, "nat dir %u ", exp->exp_nat_dir); }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/log.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/log.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/log.c Netfilter Log - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -151,6 +144,11 @@ htonl(nfnl_log_get_queue_threshold(log))) < 0) goto nla_put_failure; + if (nfnl_log_get_flags(log) && + nla_put_u16(msg, NFULA_CFG_FLAGS, + htons(nfnl_log_get_flags(log))) < 0) + goto nla_put_failure; + *result = msg; return 0;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/log_msg.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/log_msg.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/log_msg.c Netfilter Log Message - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -50,8 +43,41 @@ NFULA_GID = { .type = NLA_U32 }, NFULA_SEQ = { .type = NLA_U32 }, NFULA_SEQ_GLOBAL = { .type = NLA_U32 }, + NFULA_HWTYPE = { .type = NLA_U16 }, + NFULA_HWLEN = { .type = NLA_U16 }, + NFULA_VLAN = { .type = NLA_NESTED }, + NFULA_CT = { .type = NLA_NESTED }, + NFULA_CT_INFO = { .type = NLA_U32 }, }; +static struct nla_policy log_msg_vlan_policyNFULA_VLAN_MAX+1 = { + NFULA_VLAN_PROTO = { .type = NLA_U16 }, + NFULA_VLAN_TCI = { .type = NLA_U16 }, +}; + +static int +nfnlmsg_log_msg_parse_vlan(struct nlattr *attr_full, struct nfnl_log_msg *msg) +{ + struct nlattr *tbNFULA_VLAN_MAX+1; + struct nlattr *attr; + int err; + + err = nla_parse_nested(tb, NFULA_VLAN_MAX, attr_full, + log_msg_vlan_policy); + if (err < 0) + return err; + + attr = tbNFULA_VLAN_PROTO; + if (attr) + nfnl_log_msg_set_vlan_proto(msg, nla_get_u16(attr)); + + attr = tbNFULA_VLAN_TCI; + if (attr) + nfnl_log_msg_set_vlan_tag(msg, ntohs(nla_get_u16(attr))); + + return 0; +} + int nfnlmsg_log_msg_parse(struct nlmsghdr *nlh, struct nfnl_log_msg **result) { struct nfnl_log_msg *msg; @@ -148,6 +174,39 @@ if (attr) nfnl_log_msg_set_seq_global(msg, ntohl(nla_get_u32(attr))); + attr = tbNFULA_HWTYPE; + if (attr) + nfnl_log_msg_set_hwtype(msg, ntohs(nla_get_u16(attr))); + + attr = tbNFULA_HWLEN; + if (attr) + nfnl_log_msg_set_hwlen(msg, ntohs(nla_get_u16(attr))); + + attr = tbNFULA_HWHEADER; + if (attr) + nfnl_log_msg_set_hwheader(msg, nla_data(attr), nla_len(attr)); + + attr = tbNFULA_VLAN; + if (attr) { + err = nfnlmsg_log_msg_parse_vlan(attr, msg); + if (err < 0) + goto errout; + } + + attr = tbNFULA_CT; + if (attr) { + struct nfnl_ct *ct = NULL; + err = nfnlmsg_ct_parse_nested(attr, &ct); + if (err < 0) + goto errout; + nfnl_log_msg_set_ct(msg, ct); + nfnl_ct_put(ct); + } + + attr = tbNFULA_CT_INFO; + if (attr) + nfnl_log_msg_set_ct_info(msg, ntohl(nla_get_u32(attr))); + *result = msg; return 0;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/log_msg_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/log_msg_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/log_msg_obj.c Netfilter Log Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -34,6 +27,13 @@ #define LOG_MSG_ATTR_GID (1UL << 13) #define LOG_MSG_ATTR_SEQ (1UL << 14) #define LOG_MSG_ATTR_SEQ_GLOBAL (1UL << 15) +#define LOG_MSG_ATTR_HWTYPE (1UL << 16) +#define LOG_MSG_ATTR_HWLEN (1UL << 17) +#define LOG_MSG_ATTR_HWHEADER (1UL << 18) +#define LOG_MSG_ATTR_VLAN_PROTO (1UL << 19) +#define LOG_MSG_ATTR_VLAN_TAG (1UL << 20) +#define LOG_MSG_ATTR_CT_INFO (1UL << 21) +#define LOG_MSG_ATTR_CT (1UL << 22) /** @endcond */ static void log_msg_free_data(struct nl_object *c) @@ -45,6 +45,9 @@ free(msg->log_msg_payload); free(msg->log_msg_prefix); + free(msg->log_msg_hwheader); + if (msg->log_msg_ct) + nfnl_ct_put(msg->log_msg_ct); } static int log_msg_clone(struct nl_object *_dst, struct nl_object *_src) @@ -53,22 +56,41 @@ struct nfnl_log_msg *src = (struct nfnl_log_msg *) _src; int err; + dst->log_msg_payload = NULL; + dst->log_msg_payload_len = 0; + dst->log_msg_prefix = NULL; + dst->log_msg_hwheader = NULL; + dst->log_msg_hwheader_len = 0; + dst->log_msg_ct = NULL; + if (src->log_msg_payload) { err = nfnl_log_msg_set_payload(dst, src->log_msg_payload, - src->log_msg_payload_len); + src->log_msg_payload_len); if (err < 0) - goto errout; + return err; } if (src->log_msg_prefix) { err = nfnl_log_msg_set_prefix(dst, src->log_msg_prefix); if (err < 0) - goto errout; + return err; + } + + if (src->log_msg_hwheader) { + err = nfnl_log_msg_set_hwheader(dst, src->log_msg_hwheader, + src->log_msg_hwheader_len); + if (err < 0) + return err; + } + + if (src->log_msg_ct) { + dst->log_msg_ct = (struct nfnl_ct *) nl_object_clone((struct nl_object *) src->log_msg_ct); + if (!dst->log_msg_ct) { + return -NLE_NOMEM; + } } return 0; -errout: - return err; } static void log_msg_dump(struct nl_object *a, struct nl_dump_params *p) @@ -101,7 +123,7 @@ msg->log_msg_physindev, buf, sizeof(buf))); else - nl_dump(p, "IN=%d ", msg->log_msg_physindev); + nl_dump(p, "PHYSIN=%d ", msg->log_msg_physindev); } if (msg->ce_mask & LOG_MSG_ATTR_OUTDEV) { @@ -167,8 +189,35 @@ if (msg->ce_mask & LOG_MSG_ATTR_SEQ_GLOBAL) nl_dump(p, "SEQGLOBAL=%d ", msg->log_msg_seq_global); + if (msg->ce_mask & LOG_MSG_ATTR_HWTYPE) + nl_dump(p, "HWTYPE=%u ", msg->log_msg_hwtype); + + if (msg->ce_mask & LOG_MSG_ATTR_HWLEN) + nl_dump(p, "HWLEN=%u ", msg->log_msg_hwlen); + + if (msg->ce_mask & LOG_MSG_ATTR_HWHEADER) { + int i; + + nl_dump(p, "HWHEADER"); + for (i = 0; i < msg->log_msg_hwheader_len; i++) + nl_dump(p, "%c%02x", i?':':'=', ((uint8_t*) msg->log_msg_hwheader) i); + nl_dump(p, " "); + } + + if (msg->ce_mask & LOG_MSG_ATTR_VLAN_TAG) + nl_dump(p, "VLAN=%d CFI=%d PRIO=%d", + (int) nfnl_log_msg_get_vlan_id(msg), + (int) nfnl_log_msg_get_vlan_cfi(msg), + (int) nfnl_log_msg_get_vlan_prio(msg)); + + if (msg->ce_mask & LOG_MSG_ATTR_CT_INFO) + nl_dump(p, "CTINFO=%u ", msg->log_msg_ct_info); + nl_dump(p, "\n"); + if (msg->ce_mask & LOG_MSG_ATTR_CT) + ct_obj_ops.oo_dumpNL_DUMP_LINE((struct nl_object *)msg->log_msg_ct, p); + if (link_cache) nl_cache_put(link_cache); } @@ -342,14 +391,22 @@ int nfnl_log_msg_set_payload(struct nfnl_log_msg *msg, uint8_t *payload, int len) { - free(msg->log_msg_payload); - msg->log_msg_payload = malloc(len); - if (!msg->log_msg_payload) + uint8_t *p = NULL; + + if (len < 0) + return -NLE_INVAL; + + p = _nl_memdup(payload, len); + if (!p && len > 0) return -NLE_NOMEM; - memcpy(msg->log_msg_payload, payload, len); + free(msg->log_msg_payload); + msg->log_msg_payload = p; msg->log_msg_payload_len = len; - msg->ce_mask |= LOG_MSG_ATTR_PAYLOAD; + if (len > 0) + msg->ce_mask |= LOG_MSG_ATTR_PAYLOAD; + else + msg->ce_mask &= ~LOG_MSG_ATTR_PAYLOAD; return 0; } @@ -366,12 +423,21 @@ int nfnl_log_msg_set_prefix(struct nfnl_log_msg *msg, void *prefix) { + char *p = NULL; + + if (prefix) { + p = strdup(prefix); + if (!p) + return -NLE_NOMEM; + } + free(msg->log_msg_prefix); - msg->log_msg_prefix = strdup(prefix); - if (!msg->log_msg_prefix) - return -NLE_NOMEM; + msg->log_msg_prefix = p; - msg->ce_mask |= LOG_MSG_ATTR_PREFIX; + if (p) + msg->ce_mask |= LOG_MSG_ATTR_PREFIX; + else + msg->ce_mask &= ~LOG_MSG_ATTR_PREFIX; return 0; } @@ -445,6 +511,154 @@ return msg->log_msg_seq_global; } +void nfnl_log_msg_set_hwtype(struct nfnl_log_msg *msg, uint16_t hwtype) +{ + msg->log_msg_hwtype = hwtype; + msg->ce_mask |= LOG_MSG_ATTR_HWTYPE; +} + +int nfnl_log_msg_test_hwtype(const struct nfnl_log_msg *msg) +{ + return !!(msg->ce_mask & LOG_MSG_ATTR_HWTYPE); +} + +uint16_t nfnl_log_msg_get_hwtype(const struct nfnl_log_msg *msg) +{
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/log_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/log_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/log_obj.c Netfilter Log Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation @@ -215,9 +208,15 @@ log->log_flag_mask |= flags; } +unsigned int nfnl_log_get_flags(const struct nfnl_log *log) +{ + return log->log_flags; +} + static const struct trans_tbl log_flags = { __ADD(NFNL_LOG_FLAG_SEQ, seq), __ADD(NFNL_LOG_FLAG_SEQ_GLOBAL, seq_global), + __ADD(NFNL_LOG_FLAG_CONNTRACK, conntrack), }; char *nfnl_log_flags2str(unsigned int flags, char *buf, size_t len)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/netfilter.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/netfilter.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/netfilter.c Netfilter Generic Functions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/nfnl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/nfnl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/nfnl.c Netfilter Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/queue.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/queue.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/queue.c Netfilter Queue - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/queue_msg.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/queue_msg.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/queue_msg.c Netfilter Queue Messages - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> * Copyright (c) 2010 Karl Hiramoto <karl@hiramoto.org> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/queue_msg_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/queue_msg_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/queue_msg_obj.c Netfilter Queue Message Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */ @@ -49,16 +42,17 @@ struct nfnl_queue_msg *src = (struct nfnl_queue_msg *) _src; int err; + dst->queue_msg_payload = NULL; + dst->queue_msg_payload_len = 0; + if (src->queue_msg_payload) { err = nfnl_queue_msg_set_payload(dst, src->queue_msg_payload, - src->queue_msg_payload_len); + src->queue_msg_payload_len); if (err < 0) - goto errout; + return err; } return 0; -errout: - return err; } static void nfnl_queue_msg_dump(struct nl_object *a, struct nl_dump_params *p) @@ -392,7 +386,7 @@ } const uint8_t *nfnl_queue_msg_get_hwaddr(const struct nfnl_queue_msg *msg, - int *len) + int *len) { if (!(msg->ce_mask & QUEUE_MSG_ATTR_HWADDR)) { *len = 0; @@ -404,19 +398,24 @@ } int nfnl_queue_msg_set_payload(struct nfnl_queue_msg *msg, uint8_t *payload, - int len) + int len) { - void *new_payload = malloc(len); + void *p = NULL; + + if (len < 0) + return -NLE_INVAL; - if (new_payload == NULL) + p = _nl_memdup(payload, len); + if (!p && len > 0) return -NLE_NOMEM; - memcpy(new_payload, payload, len); free(msg->queue_msg_payload); - - msg->queue_msg_payload = new_payload; + msg->queue_msg_payload = p; msg->queue_msg_payload_len = len; - msg->ce_mask |= QUEUE_MSG_ATTR_PAYLOAD; + if (len > 0) + msg->ce_mask |= QUEUE_MSG_ATTR_PAYLOAD; + else + msg->ce_mask &= ~QUEUE_MSG_ATTR_PAYLOAD; return 0; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/netfilter/queue_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/netfilter/queue_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/netfilter/queue_obj.c Netfilter Queue - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/nl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/nl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/nl.c Core Netlink Interface - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/object.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/object.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/object.c Generic Cacheable Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -134,6 +127,11 @@ if (size) memcpy((char *)new + doff, (char *)obj + doff, size); + /* Note that the base implementation already initializes @new via memcpy(). + * That means, simple fields don't need to be handled via oo_clone(). + * However, this is only a shallow-copy, so oo_clone() MUST fix all + * pointer values accordingly. */ + if (ops->oo_clone) { if (ops->oo_clone(new, obj) < 0) { nl_object_free(new); @@ -313,38 +311,42 @@ */ int nl_object_identical(struct nl_object *a, struct nl_object *b) { - struct nl_object_ops *ops = obj_ops(a); - uint32_t req_attrs; + struct nl_object_ops *ops; + uint64_t req_attrs_a; + uint64_t req_attrs_b; + + if (a == b) + return 1; /* Both objects must be of same type */ + ops = obj_ops(a); if (ops != obj_ops(b)) return 0; + /* Can't judge unless we can compare */ + if (ops->oo_compare == NULL) + return 0; + if (ops->oo_id_attrs_get) { - int req_attrs_a = ops->oo_id_attrs_get(a); - int req_attrs_b = ops->oo_id_attrs_get(b); - if (req_attrs_a != req_attrs_b) - return 0; - req_attrs = req_attrs_a; + req_attrs_a = ops->oo_id_attrs_get(a); + req_attrs_b = ops->oo_id_attrs_get(b); } else if (ops->oo_id_attrs) { - req_attrs = ops->oo_id_attrs; + req_attrs_a = ops->oo_id_attrs; + req_attrs_b = req_attrs_a; } else { - req_attrs = 0xFFFFFFFF; + req_attrs_a = UINT64_MAX; + req_attrs_b = req_attrs_a; } - if (req_attrs == 0xFFFFFFFF) - req_attrs = a->ce_mask & b->ce_mask; + + req_attrs_a &= a->ce_mask; + req_attrs_b &= b->ce_mask; /* Both objects must provide all required attributes to uniquely * identify an object */ - if ((a->ce_mask & req_attrs) != req_attrs || - (b->ce_mask & req_attrs) != req_attrs) - return 0; - - /* Can't judge unless we can compare */ - if (ops->oo_compare == NULL) + if (req_attrs_a != req_attrs_b) return 0; - return !(ops->oo_compare(a, b, req_attrs, ID_COMPARISON)); + return !(ops->oo_compare(a, b, req_attrs_a, ID_COMPARISON)); } /** @@ -366,7 +368,7 @@ if (ops != obj_ops(b) || ops->oo_compare == NULL) return UINT64_MAX; - return ops->oo_compare(a, b, ~0, 0); + return ops->oo_compare(a, b, UINT64_MAX, 0); } /**
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/act.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/act.c Action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ @@ -17,6 +10,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/utils.h> #include <netlink-private/tc.h> #include <netlink/netlink.h> #include <netlink/utils.h> @@ -125,7 +119,7 @@ while (p_act) { err = rtnl_act_fill_one(msg, p_act, ++order); - if (err) + if (err < 0) return err; p_act = p_act->a_next; } @@ -519,8 +513,13 @@ p_act = act; while(p_act) { err = pp->pp_cb(OBJ_CAST(act), pp); - if (err) + if (err) { + if (err > 0) { + _nl_assert_not_reached(); + err = -NLE_FAILURE; + } break; + } p_act = p_act->a_next; } errout:
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/act/gact.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act/gact.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/act/gact.c gact action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Sushma Sitaram <sushma.sitaram@intel.com> */ @@ -50,14 +44,6 @@ { } -static int gact_clone(void *_dst, void *_src) -{ - struct rtnl_gact *dst = _dst, *src = _src; - - memcpy(&dst->g_parm, &src->g_parm, sizeof(src->g_parm)); - return 0; -} - static void gact_dump_line(struct rtnl_tc *tc, void *data, struct nl_dump_params *p) { @@ -126,19 +112,7 @@ if (!(u = (struct rtnl_gact *) rtnl_tc_data(TC_CAST(act)))) return -NLE_NOMEM; - if (action > TC_ACT_SHOT || action < TC_ACT_UNSPEC) - return -NLE_INVAL; - - switch (action) { - case TC_ACT_UNSPEC: - case TC_ACT_SHOT: - u->g_parm.action = action; - break; - case TC_ACT_OK: - case TC_ACT_RECLASSIFY: - default: - return NLE_OPNOTSUPP; - } + u->g_parm.action = action; return 0; } @@ -161,7 +135,7 @@ .to_size = sizeof(struct rtnl_gact), .to_msg_parser = gact_msg_parser, .to_free_data = gact_free_data, - .to_clone = gact_clone, + .to_clone = NULL, .to_msg_fill = gact_msg_fill, .to_dump = { NL_DUMP_LINE = gact_dump_line,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/act/mirred.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act/mirred.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/act/mirred.c mirred action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ @@ -49,14 +43,6 @@ { } -static int mirred_clone(void *_dst, void *_src) -{ - struct rtnl_mirred *dst = _dst, *src = _src; - - memcpy(&dst->m_parm, &src->m_parm, sizeof(src->m_parm)); - return 0; -} - static void mirred_dump_line(struct rtnl_tc *tc, void *data, struct nl_dump_params *p) { @@ -187,19 +173,8 @@ if (!(u = (struct rtnl_mirred *) rtnl_tc_data(TC_CAST(act)))) return -NLE_NOMEM; - if (policy > TC_ACT_REPEAT || policy < TC_ACT_OK) - return -NLE_INVAL; + u->m_parm.action = policy; - switch (u->m_parm.eaction) { - case TCA_EGRESS_MIRROR: - case TCA_EGRESS_REDIR: - u->m_parm.action = policy; - break; - case TCA_INGRESS_REDIR: - case TCA_INGRESS_MIRROR: - default: - return NLE_OPNOTSUPP; - } return 0; } @@ -220,7 +195,7 @@ .to_size = sizeof(struct rtnl_mirred), .to_msg_parser = mirred_msg_parser, .to_free_data = mirred_free_data, - .to_clone = mirred_clone, + .to_clone = NULL, .to_msg_fill = mirred_msg_fill, .to_dump = { NL_DUMP_LINE = mirred_dump_line,
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act/nat.c
Added
@@ -0,0 +1,288 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2016 Magnus Öberg <magnus.oberg@westermo.se> + */ + +/** + * @ingroup act + * @defgroup act_nat NAT + * + * @{ + */ + +#include <netlink-private/netlink.h> +#include <netlink-private/tc.h> +#include <netlink/netlink.h> +#include <netlink/attr.h> +#include <netlink/utils.h> +#include <netlink-private/route/tc-api.h> +#include <netlink/route/act/nat.h> +#include <netlink/route/tc.h> + +static struct nla_policy nat_policyTCA_NAT_MAX + 1 = { + TCA_NAT_PARMS = { .minlen = sizeof(struct tc_nat) }, +}; + +/** + * nat operations + */ + +static int nat_msg_parser(struct rtnl_tc *tc, void *data) +{ + struct tc_nat *nat = data; + struct nlattr *tbTCA_NAT_MAX + 1; + int err; + + err = tca_parse(tb, TCA_NAT_MAX, tc, nat_policy); + if (err < 0) + return err; + + if (!tbTCA_NAT_PARMS) + return -NLE_MISSING_ATTR; + + nla_memcpy(nat, tbTCA_NAT_PARMS, sizeof(*nat)); + + return NLE_SUCCESS; +} + +static void nat_free_data(struct rtnl_tc *tc, void *data) +{ +} + +static int nat_msg_fill(struct rtnl_tc *tc, void *data, struct nl_msg *msg) +{ + struct tc_nat *nat = data; + + if (!nat) + return -NLE_OBJ_NOTFOUND; + + NLA_PUT(msg, TCA_NAT_PARMS, sizeof(*nat), nat); + + return NLE_SUCCESS; + +nla_put_failure: + return -NLE_NOMEM; +} + +static void nat_dump_line(struct rtnl_tc *tc, void *data, + struct nl_dump_params *p) +{ + struct tc_nat *nat = data; + char buf32; + uint32_t mask; + int pfx = 0; + + if (!nat) + return; + + if (nat->flags & TCA_NAT_FLAG_EGRESS) + nl_dump(p, " egress"); + else + nl_dump(p, " ingress"); + + mask = nat->mask; + while (mask > 0) { + mask = mask >> 1; + pfx++; + } + + inet_ntop(AF_INET, &nat->old_addr, buf, sizeof(buf)); + nl_dump(p, " %s", buf); + if (pfx < 32) + nl_dump(p, "/%d", pfx); + + inet_ntop(AF_INET, &nat->new_addr, buf, sizeof(buf)); + nl_dump(p, " %s", buf); + if (pfx < 32) + nl_dump(p, "/%d", pfx); +} + +/** + * @name Attribute Modifications + * @{ + */ + +/** + * Set old IPv4 address on a netlink NAT action object + * @arg act Action object + * @arg addr Binary IPv4 address in host byte order + * + * @return 0 on success or negative error code in case of an error. + */ +int rtnl_nat_set_old_addr(struct rtnl_act *act, in_addr_t addr) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data(TC_CAST(act)))) + return -NLE_NOMEM; + + nat->old_addr = addr; + + return NLE_SUCCESS; +} + +int rtnl_nat_get_old_addr(struct rtnl_act *act, in_addr_t *addr) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data_peek(TC_CAST(act)))) + return -NLE_NOATTR; + + *addr = nat->old_addr; + + return NLE_SUCCESS; +} + +/** + * Set new IPv4 address on a netlink NAT action object + * @arg act Action object + * @arg addr Binary IPv4 address in host byte order + * + * @return 0 on success or negative error code in case of an error. + */ +int rtnl_nat_set_new_addr(struct rtnl_act *act, in_addr_t addr) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data(TC_CAST(act)))) + return -NLE_NOMEM; + + nat->new_addr = addr; + + return NLE_SUCCESS; +} + +int rtnl_nat_get_new_addr(struct rtnl_act *act, in_addr_t *addr) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data_peek(TC_CAST(act)))) + return -NLE_NOATTR; + + *addr = nat->new_addr; + + return NLE_SUCCESS; +} + +/** + * Set IPv4 address mask on a netlink NAT action object + * @arg act Action object + * @arg mask IPv4 address mask + * + * @return 0 on success or negative error code in case of an error. + */ +int rtnl_nat_set_mask(struct rtnl_act *act, in_addr_t bitmask) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data(TC_CAST(act)))) + return -NLE_NOMEM; + + nat->mask = bitmask; + + return NLE_SUCCESS; +} + +int rtnl_nat_get_mask(struct rtnl_act *act, in_addr_t *bitmask) +{ + struct tc_nat *nat; + + if (!(nat = (struct tc_nat *)rtnl_tc_data_peek(TC_CAST(act)))) + return -NLE_NOATTR; + + *bitmask = nat->mask; + + return NLE_SUCCESS; +} + +/** + * Set flags for a netlink NAT action object
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/act/skbedit.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act/skbedit.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/act/skbedit.c skbedit action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cong Wang <xiyou.wangcong@gmail.com> */ @@ -67,14 +61,6 @@ { } -static int skbedit_clone(void *_dst, void *_src) -{ - struct rtnl_skbedit *dst = _dst, *src = _src; - - memcpy(dst, src, sizeof(*src)); - return 0; -} - static void skbedit_dump_line(struct rtnl_tc *tc, void *data, struct nl_dump_params *p) { @@ -166,10 +152,8 @@ if (!(u = (struct rtnl_skbedit *) rtnl_tc_data(TC_CAST(act)))) return -NLE_NOMEM; - if (action > TC_ACT_REPEAT || action < TC_ACT_UNSPEC) - return -NLE_INVAL; - u->s_parm.action = action; + return 0; } @@ -268,7 +252,7 @@ .to_size = sizeof(struct rtnl_skbedit), .to_msg_parser = skbedit_msg_parser, .to_free_data = skbedit_free_data, - .to_clone = skbedit_clone, + .to_clone = NULL, .to_msg_fill = skbedit_msg_fill, .to_dump = { NL_DUMP_LINE = skbedit_dump_line,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/act/vlan.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/act/vlan.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/act/vlan.c vlan action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> */ @@ -109,14 +103,6 @@ { } -static int vlan_clone(void *_dst, void *_src) -{ - struct rtnl_vlan *dst = _dst, *src = _src; - - memcpy(&dst->v_parm, &src->v_parm, sizeof(src->v_parm)); - return 0; -} - static void vlan_dump_line(struct rtnl_tc *tc, void *data, struct nl_dump_params *p) { @@ -405,7 +391,7 @@ .to_size = sizeof(struct rtnl_vlan), .to_msg_parser = vlan_msg_parser, .to_free_data = vlan_free_data, - .to_clone = vlan_clone, + .to_clone = NULL, .to_msg_fill = vlan_msg_fill, .to_dump = { NL_DUMP_LINE = vlan_dump_line,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/addr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/addr.c
Changed
@@ -1,15 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/addr.c Addresses - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> - * Copyright (c) 2003-2006 Baruch Even <baruch@ev-en.org>, - * Mediatrix Telecom, inc. <ericb@mediatrix.com> + * Copyright (c) 2003-2006 Baruch Even <baruch@ev-en.org> + * Copyright (c) 2003-2006 Mediatrix Telecom, inc. <ericb@mediatrix.com> */ /** @@ -160,6 +153,13 @@ struct rtnl_addr *dst = nl_object_priv(_dst); struct rtnl_addr *src = nl_object_priv(_src); + dst->a_peer = NULL; + dst->a_local = NULL; + dst->a_bcast = NULL; + dst->a_anycast = NULL; + dst->a_multicast = NULL; + dst->a_link = NULL; + if (src->a_link) { nl_object_get(OBJ_CAST(src->a_link)); dst->a_link = src->a_link; @@ -168,7 +168,7 @@ if (src->a_peer) if (!(dst->a_peer = nl_addr_clone(src->a_peer))) return -NLE_NOMEM; - + if (src->a_local) if (!(dst->a_local = nl_addr_clone(src->a_local))) return -NLE_NOMEM; @@ -1136,6 +1136,7 @@ __ADD(IFA_F_SECONDARY, secondary), __ADD(IFA_F_NODAD, nodad), __ADD(IFA_F_OPTIMISTIC, optimistic), + __ADD(IFA_F_DADFAILED, dadfailed), __ADD(IFA_F_HOMEADDRESS, homeaddress), __ADD(IFA_F_DEPRECATED, deprecated), __ADD(IFA_F_TENTATIVE, tentative),
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/class.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/class.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/class.c Traffic Classes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/classid.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/classid.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/classid.c ClassID Management - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -415,7 +408,7 @@ fclose(fd); - if ((err = classid_map_add(classid, name)) < 0) { + if (classid_map_add(classid, name) < 0) { /* * Error adding classid map, re-read classid file is best * option here. It is likely to fail as well but better
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/classifier.c Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */ @@ -364,6 +357,78 @@ cache->c_iarg2 = parent; } +/** + * Search classifier by interface index, parent and handle + * @arg cache Classifier cache + * @arg ifindex Interface index + * @arg parent Parent + * @arg handle Handle + * + * Searches a classifier cache previously allocated with rtnl_cls_alloc_cache() + * and searches for a classifier matching the interface index, parent + * and handle. + * + * The reference counter is incremented before returning the classifier, + * therefore the reference must be given back with rtnl_cls_put() after usage. + * + * @return Classifier or NULL if no match was found. + */ +struct rtnl_cls *rtnl_cls_find_by_handle(struct nl_cache *cache, int ifindex, uint32_t parent, + uint32_t handle) +{ + struct rtnl_cls *cls; + + if (cache->c_ops != &rtnl_cls_ops) + return NULL; + + nl_list_for_each_entry(cls, &cache->c_items, ce_list) { + if ((cls->c_parent == parent) && + (cls->c_ifindex == ifindex)&& + (cls->c_handle == handle)) { + nl_object_get((struct nl_object *) cls); + return cls; + } + } + + return NULL; +} + +/** + * Search classifier by interface index, parent and priority + * @arg cache Classifier cache + * @arg ifindex Interface index + * @arg parent Parent + * @arg prio Priority + * + * Searches a classifier cache previously allocated with rtnl_cls_alloc_cache() + * and searches for a classifier matching the interface index, parent + * and prio. + * + * The reference counter is incremented before returning the classifier, + * therefore the reference must be given back with rtnl_cls_put() after usage. + * + * @return Classifier or NULL if no match was found. + */ +struct rtnl_cls *rtnl_cls_find_by_prio(struct nl_cache *cache, int ifindex, + uint32_t parent, uint16_t prio) +{ + struct rtnl_cls *cls; + + if (cache->c_ops != &rtnl_cls_ops) + return NULL; + + nl_list_for_each_entry(cls, &cache->c_items, ce_list) { + if ((cls->c_parent == parent) && + (cls->c_ifindex == ifindex) && + (cls->c_prio == prio)) { + nl_object_get((struct nl_object *) cls); + return cls; + } + } + + return NULL; +} + /** @} */ static void cls_dump_line(struct rtnl_tc *tc, struct nl_dump_params *p)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/basic.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/basic.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/basic.c Basic Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */ @@ -93,7 +87,7 @@ if (tbTCA_BASIC_ACT) { b->b_mask |= BASIC_ATTR_ACTION; err = rtnl_act_parse(&b->b_act, tbTCA_BASIC_ACT); - if (err) + if (err < 0) return err; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/cgroup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/cgroup.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/cgroup.c Control Groups Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2009-2013 Thomas Graf <tgraf@suug.ch> */ @@ -36,17 +30,14 @@ static int cgroup_clone(void *_dst, void *_src) { - struct rtnl_cgroup *dst = NULL, *src = _src; + struct rtnl_cgroup *dst = _dst, *src = _src; - dst = calloc(1, sizeof(*dst)); - if (!dst) - return -NLE_NOMEM; + dst->cg_ematch = NULL; - dst->cg_mask = src->cg_mask; - dst->cg_ematch = rtnl_ematch_tree_clone(src->cg_ematch); - if (!dst) { - free(dst); - return -NLE_NOMEM; + if (src->cg_ematch) { + dst->cg_ematch = rtnl_ematch_tree_clone(src->cg_ematch); + if (!dst->cg_ematch) + return -NLE_NOMEM; } return 0;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch.c Extended Matches - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */ @@ -699,14 +693,14 @@ if (!(tree = rtnl_ematch_tree_alloc(RTNL_EMATCH_PROGID))) return -NLE_FAILURE; - if ((err = ematch_lex_init(&scanner)) < 0) { + if (ematch_lex_init(&scanner) < 0) { err = -NLE_FAILURE; goto errout; } buf = ematch__scan_string(expr, scanner); - if ((err = ematch_parse(scanner, errp, &tree->et_list)) != 0) { + if (ematch_parse(scanner, errp, &tree->et_list) != 0) { ematch__delete_buffer(buf, scanner); err = -NLE_PARSE_ERR; goto errout;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch/cmp.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch/cmp.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/cmp.c Simple packet data comparison ematch - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch/container.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch/container.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/container.c Container Ematch - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch/meta.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch/meta.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/meta.c Metadata Match - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -246,9 +240,9 @@ nl_dump(p, " >> %u", v->mv_shift); if (v->mv_len == 4) - nl_dump(p, " & %#x", *(uint32_t *) (v + 1)); + nl_dump(p, " & %#lx", (long unsigned) *(uint32_t *) (v + 1)); else if (v->mv_len == 8) - nl_dump(p, " & %#x", *(uint64_t *) (v + 1)); + nl_dump(p, " & %#llx", (long long unsigned) (*(uint64_t *) (v + 1))); } break;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch/nbyte.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch/nbyte.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/nbyte.c Nbyte comparison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch/text.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch/text.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/text.c Text Search - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -17,6 +11,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/utils.h> #include <netlink-private/tc.h> #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> @@ -91,8 +86,7 @@ { struct text_data *t = rtnl_ematch_data(e); - strncpy(t->cfg.algo, algo, sizeof(t->cfg.algo)); - t->cfg.algosizeof(t->cfg.algo) - 1 = '\0'; + _nl_strncpy_trunc(t->cfg.algo, algo, sizeof(t->cfg.algo)); } char *rtnl_ematch_text_get_algo(struct rtnl_ematch *e)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch_grammar.l -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch_grammar.l
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch_grammar.l ematch expression grammar - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/ematch_syntax.y -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/ematch_syntax.y
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch_syntax.y ematch expression syntax - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -52,6 +46,7 @@ %{ extern int ematch_lex(YYSTYPE *, void *); +#define ematch_error yyerror static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg) { if (msg)
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/flower.c
Added
@@ -0,0 +1,896 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> + */ + +#include <netlink-private/netlink.h> +#include <netlink-private/tc.h> +#include <netlink/netlink.h> +#include <netlink/attr.h> +#include <netlink/utils.h> +#include <netlink-private/route/tc-api.h> +#include <netlink/route/classifier.h> +#include <netlink/route/action.h> +#include <netlink/route/cls/flower.h> + + +/** @cond SKIP */ +#define FLOWER_ATTR_FLAGS (1 << 0) +#define FLOWER_ATTR_ACTION (1 << 1) +#define FLOWER_ATTR_VLAN_ID (1 << 2) +#define FLOWER_ATTR_VLAN_PRIO (1 << 3) +#define FLOWER_ATTR_VLAN_ETH_TYPE (1 << 4) +#define FLOWER_ATTR_DST_MAC (1 << 5) +#define FLOWER_ATTR_DST_MAC_MASK (1 << 6) +#define FLOWER_ATTR_SRC_MAC (1 << 7) +#define FLOWER_ATTR_SRC_MAC_MASK (1 << 8) +#define FLOWER_ATTR_IP_DSCP (1 << 9) +#define FLOWER_ATTR_IP_DSCP_MASK (1 << 10) +#define FLOWER_ATTR_PROTO (1 << 11) +#define FLOWER_ATTR_IPV4_SRC (1 << 12) +#define FLOWER_ATTR_IPV4_SRC_MASK (1 << 13) +#define FLOWER_ATTR_IPV4_DST (1 << 14) +#define FLOWER_ATTR_IPV4_DST_MASK (1 << 15) +/** @endcond */ + +#define FLOWER_DSCP_MAX 0xe0 +#define FLOWER_DSCP_MASK_MAX 0xe0 +#define FLOWER_VID_MAX 4095 +#define FLOWER_VLAN_PRIO_MAX 7 + +static struct nla_policy flower_policyTCA_FLOWER_MAX + 1 = { + TCA_FLOWER_FLAGS = { .type = NLA_U32 }, + TCA_FLOWER_KEY_ETH_TYPE = { .type = NLA_U16 }, + TCA_FLOWER_KEY_ETH_DST = { .maxlen = ETH_ALEN }, + TCA_FLOWER_KEY_ETH_DST_MASK = { .maxlen = ETH_ALEN }, + TCA_FLOWER_KEY_ETH_SRC = { .maxlen = ETH_ALEN }, + TCA_FLOWER_KEY_ETH_SRC_MASK = { .maxlen = ETH_ALEN }, + TCA_FLOWER_KEY_VLAN_ID = { .type = NLA_U16 }, + TCA_FLOWER_KEY_VLAN_PRIO = { .type = NLA_U8 }, + TCA_FLOWER_KEY_IP_TOS = { .type = NLA_U8 }, + TCA_FLOWER_KEY_IP_TOS_MASK = { .type = NLA_U8 }, + TCA_FLOWER_KEY_VLAN_ETH_TYPE = { .type = NLA_U16 }, + TCA_FLOWER_KEY_IPV4_SRC = { .type = NLA_U32 }, + TCA_FLOWER_KEY_IPV4_SRC_MASK = { .type = NLA_U32 }, + TCA_FLOWER_KEY_IPV4_DST = { .type = NLA_U32 }, + TCA_FLOWER_KEY_IPV4_DST_MASK = { .type = NLA_U32 }, +}; + +static int flower_msg_parser(struct rtnl_tc *tc, void *data) +{ + struct rtnl_flower *f = data; + struct nlattr *tbTCA_FLOWER_MAX + 1; + int err; + + err = tca_parse(tb, TCA_FLOWER_MAX, tc, flower_policy); + if (err < 0) + return err; + + if (tbTCA_FLOWER_FLAGS) { + f->cf_flags = nla_get_u32(tbTCA_FLOWER_FLAGS); + f->cf_mask |= FLOWER_ATTR_FLAGS; + } + + if (tbTCA_FLOWER_ACT) { + err = rtnl_act_parse(&f->cf_act, tbTCA_FLOWER_ACT); + if (err) + return err; + + f->cf_mask |= FLOWER_ATTR_ACTION; + } + + if (tbTCA_FLOWER_KEY_ETH_TYPE) { + f->cf_proto = nla_get_u16(tbTCA_FLOWER_KEY_ETH_TYPE); + f->cf_mask |= FLOWER_ATTR_PROTO; + } + + if (tbTCA_FLOWER_KEY_VLAN_ID) { + f->cf_vlan_id = nla_get_u16(tbTCA_FLOWER_KEY_VLAN_ID); + f->cf_mask |= FLOWER_ATTR_VLAN_ID; + } + + if (tbTCA_FLOWER_KEY_VLAN_PRIO) { + f->cf_vlan_prio = nla_get_u8(tbTCA_FLOWER_KEY_VLAN_PRIO); + f->cf_mask |= FLOWER_ATTR_VLAN_PRIO; + } + + if (tbTCA_FLOWER_KEY_VLAN_ETH_TYPE) { + f->cf_vlan_ethtype = nla_get_u16(tbTCA_FLOWER_KEY_VLAN_ETH_TYPE); + f->cf_mask |= FLOWER_ATTR_VLAN_ETH_TYPE; + } + + if (tbTCA_FLOWER_KEY_ETH_DST) { + nla_memcpy(f->cf_dst_mac, tbTCA_FLOWER_KEY_ETH_DST, ETH_ALEN); + f->cf_mask |= FLOWER_ATTR_DST_MAC; + } + + if (tbTCA_FLOWER_KEY_ETH_DST_MASK) { + nla_memcpy(f->cf_dst_mac_mask, tbTCA_FLOWER_KEY_ETH_DST_MASK, ETH_ALEN); + f->cf_mask |= FLOWER_ATTR_DST_MAC_MASK; + } + + if (tbTCA_FLOWER_KEY_ETH_SRC) { + nla_memcpy(f->cf_src_mac, tbTCA_FLOWER_KEY_ETH_SRC, ETH_ALEN); + f->cf_mask |= FLOWER_ATTR_SRC_MAC; + } + + if (tbTCA_FLOWER_KEY_ETH_SRC_MASK) { + nla_memcpy(f->cf_src_mac_mask, tbTCA_FLOWER_KEY_ETH_SRC_MASK, ETH_ALEN); + f->cf_mask |= FLOWER_ATTR_SRC_MAC_MASK; + } + + if (tbTCA_FLOWER_KEY_IP_TOS) { + f->cf_ip_dscp = nla_get_u8(tbTCA_FLOWER_KEY_IP_TOS); + f->cf_mask |= FLOWER_ATTR_IP_DSCP; + } + + if (tbTCA_FLOWER_KEY_IP_TOS_MASK) { + f->cf_ip_dscp_mask = nla_get_u8(tbTCA_FLOWER_KEY_IP_TOS_MASK); + f->cf_mask |= FLOWER_ATTR_IP_DSCP_MASK; + } + + if (tbTCA_FLOWER_KEY_IPV4_SRC) { + f->cf_ipv4_src = nla_get_u32(tbTCA_FLOWER_KEY_IPV4_SRC); + f->cf_mask |= FLOWER_ATTR_IPV4_SRC; + } + + if (tbTCA_FLOWER_KEY_IPV4_SRC_MASK) { + f->cf_ipv4_src_mask = + nla_get_u32(tbTCA_FLOWER_KEY_IPV4_SRC_MASK); + f->cf_mask |= FLOWER_ATTR_IPV4_SRC_MASK; + } + + if (tbTCA_FLOWER_KEY_IPV4_DST) { + f->cf_ipv4_dst = nla_get_u32(tbTCA_FLOWER_KEY_IPV4_DST); + f->cf_mask |= FLOWER_ATTR_IPV4_DST; + } + + if (tbTCA_FLOWER_KEY_IPV4_DST_MASK) { + f->cf_ipv4_dst_mask = + nla_get_u32(tbTCA_FLOWER_KEY_IPV4_DST_MASK); + f->cf_mask |= FLOWER_ATTR_IPV4_DST_MASK; + } + + return 0; +} + +static int flower_msg_fill(struct rtnl_tc *tc, void *data, struct nl_msg *msg) +{ + struct rtnl_flower *f = data; + int err; + + if (!f) + return 0; + + if (f->cf_mask & FLOWER_ATTR_FLAGS) + NLA_PUT_U32(msg, TCA_FLOWER_FLAGS, f->cf_flags); + + if (f->cf_mask & FLOWER_ATTR_ACTION) { + err = rtnl_act_fill(msg, TCA_FLOWER_ACT, f->cf_act); + if (err) + return err; + } + + if (f->cf_mask & FLOWER_ATTR_PROTO) + NLA_PUT_U16(msg, TCA_FLOWER_KEY_ETH_TYPE, f->cf_proto); + + if (f->cf_mask & FLOWER_ATTR_VLAN_ID) + NLA_PUT_U16(msg, TCA_FLOWER_KEY_VLAN_ID, f->cf_vlan_id); + + if (f->cf_mask & FLOWER_ATTR_VLAN_PRIO) + NLA_PUT_U8(msg, TCA_FLOWER_KEY_VLAN_PRIO, f->cf_vlan_prio); + + if (f->cf_mask & FLOWER_ATTR_VLAN_ETH_TYPE) + NLA_PUT_U16(msg, TCA_FLOWER_KEY_VLAN_ETH_TYPE, f->cf_vlan_ethtype); + + if (f->cf_mask & FLOWER_ATTR_DST_MAC) + NLA_PUT(msg, TCA_FLOWER_KEY_ETH_DST, ETH_ALEN, f->cf_dst_mac); + + if (f->cf_mask & FLOWER_ATTR_DST_MAC_MASK) + NLA_PUT(msg, TCA_FLOWER_KEY_ETH_DST_MASK, ETH_ALEN, f->cf_dst_mac_mask); + + if (f->cf_mask & FLOWER_ATTR_SRC_MAC) + NLA_PUT(msg, TCA_FLOWER_KEY_ETH_SRC, ETH_ALEN, f->cf_src_mac); + + if (f->cf_mask & FLOWER_ATTR_SRC_MAC_MASK) + NLA_PUT(msg, TCA_FLOWER_KEY_ETH_SRC_MASK, ETH_ALEN, f->cf_src_mac_mask); + + if (f->cf_mask & FLOWER_ATTR_IP_DSCP) + NLA_PUT_U8(msg, TCA_FLOWER_KEY_IP_TOS, f->cf_ip_dscp);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/fw.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/fw.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/fw.c fw classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2006 Petr Gotthard <petr.gotthard@siemens.com> * Copyright (c) 2006 Siemens AG Oesterreich @@ -94,9 +88,12 @@ { struct rtnl_fw *dst = _dst, *src = _src; + dst->cf_act = NULL; + dst->cf_police = NULL; + if (src->cf_act && !(dst->cf_act = nl_data_clone(src->cf_act))) return -NLE_NOMEM; - + if (src->cf_police && !(dst->cf_police = nl_data_clone(src->cf_police))) return -NLE_NOMEM;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/mall.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/mall.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/mall.c match-all classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2017 Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com> */ @@ -108,7 +102,7 @@ mall->m_mask |= MALL_ATTR_ACTION; err = rtnl_act_append(&mall->m_act, act); - if (err) + if (err < 0) return err; rtnl_act_get(act); @@ -188,7 +182,7 @@ if (tbTCA_MATCHALL_ACT) { mall->m_mask |= MALL_ATTR_ACTION; err = rtnl_act_parse(&mall->m_act, tbTCA_MATCHALL_ACT); - if (err) + if (err < 0) return err; } @@ -212,13 +206,13 @@ int err; err = rtnl_act_fill(msg, TCA_MATCHALL_ACT, mall->m_act); - if (err) + if (err < 0) return err; } return 0; - nla_put_failure: +nla_put_failure: return -NLE_NOMEM; } @@ -228,6 +222,8 @@ struct rtnl_act *next, *new; int err; + dst->m_act = NULL; + if (src->m_act) { if (!(dst->m_act = rtnl_act_alloc())) return -NLE_NOMEM;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/police.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/police.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/police.c Policer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/cls/u32.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/cls/u32.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/u32.c u32 classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2005-2006 Petr Gotthard <petr.gotthard@siemens.com> * Copyright (c) 2005-2006 Siemens AG Oesterreich @@ -28,6 +22,8 @@ #include <netlink/route/cls/u32.h> #include <netlink/route/action.h> +#include "netlink-private/utils.h" + /** @cond SKIP */ #define U32_ATTR_DIVISOR 0x001 #define U32_ATTR_HASH 0x002 @@ -121,7 +117,7 @@ if (tbTCA_U32_ACT) { u->cu_mask |= U32_ATTR_ACTION; err = rtnl_act_parse(&u->cu_act, tbTCA_U32_ACT); - if (err) + if (err < 0) return err; } @@ -183,27 +179,96 @@ static int u32_clone(void *_dst, void *_src) { struct rtnl_u32 *dst = _dst, *src = _src; + _nl_auto_nl_data struct nl_data *selector = NULL; + _nl_auto_nl_data struct nl_data *mark = NULL; + _nl_auto_nl_data struct nl_data *police = NULL; + _nl_auto_nl_data struct nl_data *pcnt = NULL; + _nl_auto_nl_data struct nl_data *opts = NULL; + _nl_auto_nl_data struct nl_data *xstats = NULL; + _nl_auto_nl_data struct nl_data *subdata = NULL; + _nl_auto_rtnl_act struct rtnl_act *act = NULL; + + dst->cu_pcnt = NULL; + dst->cu_selector = NULL; + dst->cu_mark = NULL; + dst->cu_act = NULL; + dst->cu_police = NULL; + + if (src->cu_selector) { + if (!(selector = nl_data_clone(src->cu_selector))) + return -NLE_NOMEM; + } - if (src->cu_selector && - !(dst->cu_selector = nl_data_clone(src->cu_selector))) - return -NLE_NOMEM; - - if (src->cu_mark && - !(dst->cu_mark = nl_data_clone(src->cu_mark))) - return -NLE_NOMEM; + if (src->cu_mark) { + if (!(mark = nl_data_clone(src->cu_mark))) + return -NLE_NOMEM; + } if (src->cu_act) { - if (!(dst->cu_act = rtnl_act_alloc())) + if (!(act = rtnl_act_alloc())) return -NLE_NOMEM; - memcpy(dst->cu_act, src->cu_act, sizeof(struct rtnl_act)); + if (src->cu_act->c_opts) { + if (!(opts = nl_data_clone(src->cu_act->c_opts))) + return -NLE_NOMEM; + } + + if (src->cu_act->c_xstats) { + if (!(xstats = nl_data_clone(src->cu_act->c_xstats))) + return -NLE_NOMEM; + } + + if (src->cu_act->c_subdata) { + if (!(subdata = nl_data_clone(src->cu_act->c_subdata))) + return -NLE_NOMEM; + } } - if (src->cu_police && !(dst->cu_police = nl_data_clone(src->cu_police))) - return -NLE_NOMEM; + if (src->cu_police) { + if (!(police = nl_data_clone(src->cu_police))) + return -NLE_NOMEM; + } - if (src->cu_pcnt && !(dst->cu_pcnt = nl_data_clone(src->cu_pcnt))) - return -NLE_NOMEM; + if (src->cu_pcnt) { + if (!(pcnt = nl_data_clone(src->cu_pcnt))) + return -NLE_NOMEM; + } + + /* we've passed the critical point and its safe to proceed */ + + if (selector) + dst->cu_selector = _nl_steal_pointer(&selector); + + if (mark) + dst->cu_mark = _nl_steal_pointer(&mark); + + if (police) + dst->cu_police = _nl_steal_pointer(&police); + + if (pcnt) + dst->cu_pcnt = _nl_steal_pointer(&pcnt); + + if (act) { + dst->cu_act = _nl_steal_pointer(&act); + + /* action nl list next and prev pointers must be updated */ + nl_init_list_head(&dst->cu_act->ce_list); + + if (opts) + dst->cu_act->c_opts = _nl_steal_pointer(&opts); + + if (xstats) + dst->cu_act->c_xstats = _nl_steal_pointer(&xstats); + + if (subdata) + dst->cu_act->c_subdata = _nl_steal_pointer(&subdata); + + if (dst->cu_act->c_link) { + nl_object_get(OBJ_CAST(dst->cu_act->c_link)); + } + + dst->cu_act->a_next = NULL; /* Only clone first in chain */ + } return 0; } @@ -278,7 +343,9 @@ if (p->dp_type == NL_DUMP_STATS && (u->cu_mask & U32_ATTR_PCNT)) { struct tc_u32_pcnt *pcnt = u->cu_pcnt->d_data; - nl_dump(p, " successful %" PRIu64, pcnt->kcntsi); + + nl_dump(p, " successful %llu", + (long long unsigned)pcnt->kcntsi); } } } @@ -293,11 +360,6 @@ if (!u) return; - if (!(u->cu_mask & (U32_ATTR_SELECTOR & U32_ATTR_MARK))) { - nl_dump(p, "no-selector no-mark\n"); - return; - } - if (!(u->cu_mask & U32_ATTR_SELECTOR)) { nl_dump(p, "no-selector"); } else { @@ -338,9 +400,11 @@ if (u->cu_mask & U32_ATTR_PCNT) { struct tc_u32_pcnt *pc = u->cu_pcnt->d_data; + nl_dump(p, "\n"); - nl_dump_line(p, " hit %8" PRIu64 " count %8" PRIu64 "\n", - pc->rhit, pc->rcnt); + nl_dump_line(p, " hit %8llu count %8llu\n", + (long long unsigned)pc->rhit, + (long long unsigned)pc->rcnt); } } @@ -373,7 +437,7 @@ int err; err = rtnl_act_fill(msg, TCA_U32_ACT, u->cu_act); - if (err) + if (err < 0) return err; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link.c Links (Interfaces) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -93,13 +86,12 @@ int family) { struct rtnl_link_af_ops *af_ops; - void *data; af_ops = rtnl_link_af_ops_lookup(family); if (!af_ops) return NULL; - if (!(data = rtnl_link_af_alloc(link, af_ops))) { + if (!rtnl_link_af_alloc(link, af_ops)) { rtnl_link_af_ops_put(af_ops); return NULL; } @@ -223,22 +215,19 @@ static int do_foreach_af(struct rtnl_link *link, int (*cb)(struct rtnl_link *, - struct rtnl_link_af_ops *, void *, void *), + struct rtnl_link_af_ops *, void *, void *), void *arg) { int i, err; for (i = 0; i < AF_MAX; i++) { if (link->l_af_datai) { - struct rtnl_link_af_ops *ops; + _nl_auto_rtnl_link_af_ops struct rtnl_link_af_ops *ops = NULL; if (!(ops = rtnl_link_af_ops_lookup(i))) BUG(); err = cb(link, ops, link->l_af_datai, arg); - - rtnl_link_af_ops_put(ops); - if (err < 0) return err; } @@ -296,6 +285,19 @@ struct rtnl_link *src = nl_object_priv(_src); int err; + dst->l_addr = NULL; + dst->l_bcast = NULL; + dst->l_info_kind = NULL; + dst->l_info_slave_kind = NULL; + dst->l_info_ops = NULL; + memset(dst->l_af_data, 0, sizeof (dst->l_af_data)); + dst->l_info = NULL; + dst->l_ifalias = NULL; + dst->l_af_ops = NULL; + dst->l_phys_port_id = NULL; + dst->l_phys_switch_id = NULL; + dst->l_vf_list = NULL; + if (src->l_addr) if (!(dst->l_addr = nl_addr_clone(src->l_addr))) return -NLE_NOMEM; @@ -316,15 +318,24 @@ if (!(dst->l_info_slave_kind = strdup(src->l_info_slave_kind))) return -NLE_NOMEM; - if (src->l_info_ops && src->l_info_ops->io_clone) { - err = src->l_info_ops->io_clone(dst, src); - if (err < 0) - return err; + if (src->l_info_ops) { + + rtnl_link_info_ops_get(src->l_info_ops); + dst->l_info_ops = src->l_info_ops; + + if (src->l_info_ops->io_clone) { + err = src->l_info_ops->io_clone(dst, src); + if (err < 0) + return err; + } } if ((err = do_foreach_af(src, af_clone, dst)) < 0) return err; + if (src->l_af_ops) + dst->l_af_ops = af_lookup_and_alloc(dst, src->l_af_ops->ao_family); + if (src->l_phys_port_id) if (!(dst->l_phys_port_id = nl_data_clone(src->l_phys_port_id))) return -NLE_NOMEM; @@ -387,7 +398,7 @@ return -NLE_MISSING_ATTR; nla_strlcpy(link->l_name, tbIFLA_IFNAME, IFNAMSIZ); - + link->ce_mask |= LINK_ATTR_IFNAME; if (tbIFLA_STATS) { struct rtnl_link_stats *st = nla_data(tbIFLA_STATS); @@ -580,28 +591,22 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who, struct nlmsghdr *n, struct nl_parser_param *pp) { - struct rtnl_link *link; + _nl_auto_rtnl_link struct rtnl_link *link = NULL; + struct nla_policy real_link_policyARRAY_SIZE(rtln_link_policy); + struct nla_policy *link_policy = rtln_link_policy; + struct rtnl_link_af_ops *af_ops_family; struct ifinfomsg *ifi; struct nlattr *tbIFLA_MAX+1; - struct rtnl_link_af_ops *af_ops = NULL; - struct rtnl_link_af_ops *af_ops_family; int err, family; - struct nla_policy real_link_policyIFLA_MAX+1; - - memcpy(&real_link_policy, rtln_link_policy, sizeof(rtln_link_policy)); link = rtnl_link_alloc(); - if (link == NULL) { - err = -NLE_NOMEM; - goto errout; - } + if (link == NULL) + return -NLE_NOMEM; link->ce_msgtype = n->nlmsg_type; - if (!nlmsg_valid_hdr(n, sizeof(*ifi))) { - err = -NLE_MSG_TOOSHORT; - goto errout; - } + if (!nlmsg_valid_hdr(n, sizeof(*ifi))) + return -NLE_MSG_TOOSHORT; ifi = nlmsg_data(n); link->l_family = family = ifi->ifi_family; @@ -609,35 +614,37 @@ link->l_index = ifi->ifi_index; link->l_flags = ifi->ifi_flags; link->l_change = ifi->ifi_change; - link->ce_mask = (LINK_ATTR_IFNAME | LINK_ATTR_FAMILY | + link->ce_mask = (LINK_ATTR_FAMILY | LINK_ATTR_ARPTYPE| LINK_ATTR_IFINDEX | LINK_ATTR_FLAGS | LINK_ATTR_CHANGE); - if ((af_ops_family = af_ops = af_lookup_and_alloc(link, family))) { - if (af_ops->ao_protinfo_policy) { + if ((link->l_af_ops = af_lookup_and_alloc(link, family))) { + if (link->l_af_ops->ao_protinfo_policy) { + _NL_STATIC_ASSERT (sizeof(rtln_link_policy) == sizeof(real_link_policy)); + memcpy(&real_link_policy, rtln_link_policy, sizeof(rtln_link_policy)); memcpy(&real_link_policyIFLA_PROTINFO, - af_ops->ao_protinfo_policy, + link->l_af_ops->ao_protinfo_policy, sizeof(struct nla_policy)); + link_policy = real_link_policy; } - - link->l_af_ops = af_ops; } - err = nlmsg_parse(n, sizeof(*ifi), tb, IFLA_MAX, real_link_policy); + af_ops_family = link->l_af_ops; + + err = nlmsg_parse(n, sizeof(*ifi), tb, IFLA_MAX, link_policy); if (err < 0) - goto errout; + return err; err = rtnl_link_info_parse(link, tb); if (err < 0) - goto errout; + return err; if (tbIFLA_NUM_VF) { link->l_num_vf = nla_get_u32(tbIFLA_NUM_VF); link->ce_mask |= LINK_ATTR_NUM_VF; if (link->l_num_vf && tbIFLA_VFINFO_LIST) { - if ((err = rtnl_link_sriov_parse_vflist(link, tb)) < 0) { - goto errout; - } + if ((err = rtnl_link_sriov_parse_vflist(link, tb)) < 0) + return err; link->ce_mask |= LINK_ATTR_VF_LIST; } } @@ -648,7 +655,7 @@ err = nla_parse_nested(li, IFLA_INFO_MAX, tbIFLA_LINKINFO,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/api.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/api.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/api.c Link Info API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -87,13 +81,32 @@ } /** + * Take reference to a set of operations. + * @arg ops Link info operations. + */ +void rtnl_link_info_ops_get(struct rtnl_link_info_ops *ops) +{ + if (!ops) + return; + + nl_write_lock(&info_lock); + ops->io_refcnt++; + nl_write_unlock(&info_lock); +} + +/** * Give back reference to a set of operations. * @arg ops Link info operations. */ void rtnl_link_info_ops_put(struct rtnl_link_info_ops *ops) { - if (ops) - ops->io_refcnt--; + if (!ops) + return; + + nl_write_lock(&info_lock); + _nl_assert(ops->io_refcnt > 0); + ops->io_refcnt--; + nl_write_unlock(&info_lock); } /** @@ -152,6 +165,7 @@ nl_list_for_each_entry(t, &info_ops, io_list) { if (t == ops) { + _nl_assert(t->io_refcnt >= 0); if (t->io_refcnt > 0) { err = -NLE_BUSY; goto errout; @@ -208,8 +222,11 @@ */ void rtnl_link_af_ops_put(struct rtnl_link_af_ops *ops) { - if (ops) + if (ops) { + nl_write_lock(&info_lock); ops->ao_refcnt--; + nl_write_unlock(&info_lock); + } } /**
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/bonding.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/bonding.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/bonding.c Bonding Link Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011-2013 Thomas Graf <tgraf@suug.ch> */ @@ -33,12 +27,11 @@ struct rtnl_link *rtnl_link_bond_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "bond")) < 0) { + if (rtnl_link_set_type(link, "bond") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/bridge.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/bridge.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/bridge.c AF_BRIDGE link support - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -464,12 +458,11 @@ struct rtnl_link *rtnl_link_bridge_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "bridge")) < 0) { + if (rtnl_link_set_type(link, "bridge") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/can.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/can.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/can.c CAN Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Benedikt Spranger <b.spranger@linutronix.de> */ @@ -42,6 +36,8 @@ #define CAN_HAS_RESTART_MS (1<<5) #define CAN_HAS_RESTART (1<<6) #define CAN_HAS_BERR_COUNTER (1<<7) +#define CAN_HAS_DATA_BITTIMING (1<<8) +#define CAN_HAS_DATA_BITTIMING_CONST (1<<9) struct can_info { uint32_t ci_state; @@ -53,6 +49,8 @@ struct can_clock ci_clock; struct can_berr_counter ci_berr_counter; uint32_t ci_mask; + struct can_bittiming ci_data_bittiming; + struct can_bittiming_const ci_data_bittiming_const; }; /** @endcond */ @@ -67,6 +65,10 @@ = { .minlen = sizeof(struct can_bittiming_const) }, IFLA_CAN_CLOCK = { .minlen = sizeof(struct can_clock) }, IFLA_CAN_BERR_COUNTER = { .minlen = sizeof(struct can_berr_counter) }, + IFLA_CAN_DATA_BITTIMING + = { .minlen = sizeof(struct can_bittiming) }, + IFLA_CAN_DATA_BITTIMING_CONST + = { .minlen = sizeof(struct can_bittiming_const) }, }; static int can_alloc(struct rtnl_link *link) @@ -149,6 +151,18 @@ ci->ci_mask |= CAN_HAS_BERR_COUNTER; } + if (tbIFLA_CAN_DATA_BITTIMING) { + nla_memcpy(&ci->ci_data_bittiming, tbIFLA_CAN_DATA_BITTIMING, + sizeof(ci->ci_data_bittiming)); + ci->ci_mask |= CAN_HAS_DATA_BITTIMING; + } + + if (tbIFLA_CAN_DATA_BITTIMING_CONST) { + nla_memcpy(&ci->ci_data_bittiming_const, tbIFLA_CAN_DATA_BITTIMING_CONST, + sizeof(ci->ci_data_bittiming_const)); + ci->ci_mask |= CAN_HAS_DATA_BITTIMING_CONST; + } + err = 0; errout: return err; @@ -259,7 +273,7 @@ } if (ci->ci_mask & CAN_HAS_CLOCK) { - nl_dump_line(p," base freq %d Hz\n", ci->ci_clock); + nl_dump_line(p," base freq %u Hz\n", ci->ci_clock.freq); } @@ -303,28 +317,36 @@ return -NLE_MSGSIZE; if (ci->ci_mask & CAN_HAS_RESTART) - NLA_PUT_U32(msg, CAN_HAS_RESTART, ci->ci_restart); + NLA_PUT_U32(msg, IFLA_CAN_RESTART, ci->ci_restart); if (ci->ci_mask & CAN_HAS_RESTART_MS) - NLA_PUT_U32(msg, CAN_HAS_RESTART_MS, ci->ci_restart_ms); + NLA_PUT_U32(msg, IFLA_CAN_RESTART_MS, ci->ci_restart_ms); if (ci->ci_mask & CAN_HAS_CTRLMODE) - NLA_PUT(msg, CAN_HAS_CTRLMODE, sizeof(ci->ci_ctrlmode), + NLA_PUT(msg, IFLA_CAN_CTRLMODE, sizeof(ci->ci_ctrlmode), &ci->ci_ctrlmode); if (ci->ci_mask & CAN_HAS_BITTIMING) - NLA_PUT(msg, CAN_HAS_BITTIMING, sizeof(ci->ci_bittiming), + NLA_PUT(msg, IFLA_CAN_BITTIMING, sizeof(ci->ci_bittiming), &ci->ci_bittiming); if (ci->ci_mask & CAN_HAS_BITTIMING_CONST) - NLA_PUT(msg, CAN_HAS_BITTIMING_CONST, + NLA_PUT(msg, IFLA_CAN_BITTIMING_CONST, sizeof(ci->ci_bittiming_const), &ci->ci_bittiming_const); if (ci->ci_mask & CAN_HAS_CLOCK) - NLA_PUT(msg, CAN_HAS_CLOCK, sizeof(ci->ci_clock), + NLA_PUT(msg, IFLA_CAN_CLOCK, sizeof(ci->ci_clock), &ci->ci_clock); + if (ci->ci_mask & CAN_HAS_DATA_BITTIMING) + NLA_PUT(msg, IFLA_CAN_DATA_BITTIMING, sizeof(ci->ci_data_bittiming), + &ci->ci_data_bittiming); + + if (ci->ci_mask & CAN_HAS_DATA_BITTIMING_CONST) + NLA_PUT(msg, IFLA_CAN_DATA_BITTIMING_CONST, sizeof(ci->ci_data_bittiming_const), + &ci->ci_data_bittiming_const); + nla_nest_end(msg, data); nla_put_failure: @@ -489,7 +511,7 @@ } /** - * Get CAN harware-dependent bit-timing constant + * Get CAN hardware-dependent bit-timing constant * @arg link Link object * @arg bt_const Bit-timing constant * @@ -544,7 +566,7 @@ * @return 0 on success or a negative error code */ int rtnl_link_can_set_bittiming(struct rtnl_link *link, - struct can_bittiming *bit_timing) + const struct can_bittiming *bit_timing) { struct can_info *ci = link->l_info; @@ -747,6 +769,98 @@ return 0; } +/** + * Get CAN FD hardware-dependent data bit-timing constant + * @arg link Link object + * @arg data_bt_const CAN FD data bit-timing constant + * + * @return 0 on success or a negative error code + */ +int rtnl_link_can_get_data_bittiming_const(struct rtnl_link *link, + struct can_bittiming_const *data_bt_const) +{ + struct can_info *ci = link->l_info; + + IS_CAN_LINK_ASSERT(link); + if (!data_bt_const) + return -NLE_INVAL; + + if (ci->ci_mask & CAN_HAS_DATA_BITTIMING_CONST) + *data_bt_const = ci->ci_data_bittiming_const; + else + return -NLE_AGAIN; + + return 0; +} + +/** + * Set CAN FD device data bit-timing-const + * @arg link Link object + * @arg data_bit_timing CAN FD data bit-timing + * + * @return 0 on success or a negative error code + */ +int rtnl_link_can_set_data_bittiming_const(struct rtnl_link *link, + const struct can_bittiming_const *data_bt_const) +{ + struct can_info *ci = link->l_info; + + IS_CAN_LINK_ASSERT(link); + if (!data_bt_const) + return -NLE_INVAL; + + ci->ci_data_bittiming_const = *data_bt_const; + ci->ci_mask |= CAN_HAS_DATA_BITTIMING_CONST; + + return 0; +} + +/** + * Get CAN FD device data bit-timing + * @arg link Link object + * @arg data_bit_timing CAN FD data bit-timing + * + * @return 0 on success or a negative error code + */ +int rtnl_link_can_get_data_bittiming(struct rtnl_link *link, + struct can_bittiming *data_bit_timing) +{ + struct can_info *ci = link->l_info; + + IS_CAN_LINK_ASSERT(link); + if (!data_bit_timing) + return -NLE_INVAL; + + if (ci->ci_mask & CAN_HAS_DATA_BITTIMING) + *data_bit_timing = ci->ci_data_bittiming; + else
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/dummy.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/dummy.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/dummy.c Dummy Interfaces - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/geneve.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/geneve.c
Changed
@@ -1,12 +1,8 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/geneve.c Geneve Link Info - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Wang Jian <jianjian.wang1@gmail.com> */ + /** * @ingroup link * @defgroup geneve Geneve @@ -190,16 +186,12 @@ if (geneve->mask & GENEVE_ATTR_REMOTE) { nl_dump(p, " remote "); - if (inet_ntop(AF_INET, &geneve->remote, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", ntohs(geneve->remote)); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET, &geneve->remote, addr)); } else if (geneve->mask & GENEVE_ATTR_REMOTE6) { nl_dump(p, " remote "); - if (inet_ntop(AF_INET6, &geneve->remote6, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", geneve->remote6); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET6, &geneve->remote6, addr)); } if (geneve->mask & GENEVE_ATTR_TTL) { @@ -240,7 +232,7 @@ if (geneve->mask & GENEVE_ATTR_UDP_ZERO_CSUM6_RX) { nl_dump(p, " udp-zero-csum6-rx "); - if (geneve->udp_zero_csum6_tx) + if (geneve->udp_zero_csum6_rx) nl_dump_line(p, "enabled (%#x)\n", geneve->udp_zero_csum6_rx); else nl_dump_line(p, "disabled\n"); @@ -356,12 +348,11 @@ struct rtnl_link *rtnl_link_geneve_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "geneve")) < 0) { + if (rtnl_link_set_type(link, "geneve") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ifb.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ifb.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ifb.c IFB Interfaces - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/inet.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/inet.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/inet.c AF_INET link operations - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/inet6.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/inet6.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/inet6.c AF_INET6 link operations - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */ @@ -16,6 +10,7 @@ #include <netlink/route/link/inet6.h> #include <netlink-private/route/link/api.h> +#include "netlink-private/route/utils.h" #include "netlink-private/utils.h" #define I6_ADDR_GEN_MODE_UNKNOWN UINT8_MAX @@ -141,8 +136,11 @@ 33 = RTNL_LINK_IP6_ECT1PKTS, /* IPSTATS_MIB_ECT1PKTS */ 34 = RTNL_LINK_IP6_ECT0PKTS, /* IPSTATS_MIB_ECT0PKTS */ 35 = RTNL_LINK_IP6_CEPKTS, /* IPSTATS_MIB_CEPKTS */ + 36 = RTNL_LINK_REASM_OVERLAPS, /* IPSTATS_MIB_REASM_OVERLAPS */ }; +const uint8_t *const _nltst_map_stat_id_from_IPSTATS_MIB_v2 = map_stat_id_from_IPSTATS_MIB_v2; + static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr, void *data) { @@ -212,6 +210,9 @@ int i; int len = min_t(int, __ICMP6_MIB_MAX, nla_len(tbIFLA_INET6_ICMP6STATS) / 8); + _NL_STATIC_ASSERT (__ICMP6_MIB_MAX == 6); + _NL_STATIC_ASSERT (RTNL_LINK_ICMP6_CSUMERRORS - RTNL_LINK_ICMP6_INMSGS + 1 == 5); + for (i = 1; i < len; i++) { memcpy(&stat, &cnti * sizeof(stat), sizeof(stat)); rtnl_link_set_stat(link, RTNL_LINK_ICMP6_INMSGS + i - 1, @@ -412,7 +413,7 @@ if (octets) nl_dump(p, "%14.2f %3s ", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B ", 0); + nl_dump(p, "%16u B ", 0); nl_dump(p, "%18" PRIu64 " %18" PRIu64 "\n", link->l_statsRTNL_LINK_IP6_INDISCARDS, @@ -428,7 +429,7 @@ if (octets) nl_dump(p, "%14.2f %3s ", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B ", 0); + nl_dump(p, "%16u B ", 0); nl_dump(p, "%18" PRIu64 " %18" PRIu64 "\n", link->l_statsRTNL_LINK_IP6_OUTDISCARDS, @@ -444,7 +445,7 @@ if (octets) nl_dump(p, "%14.2f %3s ", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B ", 0); + nl_dump(p, "%16u B ", 0); nl_dump(p, "%18" PRIu64 " ", link->l_statsRTNL_LINK_IP6_INBCASTPKTS); octets = nl_cancel_down_bytes(link->l_statsRTNL_LINK_IP6_INBCASTOCTETS, @@ -452,7 +453,7 @@ if (octets) nl_dump(p, "%14.2f %3s\n", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B\n", 0); + nl_dump(p, "%16u B\n", 0); nl_dump(p, " OutMcastPkts OutMcastOctets " " OutBcastPkts OutBcastOctests\n"); @@ -464,7 +465,7 @@ if (octets) nl_dump(p, "%14.2f %3s ", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B ", 0); + nl_dump(p, "%16u B ", 0); nl_dump(p, "%18" PRIu64 " ", link->l_statsRTNL_LINK_IP6_OUTBCASTPKTS); octets = nl_cancel_down_bytes(link->l_statsRTNL_LINK_IP6_OUTBCASTOCTETS, @@ -472,7 +473,7 @@ if (octets) nl_dump(p, "%14.2f %3s\n", octets, octetsUnit); else - nl_dump(p, "%16" PRIu64 " B\n", 0); + nl_dump(p, "%16u B\n", 0); nl_dump(p, " ReasmOKs ReasmFails " " ReasmReqds ReasmTimeout\n");
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ip6gre.c
Added
@@ -0,0 +1,886 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +/** + * @ingroup link + * @defgroup ip6gre IP6GRE + * ip6gre link module + * + * @details + * \b Link Type Name: "ip6gre" + * + * @route_doc{link_ip6gre, IP6GRE Documentation} + * + * @{ + */ + +#include <netlink-private/netlink.h> +#include <netlink/netlink.h> +#include <netlink/attr.h> +#include <netlink/utils.h> +#include <netlink/object.h> +#include <netlink/route/rtnl.h> +#include <netlink/route/link/ip6gre.h> +#include <netlink-private/route/link/api.h> +#include <linux/if_tunnel.h> + +#define IP6GRE_ATTR_LINK (1 << 0) +#define IP6GRE_ATTR_IFLAGS (1 << 1) +#define IP6GRE_ATTR_OFLAGS (1 << 2) +#define IP6GRE_ATTR_IKEY (1 << 3) +#define IP6GRE_ATTR_OKEY (1 << 4) +#define IP6GRE_ATTR_LOCAL (1 << 5) +#define IP6GRE_ATTR_REMOTE (1 << 6) +#define IP6GRE_ATTR_TTL (1 << 7) +#define IP6GRE_ATTR_ENCAPLIMIT (1 << 8) +#define IP6GRE_ATTR_FLOWINFO (1 << 9) +#define IP6GRE_ATTR_FLAGS (1 << 10) +#define IP6GRE_ATTR_FWMARK (1 << 11) + +struct ip6gre_info +{ + uint8_t ttl; + uint8_t encaplimit; + uint16_t iflags; + uint16_t oflags; + uint32_t ikey; + uint32_t okey; + uint32_t link; + uint32_t flowinfo; + uint32_t flags; + struct in6_addr local; + struct in6_addr remote; + uint32_t fwmark; + uint32_t ip6gre_mask; +}; + +static struct nla_policy ip6gre_policyIFLA_GRE_MAX + 1 = { + IFLA_GRE_LINK = { .type = NLA_U32 }, + IFLA_GRE_IFLAGS = { .type = NLA_U16 }, + IFLA_GRE_OFLAGS = { .type = NLA_U16 }, + IFLA_GRE_IKEY = { .type = NLA_U32 }, + IFLA_GRE_OKEY = { .type = NLA_U32 }, + IFLA_GRE_LOCAL = { .minlen = sizeof(struct in6_addr) }, + IFLA_GRE_REMOTE = { .minlen = sizeof(struct in6_addr) }, + IFLA_GRE_TTL = { .type = NLA_U8 }, + IFLA_GRE_ENCAP_LIMIT = { .type = NLA_U8 }, + IFLA_GRE_FLOWINFO = { .type = NLA_U32 }, + IFLA_GRE_FLAGS = { .type = NLA_U32 }, + IFLA_GRE_FWMARK = { .type = NLA_U32 }, +}; + +static int ip6gre_alloc(struct rtnl_link *link) +{ + struct ip6gre_info *ip6gre; + + if (link->l_info) + memset(link->l_info, 0, sizeof(*ip6gre)); + else { + ip6gre = calloc(1, sizeof(*ip6gre)); + if (!ip6gre) + return -NLE_NOMEM; + + link->l_info = ip6gre; + } + + return 0; +} + +static int ip6gre_parse(struct rtnl_link *link, struct nlattr *data, + struct nlattr *xstats) +{ + struct nlattr *tbIFLA_GRE_MAX + 1; + struct ip6gre_info *ip6gre; + int err; + + NL_DBG(3, "Parsing IP6GRE link info\n"); + + err = nla_parse_nested(tb, IFLA_GRE_MAX, data, ip6gre_policy); + if (err < 0) + goto errout; + + err = ip6gre_alloc(link); + if (err < 0) + goto errout; + + ip6gre = link->l_info; + + if (tbIFLA_GRE_LINK) { + ip6gre->link = nla_get_u32(tbIFLA_GRE_LINK); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_LINK; + } + + if (tbIFLA_GRE_IFLAGS) { + ip6gre->iflags = nla_get_u16(tbIFLA_GRE_IFLAGS); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_IFLAGS; + } + + if (tbIFLA_GRE_OFLAGS) { + ip6gre->oflags = nla_get_u16(tbIFLA_GRE_OFLAGS); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_OFLAGS; + } + + if (tbIFLA_GRE_IKEY) { + ip6gre->ikey = nla_get_u32(tbIFLA_GRE_IKEY); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_IKEY; + } + + if (tbIFLA_GRE_OKEY) { + ip6gre->okey = nla_get_u32(tbIFLA_GRE_OKEY); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_OKEY; + } + + if (tbIFLA_GRE_LOCAL) { + nla_memcpy(&ip6gre->local, tbIFLA_GRE_LOCAL, sizeof(struct in6_addr)); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_LOCAL; + } + + if (tbIFLA_GRE_REMOTE) { + nla_memcpy(&ip6gre->remote, tbIFLA_GRE_REMOTE, sizeof(struct in6_addr)); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_REMOTE; + } + + if (tbIFLA_GRE_TTL) { + ip6gre->ttl = nla_get_u8(tbIFLA_GRE_TTL); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_TTL; + } + + if (tbIFLA_GRE_ENCAP_LIMIT) { + ip6gre->encaplimit = nla_get_u8(tbIFLA_GRE_ENCAP_LIMIT); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_ENCAPLIMIT; + } + + if (tbIFLA_GRE_FLOWINFO) { + ip6gre->flowinfo = nla_get_u32(tbIFLA_GRE_FLOWINFO); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_FLOWINFO; + } + + if (tbIFLA_GRE_FLAGS) { + ip6gre->flags = nla_get_u32(tbIFLA_GRE_FLAGS); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_FLAGS; + } + + if (tbIFLA_GRE_FWMARK) { + ip6gre->fwmark = nla_get_u32(tbIFLA_GRE_FWMARK); + ip6gre->ip6gre_mask |= IP6GRE_ATTR_FWMARK; + } + + err = 0; + + errout: + return err; +} + +static int ip6gre_put_attrs(struct nl_msg *msg, struct rtnl_link *link) +{ + struct ip6gre_info *ip6gre = link->l_info; + struct nlattr *data; + + data = nla_nest_start(msg, IFLA_INFO_DATA); + if (!data) + return -NLE_MSGSIZE; + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_LINK) + NLA_PUT_U32(msg, IFLA_GRE_LINK, ip6gre->link); + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_IFLAGS) + NLA_PUT_U16(msg, IFLA_GRE_IFLAGS, ip6gre->iflags); + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_OFLAGS) + NLA_PUT_U16(msg, IFLA_GRE_OFLAGS, ip6gre->oflags); + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_IKEY) + NLA_PUT_U32(msg, IFLA_GRE_IKEY, ip6gre->ikey); + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_OKEY) + NLA_PUT_U32(msg, IFLA_GRE_OKEY, ip6gre->okey); + + if (ip6gre->ip6gre_mask & IP6GRE_ATTR_LOCAL) + NLA_PUT(msg, IFLA_GRE_LOCAL, sizeof(struct in6_addr), &ip6gre->local); +
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ip6tnl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ip6tnl.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ip6tnl.c IP6TNL Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -42,6 +36,7 @@ #define IP6_TNL_ATTR_FLAGS (1 << 6) #define IP6_TNL_ATTR_PROTO (1 << 7) #define IP6_TNL_ATTR_FLOWINFO (1 << 8) +#define IP6_TNL_ATTR_FWMARK (1 << 9) struct ip6_tnl_info { @@ -54,6 +49,7 @@ uint32_t flowinfo; struct in6_addr local; struct in6_addr remote; + uint32_t fwmark; uint32_t ip6_tnl_mask; }; @@ -67,6 +63,7 @@ IFLA_IPTUN_FLOWINFO = { .type = NLA_U32 }, IFLA_IPTUN_FLAGS = { .type = NLA_U32 }, IFLA_IPTUN_PROTO = { .type = NLA_U8 }, + IFLA_IPTUN_FWMARK = { .type = NLA_U32 }, }; static int ip6_tnl_alloc(struct rtnl_link *link) @@ -150,6 +147,11 @@ ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_PROTO; } + if (tbIFLA_IPTUN_FWMARK) { + ip6_tnl->fwmark = nla_get_u32(tbIFLA_IPTUN_FWMARK); + ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FWMARK; + } + err = 0; errout: @@ -195,6 +197,9 @@ else NLA_PUT_U8(msg, IFLA_IPTUN_PROTO, 0); + if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_IPTUN_FWMARK, ip6_tnl->fwmark); + nla_nest_end(msg, data); nla_put_failure: @@ -236,20 +241,14 @@ if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_LOCAL) { nl_dump(p, " local "); - - if(inet_ntop(AF_INET6, &ip6_tnl->local, addr, INET6_ADDRSTRLEN)) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", ip6_tnl->local); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET6, &ip6_tnl->local, addr)); } if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_REMOTE) { nl_dump(p, " remote "); - - if(inet_ntop(AF_INET6, &ip6_tnl->remote, addr, INET6_ADDRSTRLEN)) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", ip6_tnl->remote); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET6, &ip6_tnl->remote, addr)); } if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_TTL) { @@ -281,6 +280,11 @@ nl_dump(p, " proto "); nl_dump_line(p, " (%x)\n", ip6_tnl->proto); } + + if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FWMARK) { + nl_dump(p, " fwmark "); + nl_dump_line(p, "%x\n", ip6_tnl->fwmark); + } } static int ip6_tnl_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -688,6 +692,46 @@ return ip6_tnl->proto; } +/** + * Set IP6_TNL tunnel fwmark + * @arg link Link object + * @arg fwmark fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ip6_tnl_set_fwmark(struct rtnl_link *link, uint32_t fwmark) +{ + struct ip6_tnl_info *ip6_tnl = link->l_info; + + IS_IP6_TNL_LINK_ASSERT(link); + + ip6_tnl->fwmark = fwmark; + ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FWMARK; + + return 0; +} + +/** + * Get IP6_TNL tunnel fwmark + * @arg link Link object + * @arg fwmark addr to fill in with the fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ip6_tnl_get_fwmark(struct rtnl_link *link, uint32_t *fwmark) +{ + struct ip6_tnl_info *ip6_tnl = link->l_info; + + IS_IP6_TNL_LINK_ASSERT(link); + + if (!(ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FWMARK)) + return -NLE_NOATTR; + + *fwmark = ip6_tnl->fwmark; + + return 0; +} + static void __init ip6_tnl_init(void) { rtnl_link_register_info(&ip6_tnl_info_ops);
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ip6vti.c
Added
@@ -0,0 +1,554 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +/** + * @ingroup link + * @defgroup ip6vti IP6VTI + * ip6vti link module + * + * @details + * \b Link Type Name: "vti6" + * + * @route_doc{link_ip6vti, IP6VTI Documentation} + * + * @{ + */ + +#include <netlink-private/netlink.h> +#include <netlink/netlink.h> +#include <netlink/attr.h> +#include <netlink/utils.h> +#include <netlink/object.h> +#include <netlink/route/rtnl.h> +#include <netlink/route/link/ip6vti.h> +#include <netlink-private/route/link/api.h> +#include <linux/if_tunnel.h> + +#define IP6VTI_ATTR_LINK (1 << 0) +#define IP6VTI_ATTR_IKEY (1 << 1) +#define IP6VTI_ATTR_OKEY (1 << 2) +#define IP6VTI_ATTR_LOCAL (1 << 3) +#define IP6VTI_ATTR_REMOTE (1 << 4) +#define IP6VTI_ATTR_FWMARK (1 << 5) + +struct ip6vti_info +{ + uint32_t link; + uint32_t ikey; + uint32_t okey; + struct in6_addr local; + struct in6_addr remote; + uint32_t fwmark; + uint32_t ip6vti_mask; +}; + +static struct nla_policy ip6vti_policyIFLA_VTI_MAX + 1 = { + IFLA_VTI_LINK = { .type = NLA_U32 }, + IFLA_VTI_IKEY = { .type = NLA_U32 }, + IFLA_VTI_OKEY = { .type = NLA_U32 }, + IFLA_VTI_LOCAL = { .minlen = sizeof(struct in6_addr) }, + IFLA_VTI_REMOTE = { .minlen = sizeof(struct in6_addr) }, + IFLA_VTI_FWMARK = { .type = NLA_U32 }, +}; + +static int ip6vti_alloc(struct rtnl_link *link) +{ + struct ip6vti_info *ip6vti; + + if (link->l_info) + memset(link->l_info, 0, sizeof(*ip6vti)); + else { + ip6vti = calloc(1, sizeof(*ip6vti)); + if (!ip6vti) + return -NLE_NOMEM; + + link->l_info = ip6vti; + } + + return 0; +} + +static int ip6vti_parse(struct rtnl_link *link, struct nlattr *data, + struct nlattr *xstats) +{ + struct nlattr *tbIFLA_VTI_MAX + 1; + struct ip6vti_info *ip6vti; + int err; + + NL_DBG(3, "Parsing IP6VTI link info\n"); + + err = nla_parse_nested(tb, IFLA_VTI_MAX, data, ip6vti_policy); + if (err < 0) + goto errout; + + err = ip6vti_alloc(link); + if (err < 0) + goto errout; + + ip6vti = link->l_info; + + if (tbIFLA_VTI_LINK) { + ip6vti->link = nla_get_u32(tbIFLA_VTI_LINK); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_LINK; + } + + if (tbIFLA_VTI_IKEY) { + ip6vti->ikey = nla_get_u32(tbIFLA_VTI_IKEY); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_IKEY; + } + + if (tbIFLA_VTI_OKEY) { + ip6vti->okey = nla_get_u32(tbIFLA_VTI_OKEY); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_OKEY; + } + + if (tbIFLA_VTI_LOCAL) { + nla_memcpy(&ip6vti->local, tbIFLA_VTI_LOCAL, sizeof(struct in6_addr)); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_LOCAL; + } + + if (tbIFLA_VTI_REMOTE) { + nla_memcpy(&ip6vti->remote, tbIFLA_VTI_REMOTE, sizeof(struct in6_addr)); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_REMOTE; + } + + if (tbIFLA_VTI_FWMARK) { + ip6vti->fwmark = nla_get_u32(tbIFLA_VTI_FWMARK); + ip6vti->ip6vti_mask |= IP6VTI_ATTR_FWMARK; + } + + err = 0; + + errout: + return err; +} + +static int ip6vti_put_attrs(struct nl_msg *msg, struct rtnl_link *link) +{ + struct ip6vti_info *ip6vti = link->l_info; + struct nlattr *data; + + data = nla_nest_start(msg, IFLA_INFO_DATA); + if (!data) + return -NLE_MSGSIZE; + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_LINK) + NLA_PUT_U32(msg, IFLA_VTI_LINK, ip6vti->link); + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_IKEY) + NLA_PUT_U32(msg, IFLA_VTI_IKEY, ip6vti->ikey); + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_OKEY) + NLA_PUT_U32(msg, IFLA_VTI_OKEY, ip6vti->okey); + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_LOCAL) + NLA_PUT(msg, IFLA_VTI_LOCAL, sizeof(struct in6_addr), &ip6vti->local); + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_REMOTE) + NLA_PUT(msg, IFLA_VTI_REMOTE, sizeof(struct in6_addr), &ip6vti->remote); + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_VTI_FWMARK, ip6vti->fwmark); + + nla_nest_end(msg, data); + +nla_put_failure: + + return 0; +} + +static void ip6vti_free(struct rtnl_link *link) +{ + struct ip6vti_info *ip6vti = link->l_info; + + free(ip6vti); + link->l_info = NULL; +} + +static void ip6vti_dump_line(struct rtnl_link *link, struct nl_dump_params *p) +{ + nl_dump(p, "ip6vti : %s", link->l_name); +} + +static void ip6vti_dump_details(struct rtnl_link *link, struct nl_dump_params *p) +{ + struct ip6vti_info *ip6vti = link->l_info; + char *name; + char addrINET6_ADDRSTRLEN; + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_LINK) { + nl_dump(p, " link "); + name = rtnl_link_get_name(link); + if (name) + nl_dump_line(p, "%s\n", name); + else + nl_dump_line(p, "%u\n", ip6vti->link); + } + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_IKEY) { + nl_dump(p, " ikey "); + nl_dump_line(p, "%x\n",ip6vti->ikey); + } + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_OKEY) { + nl_dump(p, " okey "); + nl_dump_line(p, "%x\n", ip6vti->okey); + } + + if (ip6vti->ip6vti_mask & IP6VTI_ATTR_LOCAL) { + nl_dump(p, " local "); + nl_dump_line(p, "%s\n",
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ipgre.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ipgre.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ipgre.c IPGRE Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -42,6 +36,7 @@ #define IPGRE_ATTR_TTL (1 << 7) #define IPGRE_ATTR_TOS (1 << 8) #define IPGRE_ATTR_PMTUDISC (1 << 9) +#define IPGRE_ATTR_FWMARK (1 << 10) struct ipgre_info { @@ -55,6 +50,7 @@ uint32_t link; uint32_t local; uint32_t remote; + uint32_t fwmark; uint32_t ipgre_mask; }; @@ -69,6 +65,7 @@ IFLA_GRE_TTL = { .type = NLA_U8 }, IFLA_GRE_TOS = { .type = NLA_U8 }, IFLA_GRE_PMTUDISC = { .type = NLA_U8 }, + IFLA_GRE_FWMARK = { .type = NLA_U32 }, }; static int ipgre_alloc(struct rtnl_link *link) @@ -157,6 +154,11 @@ ipgre->ipgre_mask |= IPGRE_ATTR_PMTUDISC; } + if (tbIFLA_GRE_FWMARK) { + ipgre->fwmark = nla_get_u32(tbIFLA_GRE_FWMARK); + ipgre->ipgre_mask |= IPGRE_ATTR_FWMARK; + } + err = 0; errout: @@ -202,6 +204,9 @@ if (ipgre->ipgre_mask & IPGRE_ATTR_PMTUDISC) NLA_PUT_U8(msg, IFLA_GRE_PMTUDISC, ipgre->pmtudisc); + if (ipgre->ipgre_mask & IPGRE_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_GRE_FWMARK, ipgre->fwmark); + nla_nest_end(msg, data); nla_put_failure: @@ -292,6 +297,11 @@ nl_dump(p, " pmtudisc "); nl_dump_line(p, "enabled (%#x)\n", ipgre->pmtudisc); } + + if (ipgre->ipgre_mask & IPGRE_ATTR_FWMARK) { + nl_dump(p, " fwmark "); + nl_dump_line(p, "%x\n", ipgre->fwmark); + } } static int ipgre_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -829,6 +839,46 @@ return rtnl_link_ipgre_get_pmtudisc (link); } +/** + * Set IPGRE tunnel fwmark + * @arg link Link object + * @arg fwmark fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipgre_set_fwmark(struct rtnl_link *link, uint32_t fwmark) +{ + struct ipgre_info *ipgre = link->l_info; + + IS_IPGRE_LINK_ASSERT(link); + + ipgre->fwmark = fwmark; + ipgre->ipgre_mask |= IPGRE_ATTR_FWMARK; + + return 0; +} + +/** + * Get IPGRE tunnel fwmark + * @arg link Link object + * @arg fwmark addr to fill in with the fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipgre_get_fwmark(struct rtnl_link *link, uint32_t *fwmark) +{ + struct ipgre_info *ipgre = link->l_info; + + IS_IPGRE_LINK_ASSERT(link); + + if (!(ipgre->ipgre_mask & IPGRE_ATTR_FWMARK)) + return -NLE_NOATTR; + + *fwmark = ipgre->fwmark; + + return 0; +} + static void __init ipgre_init(void) { rtnl_link_register_info(&ipgre_info_ops);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ipip.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ipip.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ipip.c IPIP Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -38,6 +32,7 @@ #define IPIP_ATTR_TTL (1 << 3) #define IPIP_ATTR_TOS (1 << 4) #define IPIP_ATTR_PMTUDISC (1 << 5) +#define IPIP_ATTR_FWMARK (1 << 6) struct ipip_info { @@ -47,6 +42,7 @@ uint32_t link; uint32_t local; uint32_t remote; + uint32_t fwmark; uint32_t ipip_mask; }; @@ -57,6 +53,7 @@ IFLA_IPTUN_TTL = { .type = NLA_U8 }, IFLA_IPTUN_TOS = { .type = NLA_U8 }, IFLA_IPTUN_PMTUDISC = { .type = NLA_U8 }, + IFLA_IPTUN_FWMARK = { .type = NLA_U32 }, }; static int ipip_alloc(struct rtnl_link *link) @@ -125,6 +122,11 @@ ipip->ipip_mask |= IPIP_ATTR_PMTUDISC; } + if (tbIFLA_IPTUN_FWMARK) { + ipip->fwmark = nla_get_u32(tbIFLA_IPTUN_FWMARK); + ipip->ipip_mask |= IPIP_ATTR_FWMARK; + } + err = 0; errout: @@ -158,6 +160,9 @@ if (ipip->ipip_mask & IPIP_ATTR_PMTUDISC) NLA_PUT_U8(msg, IFLA_IPTUN_PMTUDISC, ipip->pmtudisc); + if (ipip->ipip_mask & IPIP_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_IPTUN_FWMARK, ipip->fwmark); + nla_nest_end(msg, data); nla_put_failure: @@ -227,6 +232,11 @@ nl_dump(p, " pmtudisc "); nl_dump_line(p, "enabled (%#x)\n", ipip->pmtudisc); } + + if (ipip->ipip_mask & IPIP_ATTR_FWMARK) { + nl_dump(p, " fwmark "); + nl_dump_line(p, "%x\n", ipip->fwmark); + } } static int ipip_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -528,6 +538,46 @@ return ipip->pmtudisc; } +/** + * Set IPIP tunnel fwmark + * @arg link Link object + * @arg fwmark fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipip_set_fwmark(struct rtnl_link *link, uint32_t fwmark) +{ + struct ipip_info *ipip = link->l_info; + + IS_IPIP_LINK_ASSERT(link); + + ipip->fwmark = fwmark; + ipip->ipip_mask |= IPIP_ATTR_FWMARK; + + return 0; +} + +/** + * Get IPIP tunnel fwmark + * @arg link Link object + * @arg fwmark addr to fill in with the fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipip_get_fwmark(struct rtnl_link *link, uint32_t *fwmark) +{ + struct ipip_info *ipip = link->l_info; + + IS_IPIP_LINK_ASSERT(link); + + if (!(ipip->ipip_mask & IPIP_ATTR_FWMARK)) + return -NLE_NOATTR; + + *fwmark = ipip->fwmark; + + return 0; +} + static void __init ipip_init(void) { rtnl_link_register_info(&ipip_info_ops);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ipvlan.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ipvlan.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ipvlan.c IPVLAN Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cong Wang <cwang@twopensource.com> */ @@ -178,12 +172,11 @@ struct rtnl_link *rtnl_link_ipvlan_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "ipvlan")) < 0) { + if (rtnl_link_set_type(link, "ipvlan") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ipvti.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ipvti.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ipvti.c IPVTI Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -37,6 +31,7 @@ #define IPVTI_ATTR_OKEY (1 << 2) #define IPVTI_ATTR_LOCAL (1 << 3) #define IPVTI_ATTR_REMOTE (1 << 4) +#define IPVTI_ATTR_FWMARK (1 << 5) struct ipvti_info { @@ -45,6 +40,7 @@ uint32_t okey; uint32_t local; uint32_t remote; + uint32_t fwmark; uint32_t ipvti_mask; }; @@ -54,6 +50,7 @@ IFLA_VTI_OKEY = { .type = NLA_U32 }, IFLA_VTI_LOCAL = { .type = NLA_U32 }, IFLA_VTI_REMOTE = { .type = NLA_U32 }, + IFLA_VTI_FWMARK = { .type = NLA_U32 }, }; static int ipvti_alloc(struct rtnl_link *link) @@ -117,6 +114,11 @@ ipvti->ipvti_mask |= IPVTI_ATTR_REMOTE; } + if (tbIFLA_VTI_FWMARK) { + ipvti->fwmark = nla_get_u32(tbIFLA_VTI_FWMARK); + ipvti->ipvti_mask |= IPVTI_ATTR_FWMARK; + } + err = 0; errout: @@ -147,6 +149,9 @@ if (ipvti->ipvti_mask & IPVTI_ATTR_REMOTE) NLA_PUT_U32(msg, IFLA_VTI_REMOTE, ipvti->remote); + if (ipvti->ipvti_mask & IPVTI_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_VTI_FWMARK, ipvti->fwmark); + nla_nest_end(msg, data); nla_put_failure: @@ -212,6 +217,11 @@ else nl_dump_line(p, "%#x\n", ntohs(ipvti->remote)); } + + if (ipvti->ipvti_mask & IPVTI_ATTR_FWMARK) { + nl_dump(p, " fwmark "); + nl_dump_line(p, "%x\n", ipvti->fwmark); + } } static int ipvti_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -477,6 +487,46 @@ return ipvti->remote; } +/** + * Set IPVTI tunnel fwmark + * @arg link Link object + * @arg fwmark fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipvti_set_fwmark(struct rtnl_link *link, uint32_t fwmark) +{ + struct ipvti_info *ipvti = link->l_info; + + IS_IPVTI_LINK_ASSERT(link); + + ipvti->fwmark = fwmark; + ipvti->ipvti_mask |= IPVTI_ATTR_FWMARK; + + return 0; +} + +/** + * Get IPVTI tunnel fwmark + * @arg link Link object + * @arg fwmark addr to fill in with the fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_ipvti_get_fwmark(struct rtnl_link *link, uint32_t *fwmark) +{ + struct ipvti_info *ipvti = link->l_info; + + IS_IPVTI_LINK_ASSERT(link); + + if (!(ipvti->ipvti_mask & IPVTI_ATTR_FWMARK)) + return -NLE_NOATTR; + + *fwmark = ipvti->fwmark; + + return 0; +} + static void __init ipvti_init(void) { rtnl_link_register_info(&ipvti_info_ops);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/macsec.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/macsec.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/macsec.c MACsec Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Sabrina Dubroca <sd@queasysnail.net> */ @@ -47,6 +41,7 @@ #define MACSEC_ATTR_REPLAY_PROTECT (1 << 10) #define MACSEC_ATTR_VALIDATION (1 << 11) #define MACSEC_ATTR_PORT (1 << 12) +#define MACSEC_ATTR_OFFLOAD (1 << 13) struct macsec_info { int ifindex; @@ -58,7 +53,7 @@ enum macsec_validation_type validate; uint8_t encoding_sa; - uint8_t send_sci, end_station, scb, replay_protect, protect, encrypt; + uint8_t send_sci, end_station, scb, replay_protect, protect, encrypt, offload; uint32_t ce_mask; }; @@ -80,6 +75,7 @@ IFLA_MACSEC_SCB = { .type = NLA_U8 }, IFLA_MACSEC_REPLAY_PROTECT = { .type = NLA_U8 }, IFLA_MACSEC_VALIDATION = { .type = NLA_U8 }, + IFLA_MACSEC_OFFLOAD = { .type = NLA_U8 }, }; /** @@ -164,6 +160,11 @@ info->ce_mask |= MACSEC_ATTR_ENCRYPT; } + if (tbIFLA_MACSEC_OFFLOAD) { + info->offload = nla_get_u8(tbIFLA_MACSEC_OFFLOAD); + info->ce_mask |= MACSEC_ATTR_OFFLOAD; + } + if (tbIFLA_MACSEC_INC_SCI) { info->send_sci = nla_get_u8(tbIFLA_MACSEC_INC_SCI); info->ce_mask |= MACSEC_ATTR_INC_SCI; @@ -262,7 +263,8 @@ struct macsec_info *info = link->l_info; char tmp128; - nl_dump(p, "sci %016llx <%s>", ntohll(info->sci), flags_str(tmp, sizeof(tmp), info)); + nl_dump(p, "sci %016llx <%s>", (long long unsigned)ntohll(info->sci), + flags_str(tmp, sizeof(tmp), info)); } static void macsec_dump_details(struct rtnl_link *link, struct nl_dump_params *p) @@ -270,12 +272,15 @@ struct macsec_info *info = link->l_info; char tmp128; - nl_dump(p, " sci %016llx protect %s encoding_sa %d encrypt %s send_sci %s validate %s %s\n", - ntohll(info->sci), values_on_offinfo->protect, info->encoding_sa, values_on_offinfo->encrypt, values_on_offinfo->send_sci, + nl_dump(p, + " sci %016llx protect %s encoding_sa %d encrypt %s send_sci %s validate %s %s\n", + (long long unsigned)ntohll(info->sci), + values_on_offinfo->protect, info->encoding_sa, + values_on_offinfo->encrypt, values_on_offinfo->send_sci, VALIDATE_STRinfo->validate, replay_protect_str(tmp, info->replay_protect, info->window)); nl_dump(p, " cipher suite: %016llx, icv_len %d\n", - info->cipher_suite, info->icv_len); + (long long unsigned)info->cipher_suite, info->icv_len); } static int macsec_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -312,6 +317,9 @@ if ((info->ce_mask & MACSEC_ATTR_ENCRYPT)) NLA_PUT_U8(msg, IFLA_MACSEC_ENCRYPT, info->encrypt); + if ((info->ce_mask & MACSEC_ATTR_OFFLOAD)) + NLA_PUT_U8(msg, IFLA_MACSEC_OFFLOAD, info->offload); + if (info->cipher_suite != MACSEC_DEFAULT_CIPHER_ID || info->icv_len != DEFAULT_ICV_LEN) { NLA_PUT_U64(msg, IFLA_MACSEC_CIPHER_SUITE, info->cipher_suite); NLA_PUT_U8(msg, IFLA_MACSEC_ICV_LEN, info->icv_len); @@ -638,6 +646,36 @@ return 0; } +int rtnl_link_macsec_set_offload(struct rtnl_link *link, uint8_t offload) +{ + struct macsec_info *info = link->l_info; + + IS_MACSEC_LINK_ASSERT(link); + + if (offload > 1) + return -NLE_INVAL; + + info->offload = offload; + info->ce_mask |= MACSEC_ATTR_OFFLOAD; + + return 0; +} + +int rtnl_link_macsec_get_offload(struct rtnl_link *link, uint8_t *offload) +{ + struct macsec_info *info = link->l_info; + + IS_MACSEC_LINK_ASSERT(link); + + if (!(info->ce_mask & MACSEC_ATTR_OFFLOAD)) + return -NLE_NOATTR; + + if (offload) + *offload = info->offload; + + return 0; +} + int rtnl_link_macsec_set_encoding_sa(struct rtnl_link *link, uint8_t encoding_sa) { struct macsec_info *info = link->l_info; @@ -674,7 +712,7 @@ IS_MACSEC_LINK_ASSERT(link); - if (validate > 1) + if (validate > MACSEC_VALIDATE_MAX) return -NLE_INVAL; info->validate = validate;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/macvlan.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/macvlan.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/macvlan.c MACVLAN Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Michael Braun <michael-dev@fami-braun.de> */ @@ -123,6 +117,10 @@ mvi->mvi_macaddr = calloc(mvi->mvi_maccount, sizeof(*(mvi->mvi_macaddr))); + if (mvi->mvi_macaddr == NULL) { + err = -NLE_NOMEM; + goto errout; + } i = 0; for (; nla_ok(nla, len); nla = nla_next(nla, &len)) { @@ -149,6 +147,8 @@ uint32_t i; mvi = link->l_info; + if (!mvi) + return; for (i = 0; i < mvi->mvi_maccount; i++) nl_addr_put(mvi->mvi_macaddri); @@ -307,12 +307,11 @@ struct rtnl_link *rtnl_link_macvlan_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "macvlan")) < 0) { + if (rtnl_link_set_type(link, "macvlan") < 0) { rtnl_link_put(link); return NULL; } @@ -653,12 +652,11 @@ struct rtnl_link *rtnl_link_macvtap_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "macvtap")) < 0) { + if (rtnl_link_set_type(link, "macvtap") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/ppp.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/ppp.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/ppp.c PPP Link Module - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Jonas Johansson <jonasj76@gmail.com> */ @@ -156,12 +150,11 @@ struct rtnl_link *rtnl_link_ppp_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "ppp")) < 0) { + if (rtnl_link_set_type(link, "ppp") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/sit.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/sit.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/sit.c SIT Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Susant Sahani <susant@redhat.com> */ @@ -44,6 +38,7 @@ #define SIT_ATTR_6RD_RELAY_PREFIX (1 << 9) #define SIT_ATTR_6RD_PREFIXLEN (1 << 10) #define SIT_ATTR_6RD_RELAY_PREFIXLEN (1 << 11) +#define SIT_ATTR_FWMARK (1 << 12) struct sit_info { @@ -59,6 +54,7 @@ uint32_t ip6rd_relay_prefix; uint16_t ip6rd_prefixlen; uint16_t ip6rd_relay_prefixlen; + uint32_t fwmark; uint32_t sit_mask; }; @@ -75,6 +71,7 @@ IFLA_IPTUN_6RD_RELAY_PREFIX = { .type = NLA_U32 }, IFLA_IPTUN_6RD_PREFIXLEN = { .type = NLA_U16 }, IFLA_IPTUN_6RD_RELAY_PREFIXLEN = { .type = NLA_U16 }, + IFLA_IPTUN_FWMARK = { .type = NLA_U32 }, }; static int sit_alloc(struct rtnl_link *link) @@ -174,6 +171,11 @@ sit->sit_mask |= SIT_ATTR_6RD_RELAY_PREFIXLEN; } + if (tbIFLA_IPTUN_FWMARK) { + sit->fwmark = nla_get_u32(tbIFLA_IPTUN_FWMARK); + sit->sit_mask |= SIT_ATTR_FWMARK; + } + err = 0; errout: @@ -225,6 +227,9 @@ if (sit->sit_mask & SIT_ATTR_6RD_RELAY_PREFIXLEN) NLA_PUT_U16(msg, IFLA_IPTUN_6RD_RELAY_PREFIXLEN, sit->ip6rd_relay_prefixlen); + if (sit->sit_mask & SIT_ATTR_FWMARK) + NLA_PUT_U32(msg, IFLA_IPTUN_FWMARK, sit->fwmark); + nla_nest_end(msg, data); nla_put_failure: @@ -326,6 +331,11 @@ nl_dump(p, " 6rd_relay_prefixlen "); nl_dump_line(p, "%d\n", sit->ip6rd_relay_prefixlen); } + + if (sit->sit_mask & SIT_ATTR_FWMARK) { + nl_dump(p, " fwmark "); + nl_dump_line(p, "%x\n", sit->fwmark); + } } static int sit_clone(struct rtnl_link *dst, struct rtnl_link *src) @@ -812,6 +822,42 @@ return 0; } +/** + * Set SIT tunnel fwmark + * @arg link Link object + * @arg fwmark fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_sit_set_fwmark(struct rtnl_link *link, uint32_t fwmark) +{ + IS_SIT_LINK_ASSERT(link, sit); + + sit->fwmark = fwmark; + sit->sit_mask |= SIT_ATTR_FWMARK; + + return 0; +} + +/** + * Get SIT tunnel fwmark + * @arg link Link object + * @arg fwmark addr to fill in with the fwmark + * + * @return 0 on success or a negative error code + */ +int rtnl_link_sit_get_fwmark(struct rtnl_link *link, uint32_t *fwmark) +{ + IS_SIT_LINK_ASSERT(link, sit); + + if (!(sit->sit_mask & SIT_ATTR_FWMARK)) + return -NLE_NOATTR; + + *fwmark = sit->fwmark; + + return 0; +} + static void __init sit_init(void) { rtnl_link_register_info(&sit_info_ops);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/sriov.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/sriov.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/sriov.c SRIOV VF Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2016 Intel Corp. All rights reserved. * Copyright (c) 2016 Jef Oliver <jef.oliver@intel.com> */ @@ -92,7 +86,7 @@ nl_vf_vlans_t *src_vlans = NULL, *dst_vlans = NULL; nl_vf_vlan_info_t *src_vlan_info = NULL, *dst_vlan_info = NULL; - if (!(err = rtnl_link_has_vf_list(src))) + if (!rtnl_link_has_vf_list(src)) return 0; dst->l_vf_list = rtnl_link_vf_alloc(); @@ -129,7 +123,7 @@ dst_vlan_info = dst_vlans->vlans; memcpy(dst_vlans, src_vlans, sizeof(nl_vf_vlans_t)); memcpy(dst_vlan_info, src_vlan_info, - dst_vlans->size * sizeof(dst_vlan_info)); + dst_vlans->size * sizeof(*dst_vlan_info)); d_vf->vf_vlans = dst_vlans; } @@ -213,10 +207,9 @@ /* Loop through SRIOV VF list dump details */ void rtnl_link_sriov_dump_details(struct rtnl_link *link, struct nl_dump_params *p) { - int err; struct rtnl_link_vf *vf_data, *list, *next; - if (!(err = rtnl_link_has_vf_list(link))) + if (!rtnl_link_has_vf_list(link)) BUG(); nl_dump(p, " SRIOV VF List\n"); @@ -235,7 +228,7 @@ char *unit; float res; - nl_dump(p, " VF %" PRIu64 " Stats:\n", vf_data->vf_index); + nl_dump(p, " VF %u Stats:\n", vf_data->vf_index); nl_dump_line(p, "\tRX: %-14s %-10s %-10s %-10s\n", "bytes", "packets", "multicast", "broadcast"); @@ -277,10 +270,9 @@ /* Free stored SRIOV VF data */ void rtnl_link_sriov_free_data(struct rtnl_link *link) { - int err = 0; struct rtnl_link_vf *list, *vf, *next; - if (!(err = rtnl_link_has_vf_list(link))) + if (!rtnl_link_has_vf_list(link)) return; list = link->l_vf_list; @@ -656,7 +648,7 @@ } if (tIFLA_VF_STATS) { - err = nla_parse_nested(stb, IFLA_VF_STATS_MAX, + err = nla_parse_nested(stb, RTNL_LINK_VF_STATS_MAX, tIFLA_VF_STATS, sriov_stats_policy); if (err < 0) { @@ -683,7 +675,7 @@ RTNL_LINK_VF_STATS_MULTICAST, IFLA_VF_STATS_MULTICAST); - vf_data->ce_mask |= IFLA_VF_STATS; + vf_data->ce_mask |= SRIOV_ATTR_STATS; } if (tIFLA_VF_TRUST) {
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/team.c
Added
@@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2015 Jonas Johansson <jonasj76@gmail.com> + */ + +/** + * @ingroup link + * @defgroup team Team + * + * @details + * \b Link Type Name: "team" + * + * @route_doc{link_team, Team Documentation} + * @{ + */ + +#include <netlink-private/netlink.h> +#include <netlink/netlink.h> +#include <netlink-private/route/link/api.h> +#include <netlink/route/link/team.h> + +/** + * Allocate link object of type team + * + * @return Allocated link object or NULL. + */ +struct rtnl_link *rtnl_link_team_alloc(void) +{ + struct rtnl_link *link; + + if (!(link = rtnl_link_alloc())) + return NULL; + + if (rtnl_link_set_type(link, "team") < 0) { + rtnl_link_put(link); + return NULL; + } + + return link; +} + +/** + * Create a new kernel team device + * @arg sock netlink socket + * @arg name name of team device or NULL + * @arg opts team options (currently unused) + * + * Creates a new team device in the kernel. If no name is + * provided, the kernel will automatically pick a name of the + * form "type%d" (e.g. team0, vlan1, etc.) + * + * The \a opts argument is currently unused. In the future, it + * may be used to carry additional team options to be set + * when creating the team device. + * + * @note When letting the kernel assign a name, it will become + * difficult to retrieve the interface afterwards because + * you have to guess the name the kernel has chosen. It is + * therefore not recommended to not provide a device name. + * + * @see rtnl_link_team_enslave() + * @see rtnl_link_team_release() + * + * @return 0 on success or a negative error code + */ +int rtnl_link_team_add(struct nl_sock *sock, const char *name, + struct rtnl_link *opts) +{ + struct rtnl_link *link; + int err; + + if (!(link = rtnl_link_team_alloc())) + return -NLE_NOMEM; + + if (!name && opts) + name = rtnl_link_get_name(opts); + + if (name) + rtnl_link_set_name(link, name); + + err = rtnl_link_add(sock, link, NLM_F_CREATE); + + rtnl_link_put(link); + + return err; +} + +static struct rtnl_link_info_ops team_info_ops = { + .io_name = "team", +}; + +static void __init team_init(void) +{ + rtnl_link_register_info(&team_info_ops); +} + +static void __exit team_exit(void) +{ + rtnl_link_unregister_info(&team_info_ops); +} + +/** @} */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/veth.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/veth.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/veth.c Virtual Ethernet - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ @@ -213,11 +207,10 @@ struct rtnl_link *rtnl_link_veth_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "veth")) < 0) { + if (rtnl_link_set_type(link, "veth") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/vlan.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/vlan.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/vlan.c VLAN Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch> */ @@ -392,12 +386,11 @@ struct rtnl_link *rtnl_link_vlan_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "vlan")) < 0) { + if (rtnl_link_set_type(link, "vlan") < 0) { rtnl_link_put(link); return NULL; } @@ -647,6 +640,7 @@ __ADD(VLAN_FLAG_GVRP, gvrp), __ADD(VLAN_FLAG_LOOSE_BINDING, loose_binding), __ADD(VLAN_FLAG_MVRP, mvrp), + __ADD(VLAN_FLAG_BRIDGE_BINDING, bridge_binding), }; /**
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/vrf.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/vrf.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/vrf.c VRF Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2015 Cumulus Networks. All rights reserved. * Copyright (c) 2015 David Ahern <dsa@cumulusnetworks.com> */ @@ -181,12 +175,11 @@ struct rtnl_link *rtnl_link_vrf_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "vrf")) < 0) { + if (rtnl_link_set_type(link, "vrf") < 0) { rtnl_link_put(link); return NULL; } @@ -240,8 +233,8 @@ struct vrf_info *vi = link->l_info; IS_VRF_LINK_ASSERT(link); - if(id > VRF_TABLE_ID_MAX) - return -NLE_INVAL; + + _NL_STATIC_ASSERT(VRF_TABLE_ID_MAX == UINT32_MAX); vi->table_id = id; vi->vi_mask |= VRF_HAS_TABLE_ID;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/vxlan.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/vxlan.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/vxlan.c VXLAN Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Yasunobu Chiba <yasu@dsl.gr.jp> */ @@ -322,16 +316,12 @@ if (vxi->ce_mask & VXLAN_ATTR_GROUP) { nl_dump(p, " group "); - if (inet_ntop(AF_INET, &vxi->vxi_group, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", ntohs(vxi->vxi_group)); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET, &vxi->vxi_group, addr)); } else if (vxi->ce_mask & VXLAN_ATTR_GROUP6) { nl_dump(p, " group "); - if (inet_ntop(AF_INET6, &vxi->vxi_group6, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", vxi->vxi_group6); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET6, &vxi->vxi_group6, addr)); } if (vxi->ce_mask & VXLAN_ATTR_LINK) { @@ -350,19 +340,14 @@ if (vxi->ce_mask & VXLAN_ATTR_LOCAL) { nl_dump(p, " local "); - if (inet_ntop(AF_INET, &vxi->vxi_local, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", ntohs(vxi->vxi_local)); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET, &vxi->vxi_local, addr)); } else if (vxi->ce_mask & VXLAN_ATTR_LOCAL6) { nl_dump(p, " local "); - if (inet_ntop(AF_INET6, &vxi->vxi_local6, addr, sizeof(addr))) - nl_dump_line(p, "%s\n", addr); - else - nl_dump_line(p, "%#x\n", vxi->vxi_local6); + nl_dump_line(p, "%s\n", + _nl_inet_ntop(AF_INET6, &vxi->vxi_local6, addr)); } - if (vxi->ce_mask & VXLAN_ATTR_TTL) { nl_dump(p, " ttl "); if(vxi->vxi_ttl) @@ -374,7 +359,7 @@ if (vxi->ce_mask & VXLAN_ATTR_TOS) { nl_dump(p, " tos "); if (vxi->vxi_tos == 1) - nl_dump_line(p, "inherit\n", vxi->vxi_tos); + nl_dump_line(p, "inherit\n"); else nl_dump_line(p, "%#x\n", vxi->vxi_tos); } @@ -701,12 +686,11 @@ struct rtnl_link *rtnl_link_vxlan_alloc(void) { struct rtnl_link *link; - int err; if (!(link = rtnl_link_alloc())) return NULL; - if ((err = rtnl_link_set_type(link, "vxlan")) < 0) { + if (rtnl_link_set_type(link, "vxlan") < 0) { rtnl_link_put(link); return NULL; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/link/xfrmi.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/link/xfrmi.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/link/xfrmi.c XFRMI Link Info - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2019 Eyal Birger <eyal.birger@gmail.com> * * Based on lib/route/link/ipvti.c
View file
_service:tar_scm:libnl-3.7.0.tar.gz/lib/route/mdb.c
Added
@@ -0,0 +1,466 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * lib/route/mdb.c Multicast Database + */ + +#include <netlink-private/netlink.h> +#include <netlink/netlink.h> +#include <netlink/route/mdb.h> +#include <netlink/utils.h> +#include <linux/if_bridge.h> + +/** @cond SKIP */ +#define MDB_ATTR_IFINDEX 0x000001 +#define MDB_ATTR_ENTRIES 0x000002 + +static struct rtnl_mdb_entry *rtnl_mdb_entry_alloc(void); +static void rtnl_mdb_entry_free(struct rtnl_mdb_entry *mdb_entry); + +static struct nl_cache_ops rtnl_mdb_ops; +static struct nl_object_ops mdb_obj_ops; +/** @endcond */ + +static void mdb_constructor(struct nl_object *obj) +{ + struct rtnl_mdb *_mdb = (struct rtnl_mdb *) obj; + + nl_init_list_head(&_mdb->mdb_entry_list); +} + +static void mdb_free_data(struct nl_object *obj) +{ + struct rtnl_mdb *mdb = (struct rtnl_mdb *)obj; + struct rtnl_mdb_entry *mdb_entry; + struct rtnl_mdb_entry *mdb_entry_safe; + + nl_list_for_each_entry_safe(mdb_entry, mdb_entry_safe, + &mdb->mdb_entry_list, mdb_list) + rtnl_mdb_entry_free(mdb_entry); +} + +static int mdb_entry_equal(struct rtnl_mdb_entry *a, struct rtnl_mdb_entry *b) +{ + return a->ifindex == b->ifindex + && a->vid == b->vid + && a->proto == b->proto + && a->state == b->state + && nl_addr_cmp(a->addr, b->addr) == 0; +} + +static uint64_t mdb_compare(struct nl_object *_a, struct nl_object *_b, + uint64_t attrs, int flags) +{ + struct rtnl_mdb *a = (struct rtnl_mdb *) _a; + struct rtnl_mdb *b = (struct rtnl_mdb *) _b; + struct rtnl_mdb_entry *a_entry, *b_entry; + uint64_t diff = 0; + +#define MDB_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, MDB_ATTR_##ATTR, a, b, EXPR) + diff |= MDB_DIFF(IFINDEX, a->ifindex != b->ifindex); +#undef MDB_DIFF + + a_entry = nl_list_entry(a->mdb_entry_list.next, struct rtnl_mdb_entry, mdb_list); + b_entry = nl_list_entry(b->mdb_entry_list.next, struct rtnl_mdb_entry, mdb_list); + while (1) { + if ( &a_entry->mdb_list == &a->mdb_entry_list + || &b_entry->mdb_list == &b->mdb_entry_list) { + if ( &a_entry->mdb_list != &a->mdb_entry_list + || &b_entry->mdb_list != &b->mdb_entry_list) + diff |= MDB_ATTR_ENTRIES; + break; + } + if (!mdb_entry_equal(a_entry, b_entry)) { + diff |= MDB_ATTR_ENTRIES; + break; + } + a_entry = nl_list_entry(a_entry->mdb_list.next, struct rtnl_mdb_entry, mdb_list); + b_entry = nl_list_entry(b_entry->mdb_list.next, struct rtnl_mdb_entry, mdb_list); + } + + return diff; +} + +static struct rtnl_mdb_entry *mdb_entry_clone(struct rtnl_mdb_entry *src) +{ + struct rtnl_mdb_entry *dst = rtnl_mdb_entry_alloc(); + if (!dst) + return NULL; + + dst->ifindex = src->ifindex; + dst->state = src->state; + dst->vid = src->vid; + dst->proto = src->proto; + + dst->addr = nl_addr_clone(src->addr); + if (dst->addr == NULL) { + free(dst); + return NULL; + } + + return dst; +} + +static int mdb_clone(struct nl_object *_dst, struct nl_object *_src) +{ + struct rtnl_mdb *dst = nl_object_priv(_dst); + struct rtnl_mdb *src = nl_object_priv(_src); + struct rtnl_mdb_entry *entry; + + nl_init_list_head(&dst->mdb_entry_list); + + nl_list_for_each_entry(entry, &src->mdb_entry_list, mdb_list) { + struct rtnl_mdb_entry *copy = mdb_entry_clone(entry); + + if (!copy) + return -NLE_NOMEM; + + rtnl_mdb_add_entry(dst, copy); + } + + return 0; +} + +static int mdb_update(struct nl_object *old_obj, struct nl_object *new_obj) +{ + struct rtnl_mdb *old = (struct rtnl_mdb *) old_obj; + struct rtnl_mdb *new = (struct rtnl_mdb *) new_obj; + struct rtnl_mdb_entry *entry, *old_entry; + int action = new_obj->ce_msgtype; + + if (new->ifindex != old->ifindex) + return -NLE_OPNOTSUPP; + + switch (action) { + case RTM_NEWMDB: + nl_list_for_each_entry(entry, &new->mdb_entry_list, mdb_list) { + struct rtnl_mdb_entry *copy = mdb_entry_clone(entry); + + if (!copy) + return -NLE_NOMEM; + + rtnl_mdb_add_entry(old, copy); + } + break; + case RTM_DELMDB: + entry = nl_list_first_entry(&new->mdb_entry_list, + struct rtnl_mdb_entry, + mdb_list); + nl_list_for_each_entry(old_entry, &old->mdb_entry_list, mdb_list) { + if ( old_entry->ifindex == entry->ifindex + && !nl_addr_cmp(old_entry->addr, entry->addr)) { + nl_list_del(&old_entry->mdb_list); + break; + } + } + break; + } + + return NLE_SUCCESS; +} + +static struct nla_policy mdb_policyMDBA_MAX + 1 = { + MDBA_MDB = {.type = NLA_NESTED}, +}; + +static struct nla_policy mdb_db_policyMDBA_MDB_MAX + 1 = { + MDBA_MDB_ENTRY = {.type = NLA_NESTED}, +}; + +static int mdb_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who, + struct nlmsghdr *nlh, struct nl_parser_param *pp) +{ + int err = 0; + int rem = 0; + struct nlattr *tbMDBA_MAX + 1; + struct br_port_msg *port; + struct nlattr *nla; + struct br_mdb_entry *e; + _nl_auto_rtnl_mdb struct rtnl_mdb *mdb = rtnl_mdb_alloc(); + + if (!mdb) + return -NLE_NOMEM; + + err = nlmsg_parse(nlh, sizeof(struct br_port_msg), tb, MDBA_MAX, + mdb_policy); + if (err < 0) + return err; + + mdb->ce_msgtype = nlh->nlmsg_type; + + port = nlmsg_data(nlh); + mdb->ifindex = port->ifindex; + mdb->ce_mask |= MDB_ATTR_IFINDEX; + + if (tbMDBA_MDB) { + struct nlattr *db_attrMDBA_MDB_MAX+1; + + err = nla_parse_nested(db_attr, MDBA_MDB_MAX, tbMDBA_MDB, + mdb_db_policy); + if (err < 0)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/neigh.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/neigh.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/neigh.c Neighbours - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -192,6 +185,9 @@ struct rtnl_neigh *dst = nl_object_priv(_dst); struct rtnl_neigh *src = nl_object_priv(_src); + dst->n_lladdr = NULL; + dst->n_dst = NULL; + if (src->n_lladdr) if (!(dst->n_lladdr = nl_addr_clone(src->n_lladdr))) return -NLE_NOMEM; @@ -716,7 +712,7 @@ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0) goto nla_put_failure; - if (tmpl->n_family != AF_BRIDGE) + if (tmpl->ce_mask & NEIGH_ATTR_DST) NLA_PUT_ADDR(msg, NDA_DST, tmpl->n_dst); if (tmpl->ce_mask & NEIGH_ATTR_LLADDR)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/neightbl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/neightbl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/neightbl.c neighbour tables - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -18,6 +11,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/utils.h> #include <netlink/netlink.h> #include <netlink/utils.h> #include <netlink/route/rtnl.h> @@ -25,31 +19,31 @@ #include <netlink/route/link.h> /** @cond SKIP */ -#define NEIGHTBL_ATTR_FAMILY 0x001 -#define NEIGHTBL_ATTR_STATS 0x002 -#define NEIGHTBL_ATTR_NAME 0x004 -#define NEIGHTBL_ATTR_THRESH1 0x008 -#define NEIGHTBL_ATTR_THRESH2 0x010 -#define NEIGHTBL_ATTR_THRESH3 0x020 -#define NEIGHTBL_ATTR_CONFIG 0x040 -#define NEIGHTBL_ATTR_PARMS 0x080 -#define NEIGHTBL_ATTR_GC_INTERVAL 0x100 - -#define NEIGHTBLPARM_ATTR_IFINDEX 0x0001 -#define NEIGHTBLPARM_ATTR_REFCNT 0x0002 -#define NEIGHTBLPARM_ATTR_QUEUE_LEN 0x0004 -#define NEIGHTBLPARM_ATTR_APP_PROBES 0x0008 -#define NEIGHTBLPARM_ATTR_UCAST_PROBES 0x0010 -#define NEIGHTBLPARM_ATTR_MCAST_PROBES 0x0020 -#define NEIGHTBLPARM_ATTR_PROXY_QLEN 0x0040 -#define NEIGHTBLPARM_ATTR_REACHABLE_TIME 0x0080 +#define NEIGHTBL_ATTR_FAMILY 0x001 +#define NEIGHTBL_ATTR_STATS 0x002 +#define NEIGHTBL_ATTR_NAME 0x004 +#define NEIGHTBL_ATTR_THRESH1 0x008 +#define NEIGHTBL_ATTR_THRESH2 0x010 +#define NEIGHTBL_ATTR_THRESH3 0x020 +#define NEIGHTBL_ATTR_CONFIG 0x040 +#define NEIGHTBL_ATTR_PARMS 0x080 +#define NEIGHTBL_ATTR_GC_INTERVAL 0x100 + +#define NEIGHTBLPARM_ATTR_IFINDEX 0x0001 +#define NEIGHTBLPARM_ATTR_REFCNT 0x0002 +#define NEIGHTBLPARM_ATTR_QUEUE_LEN 0x0004 +#define NEIGHTBLPARM_ATTR_APP_PROBES 0x0008 +#define NEIGHTBLPARM_ATTR_UCAST_PROBES 0x0010 +#define NEIGHTBLPARM_ATTR_MCAST_PROBES 0x0020 +#define NEIGHTBLPARM_ATTR_PROXY_QLEN 0x0040 +#define NEIGHTBLPARM_ATTR_REACHABLE_TIME 0x0080 #define NEIGHTBLPARM_ATTR_BASE_REACHABLE_TIME 0x0100 -#define NEIGHTBLPARM_ATTR_RETRANS_TIME 0x0200 -#define NEIGHTBLPARM_ATTR_GC_STALETIME 0x0400 +#define NEIGHTBLPARM_ATTR_RETRANS_TIME 0x0200 +#define NEIGHTBLPARM_ATTR_GC_STALETIME 0x0400 #define NEIGHTBLPARM_ATTR_DELAY_PROBE_TIME 0x0800 -#define NEIGHTBLPARM_ATTR_ANYCAST_DELAY 0x1000 -#define NEIGHTBLPARM_ATTR_PROXY_DELAY 0x2000 -#define NEIGHTBLPARM_ATTR_LOCKTIME 0x4000 +#define NEIGHTBLPARM_ATTR_ANYCAST_DELAY 0x1000 +#define NEIGHTBLPARM_ATTR_PROXY_DELAY 0x2000 +#define NEIGHTBLPARM_ATTR_LOCKTIME 0x4000 static struct nl_cache_ops rtnl_neightbl_ops; static struct nl_object_ops neightbl_obj_ops; @@ -58,18 +52,18 @@ static uint64_t neightbl_compare(struct nl_object *_a, struct nl_object *_b, uint64_t attrs, int flags) { - struct rtnl_neightbl *a = (struct rtnl_neightbl *) _a; - struct rtnl_neightbl *b = (struct rtnl_neightbl *) _b; + struct rtnl_neightbl *a = (struct rtnl_neightbl *)_a; + struct rtnl_neightbl *b = (struct rtnl_neightbl *)_b; uint64_t diff = 0; #define NT_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, NEIGHTBL_ATTR_##ATTR, a, b, EXPR) - diff |= NT_DIFF(FAMILY, a->nt_family != b->nt_family); - diff |= NT_DIFF(NAME, strcmp(a->nt_name, b->nt_name)); - diff |= NT_DIFF(THRESH1, a->nt_gc_thresh1 != b->nt_gc_thresh1); - diff |= NT_DIFF(THRESH2, a->nt_gc_thresh2 != b->nt_gc_thresh2); - diff |= NT_DIFF(THRESH3, a->nt_gc_thresh3 != b->nt_gc_thresh3); - diff |= NT_DIFF(GC_INTERVAL, a->nt_gc_interval != b->nt_gc_interval); + diff |= NT_DIFF(FAMILY, a->nt_family != b->nt_family); + diff |= NT_DIFF(NAME, strcmp(a->nt_name, b->nt_name)); + diff |= NT_DIFF(THRESH1, a->nt_gc_thresh1 != b->nt_gc_thresh1); + diff |= NT_DIFF(THRESH2, a->nt_gc_thresh2 != b->nt_gc_thresh2); + diff |= NT_DIFF(THRESH3, a->nt_gc_thresh3 != b->nt_gc_thresh3); + diff |= NT_DIFF(GC_INTERVAL, a->nt_gc_interval != b->nt_gc_interval); #undef NT_DIFF @@ -77,8 +71,7 @@ !(b->ce_mask & NEIGHTBL_ATTR_PARMS)) return diff; - /* XXX: FIXME: Compare parameter table */ - + /* XXX: FIXME: Compare parameter table */ #if 0 #define REQ(F) (fp->ntp_mask & NEIGHTBLPARM_ATTR_##F) @@ -106,17 +99,15 @@ return diff; } - -static struct nla_policy neightbl_policyNDTA_MAX+1 = { - NDTA_NAME = { .type = NLA_STRING, - .maxlen = NTBLNAMSIZ }, - NDTA_THRESH1 = { .type = NLA_U32 }, - NDTA_THRESH2 = { .type = NLA_U32 }, - NDTA_THRESH3 = { .type = NLA_U32 }, - NDTA_GC_INTERVAL = { .type = NLA_U32 }, - NDTA_CONFIG = { .minlen = sizeof(struct ndt_config) }, - NDTA_STATS = { .minlen = sizeof(struct ndt_stats) }, - NDTA_PARMS = { .type = NLA_NESTED }, +static struct nla_policy neightbl_policyNDTA_MAX + 1 = { + NDTA_NAME = { .type = NLA_STRING, .maxlen = NTBLNAMSIZ }, + NDTA_THRESH1 = { .type = NLA_U32 }, + NDTA_THRESH2 = { .type = NLA_U32 }, + NDTA_THRESH3 = { .type = NLA_U32 }, + NDTA_GC_INTERVAL = { .type = NLA_U32 }, + NDTA_CONFIG = { .minlen = sizeof(struct ndt_config) }, + NDTA_STATS = { .minlen = sizeof(struct ndt_stats) }, + NDTA_PARMS = { .type = NLA_NESTED }, }; static int neightbl_msg_parser(struct nl_cache_ops *ops, @@ -191,11 +182,11 @@ if (err < 0) goto errout; -#define COPY_ENTRY(name, var) \ - if (tbpNDTPA_ ##name) { \ - p->ntp_ ##var = nla_get_u32(tbpNDTPA_ ##name); \ - p->ntp_mask |= NEIGHTBLPARM_ATTR_ ##name; \ - } +#define COPY_ENTRY(name, var) \ + if (tbpNDTPA_##name) { \ + p->ntp_##var = nla_get_u32(tbpNDTPA_##name); \ + p->ntp_mask |= NEIGHTBLPARM_ATTR_##name; \ + } COPY_ENTRY(IFINDEX, ifindex); COPY_ENTRY(REFCNT, refcnt); @@ -217,7 +208,7 @@ ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS; } - err = pp->pp_cb((struct nl_object *) ntbl, pp); + err = pp->pp_cb((struct nl_object *)ntbl, pp); errout: rtnl_neightbl_put(ntbl); return err; @@ -228,10 +219,9 @@ return nl_rtgen_request(h, RTM_GETNEIGHTBL, AF_UNSPEC, NLM_F_DUMP); } - static void neightbl_dump_line(struct nl_object *arg, struct nl_dump_params *p) { - struct rtnl_neightbl *ntbl = (struct rtnl_neightbl *) arg; + struct rtnl_neightbl *ntbl = (struct rtnl_neightbl *)arg; nl_dump_line(p, "%s", ntbl->nt_name); @@ -267,101 +257,102 @@ nl_dump(p, "\n"); } -static void neightbl_dump_details(struct nl_object *arg, struct nl_dump_params *p) +static void neightbl_dump_details(struct nl_object *arg, + struct nl_dump_params *p) { char x32, y32, z32; - struct rtnl_neightbl *ntbl = (struct rtnl_neightbl *) arg; + struct rtnl_neightbl *ntbl = (struct rtnl_neightbl *)arg; neightbl_dump_line(arg, p); if (ntbl->ce_mask & NEIGHTBL_ATTR_CONFIG) { nl_dump_line(p, " key-len %u entry-size %u last-flush %s\n", - ntbl->nt_config.ndtc_key_len, - ntbl->nt_config.ndtc_entry_size, - nl_msec2str(ntbl->nt_config.ndtc_last_flush, - x, sizeof(x))); - - nl_dump_line(p, " gc threshold %u/%u/%u interval %s " \
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/netconf.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/netconf.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/netconf.c netconf - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2017 David Ahern <dsa@cumulusnetworks.com> */ @@ -81,16 +74,6 @@ return (struct rtnl_netconf *) nl_object_alloc(&netconf_obj_ops); } -static int netconf_clone(struct nl_object *_dst, struct nl_object *_src) -{ - struct rtnl_netconf *dst = nl_object_priv(_dst); - struct rtnl_netconf *src = nl_object_priv(_src); - - *dst = *src; - - return 0; -} - static int netconf_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who, struct nlmsghdr *nlh, struct nl_parser_param *pp) { @@ -535,7 +518,6 @@ static struct nl_object_ops netconf_obj_ops = { .oo_name = "route/netconf", .oo_size = sizeof(struct rtnl_netconf), - .oo_clone = netconf_clone, .oo_dump = { NL_DUMP_LINE = netconf_dump_line, NL_DUMP_DETAILS = netconf_dump_line,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/nexthop.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/nexthop.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/nexthop.c Routing Nexthop - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -351,10 +344,6 @@ { struct nl_addr *old = nh->rtnh_newdst; - if (!nl_addr_valid(nl_addr_get_binary_addr(addr), - nl_addr_get_len(addr))) - return -NLE_INVAL; - if (addr) { nh->rtnh_newdst = nl_addr_get(addr); nh->ce_mask |= NH_ATTR_NEWDST; @@ -378,10 +367,6 @@ { struct nl_addr *old = nh->rtnh_via; - if (!nl_addr_valid(nl_addr_get_binary_addr(addr), - nl_addr_get_len(addr))) - return -NLE_INVAL; - if (addr) { nh->rtnh_via = nl_addr_get(addr); nh->ce_mask |= NH_ATTR_VIA;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/nexthop_encap.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/nexthop_encap.c
Changed
@@ -31,10 +31,13 @@ void nh_encap_dump(struct rtnl_nh_encap *rtnh_encap, struct nl_dump_params *dp) { + if (!rtnh_encap->ops) + return; + nl_dump(dp, " encap %s ", nh_encap_type2str(rtnh_encap->ops->encap_type)); - if (rtnh_encap->ops && rtnh_encap->ops->dump) + if (rtnh_encap->ops->dump) rtnh_encap->ops->dump(rtnh_encap->priv, dp); } @@ -55,7 +58,7 @@ goto nla_put_failure; err = rtnh_encap->ops->build_msg(msg, rtnh_encap->priv); - if (err) + if (err < 0) return err; nla_nest_end(msg, encap);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/nh_encap_mpls.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/nh_encap_mpls.c
Changed
@@ -34,7 +34,7 @@ return 0; nla_put_failure: - return -NLE_MSGSIZE; + return -NLE_MSGSIZE; } static void mpls_encap_destructor(void *priv) @@ -56,9 +56,8 @@ uint8_t ttl = 0; int err; - err = nla_parse_nested(tb, MPLS_IPTUNNEL_MAX, nla, mpls_encap_policy); - if (err) + if (err < 0) return err; if (!tbMPLS_IPTUNNEL_DST) @@ -109,10 +108,6 @@ if (!addr) return -NLE_INVAL; - if (!nl_addr_valid(nl_addr_get_binary_addr(addr), - nl_addr_get_len(addr))) - return -NLE_INVAL; - rtnh_encap = calloc(1, sizeof(*rtnh_encap)); if (!rtnh_encap) return -NLE_NOMEM; @@ -133,3 +128,31 @@ return 0; } + +struct nl_addr *rtnl_route_nh_get_encap_mpls_dst(struct rtnl_nexthop *nh) +{ + struct mpls_iptunnel_encap *mpls_encap; + + if (!nh->rtnh_encap || nh->rtnh_encap->ops->encap_type != LWTUNNEL_ENCAP_MPLS) + return NULL; + + mpls_encap = (struct mpls_iptunnel_encap *)nh->rtnh_encap->priv; + if (!mpls_encap) + return NULL; + + return mpls_encap->dst; +} + +uint8_t rtnl_route_nh_get_encap_mpls_ttl(struct rtnl_nexthop *nh) +{ + struct mpls_iptunnel_encap *mpls_encap; + + if (!nh->rtnh_encap || nh->rtnh_encap->ops->encap_type != LWTUNNEL_ENCAP_MPLS) + return 0; + + mpls_encap = (struct mpls_iptunnel_encap *)nh->rtnh_encap->priv; + if (!mpls_encap) + return 0; + + return mpls_encap->ttl; +}
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/pktloc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/pktloc.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/pktloc.c Packet Location Aliasing - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */ @@ -124,7 +117,7 @@ nl_init_list_head(&pktloc_name_hti); } - if ((err = pktloc_lex_init(&scanner)) < 0) { + if (pktloc_lex_init(&scanner) < 0) { err = -NLE_FAILURE; goto errout_close; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/pktloc_syntax.y -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/pktloc_syntax.y
Changed
@@ -24,6 +24,7 @@ %{ extern int pktloc_lex(YYSTYPE *, YYLTYPE *, void *); +#define pktloc_error yyerror static void yyerror(YYLTYPE *locp, void *scanner, const char *msg) { NL_DBG(1, "Error while parsing packet location file: %s\n", msg);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc.c Queueing Disciplines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -404,6 +397,38 @@ } /** + * Search qdisc by kind + * @arg cache Qdisc cache + * @arg ifindex Interface index + * @arg kind Qdisc kind (tbf, htb, cbq, etc) + * + * Searches a qdisc cache previously allocated with rtnl_qdisc_alloc_cache() + * and searches for a qdisc matching the interface index and kind. + * + * The reference counter is incremented before returning the qdisc, therefore + * the reference must be given back with rtnl_qdisc_put() after usage. + * + * @return pointer to qdisc inside the cache or NULL if no match was found. + */ +struct rtnl_qdisc *rtnl_qdisc_get_by_kind(struct nl_cache *cache, + int ifindex, char *kind) +{ + struct rtnl_qdisc *q; + + if (cache->c_ops != &rtnl_qdisc_ops) + return NULL; + + nl_list_for_each_entry(q, &cache->c_items, ce_list) { + if ((q->q_ifindex == ifindex) && (!strcmp(q->q_kind, kind))) { + nl_object_get((struct nl_object *) q); + return q; + } + } + + return NULL; +} + +/** * Search qdisc by interface index and handle * @arg cache Qdisc cache * @arg ifindex Interface index
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/blackhole.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/blackhole.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/blackhole.c Blackhole Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/cbq.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/cbq.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/cbq.c Class Based Queueing - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/dsmark.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/dsmark.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/dsmark.c DSMARK - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/fifo.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/fifo.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/fifo.c (p|b)fifo - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/fq_codel.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/fq_codel.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/fq_codel.c fq_codel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/hfsc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/hfsc.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/hfsc.c HFSC Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2014 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/htb.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/htb.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/htb.c HTB Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2005-2006 Petr Gotthard <petr.gotthard@siemens.com> * Copyright (c) 2005-2006 Siemens AG Oesterreich
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/ingress.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/ingress.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/ingress.c ingress - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/mqprio.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/mqprio.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/mqprio.c MQPRIO Qdisc/Class - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Volodymyr Bendiuga <volodymyr.bendiuga@westermo.se> */ @@ -271,14 +265,15 @@ if (!(mqprio->qm_mask & SCH_MQPRIO_ATTR_NUMTC)) return -NLE_MISSING_ATTR; - if ((len / sizeof(uint8_t)) > (TC_QOPT_BITMASK+1)) + if (len > TC_QOPT_BITMASK + 1) return -NLE_RANGE; - for (i = 0; i <= TC_QOPT_BITMASK; i++) { + for (i = 0; i < len; i++) { if (priomapi > mqprio->qm_num_tc) return -NLE_RANGE; } + memset(mqprio->qm_prio_map, 0, sizeof(mqprio->qm_prio_map)); memcpy(mqprio->qm_prio_map, priomap, len * sizeof(uint8_t)); mqprio->qm_mask |= SCH_MQPRIO_ATTR_PRIOMAP; @@ -366,9 +361,11 @@ if (!(mqprio->qm_mask & SCH_MQPRIO_ATTR_NUMTC)) return -NLE_MISSING_ATTR; - if ((len / sizeof(uint16_t)) > TC_QOPT_MAX_QUEUE) + if (len < 0 || len > TC_QOPT_MAX_QUEUE) return -NLE_RANGE; + memset(mqprio->qm_count, 0, sizeof(mqprio->qm_count)); + memset(mqprio->qm_offset, 0, sizeof(mqprio->qm_offset)); memcpy(mqprio->qm_count, count, len * sizeof(uint16_t)); memcpy(mqprio->qm_offset, offset, len * sizeof(uint16_t)); mqprio->qm_mask |= SCH_MQPRIO_ATTR_QUEUE; @@ -499,9 +496,10 @@ if (mqprio->qm_shaper != TC_MQPRIO_SHAPER_BW_RATE) return -NLE_INVAL; - if ((len / sizeof(uint64_t)) > TC_QOPT_MAX_QUEUE) + if (len < 0 || len > TC_QOPT_MAX_QUEUE) return -NLE_RANGE; + memset(mqprio->qm_min_rate, 0, sizeof(mqprio->qm_min_rate)); memcpy(mqprio->qm_min_rate, min, len * sizeof(uint64_t)); mqprio->qm_mask |= SCH_MQPRIO_ATTR_MIN_RATE; @@ -548,9 +546,10 @@ if (mqprio->qm_shaper != TC_MQPRIO_SHAPER_BW_RATE) return -NLE_INVAL; - if ((len / sizeof(uint64_t)) > TC_QOPT_MAX_QUEUE) + if (len < 0 || len > TC_QOPT_MAX_QUEUE) return -NLE_RANGE; + memset(mqprio->qm_max_rate, 0, sizeof(mqprio->qm_max_rate)); memcpy(mqprio->qm_max_rate, max, len * sizeof(uint64_t)); mqprio->qm_mask |= SCH_MQPRIO_ATTR_MAX_RATE;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/netem.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/netem.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/netem.c Network Emulator Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -26,6 +20,8 @@ #include <netlink/route/qdisc.h> #include <netlink/route/qdisc/netem.h> +#include "netlink-private/utils.h" + /** @cond SKIP */ #define SCH_NETEM_ATTR_LATENCY 0x0001 #define SCH_NETEM_ATTR_LIMIT 0x0002 @@ -165,39 +161,39 @@ nl_dump(p, " jitter %s", buf); if (netem->qnm_mask & SCH_NETEM_ATTR_DELAY_CORR && netem->qnm_corr.nmc_delay > 0) - nl_dump(p, " %d%", netem->qnm_corr.nmc_delay); + nl_dump(p, " %d", netem->qnm_corr.nmc_delay); } } if (netem->qnm_mask & SCH_NETEM_ATTR_LOSS && netem->qnm_loss > 0) { - nl_dump(p, " loss %d%", netem->qnm_loss); + nl_dump(p, " loss %d", netem->qnm_loss); if (netem->qnm_mask & SCH_NETEM_ATTR_LOSS_CORR && netem->qnm_corr.nmc_loss > 0) - nl_dump(p, " %d%", netem->qnm_corr.nmc_loss); + nl_dump(p, " %d", netem->qnm_corr.nmc_loss); } if (netem->qnm_mask & SCH_NETEM_ATTR_DUPLICATE && netem->qnm_duplicate > 0) { - nl_dump(p, " duplicate %d%", netem->qnm_duplicate); + nl_dump(p, " duplicate %d", netem->qnm_duplicate); if (netem->qnm_mask & SCH_NETEM_ATTR_DUP_CORR && netem->qnm_corr.nmc_duplicate > 0) - nl_dump(p, " %d%", netem->qnm_corr.nmc_duplicate); + nl_dump(p, " %d", netem->qnm_corr.nmc_duplicate); } if (netem->qnm_mask & SCH_NETEM_ATTR_RO_PROB && netem->qnm_ro.nmro_probability > 0) { - nl_dump(p, " reorder %d%", netem->qnm_ro.nmro_probability); + nl_dump(p, " reorder %d", netem->qnm_ro.nmro_probability); if (netem->qnm_mask & SCH_NETEM_ATTR_RO_CORR && netem->qnm_ro.nmro_correlation > 0) - nl_dump(p, " %d%", netem->qnm_ro.nmro_correlation); + nl_dump(p, " %d", netem->qnm_ro.nmro_correlation); if (netem->qnm_mask & SCH_NETEM_ATTR_GAP && netem->qnm_gap > 0) nl_dump(p, " gap %d", netem->qnm_gap); } if (netem->qnm_mask & SCH_NETEM_ATTR_CORRUPT_PROB && netem->qnm_crpt.nmcr_probability > 0) { - nl_dump(p, " reorder %d%", netem->qnm_crpt.nmcr_probability); + nl_dump(p, " reorder %d", netem->qnm_crpt.nmcr_probability); if (netem->qnm_mask & SCH_NETEM_ATTR_CORRUPT_CORR && netem->qnm_crpt.nmcr_correlation > 0) - nl_dump(p, " %d%", netem->qnm_crpt.nmcr_correlation); + nl_dump(p, " %d", netem->qnm_crpt.nmcr_correlation); } } } @@ -911,10 +907,10 @@ int n = 0; size_t i; size_t len = 2048; - char *line; + _nl_auto_free char *line = NULL; char nameNAME_MAX; char dist_suffix = ".dist"; - int16_t *data; + _nl_auto_free int16_t *data = NULL; char *test_suffix; /* Check several locations for the dist file */ @@ -940,9 +936,12 @@ if (f == NULL) return -nl_syserr2nlerr(errno); - data = (int16_t *) calloc (MAXDIST, sizeof(int16_t)); - - line = (char *) calloc (sizeof(char), len + 1); + data = (int16_t *) calloc(MAXDIST, sizeof(int16_t)); + line = (char *) calloc(sizeof(char), len + 1); + if (!data || !line) { + fclose(f); + return -NLE_NOMEM; + } while (getline(&line, &len, f) != -1) { char *p, *endp; @@ -955,7 +954,6 @@ if (endp == p) break; if (n >= MAXDIST) { - free(line); fclose(f); return -NLE_INVAL; } @@ -963,11 +961,8 @@ } } - free(line); fclose(f); - i = rtnl_netem_set_delay_distribution_data(qdisc, data, n); - free(data); return i; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/plug.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/plug.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/plug.c PLUG Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2012 Shriram Rajagopalan <rshriram@cs.ubc.ca> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/prio.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/prio.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/prio.c PRIO Qdisc/Class - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/red.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/red.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/red.c RED Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/sfq.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/sfq.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/sfq.c SFQ Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/qdisc/tbf.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/qdisc/tbf.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/qdisc/tbf.c TBF Qdisc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -121,9 +115,9 @@ cl = nl_cancel_down_bits(1 << tbf->qt_peakrate.rs_cell_log, &clu); - nl_dump_line(p, " peak-rate %.2f%s/s (%.0f%s) " - "bucket-size %.1f%s cell-size %.1f%s" - "latency %.1f%s", + nl_dump_line(p, + " peak-rate %.2f%s/s (%.0f%s) " + "bucket-size %.1f%s cell-size %.1f%s", pr, pru, prb, prbu, bs, bsu, cl, clu); } }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/route.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/route.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/route.c Routes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -18,6 +11,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/nl-auto.h> #include <netlink/netlink.h> #include <netlink/cache.h> #include <netlink/utils.h> @@ -131,6 +125,32 @@ result); } +int rtnl_route_lookup(struct nl_sock *sk, struct nl_addr *dst, + struct rtnl_route **result) +{ + _nl_auto_nl_msg struct nl_msg *msg = NULL; + _nl_auto_rtnl_route struct rtnl_route *tmpl = NULL; + struct nl_object *obj; + int err; + + tmpl = rtnl_route_alloc(); + rtnl_route_set_dst(tmpl, dst); + err = build_route_msg(tmpl, RTM_GETROUTE, 0, &msg); + if (err < 0) + return err; + + err = nl_send_auto(sk, msg); + if (err < 0) + return err; + + if ((err = nl_pickup(sk, route_msg_parser, &obj)) < 0) + return err; + + *result = (struct rtnl_route *)obj; + wait_for_ack(sk); + return 0; +} + int rtnl_route_add(struct nl_sock *sk, struct rtnl_route *route, int flags) { struct nl_msg *msg;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/route_obj.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/route_obj.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/route_obj.c Route Object - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ @@ -105,22 +98,27 @@ struct rtnl_route *src = (struct rtnl_route *) _src; struct rtnl_nexthop *nh, *new; - if (src->rt_dst) + dst->rt_dst = NULL; + dst->rt_src = NULL; + dst->rt_pref_src = NULL; + nl_init_list_head(&dst->rt_nexthops); + dst->rt_nr_nh = 0; + + if (src->rt_dst) { if (!(dst->rt_dst = nl_addr_clone(src->rt_dst))) return -NLE_NOMEM; + } - if (src->rt_src) + if (src->rt_src) { if (!(dst->rt_src = nl_addr_clone(src->rt_src))) return -NLE_NOMEM; + } - if (src->rt_pref_src) + if (src->rt_pref_src) { if (!(dst->rt_pref_src = nl_addr_clone(src->rt_pref_src))) return -NLE_NOMEM; + } - /* Will be inc'ed again while adding the nexthops of the source */ - dst->rt_nr_nh = 0; - - nl_init_list_head(&dst->rt_nexthops); nl_list_for_each_entry(nh, &src->rt_nexthops, rtnh_list) { new = rtnl_route_nh_clone(nh); if (!new) @@ -211,8 +209,8 @@ static void route_dump_details(struct nl_object *a, struct nl_dump_params *p) { + _nl_auto_nl_cache struct nl_cache *link_cache = NULL; struct rtnl_route *r = (struct rtnl_route *) a; - struct nl_cache *link_cache; char buf256; int i; @@ -282,9 +280,6 @@ r->rt_metricsi); nl_dump(p, "\n"); } - - if (link_cache) - nl_cache_put(link_cache); } static void route_dump_stats(struct nl_object *obj, struct nl_dump_params *p) @@ -310,13 +305,13 @@ struct rtnl_route *route = (struct rtnl_route *) obj; unsigned int rkey_sz; struct nl_addr *addr = NULL; - struct route_hash_key { + _nl_auto_free struct route_hash_key { uint8_t rt_family; uint8_t rt_tos; uint32_t rt_table; uint32_t rt_prio; char rt_addr0; - } __attribute__((packed)) *rkey; + } __attribute__((packed)) *rkey = NULL; #ifdef NL_DEBUG char bufINET6_ADDRSTRLEN+5; #endif @@ -348,8 +343,6 @@ rkey->rt_table, nl_addr2str(addr, buf, sizeof(buf)), rkey_sz, *hashkey); - free(rkey); - return; } @@ -512,6 +505,16 @@ switch(action) { case RTM_NEWROUTE : { struct rtnl_nexthop *cloned_nh; + struct rtnl_nexthop *old_nh; + + /* + * Do not add the nexthop to old route if it was already added before + */ + nl_list_for_each_entry(old_nh, &old_route->rt_nexthops, rtnh_list) { + if (!rtnl_route_nh_compare(old_nh, new_nh, ~0, 0)) { + return 0; + } + } /* * Add the nexthop to old route @@ -1022,12 +1025,13 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) { - struct rtnl_nexthop *nh = NULL; struct rtnexthop *rtnh = nla_data(attr); size_t tlen = nla_len(attr); int err; while (tlen >= sizeof(*rtnh) && tlen >= rtnh->rtnh_len) { + _nl_auto_rtnl_nexthop struct rtnl_nexthop *nh = NULL; + nh = rtnl_route_nh_alloc(); if (!nh) return -NLE_NOMEM; @@ -1044,20 +1048,17 @@ rtnh->rtnh_len - sizeof(*rtnh), route_policy); if (err < 0) - goto errout; + return err; if (ntbRTA_GATEWAY) { - struct nl_addr *addr; + _nl_auto_nl_addr struct nl_addr *addr = NULL; addr = nl_addr_alloc_attr(ntbRTA_GATEWAY, route->rt_family); - if (!addr) { - err = -NLE_NOMEM; - goto errout; - } + if (!addr) + return -NLE_NOMEM; rtnl_route_nh_set_gateway(nh, addr); - nl_addr_put(addr); } if (ntbRTA_FLOW) { @@ -1068,72 +1069,67 @@ } if (ntbRTA_NEWDST) { - struct nl_addr *addr; + _nl_auto_nl_addr struct nl_addr *addr = NULL; addr = nl_addr_alloc_attr(ntbRTA_NEWDST, route->rt_family); if (!addr) - goto errout; + return -NLE_NOMEM; err = rtnl_route_nh_set_newdst(nh, addr); - nl_addr_put(addr); - if (err) - goto errout; + if (err < 0) + return err; } if (ntbRTA_VIA) { - struct nl_addr *addr; + _nl_auto_nl_addr struct nl_addr *addr = NULL; addr = rtnl_route_parse_via(ntbRTA_VIA); if (!addr) - goto errout; + return -NLE_NOMEM; err = rtnl_route_nh_set_via(nh, addr); - nl_addr_put(addr); - if (err) - goto errout; + if (err < 0) + return err; } if (ntbRTA_ENCAP && ntbRTA_ENCAP_TYPE) { err = nh_encap_parse_msg(ntbRTA_ENCAP, ntbRTA_ENCAP_TYPE, nh); - if (err) - goto errout; + if (err < 0) + return err; } } - rtnl_route_add_nexthop(route, nh);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/route_utils.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/route_utils.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/route_utils.c Routing Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/rtnl.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/rtnl.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/rtnl.c Routing Netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/rule.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/rule.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/rule.c Routing Rules - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */ @@ -66,6 +59,9 @@ struct rtnl_rule *dst = nl_object_priv(_dst); struct rtnl_rule *src = nl_object_priv(_src); + dst->r_src = NULL; + dst->r_dst = NULL; + if (src->r_src) if (!(dst->r_src = nl_addr_clone(src->r_src))) return -NLE_NOMEM;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/route/tc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/route/tc.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/tc.c Traffic Control - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */ @@ -536,7 +529,7 @@ || strlen (kind) >= sizeof (tc->tc_kind)) return -NLE_INVAL; - _nl_strncpy(tc->tc_kind, kind, sizeof(tc->tc_kind)); + _nl_strncpy_assert(tc->tc_kind, kind, sizeof(tc->tc_kind)); tc->ce_mask |= TCA_ATTR_KIND; @@ -815,14 +808,17 @@ struct rtnl_tc *src = TC_CAST(srcobj); struct rtnl_tc_ops *ops; + dst->tc_opts = NULL; + dst->tc_xstats = NULL; + dst->tc_subdata = NULL; + dst->tc_link = NULL; + dst->tc_ops = NULL; + if (src->tc_link) { nl_object_get(OBJ_CAST(src->tc_link)); dst->tc_link = src->tc_link; } - dst->tc_opts = NULL; - dst->tc_xstats = NULL; - dst->tc_subdata = NULL; dst->ce_mask &= ~(TCA_ATTR_OPTS | TCA_ATTR_XSTATS); @@ -844,18 +840,19 @@ if (!(dst->tc_subdata = nl_data_clone(src->tc_subdata))) { return -NLE_NOMEM; } - } - - ops = rtnl_tc_get_ops(src); - if (ops && ops->to_clone) { - void *a = rtnl_tc_data(dst), *b = rtnl_tc_data(src); - - if (!a) - return 0; - else if (!b) - return -NLE_NOMEM; - return ops->to_clone(a, b); + /* Warning: if the data contains pointer, then at this point, dst->tc_subdata + * will alias those pointers. + * + * ops->to_clone() MUST fix that. + * + * If the type is actually "struct rtnl_act", then to_clone() must also + * fix dangling "a_next" pointer. */ + + ops = rtnl_tc_get_ops(src); + if (ops && ops->to_clone) { + return ops->to_clone(rtnl_tc_data(dst), rtnl_tc_data(src)); + } } return 0; @@ -952,22 +949,19 @@ res = nl_cancel_down_bytes(tc->tc_statsRTNL_TC_BYTES, &unit); - nl_dump_line(p, - " %10.2f %3s %10u %-10u %-10u %-10u %-10u\n", - res, unit, - tc->tc_statsRTNL_TC_PACKETS, - tc->tc_statsRTNL_TC_DROPS, - tc->tc_statsRTNL_TC_OVERLIMITS, - tc->tc_statsRTNL_TC_QLEN, - tc->tc_statsRTNL_TC_BACKLOG); + nl_dump_line( + p, + " %10.2f %3s %10llu %-10llu %-10llu %-10llu %-10llu\n", + res, unit, (long long unsigned)tc->tc_statsRTNL_TC_PACKETS, + (long long unsigned)tc->tc_statsRTNL_TC_DROPS, + (long long unsigned)tc->tc_statsRTNL_TC_OVERLIMITS, + (long long unsigned)tc->tc_statsRTNL_TC_QLEN, + (long long unsigned)tc->tc_statsRTNL_TC_BACKLOG); res = nl_cancel_down_bytes(tc->tc_statsRTNL_TC_RATE_BPS, &unit); - nl_dump_line(p, - " %10.2f %3s/s %10u/s\n", - res, - unit, - tc->tc_statsRTNL_TC_RATE_PPS); + nl_dump_line(p, " %10.2f %3s/s %10llu/s\n", res, unit, + (long long unsigned)tc->tc_statsRTNL_TC_RATE_PPS); } uint64_t rtnl_tc_compare(struct nl_object *aobj, struct nl_object *bobj,
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/socket.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/socket.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/socket.c Netlink Socket - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -66,7 +59,8 @@ static uint32_t generate_local_port(void) { - int i, j, n, m; + int i, j, m; + uint16_t n; static uint16_t idx_state = 0; uint32_t pid = getpid() & 0x3FFFFF; @@ -98,7 +92,7 @@ continue; for (m = 0; m < 32; m++) { - n = (n + 13) % 32; + n = (n + 13u) % 32u; if (1UL & (used_ports_mapi >> n)) continue; @@ -111,7 +105,7 @@ nl_write_unlock(&port_map_lock); /* ensure we don't return zero. */ - pid = pid + (((uint32_t)n) << 22); + pid = pid + (n << 22); return pid ? pid : 1024; } }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/utils.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/utils.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/utils.c Utility Functions - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */ @@ -475,7 +468,7 @@ else if ((ev = getenv("PROC_ROOT"))) snprintf(name, sizeof(name), "%s/net/psched", ev); else - strncpy(name, "/proc/net/psched", sizeof(name) - 1); + _nl_strncpy_assert(name, "/proc/net/psched", sizeof(name)); if ((fd = fopen(name, "re"))) { unsigned int ns_per_usec, ns_per_tick, nom, denom; @@ -1224,6 +1217,15 @@ NL_CAPABILITY_VERSION_3_4_0, NL_CAPABILITY_ROUTE_FIX_VLAN_SET_EGRESS_MAP, NL_CAPABILITY_VERSION_3_5_0, + NL_CAPABILITY_NL_OBJECT_IDENTICAL_PARTIAL, + NL_CAPABILITY_VERSION_3_6_0), + _NL_SET (4, + NL_CAPABILITY_VERSION_3_7_0, + 0, + 0, + 0, + 0, + 0, 0, 0), /* IMPORTANT: these capability numbers are intended to be universal and stable
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/version.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/version.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/version.c Run-time version information - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/xfrm/ae.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/xfrm/ae.c
Changed
@@ -164,17 +164,23 @@ struct xfrmnl_ae* dst = nl_object_priv(_dst); struct xfrmnl_ae* src = nl_object_priv(_src); - if (src->sa_id.daddr) + dst->sa_id.daddr = NULL; + dst->saddr = NULL; + dst->replay_state_esn = NULL; + + if (src->sa_id.daddr) { if ((dst->sa_id.daddr = nl_addr_clone (src->sa_id.daddr)) == NULL) return -NLE_NOMEM; + } - if (src->saddr) + if (src->saddr) { if ((dst->saddr = nl_addr_clone (src->saddr)) == NULL) return -NLE_NOMEM; + } - if (src->replay_state_esn) - { + if (src->replay_state_esn) { uint32_t len = sizeof (struct xfrmnl_replay_state_esn) + (sizeof (uint32_t) * src->replay_state_esn->bmp_len); + if ((dst->replay_state_esn = malloc (len)) == NULL) return -NLE_NOMEM; memcpy (dst->replay_state_esn, src->replay_state_esn, len); @@ -308,8 +314,9 @@ ae->flags, ae->mark.m, ae->mark.v); nl_dump_line(p, "\tlifetime current: \n"); - nl_dump_line(p, "\t\tbytes %llu packets %llu \n", ae->lifetime_cur.bytes, - ae->lifetime_cur.packets); + nl_dump_line(p, "\t\tbytes %llu packets %llu \n", + (long long unsigned)ae->lifetime_cur.bytes, + (long long unsigned)ae->lifetime_cur.packets); if (ae->lifetime_cur.add_time != 0) { add_time = ae->lifetime_cur.add_time; @@ -375,6 +382,8 @@ !(tmpl->ce_mask & XFRM_AE_ATTR_PROTO)) return -NLE_MISSING_ATTR; + memset(&ae_id, 0, sizeof(ae_id)); + memcpy (&ae_id.sa_id.daddr, nl_addr_get_binary_addr (tmpl->sa_id.daddr), sizeof (uint8_t) * nl_addr_get_len (tmpl->sa_id.daddr)); ae_id.sa_id.spi = htonl(tmpl->sa_id.spi); ae_id.sa_id.family = tmpl->sa_id.family;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/xfrm/sa.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/xfrm/sa.c
Changed
@@ -78,6 +78,7 @@ #define XFRM_SA_ATTR_REPLAY_MAXDIFF 0x1000000 #define XFRM_SA_ATTR_REPLAY_STATE 0x2000000 #define XFRM_SA_ATTR_EXPIRE 0x4000000 +#define XFRM_SA_ATTR_OFFLOAD_DEV 0x8000000 static struct nl_cache_ops xfrmnl_sa_ops; static struct nl_object_ops xfrm_sa_obj_ops; @@ -125,6 +126,8 @@ free (sa->sec_ctx); if (sa->replay_state_esn) free (sa->replay_state_esn); + if (sa->user_offload) + free(sa->user_offload); } static int xfrm_sa_clone(struct nl_object *_dst, struct nl_object *_src) @@ -133,6 +136,20 @@ struct xfrmnl_sa* src = nl_object_priv(_src); uint32_t len = 0; + dst->sel = NULL; + dst->id.daddr = NULL; + dst->saddr = NULL; + dst->lft = NULL; + dst->aead = NULL; + dst->auth = NULL; + dst->crypt = NULL; + dst->comp = NULL; + dst->encap = NULL; + dst->coaddr = NULL; + dst->sec_ctx = NULL; + dst->replay_state_esn = NULL; + dst->user_offload = NULL; + if (src->sel) if ((dst->sel = xfrmnl_sel_clone (src->sel)) == NULL) return -NLE_NOMEM; @@ -149,40 +166,35 @@ if ((dst->saddr = nl_addr_clone (src->saddr)) == NULL) return -NLE_NOMEM; - if (src->aead) - { + if (src->aead) { len = sizeof (struct xfrmnl_algo_aead) + ((src->aead->alg_key_len + 7) / 8); if ((dst->aead = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->aead, (void *)src->aead, len); } - if (src->auth) - { + if (src->auth) { len = sizeof (struct xfrmnl_algo_auth) + ((src->auth->alg_key_len + 7) / 8); if ((dst->auth = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->auth, (void *)src->auth, len); } - if (src->crypt) - { + if (src->crypt) { len = sizeof (struct xfrmnl_algo) + ((src->crypt->alg_key_len + 7) / 8); if ((dst->crypt = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->crypt, (void *)src->crypt, len); } - if (src->comp) - { + if (src->comp) { len = sizeof (struct xfrmnl_algo) + ((src->comp->alg_key_len + 7) / 8); if ((dst->comp = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->comp, (void *)src->comp, len); } - if (src->encap) - { + if (src->encap) { len = sizeof (struct xfrmnl_encap_tmpl); if ((dst->encap = calloc (1, len)) == NULL) return -NLE_NOMEM; @@ -193,22 +205,26 @@ if ((dst->coaddr = nl_addr_clone (src->coaddr)) == NULL) return -NLE_NOMEM; - if (src->sec_ctx) - { + if (src->sec_ctx) { len = sizeof (*src->sec_ctx) + src->sec_ctx->ctx_len; if ((dst->sec_ctx = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->sec_ctx, (void *)src->sec_ctx, len); } - if (src->replay_state_esn) - { + if (src->replay_state_esn) { len = sizeof (struct xfrmnl_replay_state_esn) + (src->replay_state_esn->bmp_len * sizeof (uint32_t)); if ((dst->replay_state_esn = calloc (1, len)) == NULL) return -NLE_NOMEM; memcpy ((void *)dst->replay_state_esn, (void *)src->replay_state_esn, len); } + if (src->user_offload) { + dst->user_offload = _nl_memdup_ptr(src->user_offload); + if (!dst->user_offload) + return -NLE_NOMEM; + } + return 0; } @@ -333,6 +349,7 @@ __ADD(XFRM_SA_ATTR_REPLAY_MAXDIFF, replay_maxdiff), __ADD(XFRM_SA_ATTR_REPLAY_STATE, replay_state), __ADD(XFRM_SA_ATTR_EXPIRE, expire), + __ADD(XFRM_SA_ATTR_OFFLOAD_DEV, user_offload), }; static char* xfrm_sa_attrs2str(int attrs, char *buf, size_t len) @@ -430,14 +447,23 @@ sprintf (mode, "INF"); else sprintf (mode, "%" PRIu64, sa->lft->hard_packet_limit); - nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets)\n", flags, mode); - nl_dump_line(p, "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n", - sa->lft->soft_add_expires_seconds, sa->lft->soft_use_expires_seconds); - nl_dump_line(p, "\t\thard add_time: %llu (seconds), hard use_time: %llu (seconds) \n", - sa->lft->hard_add_expires_seconds, sa->lft->hard_use_expires_seconds); + nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets)\n", flags, + mode); + nl_dump_line( + p, + "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n", + (long long unsigned)sa->lft->soft_add_expires_seconds, + (long long unsigned)sa->lft->soft_use_expires_seconds); + nl_dump_line( + p, + "\t\thard add_time: %llu (seconds), hard use_time: %llu (seconds) \n", + (long long unsigned)sa->lft->hard_add_expires_seconds, + (long long unsigned)sa->lft->hard_use_expires_seconds); nl_dump_line(p, "\tlifetime current: \n"); - nl_dump_line(p, "\t\t%llu bytes, %llu packets\n", sa->curlft.bytes, sa->curlft.packets); + nl_dump_line(p, "\t\t%llu bytes, %llu packets\n", + (long long unsigned)sa->curlft.bytes, + (long long unsigned)sa->curlft.packets); if (sa->curlft.add_time != 0) { add_time = sa->curlft.add_time; @@ -639,6 +665,7 @@ XFRMA_SEC_CTX = { .minlen = sizeof(struct xfrm_sec_ctx) }, XFRMA_LTIME_VAL = { .minlen = sizeof(struct xfrm_lifetime_cur) }, XFRMA_REPLAY_VAL = { .minlen = sizeof(struct xfrm_replay_state) }, + XFRMA_OFFLOAD_DEV = { .minlen = sizeof(struct xfrm_user_offload) }, XFRMA_REPLAY_THRESH = { .type = NLA_U32 }, XFRMA_ETIMER_THRESH = { .type = NLA_U32 }, XFRMA_SRCADDR = { .minlen = sizeof(xfrm_address_t) }, @@ -650,11 +677,7 @@ static int xfrm_sa_request_update(struct nl_cache *c, struct nl_sock *h) { - struct xfrm_id sa_id; - - memset (&sa_id, 0, sizeof (sa_id)); - return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP, - &sa_id, sizeof (sa_id)); + return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP, NULL, 0); } int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result) @@ -699,6 +722,8 @@ addr = nl_addr_build (sa_info->sel.family, &sa_info->sel.daddr.a6, sizeof (sa_info->sel.daddr.a6)); nl_addr_set_prefixlen (addr, sa_info->sel.prefixlen_d); xfrmnl_sel_set_daddr (sa->sel, addr); + /* Drop the reference count from the above set operation */ + nl_addr_put(addr); xfrmnl_sel_set_prefixlen_d (sa->sel, sa_info->sel.prefixlen_d); if (sa_info->sel.family == AF_INET) @@ -707,6 +732,8 @@ addr = nl_addr_build (sa_info->sel.family, &sa_info->sel.saddr.a6, sizeof (sa_info->sel.saddr.a6)); nl_addr_set_prefixlen (addr, sa_info->sel.prefixlen_s); xfrmnl_sel_set_saddr (sa->sel, addr); + /* Drop the reference count from the above set operation */ + nl_addr_put(addr); xfrmnl_sel_set_prefixlen_s (sa->sel, sa_info->sel.prefixlen_s); xfrmnl_sel_set_dport (sa->sel, ntohs(sa_info->sel.dport)); @@ -913,6 +940,22 @@ sa->replay_state_esn = NULL; } + if (tbXFRMA_OFFLOAD_DEV) { + struct xfrm_user_offload *offload; + + len = sizeof(struct xfrmnl_user_offload);
View file
_service:tar_scm:libnl-3.5.0.tar.gz/lib/xfrm/sp.c -> _service:tar_scm:libnl-3.7.0.tar.gz/lib/xfrm/sp.c
Changed
@@ -93,9 +93,8 @@ xfrmnl_sel_put (sp->sel); xfrmnl_ltime_cfg_put (sp->lft); - if(sp->sec_ctx) - { - free (sp->sec_ctx); + if (sp->sec_ctx) { + free(sp->sec_ctx); } nl_list_for_each_entry_safe(utmpl, tmp, &sp->usertmpl_list, utmpl_list) { @@ -106,33 +105,38 @@ static int xfrm_sp_clone(struct nl_object *_dst, struct nl_object *_src) { - struct xfrmnl_sp* dst = nl_object_priv(_dst); - struct xfrmnl_sp* src = nl_object_priv(_src); - uint32_t len = 0; - struct xfrmnl_user_tmpl *utmpl, *new; + struct xfrmnl_sp* dst = nl_object_priv(_dst); + struct xfrmnl_sp* src = nl_object_priv(_src); + struct xfrmnl_user_tmpl *utmpl; + struct xfrmnl_user_tmpl *new; - if (src->sel) + dst->sel = NULL; + dst->lft = NULL; + dst->sec_ctx = NULL; + nl_init_list_head(&dst->usertmpl_list); + + if (src->sel) { if ((dst->sel = xfrmnl_sel_clone (src->sel)) == NULL) return -NLE_NOMEM; + } - if (src->lft) + if (src->lft) { if ((dst->lft = xfrmnl_ltime_cfg_clone (src->lft)) == NULL) return -NLE_NOMEM; + } - if(src->sec_ctx) - { - len = sizeof (struct xfrmnl_user_sec_ctx) + src->sec_ctx->ctx_len; - if ((dst->sec_ctx = calloc (1, len)) == NULL) + if (src->sec_ctx) { + uint32_t len = sizeof (struct xfrmnl_user_sec_ctx) + src->sec_ctx->ctx_len; + + if ((dst->sec_ctx = malloc (len)) == NULL) return -NLE_NOMEM; - memcpy ((void *)dst->sec_ctx, (void *)src->sec_ctx, len); + memcpy(dst->sec_ctx, src->sec_ctx, len); } - nl_init_list_head(&dst->usertmpl_list); nl_list_for_each_entry(utmpl, &src->usertmpl_list, utmpl_list) { new = xfrmnl_user_tmpl_clone (utmpl); if (!new) return -NLE_NOMEM; - xfrmnl_sp_add_usertemplate(dst, new); } @@ -357,15 +361,25 @@ sprintf (share, "INF"); else sprintf (share, "%" PRIu64, sp->lft->hard_packet_limit); - nl_dump_line(p, "\t\tsoft limit: %s (bytes), %s (packets) \n", dir, action); - nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets) \n", flags, share); - nl_dump_line(p, "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n", - sp->lft->soft_add_expires_seconds, sp->lft->soft_use_expires_seconds); - nl_dump_line(p, "\t\thard add_time: %llu (seconds), hard use_time: %llu (seconds) \n", - sp->lft->hard_add_expires_seconds, sp->lft->hard_use_expires_seconds); + nl_dump_line(p, "\t\tsoft limit: %s (bytes), %s (packets) \n", dir, + action); + nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets) \n", flags, + share); + nl_dump_line( + p, + "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n", + (long long unsigned)sp->lft->soft_add_expires_seconds, + (long long unsigned)sp->lft->soft_use_expires_seconds); + nl_dump_line( + p, + "\t\thard add_time: %llu (seconds), hard use_time: %llu (seconds) \n", + (long long unsigned)sp->lft->hard_add_expires_seconds, + (long long unsigned)sp->lft->hard_use_expires_seconds); nl_dump_line(p, "\tlifetime current: \n"); - nl_dump_line(p, "\t\t%llu bytes, %llu packets\n", sp->curlft.bytes, sp->curlft.packets); + nl_dump_line(p, "\t\t%llu bytes, %llu packets\n", + (long long unsigned)sp->curlft.bytes, + (long long unsigned)sp->curlft.packets); if (sp->curlft.add_time != 0) { @@ -508,11 +522,7 @@ static int xfrm_sp_request_update(struct nl_cache *c, struct nl_sock *h) { - struct xfrm_userpolicy_id sp_id; - - memset (&sp_id, 0, sizeof (sp_id)); - return nl_send_simple (h, XFRM_MSG_GETPOLICY, NLM_F_DUMP, - &sp_id, sizeof (sp_id)); + return nl_send_simple (h, XFRM_MSG_GETPOLICY, NLM_F_DUMP, NULL, 0); } int xfrmnl_sp_parse(struct nlmsghdr *n, struct xfrmnl_sp **result) @@ -1090,16 +1100,16 @@ return 0; } -int xfrmnl_sp_get_curlifetime (struct xfrmnl_sp* sa, unsigned long long int* curr_bytes, +int xfrmnl_sp_get_curlifetime (struct xfrmnl_sp* sp, unsigned long long int* curr_bytes, unsigned long long int* curr_packets, unsigned long long int* curr_add_time, unsigned long long int* curr_use_time) { - if (sa == NULL || curr_bytes == NULL || curr_packets == NULL || curr_add_time == NULL || curr_use_time == NULL) + if (sp == NULL || curr_bytes == NULL || curr_packets == NULL || curr_add_time == NULL || curr_use_time == NULL) return -1; - *curr_bytes = sa->curlft.bytes; - *curr_packets = sa->curlft.packets; - *curr_add_time = sa->curlft.add_time; - *curr_use_time = sa->curlft.use_time; + *curr_bytes = sp->curlft.bytes; + *curr_packets = sp->curlft.packets; + *curr_add_time = sp->curlft.add_time; + *curr_use_time = sp->curlft.use_time; return 0; }
View file
_service:tar_scm:libnl-3.5.0.tar.gz/libnl-3.0.pc.in -> _service:tar_scm:libnl-3.7.0.tar.gz/libnl-3.0.pc.in
Changed
@@ -7,4 +7,5 @@ Description: Convenience library for netlink sockets Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lnl-@MAJ_VERSION@ +Libs.private: @LIBS@ Cflags: -I${includedir}/libnl@MAJ_VERSION@
View file
_service:tar_scm:libnl-3.5.0.tar.gz/libnl-3.sym -> _service:tar_scm:libnl-3.7.0.tar.gz/libnl-3.sym
Changed
@@ -363,3 +363,8 @@ global: nla_nest_end_keep_empty; } libnl_3_2_29; + +libnl_3_6 { +global: + rtnl_link_info_ops_get; +} libnl_3_5;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/libnl-nf-3.sym -> _service:tar_scm:libnl-3.7.0.tar.gz/libnl-nf-3.sym
Changed
@@ -314,3 +314,32 @@ local: *; }; + +libnl_3_6 { +global: + nfnl_log_msg_get_ct; + nfnl_log_msg_get_ct_info; + nfnl_log_msg_get_hwheader; + nfnl_log_msg_get_hwlen; + nfnl_log_msg_get_hwtype; + nfnl_log_msg_get_vlan_cfi; + nfnl_log_msg_get_vlan_id; + nfnl_log_msg_get_vlan_prio; + nfnl_log_msg_get_vlan_proto; + nfnl_log_msg_get_vlan_tag; + nfnl_log_msg_set_ct; + nfnl_log_msg_set_ct_info; + nfnl_log_msg_set_hwheader; + nfnl_log_msg_set_hwlen; + nfnl_log_msg_set_hwtype; + nfnl_log_msg_set_vlan_proto; + nfnl_log_msg_set_vlan_tag; + nfnl_log_msg_test_ct; + nfnl_log_msg_test_ct_info; + nfnl_log_msg_test_hwheader; + nfnl_log_msg_test_hwlen; + nfnl_log_msg_test_hwtype; + nfnl_log_msg_test_vlan_proto; + nfnl_log_msg_test_vlan_tag; + nfnlmsg_ct_parse_nested; +} libnl_3;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/libnl-route-3.sym -> _service:tar_scm:libnl-3.7.0.tar.gz/libnl-route-3.sym
Changed
@@ -1150,3 +1150,121 @@ rtnl_vlan_set_vlan_id; rtnl_vlan_set_vlan_prio; } libnl_3_4; + +libnl_3_6 { +global: + rtnl_cls_find_by_handle; + rtnl_cls_find_by_prio; + rtnl_flower_append_action; + rtnl_flower_del_action; + rtnl_flower_get_action; + rtnl_flower_get_dst_mac; + rtnl_flower_get_ip_dscp; + rtnl_flower_get_proto; + rtnl_flower_get_src_mac; + rtnl_flower_get_vlan_id; + rtnl_flower_get_vlan_prio; + rtnl_flower_set_dst_mac; + rtnl_flower_set_flags; + rtnl_flower_set_ip_dscp; + rtnl_flower_set_proto; + rtnl_flower_set_src_mac; + rtnl_flower_set_vlan_ethtype; + rtnl_flower_set_vlan_id; + rtnl_flower_set_vlan_prio; + rtnl_link_can_get_data_bittiming; + rtnl_link_can_get_data_bittiming_const; + rtnl_link_can_set_data_bittiming; + rtnl_link_can_set_data_bittiming_const; + rtnl_link_ip6_tnl_get_fwmark; + rtnl_link_ip6_tnl_set_fwmark; + rtnl_link_ip6gre_add; + rtnl_link_ip6gre_alloc; + rtnl_link_ip6gre_get_encaplimit; + rtnl_link_ip6gre_get_flags; + rtnl_link_ip6gre_get_flowinfo; + rtnl_link_ip6gre_get_fwmark; + rtnl_link_ip6gre_get_iflags; + rtnl_link_ip6gre_get_ikey; + rtnl_link_ip6gre_get_link; + rtnl_link_ip6gre_get_local; + rtnl_link_ip6gre_get_oflags; + rtnl_link_ip6gre_get_okey; + rtnl_link_ip6gre_get_remote; + rtnl_link_ip6gre_get_ttl; + rtnl_link_ip6gre_set_encaplimit; + rtnl_link_ip6gre_set_flags; + rtnl_link_ip6gre_set_flowinfo; + rtnl_link_ip6gre_set_fwmark; + rtnl_link_ip6gre_set_iflags; + rtnl_link_ip6gre_set_ikey; + rtnl_link_ip6gre_set_link; + rtnl_link_ip6gre_set_local; + rtnl_link_ip6gre_set_oflags; + rtnl_link_ip6gre_set_okey; + rtnl_link_ip6gre_set_remote; + rtnl_link_ip6gre_set_ttl; + rtnl_link_ip6vti_add; + rtnl_link_ip6vti_alloc; + rtnl_link_ip6vti_get_fwmark; + rtnl_link_ip6vti_get_ikey; + rtnl_link_ip6vti_get_link; + rtnl_link_ip6vti_get_local; + rtnl_link_ip6vti_get_okey; + rtnl_link_ip6vti_get_remote; + rtnl_link_ip6vti_set_fwmark; + rtnl_link_ip6vti_set_ikey; + rtnl_link_ip6vti_set_link; + rtnl_link_ip6vti_set_local; + rtnl_link_ip6vti_set_okey; + rtnl_link_ip6vti_set_remote; + rtnl_link_ipgre_get_fwmark; + rtnl_link_ipgre_set_fwmark; + rtnl_link_ipip_get_fwmark; + rtnl_link_ipip_set_fwmark; + rtnl_link_ipvti_get_fwmark; + rtnl_link_ipvti_set_fwmark; + rtnl_link_is_ip6gre; + rtnl_link_is_ip6vti; + rtnl_link_macsec_get_offload; + rtnl_link_macsec_set_offload; + rtnl_link_sit_get_fwmark; + rtnl_link_sit_set_fwmark; + rtnl_link_team_add; + rtnl_link_team_alloc; + rtnl_mdb_add_entry; + rtnl_mdb_alloc_cache; + rtnl_mdb_alloc_cache_flags; + rtnl_mdb_entry_get_addr; + rtnl_mdb_entry_get_ifindex; + rtnl_mdb_entry_get_proto; + rtnl_mdb_entry_get_state; + rtnl_mdb_entry_get_vid; + rtnl_mdb_foreach_entry; + rtnl_mdb_get_ifindex; + rtnl_netconf_alloc_cache; + rtnl_netconf_get_ignore_routes_linkdown; + rtnl_netconf_get_proxy_neigh; + rtnl_qdisc_get_by_kind; + rtnl_route_lookup; + rtnl_route_nh_get_encap_mpls_dst; + rtnl_route_nh_get_encap_mpls_ttl; +} libnl_3_5; + +libnl_3_7 { +global: + rtnl_flower_get_ipv4_dst; + rtnl_flower_get_ipv4_src; + rtnl_flower_set_ipv4_dst; + rtnl_flower_set_ipv4_src; + rtnl_nat_get_action; + rtnl_nat_get_flags; + rtnl_nat_get_mask; + rtnl_nat_get_new_addr; + rtnl_nat_get_old_addr; + rtnl_nat_set_action; + rtnl_nat_set_flags; + rtnl_nat_set_mask; + rtnl_nat_set_new_addr; + rtnl_nat_set_old_addr; +} libnl_3_6;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/libnl-xfrm-3.sym -> _service:tar_scm:libnl-3.7.0.tar.gz/libnl-xfrm-3.sym
Changed
@@ -244,3 +244,8 @@ local: *; }; + +libnl_3_6 { + xfrmnl_sa_get_user_offload; + xfrmnl_sa_set_user_offload; +} libnl_3;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/m4/libtool.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/m4/libtool.m4
Changed
@@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. ) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require(_LT_CHECK_SHELL_FEATURES)dnl m4_require(_LT_PATH_CONVERSION_FUNCTIONS)dnl m4_require(_LT_CMD_RELOAD)dnl +m4_require(_LT_DECL_FILECMD)dnl m4_require(_LT_CHECK_MAGIC_METHOD)dnl m4_require(_LT_CHECK_SHAREDLIB_FROM_LINKLIB)dnl m4_require(_LT_CMD_OLD_ARCHIVE)dnl @@ -219,8 +221,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1067,17 +1069,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin91*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.012,.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1126,12 +1123,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if($1, CXX, if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ,) else @@ -1245,7 +1242,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN(_LT_WITH_SYSROOT, -AC_MSG_CHECKING(for sysroot) +m4_require(_LT_DECL_SED)dnl +AC_MSG_CHECKING(for sysroot) AC_ARG_WITH(sysroot, AS_HELP_STRING(--with-sysroot@<:@=DIR@:>@, Search for dependent libraries within DIR (or the compiler's sysroot @@ -1262,7 +1260,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1292,7 +1290,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1309,7 +1307,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1321,7 +1319,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1343,7 +1341,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1351,7 +1349,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1359,7 +1357,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1379,14 +1377,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1454,7 +1452,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1493,9 +1491,22 @@ m4_defun(_LT_PROG_AR, AC_CHECK_TOOLS(AR, ar, false) : ${AR=ar}
View file
_service:tar_scm:libnl-3.5.0.tar.gz/m4/ltoptions.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/m4/ltoptions.m4
Changed
@@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:libnl-3.5.0.tar.gz/m4/ltsugar.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/m4/ltsugar.m4
Changed
@@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 #
View file
_service:tar_scm:libnl-3.5.0.tar.gz/m4/ltversion.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/m4/ltversion.m4
Changed
@@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define(LT_PACKAGE_VERSION, 2.4.6) -m4_define(LT_PACKAGE_REVISION, 2.4.6) +m4_define(LT_PACKAGE_VERSION, 2.4.7) +m4_define(LT_PACKAGE_REVISION, 2.4.7) AC_DEFUN(LTVERSION_VERSION, -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, Which release of libtool.m4 was used?) _LT_DECL(, macro_revision, 0) )
View file
_service:tar_scm:libnl-3.5.0.tar.gz/m4/lt~obsolete.m4 -> _service:tar_scm:libnl-3.7.0.tar.gz/m4/lt~obsolete.m4
Changed
@@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/examples/iface.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/examples/iface.py
Changed
@@ -1,3 +1,4 @@ +from __future__ import print_function import netlink.capi as nl import netlink.genl.capi as genl import nl80211 @@ -6,7 +7,7 @@ class test_class: def __init__(self): - self.done = 1; + self.done = 1 def msg_handler(m, a): try: @@ -16,7 +17,7 @@ thiswiphy = nl.nla_get_u32(attrnl80211.NL80211_ATTR_WIPHY) print("phy#%d" % thiswiphy) if nl80211.NL80211_ATTR_IFNAME in attr: - print("\tinterface %s" % nl.nla_get_string(attrnl80211.NL80211_ATTR_IFNAME)); + print("\tinterface %s" % nl.nla_get_string(attrnl80211.NL80211_ATTR_IFNAME)) if nl80211.NL80211_ATTR_IFINDEX in attr: print("\tifindex %d" % nl.nla_get_u32(attrnl80211.NL80211_ATTR_IFINDEX)) if nl80211.NL80211_ATTR_WDEV in attr: @@ -31,7 +32,7 @@ if nl80211.NL80211_ATTR_WIPHY_FREQ in attr: freq = nl.nla_get_u32(attrnl80211.NL80211_ATTR_WIPHY_FREQ) - sys.stdout.write("\tfreq %d MHz" % freq); + sys.stdout.write("\tfreq %d MHz" % freq) if nl80211.NL80211_ATTR_CHANNEL_WIDTH in attr: chanw = nl.nla_get_u32(attrnl80211.NL80211_ATTR_CHANNEL_WIDTH) @@ -44,13 +45,13 @@ nl.nla_get_u32(attrnl80211.NL80211_ATTR_CENTER_FREQ2)) elif nl80211.NL80211_ATTR_WIPHY_CHANNEL_TYPE in attr: channel_type = nl.nla_get_u32(attrnl80211.NL80211_ATTR_WIPHY_CHANNEL_TYPE) - sys.stdout.write(" %s" % nl80211.nl80211_channel_type2str(channel_type)); + sys.stdout.write(" %s" % nl80211.nl80211_channel_type2str(channel_type)) - sys.stdout.write("\n"); - return nl.NL_SKIP; + sys.stdout.write("\n") + return nl.NL_SKIP except Exception as e: (t,v,tb) = sys.exc_info() - print v.message + print(v.message) traceback.print_tb(tb) def error_handler(err, a): @@ -69,10 +70,10 @@ tx_cb = nl.nl_cb_alloc(nl.NL_CB_DEFAULT) rx_cb = nl.nl_cb_clone(tx_cb) s = nl.nl_socket_alloc_cb(tx_cb) - nl.py_nl_cb_err(rx_cb, nl.NL_CB_CUSTOM, error_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_FINISH, nl.NL_CB_CUSTOM, finish_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_ACK, nl.NL_CB_CUSTOM, ack_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_VALID, nl.NL_CB_CUSTOM, msg_handler, cbd); + nl.py_nl_cb_err(rx_cb, nl.NL_CB_CUSTOM, error_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_FINISH, nl.NL_CB_CUSTOM, finish_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_ACK, nl.NL_CB_CUSTOM, ack_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_VALID, nl.NL_CB_CUSTOM, msg_handler, cbd) genl.genl_connect(s) family = genl.genl_ctrl_resolve(s, 'nl80211') @@ -80,14 +81,14 @@ genl.genlmsg_put(m, 0, 0, family, 0, 0, nl80211.NL80211_CMD_GET_INTERFACE, 0) nl.nla_put_u32(m, nl80211.NL80211_ATTR_IFINDEX, nl.if_nametoindex('wlan0')) - err = nl.nl_send_auto_complete(s, m); + err = nl.nl_send_auto_complete(s, m) if err < 0: - nl.nlmsg_free(msg) + nl.nlmsg_free(m) while cbd.done > 0 and not err < 0: err = nl.nl_recvmsgs(s, rx_cb) except Exception as e: (t, v, tb) = sys.exc_info() - print v.message + print(v.message) traceback.print_tb(tb)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/examples/wiphy.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/examples/wiphy.py
Changed
@@ -1,3 +1,4 @@ +from __future__ import print_function import netlink.capi as nl import netlink.genl.capi as genl import nl80211 @@ -6,23 +7,23 @@ class test_class: def __init__(self): - self.done = 1; + self.done = 1 def freq_to_ch(freq): if freq == 2484: - return 14; + return 14 if freq < 2484: - return (freq - 2407) / 5; + return (freq - 2407) / 5 # FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) if freq < 45000: - return freq/5 - 1000; + return freq/5 - 1000 if freq >= 58320 and freq <= 64800: - return (freq - 56160) / 2160; + return (freq - 56160) / 2160 - return 0; + return 0 def handle_freq(attr, pol): e, fattr = nl.py_nla_parse_nested(nl80211.NL80211_FREQUENCY_ATTR_MAX, attr, pol) @@ -83,7 +84,7 @@ ciphers = nl.nla_data(attrnl80211.NL80211_ATTR_CIPHER_SUITES) num = len(ciphers) / 4 if num > 0: - print("\tSupported Ciphers:"); + print("\tSupported Ciphers:") for i in range(0, num, 4): print("\t\t* %s" % cipher_name(ciphersi:i+4)) if nl80211.NL80211_ATTR_SUPPORTED_IFTYPES in attr: @@ -99,7 +100,7 @@ return nl.NL_SKIP except Exception as e: (t,v,tb) = sys.exc_info() - print v.message + print(v.message) traceback.print_tb(tb) def error_handler(err, a): @@ -118,10 +119,10 @@ tx_cb = nl.nl_cb_alloc(nl.NL_CB_DEFAULT) rx_cb = nl.nl_cb_clone(tx_cb) s = nl.nl_socket_alloc_cb(tx_cb) - nl.py_nl_cb_err(rx_cb, nl.NL_CB_CUSTOM, error_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_FINISH, nl.NL_CB_CUSTOM, finish_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_ACK, nl.NL_CB_CUSTOM, ack_handler, cbd); - nl.py_nl_cb_set(rx_cb, nl.NL_CB_VALID, nl.NL_CB_CUSTOM, msg_handler, cbd); + nl.py_nl_cb_err(rx_cb, nl.NL_CB_CUSTOM, error_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_FINISH, nl.NL_CB_CUSTOM, finish_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_ACK, nl.NL_CB_CUSTOM, ack_handler, cbd) + nl.py_nl_cb_set(rx_cb, nl.NL_CB_VALID, nl.NL_CB_CUSTOM, msg_handler, cbd) genl.genl_connect(s) family = genl.genl_ctrl_resolve(s, 'nl80211') @@ -129,13 +130,13 @@ genl.genlmsg_put(m, 0, 0, family, 0, 0, nl80211.NL80211_CMD_GET_WIPHY, 0) nl.nla_put_u32(m, nl80211.NL80211_ATTR_WIPHY, 7) - err = nl.nl_send_auto_complete(s, m); + err = nl.nl_send_auto_complete(s, m) if err < 0: - nl.nlmsg_free(msg) + nl.nlmsg_free(m) while cbd.done > 0 and not err < 0: err = nl.nl_recvmsgs(s, rx_cb) except Exception as e: (t, v, tb) = sys.exc_info() - print v.message + print(v.message) traceback.print_tb(tb)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/netlink/core.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/netlink/core.py
Changed
@@ -127,7 +127,7 @@ capi.nlmsg_free(self._msg) def __len__(self): - return capi.nlmsg_len(nlmsg_hdr(self._msg)) + return capi.nlmsg_len(capi.nlmsg_hdr(self._msg)) @property def protocol(self):
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/netlink/route/link.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/netlink/route/link.py
Changed
@@ -40,7 +40,6 @@ __all__ = 'LinkCache', 'Link', - 'get_from_kernel', import socket @@ -159,7 +158,7 @@ if exc_type is None: self.change() else: - return false + return False @classmethod def from_capi(cls, obj):
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/netlink/route/links/inet.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/netlink/route/links/inet.py
Changed
@@ -8,9 +8,7 @@ from __future__ import absolute_import -__all__ = - '', - +__all__ = from ... import core as netlink from .. import capi as capi
View file
_service:tar_scm:libnl-3.5.0.tar.gz/python/tests/test-create-bridge.py -> _service:tar_scm:libnl-3.7.0.tar.gz/python/tests/test-create-bridge.py
Changed
@@ -1,3 +1,4 @@ +from __future__ import print_function import netlink.core as netlink import netlink.route.capi as capi import netlink.route.link as link @@ -8,21 +9,21 @@ cache.refill(sock) testtap1 = cache'testtap1' -print testtap1 +print(testtap1) lbr = link.Link() lbr.type = 'bridge' lbr.name = 'testbridge' -print lbr +print(lbr) lbr.add() cache.refill(sock) lbr = cache'testbridge' -print lbr +print(lbr) lbr.enslave(testtap1) cache.refill(sock) testtap1 = cache'testtap1' -print capi.rtnl_link_is_bridge(lbr._rtnl_link) -print capi.rtnl_link_get_master(testtap1._rtnl_link) +print(capi.rtnl_link_is_bridge(lbr._rtnl_link)) +print(capi.rtnl_link_get_master(testtap1._rtnl_link))
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/genl-ctrl-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/genl-ctrl-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/genl-ctrl-list.c List Generic Netlink Families - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/idiag-socket-details.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/idiag-socket-details.c
Changed
@@ -1,11 +1,5 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * src/idiag-socket-details.c List socket details - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2 of the License. - * * Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/addr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/addr.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/addr.c Address Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/class.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/class.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/class.c CLI Class Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/cls.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/cls.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/cls.c CLI Classifier Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/ct.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/ct.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/ct.c CLI Conntrack Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/exp.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/exp.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/exp.c CLI Expectation Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2012 Rich Fought <rich.fought@watchguard.com> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/link.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/link.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/link.c CLI Link Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/neigh.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/neigh.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/neigh.c CLI Neighbour Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/qdisc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/qdisc.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/qdisc.c CLI QDisc Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/route.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/route.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/route.c CLI Route Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/rule.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/rule.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/rule.c CLI Routing Rule Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/tc.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/tc.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/lib/tc.c CLI Traffic Control Helpers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/lib/utils.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/lib/utils.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/utils.c Utilities - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */ @@ -236,10 +229,13 @@ { void *handle; - if (!(handle = dlopen(path, RTLD_NOW))) { + handle = dlopen(path, RTLD_NOW); + if (!handle) { nl_cli_fatal(ENOENT, "Unable to load module \"%s\": %s\n", path, dlerror()); } + /* We intentionally leak the dlopen handle. */ + /* coverityRESOURCE_LEAK */ } #else nl_cli_fatal(ENOTSUP, "Unable to load module \"%s\": built without dynamic libraries support\n",
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-ct-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-ct-add.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-ct-add.c Add Conntrack Entry - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-ct-events.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-ct-events.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-ct-events.c Listen on Conntrack Events - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2018 Avast software */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-ct-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-ct-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-ct-list.c List Conntrack Entries - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-exp-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-exp-add.c
Changed
@@ -1,17 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-exp-add.c Create an expectation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation * Copyright (c) 2012 Rich Fought <rich.fought@watchguard.com> - * */ #include <netlink/cli/utils.h>
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-exp-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-exp-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-exp-delete.c Delete an expectation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-exp-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-exp-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-exp-list.c List Expectation Entries - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-log.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-log.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-log.c Monitor netfilter log events - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-monitor.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-monitor.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-monitor.c Monitor netfilter events - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> * Copyright (c) 2007 Philip Craig <philipc@snapgear.com> * Copyright (c) 2007 Secure Computing Corporation
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nf-queue.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nf-queue.c
Changed
@@ -1,17 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nf-queue.c Monitor netfilter queue events - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> * Copyright (c) 2010 Karl Hiramoto <karl@hiramoto.org> */ - #include <netlink/cli/utils.h> #include <netlink/cli/link.h> #include <netinet/in.h>
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-addr-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-addr-add.c
Changed
@@ -1,11 +1,5 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * src/nl-addr-add.c Add addresses - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2 of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-addr-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-addr-delete.c
Changed
@@ -1,11 +1,5 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * src/nl-addr-delete.c Delete addresses - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2 of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-addr-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-addr-list.c
Changed
@@ -1,11 +1,5 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * src/nl-addr-list.c List addresses - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2 of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-class-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-class-add.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-class-add.c Add/Update/Replace Traffic Class - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-class-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-class-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-class-delete.c Delete Traffic Classes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-class-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-class-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-class-list.c List Traffic Classes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-classid-lookup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-classid-lookup.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-classid-lookup.c Lookup classid - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-cls-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-cls-add.c
Changed
@@ -1,11 +1,5 @@ -/* SPDX-License-Identifier: LGPL-2.1-only */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* - * src/nl-cls-add.c Add classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2 of the License. - * * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-cls-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-cls-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-cls-delete.c Delete Classifier - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-cls-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-cls-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-cls-list.c List classifiers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-fib-lookup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-fib-lookup.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-fib-lookup.c FIB Route Lookup - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-enslave.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-enslave.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-enslave.c Enslave a link - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-ifindex2name.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-ifindex2name.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-ifindex2name.c Transform a interface index to its name - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-dump.c Dump link attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-name2ifindex.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-name2ifindex.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-name2ifindex.c Transform a interface name to its index - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-release.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-release.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-release.c release a link - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-set.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-set.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-set.c Set link attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-link-stats.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-link-stats.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-link-stats.c Retrieve link statistics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-list-caches.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-list-caches.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * nl-list-caches.c List registered cache types - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-list-sockets.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-list-sockets.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * nl-list-sockets.c Pretty-print /proc/net/netlink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-monitor.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-monitor.c
Changed
@@ -1,17 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-monitor.c Monitor events - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <netlink/cli/mdb.h> #include <linux/rtnetlink.h> @@ -36,6 +30,7 @@ { RTNLGRP_IPV4_NETCONF, "ipv4-netconf" }, { RTNLGRP_IPV6_NETCONF, "ipv6-netconf" }, { RTNLGRP_MPLS_NETCONF, "mpls-netconf" }, + { RTNLGRP_MDB, "mdb" }, { RTNLGRP_NONE, NULL } }; @@ -61,6 +56,7 @@ "Usage: nl-monitor OPTION <groups>\n" "\n" "Options\n" + " -d, --debug=LEVEL Set libnl debug level { 0 - 7 }\n" " -f, --format=TYPE Output format { brief | details | stats }\n" " -h, --help Show this help.\n" "\n" @@ -91,15 +87,20 @@ for (;;) { int c, optidx = 0; static struct option long_opts = { + { "debug", 1, 0, 'd' }, { "format", 1, 0, 'f' }, + { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "f:h", long_opts, &optidx); + c = getopt_long(argc, argv, "d:f:h", long_opts, &optidx); if (c == -1) break; switch (c) { + case 'd': + nl_debug = atoi(optarg); + break; case 'f': dp.dp_type = nl_cli_parse_dumptype(optarg); break;
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-neigh-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-neigh-add.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/ nl-neigh-add.c Add a neighbour - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-neigh-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-neigh-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-neigh-delete.c Delete a neighbour - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-neigh-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-neigh-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-neigh-list.c List Neighbours - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-neightbl-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-neightbl-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-neightbl-list.c Dump neighbour tables - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-pktloc-lookup.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-pktloc-lookup.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-pktloc-lookup.c Lookup packet location alias - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */ @@ -14,6 +7,8 @@ #include <netlink/route/pktloc.h> #include <linux/tc_ematch/tc_em_cmp.h> +#include "netlink-private/utils.h" + static void print_usage(void) { printf( @@ -52,8 +47,19 @@ TCF_LAYER_TRANSPORT = "tcp" }; +static const char *get_align_txt(struct rtnl_pktloc *loc, char bufstatic 16) +{ + if (loc->align < _NL_N_ELEMENTS(align_txt)) + return align_txtloc->align; + + snprintf(buf, 16, "%u", loc->align); + return buf; +} + static void dump_u32_style(struct rtnl_pktloc *loc, uint32_t value) { + char buf16; + if (loc->align > 4) nl_cli_fatal(EINVAL, "u32 only supports alignments u8|u16|u32."); @@ -64,37 +70,35 @@ if (loc->shift > 0) nl_cli_fatal(EINVAL, "u32 does not support shifting."); - printf("%s %x %x at %s%u\n", - align_txtloc->align, - value, loc->mask ? loc->mask : align_maskloc->align, - loc->layer == TCF_LAYER_TRANSPORT ? "nexthdr+" : "", - loc->offset); -} - -static char *get_align_txt(struct rtnl_pktloc *loc) -{ - static char buf16; - - if (loc->align <= 4) - strcpy(buf, align_txtloc->align); - else - snprintf(buf, sizeof(buf), "%u", loc->align); - - return buf; + printf("%s %x %x at %s%u\n", get_align_txt(loc, buf), value, + loc->mask ? loc->mask : + (loc->align < _NL_N_ELEMENTS(align_mask) ? + align_maskloc->align : + 0), + loc->layer == TCF_LAYER_TRANSPORT ? "nexthdr+" : "", + loc->offset); } static void dump_loc(struct rtnl_pktloc *loc) { - printf("%s = %s at %s+%u & %#x >> %u\n", - loc->name, get_align_txt(loc), layer_txtloc->layer, - loc->offset, loc->mask, loc->shift); + char buf16; + + printf("%s = %s at %s+%u & %#x >> %u\n", loc->name, + get_align_txt(loc, buf), + loc->layer < _NL_N_ELEMENTS(layer_txt) ? layer_txtloc->layer : + "???", + loc->offset, loc->mask, loc->shift); } static void list_cb(struct rtnl_pktloc *loc, void *arg) { - printf("%-26s %-5s %3s+%-4u %#-10x %-8u %u\n", - loc->name, get_align_txt(loc), layer_txtloc->layer, - loc->offset, loc->mask, loc->shift, loc->refcnt); + char buf16; + + printf("%-26s %-5s %3s+%-4u %#-10x %-8u %u\n", loc->name, + get_align_txt(loc, buf), + loc->layer < _NL_N_ELEMENTS(layer_txt) ? layer_txtloc->layer : + "???", + loc->offset, loc->mask, loc->shift, loc->refcnt); } static void do_list(void)
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-qdisc-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-qdisc-add.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-qdisc-add.c Add Queueing Discipline - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-qdisc-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-qdisc-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-qdisc-delete.c Delete Queuing Disciplines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-qdisc-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-qdisc-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-qdisc-list.c List Queueing Disciplines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-route-add.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-route-add.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-route-add.c Route addition utility - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-route-delete.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-route-delete.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-route-delete.c Delete Routes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-route-get.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-route-get.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-route-get.c Get Route Attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-route-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-route-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-route-list.c List route attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-rule-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-rule-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-rule-dump.c Dump rule attributes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-tctree-list.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-tctree-list.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-tctree-list.c List Traffic Control Tree - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/src/nl-util-addr.c -> _service:tar_scm:libnl-3.7.0.tar.gz/src/nl-util-addr.c
Changed
@@ -1,12 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-only */ /* - * src/nl-util-addr.c Address Helper - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/check-all.c -> _service:tar_scm:libnl-3.7.0.tar.gz/tests/check-all.c
Changed
@@ -1,17 +1,11 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * tests/check-all.c overall unit test program - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> */ #include <check.h> -#include "util.h" +#include "cksuite-all.h" static Suite *main_suite(void) { @@ -24,16 +18,13 @@ { SRunner *runner; int nfailed; - - runner = srunner_create(main_suite()); - /* Add testsuites below */ + runner = srunner_create(main_suite()); srunner_add_suite(runner, make_nl_addr_suite()); srunner_add_suite(runner, make_nl_attr_suite()); srunner_add_suite(runner, make_nl_ematch_tree_clone_suite()); - - /* Do not add testsuites below this line */ + srunner_add_suite(runner, make_nl_netns_suite()); srunner_run_all(runner, CK_ENV);
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/check-direct.c
Added
@@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#include <check.h> + +#include "linux/snmp.h" +#include "netlink-private/utils.h" +#include "netlink-private/route/utils.h" + +#include "netlink/route/link.h" + +START_TEST(static_checks) +{ + int i, j; + char strbuf100; + + _NL_STATIC_ASSERT(RTNL_LINK_RX_PACKETS == 0); + assert(_nltst_map_stat_id_from_IPSTATS_MIB_v20 == + RTNL_LINK_RX_PACKETS); + for (i = 1; i < __IPSTATS_MIB_MAX; i++) { + assert(_nltst_map_stat_id_from_IPSTATS_MIB_v2i > 0); + assert(_nltst_map_stat_id_from_IPSTATS_MIB_v2i < + __RTNL_LINK_STATS_MAX); + for (j = 1; j < i; j++) + assert(_nltst_map_stat_id_from_IPSTATS_MIB_v2i != + _nltst_map_stat_id_from_IPSTATS_MIB_v2j); + } + + for (i = 0; i <= RTNL_LINK_STATS_MAX + 1; i++) { + const char *s; + + s = rtnl_link_stat2str(i, strbuf, sizeof(strbuf)); + assert(s); + assert(s == strbuf); + assert(strlen(s) < sizeof(strbuf)); + if (strncmp(s, "0x", 2) == 0) { + assert(i == RTNL_LINK_STATS_MAX + 1); + ck_assert_int_eq(strtoll(&s2, NULL, 16), i); + } else + ck_assert_int_le(i, RTNL_LINK_STATS_MAX); + ck_assert_int_eq(i, rtnl_link_str2stat(s)); + } +} +END_TEST + +static Suite *make_suite(void) +{ + Suite *suite = suite_create("Direct"); + TCase *tc = tcase_create("Core"); + + tcase_add_test(tc, static_checks); + suite_add_tcase(suite, tc); + return suite; +} + +int main(int argc, char *argv) +{ + SRunner *runner; + int nfailed; + + runner = srunner_create(suite_create("main")); + + srunner_add_suite(runner, make_suite()); + + srunner_run_all(runner, CK_ENV); + + nfailed = srunner_ntests_failed(runner); + srunner_free(runner); + return nfailed != 0; +}
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/cksuite-all-addr.c
Added
@@ -0,0 +1,227 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> + */ + +#include <check.h> +#include <netlink/addr.h> +#include <netlink/route/addr.h> + +#include "cksuite-all.h" + +START_TEST(addr_alloc) +{ + struct nl_addr *addr; + + addr = nl_addr_alloc(16); + ck_assert_msg(addr, "Allocation should not return NULL"); + + ck_assert_msg(nl_addr_iszero(addr) != 0, + "New empty address should be all zeros"); + + ck_assert_msg(nl_addr_get_family(addr) == AF_UNSPEC, + "New empty address should have family AF_UNSPEC"); + + ck_assert_msg(nl_addr_get_prefixlen(addr) == 0, + "New empty address should have prefix length 0"); + + ck_assert_msg(!nl_addr_shared(addr), + "New empty address should not be shared"); + + ck_assert_msg(nl_addr_get(addr) == addr, + "nl_addr_get() should return pointer to address"); + + ck_assert_msg(nl_addr_shared(addr) != 0, + "Address should be shared after call to nl_addr_get()"); + + nl_addr_put(addr); + + ck_assert_msg( + !nl_addr_shared(addr), + "Address should not be shared after call to nl_addr_put()"); + + ck_assert_msg(nl_addr_fill_sockaddr(addr, NULL, 0) != 0, + "Socket address filling should fail for empty address"); + + nl_addr_put(addr); +} +END_TEST + +START_TEST(addr_binary_addr) +{ + struct nl_addr *addr, *addr2; + char baddr4 = { 0x1, 0x2, 0x3, 0x4 }; + char baddr26 = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 }; + + addr = nl_addr_alloc(4); + ck_assert_msg(addr != NULL, "Allocation should not return NULL"); + + ck_assert_msg(nl_addr_set_binary_addr(addr, baddr, 4) >= 0, + "Valid binary address should be settable"); + + ck_assert_msg( + nl_addr_get_prefixlen(addr) == 0, + "Prefix length should be unchanged after nl_addr_set_binary_addr()"); + + ck_assert_msg(nl_addr_get_len(addr) == 4, "Address length should be 4"); + + ck_assert_msg( + nl_addr_set_binary_addr(addr, baddr2, 6) != 0, + "Should not be able to set binary address exceeding maximum length"); + + ck_assert_msg(nl_addr_get_len(addr) == 4, + "Address length should still be 4"); + + ck_assert_msg( + nl_addr_guess_family(addr) == AF_INET, + "Binary address of length 4 should be guessed as AF_INET"); + + ck_assert_msg(memcmp(baddr, nl_addr_get_binary_addr(addr), 4) == 0, + "Binary address mismatches"); + + addr2 = nl_addr_build(AF_UNSPEC, baddr, 4); + ck_assert_msg(addr2 != NULL, "Building of address should not fail"); + + nl_addr_set_prefixlen(addr, 32); + ck_assert_msg( + nl_addr_get_prefixlen(addr) == 32, + "Prefix length should be successful changed after nl_addr_set_prefixlen()"); + + ck_assert_msg(!nl_addr_cmp(addr, addr2), + "Addresses built from same binary address should match"); + + nl_addr_put(addr); + nl_addr_put(addr2); +} +END_TEST + +START_TEST(addr_parse4) +{ + struct nl_addr *addr4, *clone; + struct sockaddr_in sin; + socklen_t len = sizeof(sin); + char *addr_str = "10.0.0.1/16"; + char buf128; + + ck_assert_msg(nl_addr_parse(addr_str, AF_INET6, &addr4) != 0, + "Should not be able to parse IPv4 address in IPv6 mode"); + + ck_assert_msg(nl_addr_parse(addr_str, AF_UNSPEC, &addr4) == 0, + "Should be able to parse \"%s\"", addr_str); + + ck_assert_msg(nl_addr_get_family(addr4) == AF_INET, + "Address family should be AF_INET"); + + ck_assert_msg(nl_addr_get_prefixlen(addr4) == 16, + "Prefix length should be 16"); + + ck_assert_msg(!nl_addr_iszero(addr4), + "Address should not be all zeroes"); + + clone = nl_addr_clone(addr4); + ck_assert_msg(clone != NULL, "Cloned address should not be NULL"); + + ck_assert_msg(nl_addr_cmp(addr4, clone) == 0, + "Cloned address should not mismatch original"); + + ck_assert_msg(nl_addr_fill_sockaddr(addr4, (struct sockaddr *)&sin, + &len) == 0, + "Should be able to fill socketaddr"); + + ck_assert_msg( + !strcmp(nl_addr2str(addr4, buf, sizeof(buf)), addr_str), + "Address translated back to string does not match original"); + + nl_addr_put(addr4); + nl_addr_put(clone); +} +END_TEST + +START_TEST(addr_parse6) +{ + struct nl_addr *addr6, *clone; + struct sockaddr_in6 sin; + socklen_t len = sizeof(sin); + char *addr_str = "2001:1:2::3/64"; + char buf128; + + ck_assert_msg(nl_addr_parse(addr_str, AF_INET, &addr6) != 0, + "Should not be able to parse IPv6 address in IPv4 mode"); + + ck_assert_msg(nl_addr_parse(addr_str, AF_UNSPEC, &addr6) == 0, + "Should be able to parse \"%s\"", addr_str); + + ck_assert_msg(nl_addr_get_family(addr6) == AF_INET6, + "Address family should be AF_INET6"); + + ck_assert_msg(nl_addr_get_prefixlen(addr6) == 64, + "Prefix length should be 64"); + + ck_assert_msg(!nl_addr_iszero(addr6), + "Address should not be all zeroes"); + + clone = nl_addr_clone(addr6); + ck_assert_msg(clone != NULL, "Cloned address should not be NULL"); + + ck_assert_msg(nl_addr_cmp(addr6, clone) == 0, + "Cloned address should not mismatch original"); + + ck_assert_msg(nl_addr_fill_sockaddr(addr6, (struct sockaddr *)&sin, + &len) == 0, + "Should be able to fill socketaddr"); + + ck_assert_msg( + !strcmp(nl_addr2str(addr6, buf, sizeof(buf)), addr_str), + "Address translated back to string does not match original"); + + nl_addr_put(addr6); + nl_addr_put(clone); +} +END_TEST + +START_TEST(addr_info) +{ + struct nl_addr *addr; + char *addr_str = "127.0.0.1"; + struct addrinfo *result; + + ck_assert_msg(nl_addr_parse(addr_str, AF_UNSPEC, &addr) == 0, + "Parsing of valid address should not fail"); + + ck_assert_msg(nl_addr_info(addr, &result) == 0, + "getaddrinfo() on loopback address should work"); + + freeaddrinfo(result); + nl_addr_put(addr); +} +END_TEST + +START_TEST(addr_flags2str)
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/cksuite-all-attr.c
Added
@@ -0,0 +1,157 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch> + */ + +#include <linux/netlink.h> +#include <linux/if_ether.h> + +#include "cksuite-all.h" +#include "netlink/attr.h" +#include "netlink/msg.h" +#include "netlink/route/cls/u32.h" +#include "netlink-private/route/tc-api.h" +#include "netlink-private/nl-auto.h" + +START_TEST(attr_size) +{ + ck_assert_msg(nla_attr_size(0) == NLA_HDRLEN, + "Length of empty attribute should match header size"); + ck_assert_msg(nla_attr_size(1) == NLA_HDRLEN + 1, + "Length of 1 bytes payload should be NLA_HDRLEN + 1"); + ck_assert_msg(nla_attr_size(2) == NLA_HDRLEN + 2, + "Length of 2 bytes payload should be NLA_HDRLEN + 2"); + ck_assert_msg(nla_attr_size(3) == NLA_HDRLEN + 3, + "Length of 3 bytes payload should be NLA_HDRLEN + 3"); + ck_assert_msg(nla_attr_size(4) == NLA_HDRLEN + 4, + "Length of 4 bytes payload should be NLA_HDRLEN + 4"); + + ck_assert_msg(nla_total_size(1) == NLA_HDRLEN + 4, + "Total size of 1 bytes payload should result in 8 bytes"); + ck_assert_msg(nla_total_size(2) == NLA_HDRLEN + 4, + "Total size of 2 bytes payload should result in 8 bytes"); + ck_assert_msg(nla_total_size(3) == NLA_HDRLEN + 4, + "Total size of 3 bytes payload should result in 8 bytes"); + ck_assert_msg(nla_total_size(4) == NLA_HDRLEN + 4, + "Total size of 4 bytes payload should result in 8 bytes"); + + ck_assert_msg(nla_padlen(1) == 3, + "2 bytes of payload should result in 3 padding bytes"); + ck_assert_msg(nla_padlen(2) == 2, + "2 bytes of payload should result in 2 padding bytes"); + ck_assert_msg(nla_padlen(3) == 1, + "3 bytes of payload should result in 1 padding bytes"); + ck_assert_msg(nla_padlen(4) == 0, + "4 bytes of payload should result in 0 padding bytes"); + ck_assert_msg(nla_padlen(5) == 3, + "5 bytes of payload should result in 3 padding bytes"); +} +END_TEST + +START_TEST(msg_construct) +{ + struct nl_msg *msg; + struct nlmsghdr *nlh; + struct nlattr *a; + int i, rem; + + msg = nlmsg_alloc(); + ck_assert_msg(msg, "Unable to allocate netlink message"); + + for (i = 1; i < 256; i++) { + ck_assert_msg(nla_put_u32(msg, i, i + 1) == 0, + "Unable to add attribute %d", i); + } + + nlh = nlmsg_hdr(msg); + i = 1; + nlmsg_for_each_attr (a, nlh, 0, rem) { + ck_assert_msg(nla_type(a) == i, "Expected attribute %d", i); + i++; + ck_assert_msg(nla_get_u32(a) == i, + "Expected attribute value %d", i); + } + + nlmsg_free(msg); +} +END_TEST + +START_TEST(clone_cls_u32) +{ + _nl_auto_rtnl_link struct rtnl_link *link = NULL; + _nl_auto_rtnl_cls struct rtnl_cls *cls = NULL; + _nl_auto_rtnl_cls struct rtnl_cls *cls2 = NULL; + int r; + const uint32_t direction = 16; + + link = rtnl_link_alloc(); + ck_assert(link); + + rtnl_link_set_ifindex(link, 5); + + cls = rtnl_cls_alloc(); + ck_assert(cls); + + rtnl_tc_set_link(TC_CAST(cls), link); + + r = rtnl_tc_set_kind(TC_CAST(cls), "u32"); + ck_assert(r == 0); + + rtnl_cls_set_prio(cls, 1); + rtnl_cls_set_protocol(cls, ETH_P_IP); + + rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(1, 0)); + + rtnl_u32_set_hashtable(cls, 5); + + rtnl_u32_add_key_uint32(cls, 0x0a000914, 0xffffffff, direction, 0); + + rtnl_u32_set_hashmask(cls, 0xff000000, direction); + + rtnl_u32_add_mark(cls, 55, 66); + + rtnl_u32_set_link(cls, 44); + + cls2 = (struct rtnl_cls *)nl_object_clone((struct nl_object *)cls); + ck_assert(cls2); +} +END_TEST + +/*****************************************************************************/ + +START_TEST(test_nltst_strtok) +{ +#define _assert_strtok(str, ...) \ + do { \ + const char *const _expected = { NULL, ##__VA_ARGS__, NULL }; \ + _nltst_auto_strfreev char **_tokens = NULL; \ + \ + _tokens = _nltst_strtokv(str); \ + _nltst_assert_strv_equal(_tokens, &_expected1); \ + } while (0) + + _assert_strtok(""); + _assert_strtok(" \n"); + _assert_strtok("a", "a"); + _assert_strtok(" a ", "a"); + _assert_strtok(" a\\ b", "a\\ ", "b"); + _assert_strtok(" a\\ b cc\\d", "a\\ ", "b", "cc\\d"); + _assert_strtok(" a\\ b\\ cc\\d", "a\\ ", "b\\ ", "cc\\d"); +} +END_TEST + +/*****************************************************************************/ + +Suite *make_nl_attr_suite(void) +{ + Suite *suite = suite_create("Netlink attributes"); + TCase *tc = tcase_create("Core"); + + tcase_add_test(tc, attr_size); + tcase_add_test(tc, msg_construct); + tcase_add_test(tc, clone_cls_u32); + tcase_add_test(tc, test_nltst_strtok); + suite_add_tcase(suite, tc); + + return suite; +}
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/cksuite-all-ematch-tree-clone.c
Added
@@ -0,0 +1,142 @@ +#include <linux/netlink.h> +#include <stdio.h> +#include <time.h> +#include <check.h> + +#include "netlink-private/types.h" +#include "netlink/route/cls/ematch.h" +#include "cksuite-all.h" +#include "netlink-private/nl-auto.h" + +#define MAX_DEPTH 6 +#define MAX_CHILDREN 5 + +static int current_depth = 0; +static int id = 1; +static long long array_size = 0; + +static long long my_pow(long long x, long long y) +{ + int ret = x; + + if (y == 0) + return 1; + + if (y < 0 || x == 0) + return 0; + + while (--y) { + ret *= x; + } + + return ret; +} + +static long int generate_random(long int max) +{ + srandom(time(NULL) + id); + return (random() % max); +} + +static int build_children(struct nl_list_head *parent) +{ + int i, num = 0; + struct rtnl_ematch *child = NULL; + + if (!parent) + return 0; + + if (++current_depth > MAX_DEPTH) { + --current_depth; + return 0; + } + + num = generate_random(MAX_CHILDREN + 1); + for (i = 0; i < num; ++i) { + child = rtnl_ematch_alloc(); + if (!child) { + printf("Mem alloc error\n"); + exit(1); + } + build_children(&child->e_childs); + child->e_id = id++; + nl_list_add_tail(&child->e_list, parent); + } + + --current_depth; + return 0; +} + +static void build_src_cgroup(struct rtnl_ematch_tree *tree) +{ + build_children(&tree->et_list); +} + +static void dump_ematch_list(struct nl_list_head *head, int *result, int *index) +{ + struct rtnl_ematch *pos = NULL; + + nl_list_for_each_entry (pos, head, e_list) { + if (!nl_list_empty(&pos->e_childs)) + dump_ematch_list(&pos->e_childs, result, index); + result*index = pos->e_id; + (*index)++; + } +} + +static void dump_ematch_tree(struct rtnl_ematch_tree *tree, int *result, + int *index) +{ + if (!tree) + return; + + dump_ematch_list(&tree->et_list, result, index); +} + +static int compare(int *r1, int *r2, int len) +{ + int i = 0; + for (i = 0; i < len; ++i) { + if (r1i != r2i) + return -1; + } + return 0; +} + +START_TEST(ematch_tree_clone) +{ + _nl_auto_rtnl_ematch_tree struct rtnl_ematch_tree *src = NULL; + _nl_auto_rtnl_ematch_tree struct rtnl_ematch_tree *dst = NULL; + _nl_auto_free int *src_result = NULL; + _nl_auto_free int *dst_result = NULL; + int i = 0; + int j = 0; + + array_size = (MAX_DEPTH * my_pow(MAX_CHILDREN, MAX_DEPTH)) / 2; + src_result = calloc(4, array_size); + dst_result = calloc(4, array_size); + + src = rtnl_ematch_tree_alloc(2); + + build_src_cgroup(src); + dump_ematch_tree(src, src_result, &i); + + dst = rtnl_ematch_tree_clone(src); + dump_ematch_tree(dst, dst_result, &j); + + ck_assert(dst); + ck_assert(i == j); + ck_assert(!compare(src_result, dst_result, i)); +} +END_TEST + +Suite *make_nl_ematch_tree_clone_suite(void) +{ + Suite *suite = suite_create("Clone ematch tree"); + TCase *tc = tcase_create("Core"); + + tcase_add_test(tc, ematch_tree_clone); + suite_add_tcase(suite, tc); + + return suite; +}
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/cksuite-all-netns.c
Added
@@ -0,0 +1,319 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ +/* + * Author: Susant Sahani <susant@redhat.com> + * Copyright (c) 2018 Red Hat, Inc. + */ + +#include <stdlib.h> +#include <stdbool.h> +#include <linux/netlink.h> + +#include "netlink-private/utils.h" +#include "netlink/route/link.h" +#include "netlink/route/link/sit.h" +#include <netlink/route/link/bonding.h> +#include <netlink/route/link/bridge.h> +#include <netlink/route/link/ip6tnl.h> +#include <netlink/route/link/ipgre.h> +#include <netlink/route/link/ipip.h> +#include <netlink/route/link/ipvlan.h> +#include <netlink/route/link/ipvti.h> +#include <netlink/route/link/macsec.h> +#include <netlink/route/link/macvlan.h> +#include <netlink/route/link/macvtap.h> +#include <netlink/route/link/veth.h> +#include <netlink/route/link/vlan.h> +#include <netlink/route/link/vrf.h> +#include <netlink/route/link/vxlan.h> + +#include "cksuite-all.h" + +/*****************************************************************************/ + +static void _nltst_delete_link2(const char *ifname) +{ + _nltst_delete_link(NULL, ifname); +} +#define _nltst_auto_delete_link _nl_auto(_nltst_auto_delete_link_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(const char *, _nltst_auto_delete_link_fcn, + _nltst_delete_link2); + +/*****************************************************************************/ + +START_TEST(cache_and_clone) +{ + _nl_auto_nl_socket struct nl_sock *sk = NULL; + _nl_auto_nl_cache struct nl_cache *link_cache = NULL; + _nl_auto_free struct nl_object **links_all = NULL; + static const struct { + const char *ifname; + const char *kind; + bool add; + } links = { + { + .ifname = "xbr0", + .kind = "bridge", + .add = true, + }, + { + .ifname = "xdummy0", + .kind = "dummy", + .add = true, + }, + { + .ifname = "xbond0", + .kind = "bond", + .add = true, + }, + { + .ifname = "lo", + .kind = NULL, + .add = false, + }, + }; + int i; + int r; + + for (i = 0; i < _NL_N_ELEMENTS(links); i++) { + if (linksi.add) + _nltst_add_link(NULL, linksi.ifname, linksi.kind, + NULL); + } + + sk = _nltst_socket(NETLINK_ROUTE); + + r = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache); + ck_assert_int_eq(r, 0); + + r = nl_cache_refill(sk, link_cache); + ck_assert_int_eq(r, 0); + + for (i = 0; i < _NL_N_ELEMENTS(links); i++) { + _nl_auto_rtnl_link struct rtnl_link *link_clone = NULL; + struct rtnl_link *link; + + link = _nltst_cache_get_link(link_cache, linksi.ifname); + ck_assert_ptr_nonnull(link); + + ck_assert_str_eq(rtnl_link_get_name(link), linksi.ifname); + + if (_nl_streq(linksi.ifname, "lo")) + ck_assert_int_eq(rtnl_link_get_ifindex(link), 1); + else + ck_assert_int_gt(rtnl_link_get_ifindex(link), 1); + + link_clone = (struct rtnl_link *)nl_object_clone( + (struct nl_object *)link); + ck_assert(link_clone); + + _nltst_object_identical(link, link_clone); + } + + links_all = _nltst_cache_get_all(link_cache, NULL); + for (i = 0; links_alli; i++) { + struct rtnl_link *link = (struct rtnl_link *)links_alli; + _nl_auto_rtnl_link struct rtnl_link *link_clone = NULL; + + link_clone = (struct rtnl_link *)nl_object_clone( + (struct nl_object *)link); + ck_assert(link_clone); + + _nltst_object_identical(link, link_clone); + } +} +END_TEST + +/*****************************************************************************/ + +START_TEST(test_create_iface) +{ + const int TEST_IDX = _i; + _nl_auto_nl_socket struct nl_sock *sk = _nltst_socket(NETLINK_ROUTE); + _nl_auto_rtnl_link struct rtnl_link *link = NULL; + _nl_auto_rtnl_link struct rtnl_link *link2 = NULL; + _nl_auto_rtnl_link struct rtnl_link *peer = NULL; + _nltst_auto_delete_link const char *IFNAME_DUMMY = NULL; + _nltst_auto_delete_link const char *IFNAME = "ifname"; + int ifindex_dummy; + uint32_t u32; + int r; + + switch (TEST_IDX) { + case 0: + link = _nltst_assert(rtnl_link_bridge_alloc()); + rtnl_link_set_name(link, IFNAME); + break; + case 1: + link = _nltst_assert(rtnl_link_vxlan_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_vxlan_set_id(link, 128)); + break; + case 2: + link = _nltst_assert(rtnl_link_alloc()); + rtnl_link_set_type(link, "ifb"); + rtnl_link_set_name(link, IFNAME); + break; + case 3: + link = _nltst_assert(rtnl_link_ipgre_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_ipgre_set_local( + link, _nltst_inet4("192.168.254.12"))); + _nltst_assert_retcode(rtnl_link_ipgre_set_remote( + link, _nltst_inet4("192.168.254.13"))); + _nltst_assert_retcode(rtnl_link_ipgre_set_ttl(link, 64)); + break; + case 4: + link = _nltst_assert(rtnl_link_ip6_tnl_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_ip6_tnl_set_local( + link, _nltst_inet6p("2607:f0d0:1002:51::4"))); + _nltst_assert_retcode(rtnl_link_ip6_tnl_set_remote( + link, _nltst_inet6p("2607:f0d0:1002:52::5"))); + break; + case 5: + link = _nltst_assert(rtnl_link_ipgretap_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_ipgre_set_local( + link, _nltst_inet4("10.211.55.10"))); + _nltst_assert_retcode(rtnl_link_ipgre_set_remote( + link, _nltst_inet4("10.133.6.33"))); + _nltst_assert_retcode(rtnl_link_ipgre_set_ttl(link, 64)); + break; + case 6: + link = _nltst_assert(rtnl_link_ipvti_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_ipvti_set_local( + link, _nltst_inet4("192.168.254.12"))); + _nltst_assert_retcode(rtnl_link_ipvti_set_remote( + link, _nltst_inet4("192.168.254.13"))); + break; + case 7: + link = _nltst_assert(rtnl_link_sit_alloc()); + rtnl_link_set_name(link, IFNAME); + _nltst_assert_retcode(rtnl_link_sit_set_local( + link, _nltst_inet4("192.168.254.12"))); + _nltst_assert_retcode(rtnl_link_sit_set_remote( + link, _nltst_inet4("192.168.254.13"))); + _nltst_assert_retcode(rtnl_link_sit_set_ttl(link, 64)); + break; + case 8:
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/cksuite-all.h
Added
@@ -0,0 +1,12 @@ +#ifndef __LIBNL3_TESTS_CHECK_ALL_H__ +#define __LIBNL3_TESTS_CHECK_ALL_H__ + +#include <check.h> +#include "nl-test-util.h" + +Suite *make_nl_attr_suite(void); +Suite *make_nl_addr_suite(void); +Suite *make_nl_ematch_tree_clone_suite(void); +Suite *make_nl_netns_suite(void); + +#endif /* __LIBNL3_TESTS_CHECK_ALL_H__ */
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/nl-test-util.c
Added
@@ -0,0 +1,657 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#include "nl-test-util.h" + +#include <fcntl.h> +#include <inttypes.h> +#include <limits.h> +#include <sched.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/mount.h> +#include <unistd.h> + +#include "netlink-private/utils.h" +#include "netlink/netlink.h" +#include "netlink/route/link.h" +#include "netlink/route/route.h" +#include "netlink/socket.h" + +/*****************************************************************************/ + +void _nltst_get_urandom(void *ptr, size_t len) +{ + int fd; + ssize_t nread; + + ck_assert_int_gt(len, 0); + ck_assert_ptr_nonnull(ptr); + + fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC | O_NOCTTY); + _nltst_assert_errno(fd >= 0); + + nread = read(fd, ptr, len); + _nltst_assert_errno(nread == len); + + _nltst_close(fd); +} + +uint32_t _nltst_rand_u32(void) +{ + _nl_thread_local static unsigned short entropy3; + _nl_thread_local static bool has_entropy = false; + + if (!has_entropy) { + unsigned long long seed; + uint64_t seed64; + const char *s; + char *s_end; + + memset(entropy, 0, sizeof(entropy)); + s = getenv("NLTST_SEED_RAND"); + if (!s) + seed = 0; + else if (s0 != '\0') { + errno = 0; + seed = strtoull(s, &s_end, 10); + if (errno != 0 || s_end0 != '\0') { + ck_assert_msg( + 0, + "invalid NLTST_SEED_RAND=\"%s\". Must be an integer to seed the random numbers", + s); + } + } else + _nltst_get_urandom(&seed, sizeof(seed)); + + seed64 = seed; + printf("runs with NLTST_SEED_RAND=%" PRIu64 "\n", seed64); + + entropy0 = (seed64 >> 0) ^ (seed64 >> 48); + entropy1 = (seed64 >> 16) ^ (seed64 >> 0); + entropy2 = (seed64 >> 32) ^ (seed64 >> 16); + has_entropy = true; + } + + _NL_STATIC_ASSERT(sizeof(long) >= sizeof(uint32_t)); + return jrand48(entropy); +} + +/*****************************************************************************/ + +#define _CANARY 539339 + +struct nltst_netns { + int canary; +}; + +/*****************************************************************************/ + +#define _assert_nltst_netns(nsdata) \ + do { \ + const struct nltst_netns *_nsdata = (nsdata); \ + \ + ck_assert_ptr_nonnull(_nsdata); \ + ck_assert_int_eq(_nsdata->canary, _CANARY); \ + } while (0) + +static struct { + struct nltst_netns *nsdata; +} _netns_fixture_global; + +void nltst_netns_fixture_setup(void) +{ + ck_assert(!_netns_fixture_global.nsdata); + + _netns_fixture_global.nsdata = nltst_netns_enter(); + _assert_nltst_netns(_netns_fixture_global.nsdata); +} + +void nltst_netns_fixture_teardown(void) +{ + _assert_nltst_netns(_netns_fixture_global.nsdata); + _nl_clear_pointer(&_netns_fixture_global.nsdata, nltst_netns_leave); +} + +/*****************************************************************************/ + +static void unshare_user(void) +{ + const uid_t uid = geteuid(); + const gid_t gid = getegid(); + FILE *f; + int r; + + /* Become a root in new user NS. */ + r = unshare(CLONE_NEWUSER); + _nltst_assert_errno(r == 0); + + /* Since Linux 3.19 we have to disable setgroups() in order to map users. + * Just proceed if the file is not there. */ + f = fopen("/proc/self/setgroups", "we"); + if (f) { + r = fprintf(f, "deny"); + _nltst_assert_errno(r > 0); + _nltst_fclose(f); + } + + /* Map current UID to root in NS to be created. */ + f = fopen("/proc/self/uid_map", "we"); + if (!f) { + if (errno == EACCES) { + /* Accessing uid_map might fail due to sandboxing. + * We ignore that error and proceed with the test. It will probably + * still work. */ + return; + } + _nltst_assert_errno(f); + } + r = fprintf(f, "0 %d 1", uid); + _nltst_assert_errno(r > 0); + _nltst_fclose(f); + + /* Map current GID to root in NS to be created. */ + f = fopen("/proc/self/gid_map", "we"); + _nltst_assert_errno(f); + r = fprintf(f, "0 %d 1", gid); + _nltst_assert_errno(r > 0); + _nltst_fclose(f); +} + +struct nltst_netns *nltst_netns_enter(void) +{ + struct nltst_netns *nsdata; + int r; + + nsdata = calloc(1, sizeof(struct nltst_netns)); + ck_assert(nsdata); + + nsdata->canary = _CANARY; + + unshare_user(); + + r = unshare(CLONE_NEWNET | CLONE_NEWNS); + _nltst_assert_errno(r == 0); + + /* We need a read-only /sys so that the platform knows there's no udev. */ + mount(NULL, "/sys", "sysfs", MS_SLAVE, NULL); + r = mount("sys", "/sys", "sysfs", MS_RDONLY, NULL); + _nltst_assert_errno(r == 0); + + return nsdata; +} + +void nltst_netns_leave(struct nltst_netns *nsdata) +{ + ck_assert(nsdata); + ck_assert_int_eq(nsdata->canary, _CANARY); + + /* nltst_netns_leave() was supposed to enter the original namespaces again + * and undo enter. + * + * However, I could get it to work (setns() always fails with EPERM) + * and valgrind on current Ubuntu seems not to support setns() call. + * + * So, do nothing. It's not really a problem, because the next test + * either should unshare yet another namespace, or not care about + * such things. */ + + free(nsdata);
View file
_service:tar_scm:libnl-3.7.0.tar.gz/tests/nl-test-util.h
Added
@@ -0,0 +1,400 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ + +#ifndef __NL_TEST_UTIL_H__ +#define __NL_TEST_UTIL_H__ + +#include <errno.h> +#include <sys/stat.h> +#include <check.h> +#include <string.h> +#include <stdbool.h> +#include <arpa/inet.h> + +#include "netlink/object.h" +#include "netlink/cache.h" + +#include "netlink-private/nl-auto.h" +#include "netlink-private/utils.h" + +/*****************************************************************************/ + +static inline void _nltst_strfreev(char **strv) +{ + size_t i; + + if (strv) { + for (i = 0; strvi; i++) + free(strvi); + free(strv); + } +} + +#define _nltst_auto_strfreev _nl_auto(_nltst_auto_strfreev_fcn) +_NL_AUTO_DEFINE_FCN_TYPED0(char **, _nltst_auto_strfreev_fcn, _nltst_strfreev); + +/*****************************************************************************/ + +#ifndef ck_assert_ptr_nonnull +#define ck_assert_ptr_nonnull(ptr) ck_assert(ptr) +#endif + +#ifndef ck_assert_pstr_ne +#define ck_assert_pstr_ne(a, b) \ + do { \ + const char *_a = (a); \ + const char *_b = (b); \ + \ + ck_assert(!(_a == _b || (_a && _b && strcmp(_a, _b) == 0))); \ + } while (0) +#endif + +#ifndef ck_assert_ptr_null +#define ck_assert_ptr_null(ptr) ck_assert(!(ptr)) +#endif + +/*****************************************************************************/ + +void _nltst_get_urandom(void *ptr, size_t len); + +uint32_t _nltst_rand_u32(void); + +static inline uint32_t _nltst_rand_u32_range(uint32_t n) +{ + uint32_t rem; + uint32_t i; + + if (n == 0) + return _nltst_rand_u32(); + if (n == 1) + return 0; + + rem = UINT32_MAX % n; + for (;;) { + i = _nltst_rand_u32(); + if (i < (UINT32_MAX - rem)) + return i % n; + } +} + +static inline bool _nltst_rand_bool(void) +{ + return _nltst_rand_u32() % 2 == 0; +} + +#define _nltst_rand_select(a, ...) \ + ({ \ + const typeof(a) _lst = { (a), ##__VA_ARGS__ }; \ + \ + _lst_nltst_rand_u32_range(_NL_N_ELEMENTS(_lst)); \ + }) + +/*****************************************************************************/ + +#define _nltst_assert(expr) \ + ({ \ + typeof(expr) _expr = (expr); \ + \ + if (!_expr) { \ + ck_assert_msg(0, "assert(%s) failed", #expr); \ + } \ + _expr; \ + }) + +#define _nltst_assert_errno(expr) \ + do { \ + if (expr) { \ + } else { \ + const int _errno = (errno); \ + \ + ck_assert_msg(0, "assert(%s) failed (errno=%d, %s)", \ + #expr, _errno, strerror(_errno)); \ + } \ + } while (0) + +#define _nltst_assert_retcode(expr) \ + do { \ + const int _r = (expr); \ + \ + if (_r < 0) { \ + ck_assert_msg( \ + 0, "command(%s) failed with return code %d", \ + #expr, _r); \ + } \ + if (_r > 0) { \ + ck_assert_msg( \ + 0, \ + "command(%s) has unexpected positive return code %d", \ + #expr, _r); \ + } \ + } while (0) + +#define _nltst_close(fd) \ + do { \ + int _r; \ + \ + _r = _nl_close((fd)); \ + _nltst_assert_errno(_r == 0); \ + } while (0) + +#define _nltst_fclose(f) \ + do { \ + int _r; \ + \ + _r = fclose((f)); \ + _nltst_assert_errno(_r == 0); \ + } while (0) + +void _nltst_assert_link_exists_full(const char *ifname, bool exists); + +#define _nltst_assert_link_exists(ifname) \ + _nltst_assert_link_exists_full((ifname), true) + +#define _nltst_assert_link_not_exists(ifname) \ + _nltst_assert_link_exists_full((ifname), false) + +/*****************************************************************************/ + +typedef union { + in_addr_t addr4; + struct in_addr a4; + struct in6_addr a6; +} NLTstIPAddr; + +static inline char *_nltst_inet_ntop(int addr_family, const void *addr, + char bufstatic INET_ADDRSTRLEN) +{ + char *r; + + ck_assert(addr_family == AF_INET || addr_family == AF_INET6); + ck_assert(addr); + + r = (char *)inet_ntop(addr_family, addr, buf, + (addr_family == AF_INET) ? INET_ADDRSTRLEN : + INET6_ADDRSTRLEN); + ck_assert_ptr_eq(r, buf); + ck_assert_int_lt(strlen(r), (addr_family == AF_INET) ? + INET_ADDRSTRLEN : + INET6_ADDRSTRLEN); + return r; +} + +static inline char *_nltst_inet_ntop_dup(int addr_family, const void *addr) +{ + return (char *)_nltst_inet_ntop(addr_family, addr, + malloc((addr_family == AF_INET) ? + INET_ADDRSTRLEN : + INET6_ADDRSTRLEN)); +} + +static inline bool _nltst_inet_pton(int addr_family, const char *str, + int *out_addr_family, void *out_addr) +{ + NLTstIPAddr a; + int r; + + ck_assert(addr_family == AF_UNSPEC || addr_family == AF_INET || + addr_family == AF_INET6); + + /* when requesting @out_addr, then the addr-family must either be + * pre-determined or requested too. */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/test-complex-HTB-with-hash-filters.c -> _service:tar_scm:libnl-3.7.0.tar.gz/tests/test-complex-HTB-with-hash-filters.c
Changed
@@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * test/test-complex-HTB-with-hash-filters.c Add HTB qdisc, HTB classes and creates some hash filters - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2011 Adrian Ban <adrian.ban@mantech.ro> */
View file
_service:tar_scm:libnl-3.5.0.tar.gz/tests/test-u32-filter-with-actions.c -> _service:tar_scm:libnl-3.7.0.tar.gz/tests/test-u32-filter-with-actions.c
Changed
@@ -1,14 +1,8 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * test/tests-u32-with-actions.c Add ingress qdisc, create some hash filters, and add redirect action - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. + * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> * * Stolen from tests/test-complex-HTB-with-hash-filters.c - * - * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com> */ #include <netlink/route/link.h>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2