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@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2018-11-15 14:36:23 -08:00
parent cc5b7e37ac
commit 1d2fac4145
2 changed files with 2 additions and 33 deletions

View File

@ -102,8 +102,6 @@ struct rtnl_dump_filter_arg {
__u16 nc_flags; __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, int rtnl_dump_filter_nc(struct rtnl_handle *rth,
rtnl_filter_t filter, rtnl_filter_t filter,
void *arg, __u16 nc_flags); 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, int rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iovec, size_t iovlen,
struct nlmsghdr **answer) struct nlmsghdr **answer)
__attribute__((warn_unused_result)); __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, int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n,
struct nlmsghdr **answer) struct nlmsghdr **answer)
__attribute__((warn_unused_result)); __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(struct rtattr *tb[], int max, struct rtattr *rta, int len);
int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta, int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
int len, unsigned short flags); 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); 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); int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, int len);

View File

@ -611,8 +611,8 @@ static int rtnl_recvmsg(int fd, struct msghdr *msg, char **answer)
return len; return len;
} }
int rtnl_dump_filter_l(struct rtnl_handle *rth, static int rtnl_dump_filter_l(struct rtnl_handle *rth,
const struct rtnl_dump_filter_arg *arg) const struct rtnl_dump_filter_arg *arg)
{ {
struct sockaddr_nl nladdr; struct sockaddr_nl nladdr;
struct iovec iov; 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); 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, int rtnl_talk_suppress_rtnl_errmsg(struct rtnl_handle *rtnl, struct nlmsghdr *n,
struct nlmsghdr **answer) struct nlmsghdr **answer)
{ {
@ -1242,23 +1235,6 @@ int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
return 0; 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) struct rtattr *parse_rtattr_one(int type, struct rtattr *rta, int len)
{ {
while (RTA_OK(rta, len)) { while (RTA_OK(rta, len)) {