diff options
author | marino <marino@pkgsrc.org> | 2012-08-11 17:20:23 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2012-08-11 17:20:23 +0000 |
commit | b15928e6a4e3a5f7cccd05dedaaa57a74729ed86 (patch) | |
tree | d7665a0a6cad36d6f4d33c4eb640849a040183f6 /net | |
parent | 29004e96ac2c25724bae2a49e0e6f5af1272ffdc (diff) | |
download | pkgsrc-b15928e6a4e3a5f7cccd05dedaaa57a74729ed86.tar.gz |
net/wmpload: Add FreeBSD and DragonFly support
Patch differentials came from FreeBSD ports.
Followed NetBSD's suit with the quad support.
Diffstat (limited to 'net')
-rw-r--r-- | net/pload/distinfo | 10 | ||||
-rw-r--r-- | net/pload/patches/patch-aa | 89 | ||||
-rw-r--r-- | net/pload/patches/patch-ac | 16 | ||||
-rw-r--r-- | net/pload/patches/patch-ad | 4 | ||||
-rw-r--r-- | net/pload/patches/patch-ae | 4 |
5 files changed, 106 insertions, 17 deletions
diff --git a/net/pload/distinfo b/net/pload/distinfo index ddf164f1174..4533fba6666 100644 --- a/net/pload/distinfo +++ b/net/pload/distinfo @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.8 2009/01/04 20:03:21 shattered Exp $ +$NetBSD: distinfo,v 1.9 2012/08/11 17:20:23 marino Exp $ SHA1 (pload-0.9.5.tar.gz) = 52e8ca31ad534cbc131d0bd19ef5ae45b5b37777 RMD160 (pload-0.9.5.tar.gz) = 48ff961d760430a3a45533f7023b1fefa252ede8 Size (pload-0.9.5.tar.gz) = 22423 bytes -SHA1 (patch-aa) = 6a30a15c60e74eeb5312e275b1dac882c86b2420 +SHA1 (patch-aa) = fb3a59555edfcd59b4930990dacc3dcab42cc462 SHA1 (patch-ab) = 4bf2639b64d20717716c66be85c4fb5cd3b114d5 -SHA1 (patch-ac) = 345ac88bb5d279039ae0169c2b468b22964a0c09 -SHA1 (patch-ad) = 97e7f37561882098b080683237e661f2f5692025 -SHA1 (patch-ae) = d98a346e56d36eb5efd084eef1a95ca6c350c0f5 +SHA1 (patch-ac) = 401f9e56ed6543968b47d7c61eff40f5019b3959 +SHA1 (patch-ad) = 2613c9344a8545af91ff7476b2fc5ea1e473aabe +SHA1 (patch-ae) = ef7707633af2c331fcc4d61479346089d443e4e3 diff --git a/net/pload/patches/patch-aa b/net/pload/patches/patch-aa index f83c18dae3b..7c74359ddb8 100644 --- a/net/pload/patches/patch-aa +++ b/net/pload/patches/patch-aa @@ -1,19 +1,69 @@ -$NetBSD: patch-aa,v 1.4 2007/12/09 23:41:11 wiz Exp $ +$NetBSD: patch-aa,v 1.5 2012/08/11 17:20:23 marino Exp $ + +FreeBSD changes taken from FreeBSD ports --- ioctl_stat.c.orig 2000-02-01 07:11:24.000000000 +0000 +++ ioctl_stat.c -@@ -61,6 +61,10 @@ void getsocket(if_data *ifd) +@@ -30,6 +30,15 @@ + #include <fcntl.h> /* open */ + #include <sys/ioctl.h> /* ioctl */ + #include <errno.h> ++#if defined(__FreeBSD__) || defined(__DragonFly__) ++#define __FreeFly__ 1 ++#endif ++#if __FreeFly__ ++#include <sys/sysctl.h> ++#include <sys/socket.h> ++#include <net/if.h> ++#include <net/if_mib.h> ++#endif + + #ifndef STREAMS /* Linux, FreeBSD, NetBSD, Ultrix */ + # include <sys/socket.h> /* socket */ +@@ -39,8 +48,10 @@ + # include <linux/if_ppp.h> + # else /* most everything else */ + # include <net/if.h> ++# ifndef __FreeFly__ + # include <net/ppp_defs.h> + # include <net/if_ppp.h> ++# endif /* FreeBSD | DragonFly */ + # endif /* linux && __GLIBC__ < 2 */ + #else /* STREAMS */ /* Solaris, SunOS, OSF/1, SVR4 */ + # include <net/ppp_defs.h> +@@ -61,7 +72,21 @@ void getsocket(if_data *ifd) void ioctl_stat(if_data *ifd) { struct ifreq ifr; ++#if __FreeFly__ ++ static int if_ix = -1; ++ struct ifmibdata ifmd; ++ size_t ifmd_sz = sizeof(ifmd); ++ int nr_ifs; ++ size_t nr_ifs_sz = sizeof(nr_ifs); ++ int name[6]; ++ int i; ++#else +#ifdef SIOCGIFDATA + struct ifdatareq ifdr; + struct if_data * const ifi = &ifdr.ifdr_data; +#endif struct ifpppstatsreq req; ++#endif /* FreeBSD | DragonFly */ if (!ifd->s) getsocket(ifd); -@@ -84,6 +88,31 @@ void ioctl_stat(if_data *ifd) + +@@ -76,7 +101,9 @@ void ioctl_stat(if_data *ifd) + return; + } + ++#ifndef __FreeFly__ + memset(&req, 0, sizeof(req)); ++#endif + + #ifdef linux + req.stats_ptr = (caddr_t) &req.stats; +@@ -84,6 +111,60 @@ void ioctl_stat(if_data *ifd) #define ifr_name ifr__name #endif @@ -29,7 +79,36 @@ $NetBSD: patch-aa,v 1.4 2007/12/09 23:41:11 wiz Exp $ + } +#endif + -+#if defined(__NetBSD__) && defined(SIOCGIFDATA) ++#if __FreeFly__ ++ name[0] = CTL_NET; ++ name[1] = PF_LINK; ++ name[2] = NETLINK_GENERIC; ++ name[3] = IFMIB_IFDATA; ++ name[5] = IFDATA_GENERAL; ++ ++ if (if_ix < 0) { ++ if (sysctlbyname("net.link.generic.system.ifcount", (void *) &nr_ifs, &nr_ifs_sz, (void *) 0, 0) < 0) { ++ return; ++ } ++ for (i = 1; i <= nr_ifs; i++) { ++ name[4] = i; /* row of the ifmib table */ ++ ++ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) < 0) { ++ continue; ++ } ++ if (strncmp(ifmd.ifmd_name, ifr.ifr_name, strlen(ifr.ifr_name)) == 0) { ++ if_ix = i; ++ break; ++ } ++ } ++ } ++ ++ name[4] = if_ix; ++ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) >= 0) { ++ ifd->in_bytes = ifmd.ifmd_data.ifi_ibytes; ++ ifd->out_bytes = ifmd.ifmd_data.ifi_obytes; ++ } ++#elif defined(__NetBSD__) && defined(SIOCGIFDATA) + /* prefer the generic interface statistics over the PPP specific ones */ + strncpy(ifdr.ifdr_name, ifd->device, sizeof(ifdr.ifdr_name)); + if (ioctl(ifd->s, SIOCGIFDATA, &ifdr) == -1) @@ -45,7 +124,7 @@ $NetBSD: patch-aa,v 1.4 2007/12/09 23:41:11 wiz Exp $ strncpy(req.ifr_name, ifd->device, sizeof(req.ifr_name)); if (ioctl(ifd->s, SIOCGPPPSTATS, &req) != 0) { -@@ -95,6 +124,7 @@ void ioctl_stat(if_data *ifd) +@@ -95,6 +176,7 @@ void ioctl_stat(if_data *ifd) ifd->in_bytes = (unsigned long)req.stats.p.ppp_ibytes; ifd->out_bytes = (unsigned long)req.stats.p.ppp_obytes; diff --git a/net/pload/patches/patch-ac b/net/pload/patches/patch-ac index 4c84ac92721..c20574d962a 100644 --- a/net/pload/patches/patch-ac +++ b/net/pload/patches/patch-ac @@ -1,8 +1,18 @@ -$NetBSD: patch-ac,v 1.1 2002/01/29 13:46:54 wiz Exp $ +$NetBSD: patch-ac,v 1.2 2012/08/11 17:20:23 marino Exp $ ---- configure.orig Thu Mar 4 08:33:03 1999 +--- configure.orig 2000-02-01 07:11:24.000000000 +0000 +++ configure -@@ -60,7 +60,7 @@ +@@ -17,6 +17,9 @@ case $system in + echo "enabling proc stats reading"; + fi + ;; ++ DragonFly) ++ os="dragonfly"; ++ ;; + FreeBSD) + os="freebsd"; + ;; +@@ -62,7 +65,7 @@ else # is this proper sed syntax? echo "OBJS=`echo $common_src $sys_src | sed s/'\.c'/'\.o'/g`" >> osdefs.mk diff --git a/net/pload/patches/patch-ad b/net/pload/patches/patch-ad index ad47ae93d27..7a293c8f0f0 100644 --- a/net/pload/patches/patch-ad +++ b/net/pload/patches/patch-ad @@ -1,4 +1,4 @@ -$NetBSD: patch-ad,v 1.1 2009/01/04 20:03:21 shattered Exp $ +$NetBSD: patch-ad,v 1.2 2012/08/11 17:20:23 marino Exp $ --- pload.h.orig 2000-02-01 07:11:24.000000000 +0000 +++ pload.h @@ -6,7 +6,7 @@ $NetBSD: patch-ad,v 1.1 2009/01/04 20:03:21 shattered Exp $ #ifdef LINUXPROC FILE *file; /* /proc/net/dev */ #endif -+#ifdef __NetBSD__ ++#if defined(__NetBSD__) || defined(__DragonFly__) + u_quad_t in_bytes; /* total bytes in */ + u_quad_t in_bytes_old; /* last total bytes in */ + u_quad_t out_bytes; /* total bytes out */ diff --git a/net/pload/patches/patch-ae b/net/pload/patches/patch-ae index 3e143efc7b2..3f429ff01e2 100644 --- a/net/pload/patches/patch-ae +++ b/net/pload/patches/patch-ae @@ -1,4 +1,4 @@ -$NetBSD: patch-ae,v 1.1 2009/01/04 20:03:21 shattered Exp $ +$NetBSD: patch-ae,v 1.2 2012/08/11 17:20:23 marino Exp $ --- pload.c.orig 2000-02-01 07:11:24.000000000 +0000 +++ pload.c @@ -6,7 +6,7 @@ $NetBSD: patch-ae,v 1.1 2009/01/04 20:03:21 shattered Exp $ static void CheckForWMExit(Widget, XtPointer, XEvent*, Boolean*); static void CheckForIconState(Widget, XtPointer, XEvent*, Boolean*); static void update(XtPointer, XtIntervalId*); -+#ifdef __NetBSD__ ++#if defined(__NetBSD__) || defined(__DragonFly__) +static void make_label(char*,u_quad_t,double,double); +#else static void make_label(char*,unsigned long,double,double); |