case RTM_DELROUTE:
return "Del route";
+ case RTM_NEWNEXTHOP:
+ return "New Nexthop Group";
+
+ case RTM_DELNEXTHOP:
+ return "Del Nexthop Group";
+
default:
return "Unknown";
}
struct rtattr *dest;
struct rtattr *src;
int *metric;
+ unsigned int *nhgid;
const char *err_msg;
};
if (rtattr)
ctx->metric = (int *)RTA_DATA(rtattr);
+ rtattr = rtattrs[RTA_NH_ID];
+ if (rtattr)
+ ctx->nhgid = (unsigned int *)RTA_DATA(rtattr);
+
gateway = rtattrs[RTA_GATEWAY];
oif = rtattrs[RTA_OIF];
if (gateway || oif) {
if (ctx->metric)
cur += snprintf(cur, end - cur, ", Metric: %d", *ctx->metric);
+ if (ctx->nhgid)
+ cur += snprintf(cur, end - cur, ", nhgid: %u", *ctx->nhgid);
for (i = 0; i < ctx->num_nhs; i++) {
cur += snprintf(cur, end - cur, "\n ");
nh = &ctx->nhs[i];
break;
default:
- fprintf(stdout, "Ignoring unknown netlink message - Type: %d\n",
- hdr->nlmsg_type);
+ fprintf(stdout,
+ "Ignoring netlink message - Type: %s(%d)\n",
+ netlink_msg_type_to_s(hdr->nlmsg_type),
+ hdr->nlmsg_type);
}
}
}