[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181115223640.411-6-stephen@networkplumber.org>
Date: Thu, 15 Nov 2018 14:36:23 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 05/22] libnetlnk: unused and local functions cleanup
rntl_talk_extack and parse_rtattr_index not used in current code.
rtnl_dump_filter_l is only used in this file.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
include/libnetlink.h | 7 -------
lib/libnetlink.c | 28 ++--------------------------
2 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index fa8de093d484..138840d5c892 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -102,8 +102,6 @@ struct rtnl_dump_filter_arg {
__u16 nc_flags;
};
-int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg);
int rtnl_dump_filter_nc(struct rtnl_handle *rth,
rtnl_filter_t filter,
void *arg, __u16 nc_flags);
@@ -115,9 +113,6 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
int rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iovec, size_t iovlen,
struct nlmsghdr **answer)
__attribute__((warn_unused_result));
-int rtnl_talk_extack(struct rtnl_handle *rtnl, struct nlmsghdr *n,
- struct nlmsghdr **answer, nl_ext_ack_fn_t errfn)
- __attribute__((warn_unused_result));
int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n,
struct nlmsghdr **answer)
__attribute__((warn_unused_result));
@@ -152,8 +147,6 @@ int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
int len, unsigned short flags);
-int parse_rtattr_byindex(struct rtattr *tb[], int max,
- struct rtattr *rta, int len);
struct rtattr *parse_rtattr_one(int type, struct rtattr *rta, int len);
int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, int len);
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index fe4a7a4b9c71..c0b80ed6fdfb 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -611,8 +611,8 @@ static int rtnl_recvmsg(int fd, struct msghdr *msg, char **answer)
return len;
}
-int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg)
+static int rtnl_dump_filter_l(struct rtnl_handle *rth,
+ const struct rtnl_dump_filter_arg *arg)
{
struct sockaddr_nl nladdr;
struct iovec iov;
@@ -877,13 +877,6 @@ int rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iovec, size_t iovlen,
return __rtnl_talk_iov(rtnl, iovec, iovlen, answer, true, NULL);
}
-int rtnl_talk_extack(struct rtnl_handle *rtnl, struct nlmsghdr *n,
- struct nlmsghdr **answer,
- nl_ext_ack_fn_t errfn)
-{
- return __rtnl_talk(rtnl, n, answer, true, errfn);
-}
-
int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n,
struct nlmsghdr **answer)
{
@@ -1242,23 +1235,6 @@ int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
return 0;
}
-int parse_rtattr_byindex(struct rtattr *tb[], int max,
- struct rtattr *rta, int len)
-{
- int i = 0;
-
- memset(tb, 0, sizeof(struct rtattr *) * max);
- while (RTA_OK(rta, len)) {
- if (rta->rta_type <= max && i < max)
- tb[i++] = rta;
- rta = RTA_NEXT(rta, len);
- }
- if (len)
- fprintf(stderr, "!!!Deficit %d, rta_len=%d\n",
- len, rta->rta_len);
- return i;
-}
-
struct rtattr *parse_rtattr_one(int type, struct rtattr *rta, int len)
{
while (RTA_OK(rta, len)) {
--
2.17.1
Powered by blists - more mailing lists