const char *kind
= rta_getattr_str(linkinfo[IFLA_INFO_KIND]);
- print_string(PRINT_FP, NULL, "%s", _SL_);
+ print_nl();
print_string(PRINT_ANY, "info_kind", " %s ", kind);
lu = get_link_kind(kind);
const char *slave_kind
= rta_getattr_str(linkinfo[IFLA_INFO_SLAVE_KIND]);
- print_string(PRINT_FP, NULL, "%s", _SL_);
+ print_nl();
print_string(PRINT_ANY,
"info_slave_kind",
" %s_slave ",
rta_getattr_u64(vf[IFLA_VF_STATS_MULTICAST]));
print_u64(PRINT_JSON, "broadcast", NULL,
rta_getattr_u64(vf[IFLA_VF_STATS_BROADCAST]));
+ if (vf[IFLA_VF_STATS_RX_DROPPED])
+ print_u64(PRINT_JSON, "dropped", NULL,
+ rta_getattr_u64(vf[IFLA_VF_STATS_RX_DROPPED]));
close_json_object();
/* TX stats */
rta_getattr_u64(vf[IFLA_VF_STATS_TX_BYTES]));
print_u64(PRINT_JSON, "tx_packets", NULL,
rta_getattr_u64(vf[IFLA_VF_STATS_TX_PACKETS]));
+ if (vf[IFLA_VF_STATS_TX_DROPPED])
+ print_u64(PRINT_JSON, "dropped", NULL,
+ rta_getattr_u64(vf[IFLA_VF_STATS_TX_DROPPED]));
close_json_object();
close_json_object();
} else {
/* RX stats */
fprintf(fp, "%s", _SL_);
- fprintf(fp, " RX: bytes packets mcast bcast %s", _SL_);
+ fprintf(fp, " RX: bytes packets mcast bcast ");
+ if (vf[IFLA_VF_STATS_RX_DROPPED])
+ fprintf(fp, " dropped ");
+ fprintf(fp, "%s", _SL_);
fprintf(fp, " ");
print_num(fp, 10, rta_getattr_u64(vf[IFLA_VF_STATS_RX_BYTES]));
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_RX_PACKETS]));
print_num(fp, 7, rta_getattr_u64(vf[IFLA_VF_STATS_MULTICAST]));
print_num(fp, 7, rta_getattr_u64(vf[IFLA_VF_STATS_BROADCAST]));
+ if (vf[IFLA_VF_STATS_RX_DROPPED])
+ print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_RX_DROPPED]));
/* TX stats */
fprintf(fp, "%s", _SL_);
- fprintf(fp, " TX: bytes packets %s", _SL_);
+ fprintf(fp, " TX: bytes packets ");
+ if (vf[IFLA_VF_STATS_TX_DROPPED])
+ fprintf(fp, " dropped ");
+ fprintf(fp, "%s", _SL_);
fprintf(fp, " ");
print_num(fp, 10, rta_getattr_u64(vf[IFLA_VF_STATS_TX_BYTES]));
print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_TX_PACKETS]));
+ if (vf[IFLA_VF_STATS_TX_DROPPED])
+ print_num(fp, 8, rta_getattr_u64(vf[IFLA_VF_STATS_TX_DROPPED]));
}
}
parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi),
n->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)));
__print_link_stats(fp, tb);
- fprintf(fp, "%s", _SL_);
+ print_nl();
}
static int print_linkinfo_brief(FILE *fp, const char *name,
print_link_event(fp, rta_getattr_u32(tb[IFLA_EVENT]));
if (!filter.family || filter.family == AF_PACKET || show_details) {
- print_string(PRINT_FP, NULL, "%s", _SL_);
+ print_nl();
print_string(PRINT_ANY,
"link_type",
" link/%s ",
" promiscuity %u ",
rta_getattr_u32(tb[IFLA_PROMISCUITY]));
+ if (tb[IFLA_MIN_MTU])
+ print_uint(PRINT_ANY,
+ "min_mtu", "minmtu %u ",
+ rta_getattr_u32(tb[IFLA_MIN_MTU]));
+
+ if (tb[IFLA_MAX_MTU])
+ print_uint(PRINT_ANY,
+ "max_mtu", "maxmtu %u ",
+ rta_getattr_u32(tb[IFLA_MAX_MTU]));
+
if (tb[IFLA_LINKINFO])
print_linktype(fp, tb[IFLA_LINKINFO]);
xdp_dump(fp, tb[IFLA_XDP], true, true);
if (do_link && show_stats) {
- print_string(PRINT_FP, NULL, "%s", _SL_);
+ print_nl();
__print_link_stats(fp, tb);
}
if (rta_tb[IFA_CACHEINFO]) {
struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]);
- print_string(PRINT_FP, NULL, "%s", _SL_);
+ print_nl();
print_string(PRINT_FP, NULL, " valid_lft ", NULL);
if (ci->ifa_valid == INFINITY_LIFE_TIME) {
filter.flushe = sizeof(flushb);
while ((max_flush_loops == 0) || (round < max_flush_loops)) {
- if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, filter.family) < 0) {
perror("Cannot send dump request");
exit(1);
}
int ip_linkaddr_list(int family, req_filter_fn_t filter_fn,
struct nlmsg_chain *linfo, struct nlmsg_chain *ainfo)
{
- if (rtnl_wilddump_req_filter_fn(&rth, preferred_family, RTM_GETLINK,
+ if (rtnl_linkdump_req_filter_fn(&rth, preferred_family,
filter_fn) < 0) {
perror("Cannot send dump request");
return 1;
}
if (ainfo) {
- if (rtnl_wilddump_request(&rth, family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, family) < 0) {
perror("Cannot send dump request");
return 1;
}
if (ipadd_save_prep())
exit(1);
- if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETADDR) < 0) {
+ if (rtnl_addrdump_req(&rth, preferred_family) < 0) {
perror("Cannot send dump request");
exit(1);
}
exit(1);
}
- if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) {
perror("Cannot send dump request");
exit(1);
}