ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.34 by tdb, Fri Feb 13 15:40:13 2004 UTC vs.
Revision 1.35 by pajs, Fri Feb 13 18:45:43 2004 UTC

# Line 465 | Line 465 | network_iface_stat_t *get_network_iface_stats(int *ent
465                                  break;
466                  }
467  
468 +                if((ifmr.ifm_status & IFM_ACTIVE)){
469 +                        network_iface_stat_ptr->up = 1;
470 +                }else{
471 +                        network_iface_stat_ptr->up = 0;
472 +                }
473 +
474                  if( (ifmed.ifm_active | IFM_FDX) == ifmed.ifm_active ){
475                          network_iface_stat_ptr->dup = FULL_DUPLEX;
476                  }else if( (ifmed.ifm_active | IFM_HDX) == ifmed.ifm_active ){
# Line 497 | Line 503 | network_iface_stat_t *get_network_iface_stats(int *ent
503                          network_iface_stat_ptr = network_iface_stats + ifaces;
504                          network_iface_stat_ptr->speed = knp->value.ui64 / (1000*1000);
505  
506 +                        if((knp=kstat_data_lookup(ksp, "link_up"))==NULL){
507 +                                /* Not a network interface, so skip to the next entry */
508 +                                continue;
509 +                        }
510 +                        /* Solaris has 1 for up, and 0 for not. As we do too */
511 +                        network_iface_stat_ptr->up = value.ui32;
512 +
513                          if((knp=kstat_data_lookup(ksp, "link_duplex"))==NULL){
514                                  /* Not a network interface, so skip to the next entry */
515                                  continue;
# Line 578 | Line 591 | network_iface_stat_t *get_network_iface_stats(int *ent
591                  network_iface_stat_ptr = network_iface_stats + ifaces;
592                  network_iface_stat_ptr->interface_name = strdup(name);
593                  network_iface_stat_ptr->speed = ethcmd->speed;
594 +                if((ifr.ifr_flags & IFF_UP) != 0){
595 +                        network_iface_stat_ptr->up = 1;
596 +                }else{
597 +                        network_iface_stat_ptr->up = 0;
598 +                }
599 +
600                  network_iface_stat_ptr->dup = UNKNOWN_DUPLEX;
601                  if(ethcmd->duplex == 0x00){
602                          network_iface_stat_ptr->dup = FULL_DUPLEX;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines