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.35 by pajs, Fri Feb 13 18:45:43 2004 UTC vs.
Revision 1.36 by pajs, Fri Feb 13 18:54:29 2004 UTC

# Line 385 | Line 385 | network_iface_stat_t *get_network_iface_stats(int *ent
385   #ifdef ALLBSD
386          struct ifaddrs *net, *net_ptr;
387          struct ifmediareq ifmed;
388 +        struct ifreq ifr;
389          int s;
390          int x;
391   #endif
# Line 465 | Line 466 | network_iface_stat_t *get_network_iface_stats(int *ent
466                                  break;
467                  }
468  
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
469                  if( (ifmed.ifm_active | IFM_FDX) == ifmed.ifm_active ){
470                          network_iface_stat_ptr->dup = FULL_DUPLEX;
471                  }else if( (ifmed.ifm_active | IFM_HDX) == ifmed.ifm_active ){
# Line 478 | Line 473 | network_iface_stat_t *get_network_iface_stats(int *ent
473                  }else{
474                          network_iface_stat_ptr->dup = UNKNOWN_DUPLEX;
475                  }
476 +
477 +                if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0){
478 +                        continue;
479 +                }      
480 +                if((ifr.ifr_flags & IFF_UP) != 0){
481 +                        network_iface_stat_ptr->up = 1;
482 +                }else{
483 +                        network_iface_stat_ptr->up = 0;
484 +                }
485 +
486                  ifaces++;
487          }      
488          freeifaddrs(net);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines