"INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n"
"NH := [ encap ENCAPTYPE ENCAPHDR ] [ via [ FAMILY ] ADDRESS ]\n"
" [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"
- "FAMILY := [ inet | inet6 | ipx | dnet | mpls | bridge | link ]\n"
+ "FAMILY := [ inet | inet6 | dnet | mpls | bridge | link ]\n"
"OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]\n"
" [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ]\n"
" [ window NUMBER ] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"
}
}
-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);
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;
filter.flushe = sizeof(flushb);
for (;;) {
- if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
perror("Cannot send dump request");
return -2;
}
return iproute_flush(do_ipv6, filter_fn);
if (!filter.cloned) {
- if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
perror("Cannot send dump request");
return -2;
}
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;
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;
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);
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;
}