[BACK]Return to if.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / systat

Diff for /src/usr.bin/systat/if.c between version 1.6 and 1.7

version 1.6, 2006/03/31 18:19:44 version 1.7, 2006/06/02 08:16:51
Line 38 
Line 38 
         u_long          ifc_op;                 /* output packets */          u_long          ifc_op;                 /* output packets */
         u_long          ifc_oe;                 /* output errors */          u_long          ifc_oe;                 /* output errors */
         u_long          ifc_co;                 /* collisions */          u_long          ifc_co;                 /* collisions */
           int             ifc_flags;              /* up / down */
           int             ifc_state;              /* link state */
 } sum;  } sum;
   
 struct ifstat {  struct ifstat {
Line 50 
Line 52 
 static  int nifs = 0;  static  int nifs = 0;
 extern  u_int naptime;  extern  u_int naptime;
   
   const char      *showlinkstate(int);
   
 WINDOW *  WINDOW *
 openifstat(void)  openifstat(void)
 {  {
Line 169 
Line 173 
                 UPDATE(ifc_ob, ifm_data.ifi_obytes);                  UPDATE(ifc_ob, ifm_data.ifi_obytes);
                 UPDATE(ifc_oe, ifm_data.ifi_oerrors);                  UPDATE(ifc_oe, ifm_data.ifi_oerrors);
                 UPDATE(ifc_co, ifm_data.ifi_collisions);                  UPDATE(ifc_co, ifm_data.ifi_collisions);
                   ifs->ifs_cur.ifc_flags = ifm.ifm_flags;
                   ifs->ifs_cur.ifc_state = ifm.ifm_data.ifi_link_state;
         }          }
         free(buf);          free(buf);
 }  }
Line 182 
Line 188 
         wmove(wnd, 0, 0);          wmove(wnd, 0, 0);
         wclrtobot(wnd);          wclrtobot(wnd);
   
         mvwaddstr(wnd, 1, INSET, "Interfaces");          mvwaddstr(wnd, 1, INSET, "Iface");
         mvwaddstr(wnd, 1, INSET+15, "Ibytes");          mvwaddstr(wnd, 1, INSET+9, "State");
         mvwaddstr(wnd, 1, INSET+27, "Ipkts");          mvwaddstr(wnd, 1, INSET+19, "Ibytes");
         mvwaddstr(wnd, 1, INSET+34, "Ierrs");          mvwaddstr(wnd, 1, INSET+29, "Ipkts");
         mvwaddstr(wnd, 1, INSET+46, "Obytes");          mvwaddstr(wnd, 1, INSET+36, "Ierrs");
           mvwaddstr(wnd, 1, INSET+48, "Obytes");
         mvwaddstr(wnd, 1, INSET+58, "Opkts");          mvwaddstr(wnd, 1, INSET+58, "Opkts");
         mvwaddstr(wnd, 1, INSET+65, "Oerrs");          mvwaddstr(wnd, 1, INSET+65, "Oerrs");
         mvwaddstr(wnd, 1, INSET+74, "Colls");          mvwaddstr(wnd, 1, INSET+74, "Colls");
 }  }
   
 #define FMT "%-10.10s %10lu %10lu %6lu   %10lu %10lu %6lu   %6lu "  #define FMT "%-8.8s %2s%2s  %10lu %8lu %6lu   %10lu %8lu %6lu   %6lu "
   
   const char *
   showlinkstate(int state)
   {
           switch (state) {
           case LINK_STATE_UP:
                   return (":U");
           case LINK_STATE_DOWN:
                   return (":D");
           case LINK_STATE_UNKNOWN:
                   return ("");
           }
   }
   
 void  void
 showifstat(void)  showifstat(void)
 {  {
Line 208 
Line 228 
                         continue;                          continue;
                 mvwprintw(wnd, row++, INSET, FMT,                  mvwprintw(wnd, row++, INSET, FMT,
                     ifs->ifs_name,                      ifs->ifs_name,
                       ifs->ifs_cur.ifc_flags & IFF_UP ? "up" : "dn",
                       showlinkstate(ifs->ifs_cur.ifc_state),
                     ifs->ifs_cur.ifc_ib,                      ifs->ifs_cur.ifc_ib,
                     ifs->ifs_cur.ifc_ip,                      ifs->ifs_cur.ifc_ip,
                     ifs->ifs_cur.ifc_ie,                      ifs->ifs_cur.ifc_ie,
Line 218 
Line 240 
         }          }
         mvwprintw(wnd, row++, INSET, FMT,          mvwprintw(wnd, row++, INSET, FMT,
             "Totals",              "Totals",
               "", "",
             sum.ifc_ib,              sum.ifc_ib,
             sum.ifc_ip,              sum.ifc_ip,
             sum.ifc_ie,              sum.ifc_ie,

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7