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.30 by pajs, Fri Feb 13 14:41:05 2004 UTC vs.
Revision 1.34 by tdb, Fri Feb 13 15:40:13 2004 UTC

# Line 50 | Line 50 | typedef __uint16_t u16;
50   typedef __uint32_t u32;
51   #include <linux/ethtool.h>
52   #include <linux/sockios.h>
53 + #include <unistd.h>
54   #endif
55   #ifdef ALLBSD
56   #include <sys/types.h>
# Line 339 | Line 340 | void network_iface_stat_init(int start, int end, netwo
340          for(net_stats+=start; start<end; start++){
341                  net_stats->interface_name=NULL;
342                  net_stats->speed=0;
343 <                net_stats->dup=UNKNOWN_DUPEX;
343 >                net_stats->dup=UNKNOWN_DUPLEX;
344                  net_stats++;
345          }
346   }
# Line 450 | Line 451 | network_iface_stat_t *get_network_iface_stats(int *ent
451                          case(IFM_1000_SX):
452                          case(IFM_1000_LX):
453                          case(IFM_1000_CX):
454 < #ifdef FREEBSD5
454 <                        case(IFM_1000_T):
455 < #else
454 > #if defined(FREEBSD) && !defined(FREEBSD5)
455                          case(IFM_1000_TX):
456                          case(IFM_1000_FX):
457 + #else
458 +                        case(IFM_1000_T):
459   #endif
460                                  network_iface_stat_ptr->speed = 1000;
461                                  break;
# Line 469 | Line 470 | network_iface_stat_t *get_network_iface_stats(int *ent
470                  }else if( (ifmed.ifm_active | IFM_HDX) == ifmed.ifm_active ){
471                          network_iface_stat_ptr->dup = HALF_DUPLEX;
472                  }else{
473 <                        network_iface_stat_ptr->dup = UNKNOWN_DUPEX;
473 >                        network_iface_stat_ptr->dup = UNKNOWN_DUPLEX;
474                  }
475                  ifaces++;
476          }      
# Line 501 | Line 502 | network_iface_stat_t *get_network_iface_stats(int *ent
502                                  continue;
503                          }
504  
505 <                        if(knp->value.ui64 == 0){
505 >                        network_iface_stat_ptr->dup = UNKNOWN_DUPLEX;
506 >                        if(knp->value.ui32 == 2){
507                                  network_iface_stat_ptr->dup = FULL_DUPLEX;
508 <                        }else{
508 >                        }
509 >                        if(knp->value.ui32 == 1){
510                                  network_iface_stat_ptr->dup = HALF_DUPLEX;
511                          }
512  
# Line 575 | Line 578 | network_iface_stat_t *get_network_iface_stats(int *ent
578                  network_iface_stat_ptr = network_iface_stats + ifaces;
579                  network_iface_stat_ptr->interface_name = strdup(name);
580                  network_iface_stat_ptr->speed = ethcmd->speed;
581 <                network_iface_stat_ptr->dup = UNKNOWN_DUPEX;
581 >                network_iface_stat_ptr->dup = UNKNOWN_DUPLEX;
582                  if(ethcmd->duplex == 0x00){
583                          network_iface_stat_ptr->dup = FULL_DUPLEX;
584                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines