static void draw_detailed(void) { int start_pos, end_pos, i; item_t *intf; int attr_flag = 0; intf = get_current_item(); if (NULL == intf) return; move(row, 39); addch(ACS_TTEE); move(row, 0); NEXT_ROW; start_pos = row; putl(" RX TX " \ " RX TX"); foreach_attr(intf, draw_attr_detail, &attr_flag); end_pos = row; for (i = start_pos; i <= end_pos; i++) { move(i, 39); addch(ACS_VLINE); } move(end_pos, 0); }
static void print_details(item_t *i) { if (i->i_handle) printf(" %s (%u)\n", i->i_name, i->i_handle); else printf(" %s\n", i->i_name); foreach_attr(i, print_attr_detail, NULL); }
static void write_per_item(item_t *it, void *arg) { fprintf(outfd, "<item index=\"%d\" name=\"%s\" handle=\"%d\" " \ "level=\"%d\" ischild=\"%d\" parent=\"%d\" >\n", it->i_index, it->i_name, it->i_handle, it->i_level, !!(it->i_flags & ITEM_FLAG_IS_CHILD), it->i_parent); foreach_attr(it, &write_attr, NULL); fprintf(outfd, "</item>\n"); }
static void draw_detailed(void) { int start_pos, end_pos, i; intf_t *intf; double rx, tx; char *rx_u, *tx_u; int attr_flag = 0; intf = get_current_intf(); if (NULL == intf) return; move(row, 40); addch(ACS_TTEE); move(row, 0); #ifndef DISABLE_OVERFLOW_WORKAROUND if (intf->i_rx_bytes.r_overflows) rx = sumup((intf->i_rx_bytes.r_overflows * OVERFLOW_LIMIT) + intf->i_rx_bytes.r_total, &rx_u); #endif else rx = sumup(intf->i_rx_bytes.r_total, &rx_u); #ifndef DISABLE_OVERFLOW_WORKAROUND if (intf->i_tx_bytes.r_overflows) tx = sumup((intf->i_tx_bytes.r_overflows * OVERFLOW_LIMIT) + intf->i_tx_bytes.r_total, &tx_u); #endif else tx = sumup(intf->i_tx_bytes.r_total, &tx_u); NEXT_ROW; start_pos = row; putl(" RX TX RX TX"); NEXT_ROW; putl(" Bytes: %9.1f %s%8.1f %s Packets: %11llu %11llu", rx, rx_u, tx, tx_u, intf->i_rx_packets.r_total, intf->i_tx_packets.r_total); foreach_attr(intf, draw_attr_detail, &attr_flag); end_pos = row; for (i = start_pos; i <= end_pos; i++) { move(i, 40); addch(ACS_VLINE); } move(end_pos, 0); }
static void print_details(intf_t *i) { double rx, tx; char *rx_u, *tx_u; if (i->i_handle) printf(" %s (%u)\n", i->i_name, i->i_handle); else printf(" %s\n", i->i_name); rx = sumup(i->i_rx_bytes.r_total, &rx_u); tx = sumup(i->i_tx_bytes.r_total, &tx_u); printf(" Bytes: %12.2f %s %12.2f %s\n", rx, rx_u, tx, tx_u); printf(" Packets: %12llu %12llu\n", i->i_rx_packets.r_total, i->i_tx_packets.r_total); foreach_attr(i, print_attr_detail, NULL); }
static void print_graph(item_t *i) { foreach_attr(i, &__print_graph, i); }