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.70 by ats, Sun Nov 7 12:30:54 2004 UTC vs.
Revision 1.73 by tdb, Mon Apr 25 14:12:05 2005 UTC

# Line 52 | Line 52
52   /* Stuff which could be defined by defining KERNEL, but
53   * that would be a bad idea, so we'll just declare it here
54   */
55 + #include <linux/version.h>
56 + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
57 + typedef __uint8_t __u8;
58 + typedef __uint16_t __u16;
59 + typedef __uint32_t __u32;
60 + typedef __uint64_t __u64;
61 + #else
62   typedef __uint8_t u8;
63   typedef __uint16_t u16;
64   typedef __uint32_t u32;
65   typedef __uint64_t u64;
66 + #endif
67   #include <linux/ethtool.h>
68   #include <linux/sockios.h>
69   #include <unistd.h>
# Line 675 | Line 683 | sg_network_iface_stats *sg_get_network_iface_stats(int
683                          network_iface_stat_ptr->speed = ethcmd.speed;
684  
685                          switch (ethcmd.duplex) {
686 <                        case 0x00:
686 >                        case DUPLEX_FULL:
687                                  network_iface_stat_ptr->dup = SG_IFACE_DUPLEX_FULL;
688                                  break;
689 <                        case 0x01:
689 >                        case DUPLEX_HALF:
690                                  network_iface_stat_ptr->dup = SG_IFACE_DUPLEX_HALF;
691                                  break;
692                          default:
# Line 695 | Line 703 | sg_network_iface_stats *sg_get_network_iface_stats(int
703          close(sock);
704          fclose(f);
705   #endif
706 + #ifdef CYGWIN
707 +        sg_set_error(SG_ERROR_UNSUPPORTED, "Cygwin");
708 +        return NULL;
709 + #endif
710 + #ifdef HPUX
711 +        sg_set_error(SG_ERROR_UNSUPPORTED, "HP-UX");
712 +        return NULL;
713 + #endif
714 +
715          *entries = ifaces;
716          return network_iface_stats;
717   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines