Home | History | Annotate | Download | only in ip

Lines Matching refs:fp

86 void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
88 fprintf(fp, "<");
90 fprintf(fp, "NO-CARRIER%s", flags ? "," : "");
94 fprintf(fp, #f "%s", flags ? "," : ""); }
115 fprintf(fp, "%x", flags);
117 fprintf(fp, ",M-DOWN");
118 fprintf(fp, "> ");
185 static void print_linktype(FILE *fp, struct rtattr *tb)
197 fprintf(fp, "%s", _SL_);
198 fprintf(fp, " %s ", kind);
212 lu->print_opt(lu, fp, data);
216 lu->print_xstats(lu, fp, linkinfo[IFLA_INFO_XSTATS]);
220 static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
252 fprintf(fp, "\n vf %d MAC %s", vf_mac->vf,
256 fprintf(fp, ", vlan %d", vf_vlan->vlan);
258 fprintf(fp, ", qos %d", vf_vlan->qos);
260 fprintf(fp, ", tx rate %d (Mbps)", vf_tx_rate->rate);
263 fprintf(fp, ", spoof checking on");
265 fprintf(fp, ", spoof checking off");
269 static void print_link_stats64(FILE *fp, const struct rtnl_link_stats64 *s) {
270 fprintf(fp, "%s", _SL_);
271 fprintf(fp, " RX: bytes packets errors dropped overrun mcast %s%s",
273 fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
281 fprintf(fp, " %-7"PRIu64"",
284 fprintf(fp, "%s", _SL_);
285 fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
286 fprintf(fp, " %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
293 fprintf(fp, "%s", _SL_);
294 fprintf(fp, " TX: bytes packets errors dropped carrier collsns %s%s",
296 fprintf(fp, " %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
304 fprintf(fp, " %-7"PRIu64"",
307 fprintf(fp, "%s", _SL_);
308 fprintf(fp, " TX errors: aborted fifo window heartbeat%s", _SL_);
309 fprintf(fp, " %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
317 static void print_link_stats(FILE *fp, const struct rtnl_link_stats *s)
319 fprintf(fp, "%s", _SL_);
320 fprintf(fp, " RX: bytes packets errors dropped overrun mcast %s%s",
322 fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
328 fprintf(fp, " %-7u", s->rx_compressed);
330 fprintf(fp, "%s", _SL_);
331 fprintf(fp, " RX errors: length crc frame fifo missed%s", _SL_);
332 fprintf(fp, " %-7u %-7u %-7u %-7u %-7u",
340 fprintf(fp, "%s", _SL_);
341 fprintf(fp, " TX: bytes packets errors dropped carrier collsns %s%s",
343 fprintf(fp, " %-10u %-8u %-7u %-7u %-7u %-7u",
347 fprintf(fp, " %-7u", s->tx_compressed);
349 fprintf(fp, "%s", _SL_);
350 fprintf(fp, " TX errors: aborted fifo window heartbeat%s", _SL_);
351 fprintf(fp, " %-7u %-7u %-7u %-7u",
363 FILE *fp = (FILE*)arg;
397 fprintf(fp, "Deleted ");
399 fprintf(fp, "%d: %s", ifi->ifi_index,
406 fprintf(fp, "@NONE: ");
408 fprintf(fp, "@%s: ", ll_idx_n2a(iflink, b1));
413 fprintf(fp, ": ");
415 print_link_flags(fp, ifi->ifi_flags, m_flag);
418 fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
420 fprintf(fp, "qdisc %s ", rta_getattr_str(tb[IFLA_QDISC]));
423 fprintf(fp, "master %s ", ll_idx_n2a(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
427 print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE]));
430 print_linkmode(fp, tb[IFLA_LINKMODE]);
433 print_queuelen(fp, tb);
437 fprintf(fp, "%s", _SL_);
438 fprintf(fp, " link/%s ", ll_type_n2a(ifi->ifi_type, b1, sizeof(b1)));
441 fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_ADDRESS]),
448 fprintf(fp, " peer ");
450 fprintf(fp, " brd ");
451 fprintf(fp, "%s", ll_addr_n2a(RTA_DATA(tb[IFLA_BROADCAST]),
459 print_linktype(fp, tb[IFLA_LINKINFO]);
462 fprintf(fp,"\n alias %s",
467 print_link_stats64(fp, RTA_DATA(tb[IFLA_STATS64]));
469 print_link_stats(fp, RTA_DATA(tb[IFLA_STATS]));
476 print_vfinfo(fp, i);
479 fprintf(fp, "\n");
480 fflush(fp);
507 FILE *fp = (FILE*)arg;
583 fprintf(fp, "Deleted ");
586 fprintf(fp, "%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index));
588 fprintf(fp, " inet ");
590 fprintf(fp, " inet6 ");
592 fprintf(fp, " dnet ");
594 fprintf(fp, " ipx ");
596 fprintf(fp, " family %d ", ifa->ifa_family);
599 fprintf(fp, "%s", rt_addr_n2a(ifa->ifa_family,
606 fprintf(fp, "/%d ", ifa->ifa_prefixlen);
608 fprintf(fp, " peer %s/%d ",
618 fprintf(fp, "brd %s ",
625 fprintf(fp, "any %s ",
631 fprintf(fp, "scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1, sizeof(b1)));
636 fprintf(fp, "temporary ");
638 fprintf(fp, "secondary ");
642 fprintf(fp, "tentative ");
647 fprintf(fp, "deprecated ");
651 fprintf(fp, "home ");
655 fprintf(fp, "nodad ");
658 fprintf(fp, "dynamic ");
663 fprintf(fp, "dadfailed ");
666 fprintf(fp, "flags %02x ", ifa_flags);
668 fprintf(fp, "%s", rta_getattr_str(rta_tb[IFA_LABEL]));
671 fprintf(fp, "%s", _SL_);
672 fprintf(fp, " valid_lft ");
674 fprintf(fp, "forever");
676 fprintf(fp, "%usec", ci->ifa_valid);
677 fprintf(fp, " preferred_lft ");
679 fprintf(fp, "forever");
682 fprintf(fp, "%dsec", ci->ifa_prefered);
684 fprintf(fp, "%usec", ci->ifa_prefered);
687 fprintf(fp, "\n");
688 fflush(fp);
720 static int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo, FILE *fp)
736 print_addrinfo(NULL, n, fp);