summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-10-19 13:42:36 -0700
committerDavid Ahern <dsahern@gmail.com>2018-10-22 09:43:48 -0700
commitcd554f2c2f67a56248333f221efe3d841a0173ec (patch)
treed0a4cf5213078123b686bf5f7b4eb64c21436a49
parent9d16a1de1faa19278fe90838a9d4f62641ac5959 (diff)
Tree wide: Drop sockaddr_nl arg
No function, filter, or print function uses the sockaddr_nl arg, so just drop it. Signed-off-by: David Ahern <dsahern@gmail.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--bridge/br_common.h9
-rw-r--r--bridge/fdb.c2
-rw-r--r--bridge/link.c3
-rw-r--r--bridge/mdb.c2
-rw-r--r--bridge/monitor.c9
-rw-r--r--bridge/vlan.c12
-rw-r--r--genl/ctrl.c10
-rw-r--r--genl/genl.c3
-rw-r--r--genl/genl_utils.h3
-rw-r--r--include/libnetlink.h6
-rw-r--r--include/ll_map.h3
-rw-r--r--ip/ip_common.h36
-rw-r--r--ip/ipaddress.c26
-rw-r--r--ip/ipaddrlabel.c4
-rw-r--r--ip/ipfou.c3
-rw-r--r--ip/ipila.c3
-rw-r--r--ip/ipl2tp.c6
-rw-r--r--ip/iplink.c9
-rw-r--r--ip/iplink_bridge.c3
-rw-r--r--ip/ipmacsec.c3
-rw-r--r--ip/ipmonitor.c25
-rw-r--r--ip/ipmroute.c2
-rw-r--r--ip/ipneigh.c2
-rw-r--r--ip/ipnetconf.c8
-rw-r--r--ip/ipnetns.c5
-rw-r--r--ip/ipntable.c3
-rw-r--r--ip/ipprefix.c2
-rw-r--r--ip/iproute.c17
-rw-r--r--ip/iprule.c11
-rw-r--r--ip/ipseg6.c5
-rw-r--r--ip/iptoken.c2
-rw-r--r--ip/iptuntap.c3
-rw-r--r--ip/rtmon.c7
-rw-r--r--ip/tcp_metrics.c5
-rw-r--r--ip/tunnel.c3
-rw-r--r--ip/xfrm.h6
-rw-r--r--ip/xfrm_monitor.c37
-rw-r--r--ip/xfrm_policy.c9
-rw-r--r--ip/xfrm_state.c11
-rw-r--r--lib/libnetlink.c7
-rw-r--r--lib/ll_map.c3
-rw-r--r--misc/ifstat.c6
-rw-r--r--misc/ss.c31
-rw-r--r--tc/m_action.c6
-rw-r--r--tc/tc_class.c3
-rw-r--r--tc/tc_common.h8
-rw-r--r--tc/tc_filter.c4
-rw-r--r--tc/tc_monitor.c11
-rw-r--r--tc/tc_qdisc.c6
49 files changed, 155 insertions, 248 deletions
diff --git a/bridge/br_common.h b/bridge/br_common.h
index 00a4e9ea..23d653df 100644
--- a/bridge/br_common.h
+++ b/bridge/br_common.h
@@ -7,12 +7,9 @@
((struct rtattr *)(((char *)(r)) + RTA_ALIGN(sizeof(__u32))))
void print_vlan_info(struct rtattr *tb, int ifindex);
-int print_linkinfo(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_fdb(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_mdb(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+int print_linkinfo(struct nlmsghdr *n, void *arg);
+int print_fdb(struct nlmsghdr *n, void *arg);
+int print_mdb(struct nlmsghdr *n, void *arg);
int do_fdb(int argc, char **argv);
int do_mdb(int argc, char **argv);
diff --git a/bridge/fdb.c b/bridge/fdb.c
index 97b08489..f82938f8 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -126,7 +126,7 @@ static void fdb_print_stats(FILE *fp, const struct nda_cacheinfo *ci)
}
}
-int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_fdb(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct ndmsg *r = NLMSG_DATA(n);
diff --git a/bridge/link.c b/bridge/link.c
index 4a14845d..3290c16f 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -190,8 +190,7 @@ static void print_af_spec(struct rtattr *attr, int ifindex)
print_vlan_info(aftb[IFLA_BRIDGE_VLAN_INFO], ifindex);
}
-int print_linkinfo(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int print_linkinfo(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct ifinfomsg *ifi = NLMSG_DATA(n);
diff --git a/bridge/mdb.c b/bridge/mdb.c
index 03fcc91f..855a6a45 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -225,7 +225,7 @@ static void print_router_entries(FILE *fp, struct nlmsghdr *n,
close_json_array(PRINT_JSON, NULL);
}
-int print_mdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_mdb(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct br_port_msg *r = NLMSG_DATA(n);
diff --git a/bridge/monitor.c b/bridge/monitor.c
index d294269e..82bc6b40 100644
--- a/bridge/monitor.c
+++ b/bridge/monitor.c
@@ -35,8 +35,7 @@ static void usage(void)
exit(-1);
}
-static int accept_msg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int accept_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
@@ -50,19 +49,19 @@ static int accept_msg(const struct sockaddr_nl *who,
if (prefix_banner)
fprintf(fp, "[LINK]");
- return print_linkinfo(who, n, arg);
+ return print_linkinfo(n, arg);
case RTM_NEWNEIGH:
case RTM_DELNEIGH:
if (prefix_banner)
fprintf(fp, "[NEIGH]");
- return print_fdb(who, n, arg);
+ return print_fdb(n, arg);
case RTM_NEWMDB:
case RTM_DELMDB:
if (prefix_banner)
fprintf(fp, "[MDB]");
- return print_mdb(who, n, arg);
+ return print_mdb(n, arg);
case NLMSG_TSTAMP:
print_nlmsg_timestamp(fp, n);
diff --git a/bridge/vlan.c b/bridge/vlan.c
index 239907bd..a111d5e6 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -347,9 +347,7 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex)
close_vlan_port();
}
-static int print_vlan_tunnel(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int print_vlan_tunnel(struct nlmsghdr *n, void *arg)
{
struct ifinfomsg *ifm = NLMSG_DATA(n);
struct rtattr *tb[IFLA_MAX+1];
@@ -392,9 +390,7 @@ static int print_vlan_tunnel(const struct sockaddr_nl *who,
return 0;
}
-static int print_vlan(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int print_vlan(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct ifinfomsg *ifm = NLMSG_DATA(n);
@@ -513,9 +509,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)
}
-static int print_vlan_stats(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int print_vlan_stats(struct nlmsghdr *n, void *arg)
{
struct if_stats_msg *ifsm = NLMSG_DATA(n);
struct rtattr *tb[IFLA_STATS_MAX+1];
diff --git a/genl/ctrl.c b/genl/ctrl.c
index 0d9c5f25..6133336a 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -174,8 +174,7 @@ static int print_ctrl_grp(FILE *fp, struct rtattr *arg, __u32 ctrl_ver)
/*
* The controller sends one nlmsg per family
*/
-static int print_ctrl(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int print_ctrl(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct rtattr *tb[CTRL_ATTR_MAX + 1];
@@ -279,10 +278,9 @@ static int print_ctrl(const struct sockaddr_nl *who,
return 0;
}
-static int print_ctrl2(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_ctrl2(struct nlmsghdr *n, void *arg)
{
- return print_ctrl(who, NULL, n, arg);
+ return print_ctrl(NULL, n, arg);
}
static int ctrl_list(int cmd, int argc, char **argv)
@@ -339,7 +337,7 @@ static int ctrl_list(int cmd, int argc, char **argv)
goto ctrl_done;
}
- if (print_ctrl2(NULL, answer, (void *) stdout) < 0) {
+ if (print_ctrl2(answer, (void *) stdout) < 0) {
fprintf(stderr, "Dump terminated\n");
goto ctrl_done;
}
diff --git a/genl/genl.c b/genl/genl.c
index 253c4450..aba3c13a 100644
--- a/genl/genl.c
+++ b/genl/genl.c
@@ -34,8 +34,7 @@ static void *BODY;
static struct genl_util *genl_list;
-static int print_nofopt(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int print_nofopt(struct nlmsghdr *n, void *arg)
{
fprintf((FILE *) arg, "unknown genl type ..\n");
return 0;
diff --git a/genl/genl_utils.h b/genl/genl_utils.h
index 3de0da34..cc1f3fb7 100644
--- a/genl/genl_utils.h
+++ b/genl/genl_utils.h
@@ -10,8 +10,7 @@ struct genl_util
struct genl_util *next;
char name[16];
int (*parse_genlopt)(struct genl_util *fu, int argc, char **argv);
- int (*print_genlopt)(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+ int (*print_genlopt)(struct nlmsghdr *n, void *arg);
};
int genl_ctrl_resolve_family(const char *family);
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 04264b87..fa8de093 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -88,11 +88,9 @@ struct rtnl_ctrl_data {
int nsid;
};
-typedef int (*rtnl_filter_t)(const struct sockaddr_nl *,
- struct nlmsghdr *n, void *);
+typedef int (*rtnl_filter_t)(struct nlmsghdr *n, void *);
-typedef int (*rtnl_listen_filter_t)(const struct sockaddr_nl *,
- struct rtnl_ctrl_data *,
+typedef int (*rtnl_listen_filter_t)(struct rtnl_ctrl_data *,
struct nlmsghdr *n, void *);
typedef int (*nl_ext_ack_fn_t)(const char *errmsg, uint32_t off,
diff --git a/include/ll_map.h b/include/ll_map.h
index 8546ff92..fb708191 100644
--- a/include/ll_map.h
+++ b/include/ll_map.h
@@ -2,8 +2,7 @@
#ifndef __LL_MAP_H__
#define __LL_MAP_H__ 1
-int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+int ll_remember_index(struct nlmsghdr *n, void *arg);
void ll_init_map(struct rtnl_handle *rth);
unsigned ll_name_to_index(const char *name);
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 200be5e2..c0b094b3 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -27,14 +27,10 @@ struct link_filter {
};
int get_operstate(const char *name);
-int print_linkinfo(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_addrinfo(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_addrlabel(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_neigh(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+int print_linkinfo(struct nlmsghdr *n, void *arg);
+int print_addrinfo(struct nlmsghdr *n, void *arg);
+int print_addrlabel(struct nlmsghdr *n, void *arg);
+int print_neigh(struct nlmsghdr *n, void *arg);
int ipaddr_list_link(int argc, char **argv);
void ipaddr_get_vf_rate(int, int *, int *, const char *);
void iplink_usage(void) __attribute__((noreturn));
@@ -45,21 +41,15 @@ void ipaddr_reset_filter(int oneline, int ifindex);
void ipneigh_reset_filter(int ifindex);
void ipnetconf_reset_filter(int ifindex);
-int print_route(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_mroute(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_prefix(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_rule(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-int print_netconf(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+int print_route(struct nlmsghdr *n, void *arg);
+int print_mroute(struct nlmsghdr *n, void *arg);
+int print_prefix(struct nlmsghdr *n, void *arg);
+int print_rule(struct nlmsghdr *n, void *arg);
+int print_netconf(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg);
void netns_map_init(void);
void netns_nsid_socket_init(void);
-int print_nsid(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+int print_nsid(struct nlmsghdr *n, void *arg);
char *get_name_from_nsid(int nsid);
int get_netnsid_from_name(const char *name);
int set_netnsid_from_name(const char *name, int nsid);
@@ -129,8 +119,7 @@ struct link_util {
FILE *);
int (*parse_ifla_xstats)(struct link_util *,
int, char **);
- int (*print_ifla_xstats)(const struct sockaddr_nl *,
- struct nlmsghdr *, void *);
+ int (*print_ifla_xstats)(struct nlmsghdr *, void *);
};
struct link_util *get_link_kind(const char *kind);
@@ -140,8 +129,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type);
/* iplink_bridge.c */
void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len);
int bridge_parse_xstats(struct link_util *lu, int argc, char **argv);
-int bridge_print_xstats(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
+int bridge_print_xstats(struct nlmsghdr *n, void *arg);
/* iproute_lwtunnel.c */
int lwt_parse_encap(struct rtattr *rta, size_t len, int *argcp, char ***argvp);
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index c0c1fbbe..1d67e427 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -824,8 +824,7 @@ static void print_link_event(FILE *f, __u32 event)
}
}
-int print_linkinfo(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int print_linkinfo(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct ifinfomsg *ifi = NLMSG_DATA(n);
@@ -1261,8 +1260,7 @@ static int ifa_label_match_rta(int ifindex, const struct rtattr *rta)
return fnmatch(filter.label, label, 0);
}
-int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+int print_addrinfo(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct ifaddrmsg *ifa = NLMSG_DATA(n);
@@ -1478,7 +1476,7 @@ static int print_selected_addrinfo(struct ifinfomsg *ifi,
continue;
open_json_object(NULL);
- print_addrinfo(NULL, n, fp);
+ print_addrinfo(n, fp);
close_json_object();
}
close_json_array(PRINT_JSON, NULL);
@@ -1491,8 +1489,7 @@ static int print_selected_addrinfo(struct ifinfomsg *ifi,
}
-static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int store_nlmsg(struct nlmsghdr *n, void *arg)
{
struct nlmsg_chain *lchain = (struct nlmsg_chain *)arg;
struct nlmsg_list *h;
@@ -1510,7 +1507,7 @@ static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n,
lchain->head = h;
lchain->tail = h;
- ll_remember_index(who, n, NULL);
+ ll_remember_index(n, NULL);
return 0;
}
@@ -1553,8 +1550,7 @@ static int ipadd_dump_check_magic(void)
return 0;
}
-static int save_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int save_nlmsg(struct nlmsghdr *n, void *arg)
{
int ret;
@@ -1567,15 +1563,14 @@ static int save_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n,
return ret == n->nlmsg_len ? 0 : ret;
}
-static int show_handler(const struct sockaddr_nl *nl,
- struct rtnl_ctrl_data *ctrl,
+static int show_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct ifaddrmsg *ifa = NLMSG_DATA(n);
open_json_object(NULL);
print_int(PRINT_ANY, "index", "if%d:\n", ifa->ifa_index);
- print_addrinfo(NULL, n, stdout);
+ print_addrinfo(n, stdout);
close_json_object();
return 0;
}
@@ -1600,8 +1595,7 @@ static int ipaddr_showdump(void)
exit(err);
}
-static int restore_handler(const struct sockaddr_nl *nl,
- struct rtnl_ctrl_data *ctrl,
+static int restore_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
int ret;
@@ -1970,7 +1964,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
open_json_object(NULL);
if (brief || !no_link)
- res = print_linkinfo(NULL, n, stdout);
+ res = print_linkinfo(n, stdout);
if (res >= 0 && filter.family != AF_PACKET)
print_selected_addrinfo(ifi, ainfo->head, stdout);
if (res > 0 && !do_link && show_stats)
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index fb80ed27..f06ed1e7 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -54,7 +54,7 @@ static void usage(void)
exit(-1);
}
-int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_addrlabel(struct nlmsghdr *n, void *arg)
{
struct ifaddrlblmsg *ifal = NLMSG_DATA(n);
int len = n->nlmsg_len;
@@ -196,7 +196,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
}
-static int flush_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+static int flush_addrlabel(struct nlmsghdr *n, void *arg)
{
struct rtnl_handle rth2;
struct rtmsg *r = NLMSG_DATA(n);
diff --git a/ip/ipfou.c b/ip/ipfou.c
index 0cb5e3c7..346522dd 100644
--- a/ip/ipfou.c
+++ b/ip/ipfou.c
@@ -137,8 +137,7 @@ static int do_del(int argc, char **argv)
return 0;
}
-static int print_fou_mapping(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_fou_mapping(struct nlmsghdr *n, void *arg)
{
struct genlmsghdr *ghdr;
struct rtattr *tb[FOU_ATTR_MAX + 1];
diff --git a/ip/ipila.c b/ip/ipila.c
index 895fe0cd..11fbb5fa 100644
--- a/ip/ipila.c
+++ b/ip/ipila.c
@@ -81,8 +81,7 @@ static void print_ila_locid(const char *tag, int attr, struct rtattr *tb[])
print_string(PRINT_ANY, tag, "%-20s", abuf);
}
-static int print_ila_mapping(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_ila_mapping(struct nlmsghdr *n, void *arg)
{
struct genlmsghdr *ghdr;
struct rtattr *tb[ILA_ATTR_MAX + 1];
diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index 16561ecc..4308b591 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -437,8 +437,7 @@ static int get_response(struct nlmsghdr *n, void *arg)
return 0;
}
-static int session_nlmsg(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int session_nlmsg(struct nlmsghdr *n, void *arg)
{
int ret = get_response(n, arg);
@@ -476,8 +475,7 @@ static int get_session(struct l2tp_data *p)
return 0;
}
-static int tunnel_nlmsg(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int tunnel_nlmsg(struct nlmsghdr *n, void *arg)
{
int ret = get_response(n, arg);
diff --git a/ip/iplink.c b/ip/iplink.c
index 50ccb49a..3fe2e317 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -199,8 +199,7 @@ static int get_addr_gen_mode(const char *mode)
#if IPLINK_IOCTL_COMPAT
static int have_rtnl_newlink = -1;
-static int accept_msg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int accept_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(n);
@@ -1107,7 +1106,7 @@ int iplink_get(unsigned int flags, char *name, __u32 filt_mask)
return -2;
open_json_object(NULL);
- print_linkinfo(NULL, answer, stdout);
+ print_linkinfo(answer, stdout);
close_json_object();
free(answer);
@@ -1536,9 +1535,7 @@ struct af_stats_ctx {
int ifindex;
};
-static int print_af_stats(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int print_af_stats(struct nlmsghdr *n, void *arg)
{
struct if_stats_msg *ifsm = NLMSG_DATA(n);
struct rtattr *tb[IFLA_STATS_MAX+1];
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 3008e44b..0ba6be3f 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -757,8 +757,7 @@ static void bridge_print_stats_attr(FILE *f, struct rtattr *attr, int ifindex)
}
}
-int bridge_print_xstats(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int bridge_print_xstats(struct nlmsghdr *n, void *arg)
{
struct if_stats_msg *ifsm = NLMSG_DATA(n);
struct rtattr *tb[IFLA_STATS_MAX+1];
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
index 007ce540..9b991065 100644
--- a/ip/ipmacsec.c
+++ b/ip/ipmacsec.c
@@ -929,8 +929,7 @@ static void print_rxsc_list(struct rtattr *sc)
close_json_array(PRINT_JSON, NULL);
}
-static int process(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int process(struct nlmsghdr *n, void *arg)
{
struct genlmsghdr *ghdr;
struct rtattr *attrs[MACSEC_ATTR_MAX + 1];
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index a93b62cd..9d5ac2b5 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -52,8 +52,7 @@ static void print_headers(FILE *fp, char *label, struct rtnl_ctrl_data *ctrl)
fprintf(fp, "%s", label);
}
-static int accept_msg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int accept_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
@@ -75,32 +74,32 @@ static int accept_msg(const struct sockaddr_nl *who,
if (r->rtm_family == RTNL_FAMILY_IPMR ||
r->rtm_family == RTNL_FAMILY_IP6MR) {
print_headers(fp, "[MROUTE]", ctrl);
- print_mroute(who, n, arg);
+ print_mroute(n, arg);
return 0;
} else {
print_headers(fp, "[ROUTE]", ctrl);
- print_route(who, n, arg);
+ print_route(n, arg);
return 0;
}
}
case RTM_NEWLINK:
case RTM_DELLINK:
- ll_remember_index(who, n, NULL);
+ ll_remember_index(n, NULL);
print_headers(fp, "[LINK]", ctrl);
- print_linkinfo(who, n, arg);
+ print_linkinfo(n, arg);
return 0;
case RTM_NEWADDR:
case RTM_DELADDR:
print_headers(fp, "[ADDR]", ctrl);
- print_addrinfo(who, n, arg);
+ print_addrinfo(n, arg);
return 0;
case RTM_NEWADDRLABEL:
case RTM_DELADDRLABEL:
print_headers(fp, "[ADDRLABEL]", ctrl);
- print_addrlabel(who, n, arg);
+ print_addrlabel(n, arg);
return 0;
case RTM_NEWNEIGH:
@@ -114,18 +113,18 @@ static int accept_msg(const struct sockaddr_nl *who,
}
print_headers(fp, "[NEIGH]", ctrl);
- print_neigh(who, n, arg);
+ print_neigh(n, arg);
return 0;
case RTM_NEWPREFIX:
print_headers(fp, "[PREFIX]", ctrl);
- print_prefix(who, n, arg);
+ print_prefix(n, arg);
return 0;
case RTM_NEWRULE:
case RTM_DELRULE:
print_headers(fp, "[RULE]", ctrl);
- print_rule(who, n, arg);
+ print_rule(n, arg);
return 0;
case NLMSG_TSTAMP:
@@ -135,13 +134,13 @@ static int accept_msg(const struct sockaddr_nl *who,
case RTM_NEWNETCONF:
case RTM_DELNETCONF:
print_headers(fp, "[NETCONF]", ctrl);
- print_netconf(who, ctrl, n, arg);
+ print_netconf(ctrl, n, arg);
return 0;
case RTM_DELNSID:
case RTM_NEWNSID:
print_headers(fp, "[NSID]", ctrl);
- print_nsid(who, n, arg);
+ print_nsid(n, arg);
return 0;
case NLMSG_ERROR:
diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index c5dfa9cb..4d8867d3 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -52,7 +52,7 @@ struct rtfilter {
inet_prefix msrc;
} filter;
-int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_mroute(struct nlmsghdr *n, void *arg)
{
struct rtmsg *r = NLMSG_DATA(n);
int len = n->nlmsg_len;
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 042d01fd..6041c467 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -237,7 +237,7 @@ static void print_neigh_state(unsigned int nud)
close_json_array(PRINT_JSON, NULL);
}
-int print_neigh(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_neigh(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct ndmsg *r = NLMSG_DATA(n);
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
index 21822e36..0e946ca3 100644
--- a/ip/ipnetconf.c
+++ b/ip/ipnetconf.c
@@ -55,8 +55,7 @@ static struct rtattr *netconf_rta(struct netconfmsg *ncm)
+ NLMSG_ALIGN(sizeof(struct netconfmsg)));
}
-int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
- struct nlmsghdr *n, void *arg)
+int print_netconf(struct rtnl_ctrl_data *ctrl, struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct netconfmsg *ncm = NLMSG_DATA(n);
@@ -154,10 +153,9 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
return 0;
}
-static int print_netconf2(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_netconf2(struct nlmsghdr *n, void *arg)
{
- return print_netconf(who, NULL, n, arg);
+ return print_netconf(NULL, n, arg);
}
void ipnetconf_reset_filter(int ifindex)
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index e8500c77..0eac18cf 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -43,8 +43,7 @@ static struct rtnl_handle rtnsh = { .fd = -1 };
static int have_rtnl_getnsid = -1;
-static int ipnetns_accept_msg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int ipnetns_accept_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(n);
@@ -284,7 +283,7 @@ static int netns_get_name(int nsid, char *name)
return -ENOENT;
}
-int print_nsid(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_nsid(struct nlmsghdr *n, void *arg)
{
struct rtgenmsg *rthdr = NLMSG_DATA(n);
struct rtattr *tb[NETNSA_MAX+1];
diff --git a/ip/ipntable.c b/ip/ipntable.c
index ce3f4614..5b61dd5c 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -520,8 +520,7 @@ static void print_ndtstats(const struct ndt_stats *ndts)
print_nl();
}
-static int print_ntable(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_ntable(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct ndtmsg *ndtm = NLMSG_DATA(n);
diff --git a/ip/ipprefix.c b/ip/ipprefix.c
index 20f23ca7..466af208 100644
--- a/ip/ipprefix.c
+++ b/ip/ipprefix.c
@@ -35,7 +35,7 @@
#define IF_PREFIX_ONLINK 0x01
#define IF_PREFIX_AUTOCONF 0x02
-int print_prefix(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_prefix(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct prefixmsg *prefix = NLMSG_DATA(n);
diff --git a/ip/iproute.c b/ip/iproute.c
index 69963592..1326a657 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -708,7 +708,7 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
}
}
-int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_route(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct rtmsg *r = NLMSG_DATA(n);
@@ -1580,8 +1580,7 @@ static int iproute_flush_cache(void)
static __u32 route_dump_magic = 0x45311224;
-static int save_route(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int save_route(struct nlmsghdr *n, void *arg)
{
int ret;
int len = n->nlmsg_len;
@@ -2082,7 +2081,7 @@ static int iproute_get(int argc, char **argv)
int len = answer->nlmsg_len;
struct rtattr *tb[RTA_MAX+1];
- if (print_route(NULL, answer, (void *)stdout) < 0) {
+ if (print_route(answer, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
free(answer);
return -1;
@@ -2126,7 +2125,7 @@ static int iproute_get(int argc, char **argv)
return -2;
}
- if (print_route(NULL, answer, (void *)stdout) < 0) {
+ if (print_route(answer, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
free(answer);
return -1;
@@ -2144,8 +2143,7 @@ static int rtattr_cmp(const struct rtattr *rta1, const struct rtattr *rta2)
return memcmp(RTA_DATA(rta1), RTA_DATA(rta2), RTA_PAYLOAD(rta1));
}
-static int restore_handler(const struct sockaddr_nl *nl,
- struct rtnl_ctrl_data *ctrl,
+static int restore_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
struct rtmsg *r = NLMSG_DATA(n);
@@ -2231,11 +2229,10 @@ static int iproute_restore(void)
return 0;
}
-static int show_handler(const struct sockaddr_nl *nl,
- struct rtnl_ctrl_data *ctrl,
+static int show_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
- print_route(nl, n, stdout);
+ print_route(n, stdout);
return 0;
}
diff --git a/ip/iprule.c b/ip/iprule.c
index 60fd4c7e..d89d808d 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -181,7 +181,7 @@ static bool filter_nlmsg(struct nlmsghdr *n, struct rtattr **tb, int host_len)
return true;
}
-int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_rule(struct nlmsghdr *n, void *arg)
{
FILE *fp = arg;
struct fib_rule_hdr *frh = NLMSG_DATA(n);
@@ -442,8 +442,7 @@ static int save_rule_prep(void)
return 0;
}
-static int save_rule(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int save_rule(struct nlmsghdr *n, void *arg)
{
int ret;
@@ -456,8 +455,7 @@ static int save_rule(const struct sockaddr_nl *who,
return ret == n->nlmsg_len ? 0 : ret;
}
-static int flush_rule(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int flush_rule(struct nlmsghdr *n, void *arg)
{
struct rtnl_handle rth2;
struct fib_rule_hdr *frh = NLMSG_DATA(n);
@@ -650,8 +648,7 @@ static int rule_dump_check_magic(void)
return 0;
}
-static int restore_handler(const struct sockaddr_nl *nl,
- struct rtnl_ctrl_data *ctrl,
+static int restore_handler(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
int ret;
diff --git a/ip/ipseg6.c b/ip/ipseg6.c
index 6f5ae4d2..33076e72 100644
--- a/ip/ipseg6.c
+++ b/ip/ipseg6.c
@@ -99,8 +99,7 @@ static void print_tunsrc(struct rtattr *attrs[])
"tunsrc addr %s\n", dst);
}
-static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int process_msg(struct nlmsghdr *n, void *arg)
{
struct rtattr *attrs[SEG6_ATTR_MAX + 1];
struct genlmsghdr *ghdr;
@@ -180,7 +179,7 @@ static int seg6_do_cmd(void)
if (rtnl_talk(&grth, &req.n, &answer) < 0)
return -2;
new_json_obj(json);
- if (process_msg(NULL, answer, stdout) < 0) {
+ if (process_msg(answer, stdout) < 0) {
fprintf(stderr, "Error parsing reply\n");
exit(1);
}
diff --git a/ip/iptoken.c b/ip/iptoken.c
index 8605e75c..f1194c3e 100644
--- a/ip/iptoken.c
+++ b/ip/iptoken.c
@@ -42,7 +42,7 @@ static void usage(void)
exit(-1);
}
-static int print_token(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+static int print_token(struct nlmsghdr *n, void *arg)
{
struct rtnl_dump_args *args = arg;
FILE *fp = args->fp;
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index 8c84e620..528055a0 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -386,8 +386,7 @@ static int tuntap_filter_req(struct nlmsghdr *nlh, int reqlen)
return 0;
}
-static int print_tuntap(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_tuntap(struct nlmsghdr *n, void *arg)
{
struct ifinfomsg *ifi = NLMSG_DATA(n);
struct rtattr *tb[IFLA_MAX+1];
diff --git a/ip/rtmon.c b/ip/rtmon.c
index 7d2405d7..7373443f 100644
--- a/ip/rtmon.c
+++ b/ip/rtmon.c
@@ -43,7 +43,7 @@ static void write_stamp(FILE *fp)
fwrite((void *)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
}
-static int dump_msg(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
+static int dump_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
@@ -55,10 +55,9 @@ static int dump_msg(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
return 0;
}
-static int dump_msg2(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int dump_msg2(struct nlmsghdr *n, void *arg)
{
- return dump_msg(who, NULL, n, arg);
+ return dump_msg(NULL, n, arg);
}
static void usage(void)
diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c
index ad3d6f36..72ef3ab5 100644
--- a/ip/tcp_metrics.c
+++ b/ip/tcp_metrics.c
@@ -156,8 +156,7 @@ static void print_tcp_metrics(struct rtattr *a)
}
}
-static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+static int process_msg(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *) arg;
struct genlmsghdr *ghdr;
@@ -501,7 +500,7 @@ static int tcpm_do_cmd(int cmd, int argc, char **argv)
} else if (atype >= 0) {
if (rtnl_talk(&grth, &req.n, &answer) < 0)
return -2;
- if (process_msg(NULL, answer, stdout) < 0) {
+ if (process_msg(answer, stdout) < 0) {
fprintf(stderr, "Dump terminated\n");
exit(1);
}
diff --git a/ip/tunnel.c b/ip/tunnel.c
index 20fe6d7d..d0d55f37 100644
--- a/ip/tunnel.c
+++ b/ip/tunnel.c
@@ -321,8 +321,7 @@ static void tnl_print_stats(const struct rtnl_link_stats64 *s)
s->tx_carrier_errors, s->tx_dropped);
}
-static int print_nlmsg_tunnel(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_nlmsg_tunnel(struct nlmsghdr *n, void *arg)
{
struct tnl_print_nlmsg_info *info = arg;
struct ifinfomsg *ifi = NLMSG_DATA(n);
diff --git a/ip/xfrm.h b/ip/xfrm.h
index 71be574d..3b158ad7 100644
--- a/ip/xfrm.h
+++ b/ip/xfrm.h
@@ -104,10 +104,8 @@ struct xfrm_filter {
extern struct xfrm_filter filter;
-int xfrm_state_print(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg);
-int xfrm_policy_print(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg);
+int xfrm_state_print(struct nlmsghdr *n, void *arg);
+int xfrm_policy_print(struct nlmsghdr *n, void *arg);
int do_xfrm_state(int argc, char **argv);
int do_xfrm_policy(int argc, char **argv);
int do_xfrm_monitor(int argc, char **argv);
diff --git a/ip/xfrm_monitor.c b/ip/xfrm_monitor.c
index 5d086768..eb07af17 100644
--- a/ip/xfrm_monitor.c
+++ b/ip/xfrm_monitor.c
@@ -43,8 +43,7 @@ static void usage(void)
exit(-1);
}
-static int xfrm_acquire_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_acquire_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct xfrm_user_acquire *xacq = NLMSG_DATA(n);
@@ -105,8 +104,7 @@ static int xfrm_acquire_print(const struct sockaddr_nl *who,
return 0;
}
-static int xfrm_state_flush_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_state_flush_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct xfrm_usersa_flush *xsf = NLMSG_DATA(n);
@@ -135,8 +133,7 @@ static int xfrm_state_flush_print(const struct sockaddr_nl *who,
return 0;
}
-static int xfrm_policy_flush_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_policy_flush_print(struct nlmsghdr *n, void *arg)
{
struct rtattr *tb[XFRMA_MAX+1];
FILE *fp = (FILE *)arg;
@@ -173,8 +170,7 @@ static int xfrm_policy_flush_print(const struct sockaddr_nl *who,
return 0;
}
-static int xfrm_report_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_report_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct xfrm_user_report *xrep = NLMSG_DATA(n);
@@ -236,8 +232,7 @@ static void xfrm_usersa_print(const struct xfrm_usersa_id *sa_id, __u32 reqid, F
fprintf(fp, " SPI 0x%x", ntohl(sa_id->spi));
}
-static int xfrm_ae_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_ae_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct xfrm_aevent_id *id = NLMSG_DATA(n);
@@ -261,8 +256,7 @@ static void xfrm_print_addr(FILE *fp, int family, xfrm_address_t *a)
fprintf(fp, "%s", rt_addr_n2a(family, sizeof(*a), a));
}
-static int xfrm_mapping_print(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int xfrm_mapping_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct xfrm_user_mapping *map = NLMSG_DATA(n);
@@ -281,8 +275,7 @@ static int xfrm_mapping_print(const struct sockaddr_nl *who,
return 0;
}
-static int xfrm_accept_msg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int xfrm_accept_msg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
@@ -302,31 +295,31 @@ static int xfrm_accept_msg(const struct sockaddr_nl *who,
case XFRM_MSG_DELSA:
case XFRM_MSG_UPDSA:
case XFRM_MSG_EXPIRE:
- xfrm_state_print(who, n, arg);
+ xfrm_state_print(n, arg);
return 0;
case XFRM_MSG_NEWPOLICY:
case XFRM_MSG_DELPOLICY:
case XFRM_MSG_UPDPOLICY:
case XFRM_MSG_POLEXPIRE:
- xfrm_policy_print(who, n, arg);
+ xfrm_policy_print(n, arg);
return 0;
case XFRM_MSG_ACQUIRE:
- xfrm_acquire_print(who, n, arg);
+ xfrm_acquire_print(n, arg);
return 0;
case XFRM_MSG_FLUSHSA:
- xfrm_state_flush_print(who, n, arg);
+ xfrm_state_flush_print(n, arg);
return 0;
case XFRM_MSG_FLUSHPOLICY:
- xfrm_policy_flush_print(who, n, arg);
+ xfrm_policy_flush_print(n, arg);
return 0;
case XFRM_MSG_REPORT:
- xfrm_report_print(who, n, arg);
+ xfrm_report_print(n, arg);
return 0;
case XFRM_MSG_NEWAE:
- xfrm_ae_print(who, n, arg);
+ xfrm_ae_print(n, arg);
return 0;
case XFRM_MSG_MAPPING:
- xfrm_mapping_print(who, n, arg);
+ xfrm_mapping_print(n, arg);
return 0;
default:
break;
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index d5440269..feccaada 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -453,8 +453,7 @@ static int xfrm_policy_filter_match(struct xfrm_userpolicy_info *xpinfo,
return 1;
}
-int xfrm_policy_print(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+int xfrm_policy_print(struct nlmsghdr *n, void *arg)
{
struct rtattr *tb[XFRMA_MAX+1];
struct rtattr *rta;
@@ -681,7 +680,7 @@ static int xfrm_policy_get(int argc, char **argv)
xfrm_policy_get_or_delete(argc, argv, 0, &n);
- if (xfrm_policy_print(NULL, n, (void *)stdout) < 0) {
+ if (xfrm_policy_print(n, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
exit(1);
}
@@ -694,9 +693,7 @@ static int xfrm_policy_get(int argc, char **argv)
* With an existing policy of nlmsg, make new nlmsg for deleting the policy
* and store it to buffer.
*/
-static int xfrm_policy_keep(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int xfrm_policy_keep(struct nlmsghdr *n, void *arg)
{
struct xfrm_buffer *xb = (struct xfrm_buffer *)arg;
struct rtnl_handle *rth = xb->rth;
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index 913e9fa3..3cfcad1a 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -869,7 +869,7 @@ static int xfrm_state_allocspi(int argc, char **argv)
if (rtnl_talk(&rth, &req.n, &answer) < 0)
exit(2);
- if (xfrm_state_print(NULL, answer, (void *)stdout) < 0) {
+ if (xfrm_state_print(answer, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
exit(1);
}
@@ -908,8 +908,7 @@ static int xfrm_state_filter_match(struct xfrm_usersa_info *xsinfo)
return 1;
}
-int xfrm_state_print(const struct sockaddr_nl *who, struct nlmsghdr *n,
- void *arg)
+int xfrm_state_print(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct rtattr *tb[XFRMA_MAX+1];
@@ -1063,7 +1062,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
if (rtnl_talk(&rth, &req.n, &answer) < 0)
exit(2);
- if (xfrm_state_print(NULL, answer, (void *)stdout) < 0) {
+ if (xfrm_state_print(answer, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
exit(1);
}
@@ -1080,9 +1079,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
* With an existing state of nlmsg, make new nlmsg for deleting the state
* and store it to buffer.
*/
-static int xfrm_state_keep(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+static int xfrm_state_keep(struct nlmsghdr *n, void *arg)
{
struct xfrm_buffer *xb = (struct xfrm_buffer *)arg;
struct rtnl_handle *rth = xb->rth;
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index e8202f79..fe4a7a4b 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -674,7 +674,7 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth,
}
if (!rth->dump_fp) {
- err = a->filter(&nladdr, h, a->arg1);
+ err = a->filter(h, a->arg1);
if (err < 0) {
free(buf);
return err;
@@ -983,7 +983,7 @@ int rtnl_listen(struct rtnl_handle *rtnl,
exit(1);
}
- err = handler(&nladdr, &ctrl, h, jarg);
+ err = handler(&ctrl, h, jarg);
if (err < 0)
return err;
@@ -1005,7 +1005,6 @@ int rtnl_from_file(FILE *rtnl, rtnl_listen_filter_t handler,
void *jarg)
{
int status;
- struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
char buf[16384];
struct nlmsghdr *h = (struct nlmsghdr *)buf;
@@ -1044,7 +1043,7 @@ int rtnl_from_file(FILE *rtnl, rtnl_listen_filter_t handler,
return -1;
}
- err = handler(&nladdr, NULL, h, jarg);
+ err = handler(NULL, h, jarg);
if (err < 0)
return err;
}
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 32c8e442..1b4095a7 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -77,8 +77,7 @@ static struct ll_cache *ll_get_by_name(const char *name)
return NULL;
}
-int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int ll_remember_index(struct nlmsghdr *n, void *arg)
{
unsigned int h;
const char *ifname;
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 3a0e780f..60efe6cb 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -110,8 +110,7 @@ static int match(const char *id)
return 0;
}
-static int get_nlmsg_extended(const struct sockaddr_nl *who,
- struct nlmsghdr *m, void *arg)
+static int get_nlmsg_extended(struct nlmsghdr *m, void *arg)
{
struct if_stats_msg *ifsm = NLMSG_DATA(m);
struct rtattr *tb[IFLA_STATS_MAX+1];
@@ -154,8 +153,7 @@ static int get_nlmsg_extended(const struct sockaddr_nl *who,
return 0;
}
-static int get_nlmsg(const struct sockaddr_nl *who,
- struct nlmsghdr *m, void *arg)
+static int get_nlmsg(struct nlmsghdr *m, void *arg)
{
struct ifinfomsg *ifi = NLMSG_DATA(m);
struct rtattr *tb[IFLA_MAX+1];
diff --git a/misc/ss.c b/misc/ss.c
index f99b6874..c8970438 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3156,8 +3156,7 @@ static int kill_inet_sock(struct nlmsghdr *h, void *arg, struct sockstat *s)
return rtnl_talk(rth, &req.nlh, NULL);
}
-static int show_one_inet_sock(const struct sockaddr_nl *addr,
- struct nlmsghdr *h, void *arg)
+static int show_one_inet_sock(struct nlmsghdr *h, void *arg)
{
int err;
struct inet_diag_arg *diag_arg = arg;
@@ -3548,8 +3547,7 @@ static void unix_stats_print(struct sockstat *s, struct filter *f)
proc_ctx_print(s);
}
-static int unix_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh,
- void *arg)
+static int unix_show_sock(struct nlmsghdr *nlh, void *arg)
{
struct filter *f = (struct filter *)arg;
struct unix_diag_msg *r = NLMSG_DATA(nlh);
@@ -3843,8 +3841,7 @@ static void packet_show_ring(struct packet_diag_ring *ring)
out(",features:0x%x", ring->pdr_features);
}
-static int packet_show_sock(const struct sockaddr_nl *addr,
- struct nlmsghdr *nlh, void *arg)
+static int packet_show_sock(struct nlmsghdr *nlh, void *arg)
{
const struct filter *f = arg;
struct packet_diag_msg *r = NLMSG_DATA(nlh);
@@ -4133,8 +4130,7 @@ static int netlink_show_one(struct filter *f,
return 0;
}
-static int netlink_show_sock(const struct sockaddr_nl *addr,
- struct nlmsghdr *nlh, void *arg)
+static int netlink_show_sock(struct nlmsghdr *nlh, void *arg)
{
struct filter *f = (struct filter *)arg;
struct netlink_diag_msg *r = NLMSG_DATA(nlh);
@@ -4257,8 +4253,7 @@ static void vsock_stats_print(struct sockstat *s, struct filter *f)
proc_ctx_print(s);
}
-static int vsock_show_sock(const struct sockaddr_nl *addr,
- struct nlmsghdr *nlh, void *arg)
+static int vsock_show_sock(struct nlmsghdr *nlh, void *arg)
{
struct filter *f = (struct filter *)arg;
struct vsock_diag_msg *r = NLMSG_DATA(nlh);
@@ -4311,8 +4306,7 @@ static void tipc_sock_addr_print(struct rtattr *net_addr, struct rtattr *id)
}
-static int tipc_show_sock(const struct sockaddr_nl *addr, struct nlmsghdr *nlh,
- void *arg)
+static int tipc_show_sock(struct nlmsghdr *nlh, void *arg)
{
struct rtattr *stat[TIPC_NLA_SOCK_STAT_MAX + 1] = {};
struct rtattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {};
@@ -4400,8 +4394,7 @@ struct sock_diag_msg {
__u8 sdiag_family;
};
-static int generic_show_sock(const struct sockaddr_nl *addr,
- struct nlmsghdr *nlh, void *arg)
+static int generic_show_sock(struct nlmsghdr *nlh, void *arg)
{
struct sock_diag_msg *r = NLMSG_DATA(nlh);
struct inet_diag_arg inet_arg = { .f = arg, .protocol = IPPROTO_MAX };
@@ -4411,19 +4404,19 @@ static int generic_show_sock(const struct sockaddr_nl *addr,
case AF_INET:
case AF_INET6:
inet_arg.rth = inet_arg.f->rth_for_killing;
- ret = show_one_inet_sock(addr, nlh, &inet_arg);
+ ret = show_one_inet_sock(nlh, &inet_arg);
break;
case AF_UNIX:
- ret = unix_show_sock(addr, nlh, arg);
+ ret = unix_show_sock(nlh, arg);
break;
case AF_PACKET:
- ret = packet_show_sock(addr, nlh, arg);
+ ret = packet_show_sock(nlh, arg);
break;
case AF_NETLINK:
- ret = netlink_show_sock(addr, nlh, arg);
+ ret = netlink_show_sock(nlh, arg);
break;
case AF_VSOCK:
- ret = vsock_show_sock(addr, nlh, arg);
+ ret = vsock_show_sock(nlh, arg);
break;
default:
ret = -1;
diff --git a/tc/m_action.c b/tc/m_action.c
index 8993b93a..e90867fc 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -386,9 +386,7 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts)
return 0;
}
-int print_action(const struct sockaddr_nl *who,
- struct nlmsghdr *n,
- void *arg)
+int print_action(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct tcamsg *t = NLMSG_DATA(n);
@@ -541,7 +539,7 @@ static int tc_action_gd(int cmd, unsigned int flags,
if (cmd == RTM_GETACTION) {
new_json_obj(json);
- ret = print_action(NULL, ans, stdout);
+ ret = print_action(ans, stdout);
if (ret < 0) {
fprintf(stderr, "Dump terminated\n");
free(ans);
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 6b4ea480..7e4e17fd 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -296,8 +296,7 @@ static void graph_cls_show(FILE *fp, char *buf, struct hlist_head *root_list,
}
}
-int print_class(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int print_class(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct tcmsg *t = NLMSG_DATA(n);
diff --git a/tc/tc_common.h b/tc/tc_common.h
index 371ca7d0..d8a6dfde 100644
--- a/tc/tc_common.h
+++ b/tc/tc_common.h
@@ -13,10 +13,10 @@ int do_action(int argc, char **argv, void *buf, size_t buflen);
int do_tcmonitor(int argc, char **argv);
int do_exec(int argc, char **argv);
-int print_action(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-int print_filter(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-int print_qdisc(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-int print_class(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
+int print_action(struct nlmsghdr *n, void *arg);
+int print_filter(struct nlmsghdr *n, void *arg);
+int print_qdisc(struct nlmsghdr *n, void *arg);
+int print_class(struct nlmsghdr *n, void *arg);
void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta);
struct tc_estimator;
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index 15044b4b..e5c7bc46 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -258,7 +258,7 @@ static int filter_chain_index_set;
static __u32 filter_block_index;
__u16 f_proto;
-int print_filter(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_filter(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct tcmsg *t = NLMSG_DATA(n);
@@ -592,7 +592,7 @@ static int tc_filter_get(int cmd, unsigned int flags, int argc, char **argv)
}
new_json_obj(json);
- print_filter(NULL, answer, (void *)stdout);
+ print_filter(answer, (void *)stdout);
delete_json_obj();
free(answer);
diff --git a/tc/tc_monitor.c b/tc/tc_monitor.c
index 1f1ee08f..f8816cc5 100644
--- a/tc/tc_monitor.c
+++ b/tc/tc_monitor.c
@@ -34,8 +34,7 @@ static void usage(void)
}
-static int accept_tcmsg(const struct sockaddr_nl *who,
- struct rtnl_ctrl_data *ctrl,
+static int accept_tcmsg(struct rtnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
@@ -47,20 +46,20 @@ static int accept_tcmsg(const struct sockaddr_nl *who,
n->nlmsg_type == RTM_DELTFILTER ||
n->nlmsg_type == RTM_NEWCHAIN ||
n->nlmsg_type == RTM_DELCHAIN) {
- print_filter(who, n, arg);
+ print_filter(n, arg);
return 0;
}
if (n->nlmsg_type == RTM_NEWTCLASS || n->nlmsg_type == RTM_DELTCLASS) {
- print_class(who, n, arg);
+ print_class(n, arg);
return 0;
}
if (n->nlmsg_type == RTM_NEWQDISC || n->nlmsg_type == RTM_DELQDISC) {
- print_qdisc(who, n, arg);
+ print_qdisc(n, arg);
return 0;
}
if (n->nlmsg_type == RTM_GETACTION || n->nlmsg_type == RTM_NEWACTION ||
n->nlmsg_type == RTM_DELACTION) {
- print_action(who, n, arg);
+ print_action(n, arg);
return 0;
}
if (n->nlmsg_type != NLMSG_ERROR && n->nlmsg_type != NLMSG_NOOP &&
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index c1d2df01..c5da5b5c 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -212,8 +212,7 @@ static int tc_qdisc_modify(int cmd, unsigned int flags, int argc, char **argv)
static int filter_ifindex;
-int print_qdisc(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int print_qdisc(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct tcmsg *t = NLMSG_DATA(n);
@@ -448,8 +447,7 @@ struct tc_qdisc_block_exists_ctx {
bool found;
};
-static int tc_qdisc_block_exists_cb(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int tc_qdisc_block_exists_cb(struct nlmsghdr *n, void *arg)
{
struct tc_qdisc_block_exists_ctx *ctx = arg;
struct tcmsg *t = NLMSG_DATA(n);