]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Tree wide: Drop sockaddr_nl arg
authorDavid Ahern <dsahern@gmail.com>
Fri, 19 Oct 2018 20:42:36 +0000 (13:42 -0700)
committerDavid Ahern <dsahern@gmail.com>
Mon, 22 Oct 2018 16:43:48 +0000 (09:43 -0700)
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>
49 files changed:
bridge/br_common.h
bridge/fdb.c
bridge/link.c
bridge/mdb.c
bridge/monitor.c
bridge/vlan.c
genl/ctrl.c
genl/genl.c
genl/genl_utils.h
include/libnetlink.h
include/ll_map.h
ip/ip_common.h
ip/ipaddress.c
ip/ipaddrlabel.c
ip/ipfou.c
ip/ipila.c
ip/ipl2tp.c
ip/iplink.c
ip/iplink_bridge.c
ip/ipmacsec.c
ip/ipmonitor.c
ip/ipmroute.c
ip/ipneigh.c
ip/ipnetconf.c
ip/ipnetns.c
ip/ipntable.c
ip/ipprefix.c
ip/iproute.c
ip/iprule.c
ip/ipseg6.c
ip/iptoken.c
ip/iptuntap.c
ip/rtmon.c
ip/tcp_metrics.c
ip/tunnel.c
ip/xfrm.h
ip/xfrm_monitor.c
ip/xfrm_policy.c
ip/xfrm_state.c
lib/libnetlink.c
lib/ll_map.c
misc/ifstat.c
misc/ss.c
tc/m_action.c
tc/tc_class.c
tc/tc_common.h
tc/tc_filter.c
tc/tc_monitor.c
tc/tc_qdisc.c

index 00a4e9ea125deadc93a93e1286bdabd59359004e..23d653df931da46cbb715bcca6cbfecc277fb370 100644 (file)
@@ -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);
index 97b08489e7582cfaa7df48e943d7317297aa89ad..f82938f838ae2173524553e17312d5fae3f0b08d 100644 (file)
@@ -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);
index 4a14845da591450a9c61e74354c3782a61ea543c..3290c16f0951680ab056f323c285e55fd3340577 100644 (file)
@@ -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);
index 03fcc91f0219f00ad6bdf10c2c66425664a67358..855a6a4552c7fc8a9a5976c2782e6dee46177fe0 100644 (file)
@@ -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);
index d294269e1092fad077e59a5abcbd38b64e027cde..82bc6b407a06f022bcb5249e2cf7ee74242cfd30 100644 (file)
@@ -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);
index 239907bdad89980c5eda4cad3594fe30edf309e0..a111d5e6643960b1124a7f23a5db614dd4bfe206 100644 (file)
@@ -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];
index 0d9c5f2517b78b978e413e1443be371859e851a5..6133336ab435539de0df6228a47a8a3086ed40f6 100644 (file)
@@ -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;
                }
index 253c4450a3b917b0dd103e5d57b679d0db8628ac..aba3c13afd3496a8c583c7888c370a7b3072e1b2 100644 (file)
@@ -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;
index 3de0da34bdba12b26ecfcaa21ab5f6b9cb54b5e9..cc1f3fb76596186c5d3efcef21e222c9f3184bc4 100644 (file)
@@ -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);
index 04264b871ce45d3b19e44bfee338a8db07fdbfd1..fa8de093d484d818b9e9e62911ecacb8c3112e2d 100644 (file)
@@ -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,
index 8546ff928bc0b8b5a424a8806106cd8fb532f93c..fb708191c22c547bb0012f8477ada75a953a4ed7 100644 (file)
@@ -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);
index 200be5e23dd1bb98d6920b71b4bada5957bebb07..c0b094b37cd224d2f56a556d8f349e1afe0603f6 100644 (file)
@@ -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);
index c0c1fbbe4c74d10a8fadfedfac08333fe93b9db5..1d67e4275f01ffba94323303fd97afeeed4286ac 100644 (file)
@@ -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)
index fb80ed276cde8636e34b9d816080628d2419684b..f06ed1e77f41ed8e79c101688ab457251bbb50aa 100644 (file)
@@ -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);
index 0cb5e3c7a0c7c8504286320a3df312ad9c6578bb..346522ddb7f7fa19d58d3cc69e047cd5f4ccdfc3 100644 (file)
@@ -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];
index 895fe0cdaf7792028eaec46ebcfcafec0cacb13d..11fbb5fae805e44c4a640512143dc809557c05b2 100644 (file)
@@ -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];
index 16561eccd4582adf4ab871e603331ea1a474debd..4308b591196505e74424a2f3e254fe65a46fce34 100644 (file)
@@ -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);
 
index 50ccb49a02639604e7f12c05c4a3d1a7ef05ec0f..3fe2e31738fc20e24c5103d045b38d860f5ae620 100644 (file)
@@ -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];
index 3008e44b7d72537913e4970fc8e9cbca3faf16c8..0ba6be3f47da0843403547cca18b9f7e99e01853 100644 (file)
@@ -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];
index 007ce5404788d40a416806d8b826a578cfac8a24..9b991065e4836a52438bff34dad544b492be555c 100644 (file)
@@ -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];
index a93b62cd6624cc0ee88046321cd887274678f59b..9d5ac2b5e4d2c576da9bc4cf5cc22aca237aeb61 100644 (file)
@@ -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:
index c5dfa9cb1538c5171df6f5eca75b15f9ad73284d..4d8867d3219f6ec86290457ab2b6d4b4e7e930fc 100644 (file)
@@ -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;
index 042d01fd24c2cd8e01c48556f5396797f7f63268..6041c467749c35bc25794a9bdc20a409e8a4af74 100644 (file)
@@ -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);
index 21822e367e112129f8aade7d5b7534479dd78b23..0e946ca34b4a633fd8e90d39abfc6d0af65978f9 100644 (file)
@@ -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)
index e8500c77399485a724992a68be3ae91579ae5afe..0eac18cf268234cb242280c0c1fc4f3347831f1c 100644 (file)
@@ -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];
index ce3f4614e32b47d5b891c7e7b940f4ca93a17507..5b61dd5cb001da598d171fd77fb35278631ff3ad 100644 (file)
@@ -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);
index 20f23ca799aac3a873af64ecc9e3ed4cee4236fc..466af2088d9037e4a56ee2df21fa9eee145b12b5 100644 (file)
@@ -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);
index 699635923764c0ac7a38b9b3c49b49694e20d15e..1326a6574fbed2668e8b92f2a6fffd6897ba4305 100644 (file)
@@ -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;
 }
 
index 60fd4c7e9f935166b046636275faa7d1733891cd..d89d808d89095d3e958bd02f14ceaec76d25d1ac 100644 (file)
@@ -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;
index 6f5ae4d239f74f097534a47c3bea61ee1e346496..33076e726de64d6d547b82334cfb76e2ed8b9bf5 100644 (file)
@@ -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);
                }
index 8605e75c4edc8d82230d77af8fbb08cf53c492e7..f1194c3e1aa453007639babfc122e13829d55ba6 100644 (file)
@@ -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;
index 8c84e6206fa9c2200fb50258e567747974d8aaa0..528055a0bf46440ca3c3d7514ce715c37b18f70d 100644 (file)
@@ -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];
index 7d2405d724a63ea81e78d2c8dbadcdabe375d1d2..7373443f2f8ab18380ac21534d41ba492c217f9c 100644 (file)
@@ -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)
index ad3d6f363003dfc9ab6f29ce37c88c6950ea68ab..72ef3ab5cfda4a01ae3a0328125068ae5b0e6d4f 100644 (file)
@@ -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);
                }
index 20fe6d7d72f10f34a1368f80becbfa91773e7d04..d0d55f37169e9f522e39453b894b61f9bbf0200e 100644 (file)
@@ -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);
index 71be574d90d86b50b0c1f39b03604bf6e5626124..3b158ad71c13ad14e86c171e709b7abef726425e 100644 (file)
--- 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);
index 5d086768560e3013c78ae4462ab10b6677f6b29d..eb07af17cadf43c9231645e2dba8fc90ef3f7dd8 100644 (file)
@@ -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;
index d54402691ca0acda74126f77580061deeba58769..feccaadac2db1eedd9dbcb1dab3bc3ca15f8165c 100644 (file)
@@ -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;
index 913e9fa3bbdb631101a1bf39a5f6bbd1a6d1d575..3cfcad1a4712f68aa3ce746418771400fb1f4650 100644 (file)
@@ -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;
index e8202f7915ba405d4c752b65a1b23870b2484f48..fe4a7a4b9c71afd14438037a624d9aaba77bd431 100644 (file)
@@ -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;
        }
index 32c8e4429fca19105061b1f7d954723f0679aa77..1b4095a7d873b34c2d8eccd0b90ddd2bedb206fa 100644 (file)
@@ -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;
index 3a0e780f75695ceeecddb59d2a01d64720eab471..60efe6cb60faafc78185b17bdadd9ed77f500595 100644 (file)
@@ -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];
index f99b6874c2281d7160d1e7227e0df2406fc5dddd..c8970438ce73723fba2f67e911ba9e3192ca9da1 100644 (file)
--- 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;
index 8993b93a5c4b59c0c0e0eff56d57991b14269e7d..e90867fc6c255f5a9e02863a14d071685b9f3f24 100644 (file)
@@ -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);
index 6b4ea48073f2966198a793ca0b65331e5d3e2451..7e4e17fd7f39c6a324e2eb27f9e46b87f983d060 100644 (file)
@@ -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);
index 371ca7d046021bc3e298a05f8fa0127ecb93fdf2..d8a6dfdeabd4a95af19b464778f561b62d3d9472 100644 (file)
@@ -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;
index 15044b4bc6ed97910fd02b3725a79cf93a94b082..e5c7bc4605a2abdb5649c8e75ea09e35e7ffd7c6 100644 (file)
@@ -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);
index 1f1ee08fb9cf89844f92cba2f5594c5ae058a8b4..f8816cc53a46a077d7bd9f6f6f5e6269af3edb89 100644 (file)
@@ -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 &&
index c1d2df0171a75077a9d7981ca4ecbea6e881e83a..c5da5b5c1ed5164b4a2bb7e4514242aada193749 100644 (file)
@@ -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);