[Midnightbsd-cvs] mports: mports/net: Add gnome-netstatus to monitor network interfaces.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri May 30 20:42:00 EDT 2008


Log Message:
-----------
Add gnome-netstatus to monitor network interfaces.

Modified Files:
--------------
    mports/net:
        Makefile (r1.77 -> r1.78)

Added Files:
-----------
    mports/net/gnome-netstatus:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-plist (r1.1)
    mports/net/gnome-netstatus/files:
        patch-src_netstatus-sysdeps.c (r1.1)

-------------- next part --------------
--- /dev/null
+++ net/gnome-netstatus/pkg-descr
@@ -0,0 +1,2 @@
+Gnome-netstatus is a panel applet which provides information about 
+network interfaces.
--- /dev/null
+++ net/gnome-netstatus/pkg-plist
@@ -0,0 +1,206 @@
+libdata/bonobo/servers/GNOME_NetstatusApplet_Factory.server
+libexec/gnome-netstatus-applet
+share/gnome-2.0/ui/GNOME_NetstatusApplet.xml
+share/gnome-netstatus/gnome-netstatus.glade
+share/gnome/help/gnome-netstatus/C/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/C/legal.xml
+share/gnome/help/gnome-netstatus/bg/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/de/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/de/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/de/legal.xml
+share/gnome/help/gnome-netstatus/es/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/fr/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/it/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/it/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/it/legal.xml
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/ja/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/ja/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/ja/legal.xml
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/ko/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/ko/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/ko/legal.xml
+share/gnome/help/gnome-netstatus/nl/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/pa/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/ru/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/sv/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/uk/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/zh_CN/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/zh_CN/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/zh_CN/legal.xml
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/zh_HK/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/zh_HK/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/zh_HK/legal.xml
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-disconn.png
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-error.png
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-idle.png
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-rx.png
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-tx.png
+share/gnome/help/gnome-netstatus/zh_TW/figures/gnome-netstatus-txrx.png
+share/gnome/help/gnome-netstatus/zh_TW/gnome-netstatus.xml
+share/gnome/help/gnome-netstatus/zh_TW/legal.xml
+share/omf/gnome-netstatus/gnome-netstatus-C.omf
+share/omf/gnome-netstatus/gnome-netstatus-bg.omf
+share/omf/gnome-netstatus/gnome-netstatus-de.omf
+share/omf/gnome-netstatus/gnome-netstatus-es.omf
+share/omf/gnome-netstatus/gnome-netstatus-fr.omf
+share/omf/gnome-netstatus/gnome-netstatus-it.omf
+share/omf/gnome-netstatus/gnome-netstatus-ja.omf
+share/omf/gnome-netstatus/gnome-netstatus-ko.omf
+share/omf/gnome-netstatus/gnome-netstatus-nl.omf
+share/omf/gnome-netstatus/gnome-netstatus-pa.omf
+share/omf/gnome-netstatus/gnome-netstatus-ru.omf
+share/omf/gnome-netstatus/gnome-netstatus-sv.omf
+share/omf/gnome-netstatus/gnome-netstatus-uk.omf
+share/omf/gnome-netstatus/gnome-netstatus-zh_CN.omf
+share/omf/gnome-netstatus/gnome-netstatus-zh_HK.omf
+share/omf/gnome-netstatus/gnome-netstatus-zh_TW.omf
+share/pixmaps/gnome-netstatus-tx.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-0-24.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-25-49.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-50-74.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-75-100.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-disconn.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-error.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-idle.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-rx.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-tx.png
+share/icons/hicolor/48x48/apps/gnome-netstatus-txrx.png
+share/locale/ar/LC_MESSAGES/gnome-netstatus.mo
+share/locale/az/LC_MESSAGES/gnome-netstatus.mo
+share/locale/bg/LC_MESSAGES/gnome-netstatus.mo
+share/locale/bn/LC_MESSAGES/gnome-netstatus.mo
+share/locale/bn_IN/LC_MESSAGES/gnome-netstatus.mo
+share/locale/bs/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ca/LC_MESSAGES/gnome-netstatus.mo
+share/locale/cs/LC_MESSAGES/gnome-netstatus.mo
+share/locale/cy/LC_MESSAGES/gnome-netstatus.mo
+share/locale/da/LC_MESSAGES/gnome-netstatus.mo
+share/locale/de/LC_MESSAGES/gnome-netstatus.mo
+share/locale/dz/LC_MESSAGES/gnome-netstatus.mo
+share/locale/el/LC_MESSAGES/gnome-netstatus.mo
+share/locale/en_CA/LC_MESSAGES/gnome-netstatus.mo
+share/locale/en_GB/LC_MESSAGES/gnome-netstatus.mo
+share/locale/es/LC_MESSAGES/gnome-netstatus.mo
+share/locale/et/LC_MESSAGES/gnome-netstatus.mo
+share/locale/eu/LC_MESSAGES/gnome-netstatus.mo
+share/locale/fa/LC_MESSAGES/gnome-netstatus.mo
+share/locale/fi/LC_MESSAGES/gnome-netstatus.mo
+share/locale/fr/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ga/LC_MESSAGES/gnome-netstatus.mo
+share/locale/gl/LC_MESSAGES/gnome-netstatus.mo
+share/locale/gu/LC_MESSAGES/gnome-netstatus.mo
+share/locale/he/LC_MESSAGES/gnome-netstatus.mo
+share/locale/hi/LC_MESSAGES/gnome-netstatus.mo
+share/locale/hr/LC_MESSAGES/gnome-netstatus.mo
+share/locale/hu/LC_MESSAGES/gnome-netstatus.mo
+share/locale/id/LC_MESSAGES/gnome-netstatus.mo
+share/locale/it/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ja/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ka/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ko/LC_MESSAGES/gnome-netstatus.mo
+share/locale/lt/LC_MESSAGES/gnome-netstatus.mo
+share/locale/lv/LC_MESSAGES/gnome-netstatus.mo
+share/locale/mg/LC_MESSAGES/gnome-netstatus.mo
+share/locale/mk/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ml/LC_MESSAGES/gnome-netstatus.mo
+share/locale/mn/LC_MESSAGES/gnome-netstatus.mo
+share/locale/mr/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ms/LC_MESSAGES/gnome-netstatus.mo
+share/locale/nb/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ne/LC_MESSAGES/gnome-netstatus.mo
+share/locale/nl/LC_MESSAGES/gnome-netstatus.mo
+share/locale/nn/LC_MESSAGES/gnome-netstatus.mo
+share/locale/or/LC_MESSAGES/gnome-netstatus.mo
+share/locale/pa/LC_MESSAGES/gnome-netstatus.mo
+share/locale/pl/LC_MESSAGES/gnome-netstatus.mo
+share/locale/pt/LC_MESSAGES/gnome-netstatus.mo
+share/locale/pt_BR/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ro/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ru/LC_MESSAGES/gnome-netstatus.mo
+share/locale/rw/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sk/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sl/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sq/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sr/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sr at Latn/LC_MESSAGES/gnome-netstatus.mo
+share/locale/sv/LC_MESSAGES/gnome-netstatus.mo
+share/locale/ta/LC_MESSAGES/gnome-netstatus.mo
+share/locale/th/LC_MESSAGES/gnome-netstatus.mo
+share/locale/tr/LC_MESSAGES/gnome-netstatus.mo
+share/locale/uk/LC_MESSAGES/gnome-netstatus.mo
+share/locale/vi/LC_MESSAGES/gnome-netstatus.mo
+share/locale/wa/LC_MESSAGES/gnome-netstatus.mo
+share/locale/xh/LC_MESSAGES/gnome-netstatus.mo
+share/locale/zh_CN/LC_MESSAGES/gnome-netstatus.mo
+share/locale/zh_HK/LC_MESSAGES/gnome-netstatus.mo
+share/locale/zh_TW/LC_MESSAGES/gnome-netstatus.mo
+ at dirrm share/omf/gnome-netstatus
+ at dirrm share/gnome/help/gnome-netstatus/zh_TW/figures
+ at dirrm share/gnome/help/gnome-netstatus/zh_TW
+ at dirrm share/gnome/help/gnome-netstatus/zh_HK/figures
+ at dirrm share/gnome/help/gnome-netstatus/zh_HK
+ at dirrm share/gnome/help/gnome-netstatus/zh_CN/figures
+ at dirrm share/gnome/help/gnome-netstatus/zh_CN
+ at dirrm share/gnome/help/gnome-netstatus/uk
+ at dirrm share/gnome/help/gnome-netstatus/sv
+ at dirrm share/gnome/help/gnome-netstatus/ru
+ at dirrm share/gnome/help/gnome-netstatus/pa
+ at dirrm share/gnome/help/gnome-netstatus/nl
+ at dirrm share/gnome/help/gnome-netstatus/ko/figures
+ at dirrm share/gnome/help/gnome-netstatus/ko
+ at dirrm share/gnome/help/gnome-netstatus/ja/figures
+ at dirrm share/gnome/help/gnome-netstatus/ja
+ at dirrm share/gnome/help/gnome-netstatus/it/figures
+ at dirrm share/gnome/help/gnome-netstatus/it
+ at dirrm share/gnome/help/gnome-netstatus/fr
+ at dirrm share/gnome/help/gnome-netstatus/es
+ at dirrm share/gnome/help/gnome-netstatus/de/figures
+ at dirrm share/gnome/help/gnome-netstatus/de
+ at dirrm share/gnome/help/gnome-netstatus/bg
+ at dirrm share/gnome/help/gnome-netstatus/C
+ at dirrm share/gnome/help/gnome-netstatus
+ at dirrm share/gnome-netstatus
+ at dirrmtry share/locale/zh_HK/LC_MESSAGES
+ at dirrmtry share/locale/zh_HK
+ at dirrmtry share/locale/xh/LC_MESSAGES
+ at dirrmtry share/locale/xh
+ at dirrmtry share/locale/rw/LC_MESSAGES
+ at dirrmtry share/locale/rw
+ at dirrmtry share/locale/mr/LC_MESSAGES
+ at dirrmtry share/locale/mr
+ at dirrmtry share/locale/mg/LC_MESSAGES
+ at dirrmtry share/locale/mg
+ at dirrmtry share/locale/dz/LC_MESSAGES
+ at dirrmtry share/locale/dz
+ at dirrmtry share/locale/bn_IN/LC_MESSAGES
+ at dirrmtry share/locale/bn_IN
--- /dev/null
+++ net/gnome-netstatus/Makefile
@@ -0,0 +1,36 @@
+# New ports collection makefile for:   gnomenetstatus
+# Date Created:			05 December 2003
+# Whom:				Joe Marcus Clarke <marcus at FreeBSD.org>
+#
+# $MidnightBSD: mports/net/gnome-netstatus/Makefile,v 1.1 2008/05/31 00:41:57 laffer1 Exp $
+# $FreeBSD: ports/net/gnome-netstatus/Makefile,v 1.30 2008/04/23 18:22:48 cokane Exp $
+#   $MCom: ports/net/gnome-netstatus/Makefile,v 1.48 2007/07/04 21:42:20 marcus Exp $
+#
+
+PORTNAME=	gnome-netstatus
+PORTVERSION=	2.12.1
+PORTREVISION=	0
+CATEGORIES=	net gnome
+MASTER_SITES=	${MASTER_SITE_GNOME}
+MASTER_SITE_SUBDIR=	sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
+DIST_SUBDIR=	gnome2
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	A GNOME applet that shows network status
+LICENSE=	gpl2
+
+INSTALLS_OMF=	yes
+INSTALLS_ICONS=	yes
+USE_BZIP2=	yes
+GNOME_DESKTOP_VERSION=2
+USE_GNOME=	gnomehack intlhack gnomeprefix libgnome gnomepanel libglade2 \
+		gnomedocutils
+USE_GMAKE=	yes
+USE_GETTEXT=	yes
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	CPPFLAGS="-I${LOCALBASE}/include" \
+		LDFLAGS="-L${LOCALBASE}/lib"
+
+GCONF_SCHEMAS=	netstatus.schemas
+
+.include <bsd.port.mk>
--- /dev/null
+++ net/gnome-netstatus/distinfo
@@ -0,0 +1,3 @@
+MD5 (gnome2/gnome-netstatus-2.12.1.tar.bz2) = 8651ca1694a6c222ae5cad6e21814d24
+SHA256 (gnome2/gnome-netstatus-2.12.1.tar.bz2) = 4648439f0327963dcbbf2d07d2de1cf1ef74a7430bcbe175717efd0e7f7824ed
+SIZE (gnome2/gnome-netstatus-2.12.1.tar.bz2) = 500536
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/net/Makefile,v
retrieving revision 1.77
retrieving revision 1.78
diff -L net/Makefile -L net/Makefile -u -r1.77 -r1.78
--- net/Makefile
+++ net/Makefile
@@ -16,6 +16,7 @@
     SUBDIR += fping
     SUBDIR += freeradius
     SUBDIR += gnet2
+    SUBDIR += gnome-netstatus
     SUBDIR += hinfo
     SUBDIR += hping
     SUBDIR += ilbc
--- /dev/null
+++ net/gnome-netstatus/files/patch-src_netstatus-sysdeps.c
@@ -0,0 +1,212 @@
+--- src/netstatus-sysdeps.c.orig	2007-02-13 04:39:19.000000000 -0500
++++ src/netstatus-sysdeps.c	2008-04-23 13:07:24.000000000 -0400
+@@ -37,13 +37,26 @@
+ 
+ #ifdef __FreeBSD__
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
++#include <ifaddrs.h>
+ #include <net/if.h>
++#include <net/if_media.h>
+ #include <net/if_var.h>
++#if __FreeBSD_version < 700046
+ #include <dev/an/if_aironet_ieee.h>
+ #include <dev/wi/if_wavelan_ieee.h>
+ #endif
++#if __FreeBSD_version >= 602000
++#include <net80211/ieee80211.h>
++#include <net80211/ieee80211_ioctl.h>
++#endif
++#include <stdlib.h>
++#ifndef IEEE80211_ADDR_COPY
++#define IEEE80211_ADDR_COPY(dst, src)   memcpy(dst, src, IEEE80211_ADDR_LEN)
++#endif
++#endif
+ 
+ static inline gboolean
+ parse_stats (char    *buf,
+@@ -426,15 +439,16 @@ wireless_getval (const char      *iface,
+   return TRUE;
+ }
+ 
++#if __FreeBSD_version < 700046
+ static inline char *
+ get_an_data (const char *iface,
+ 	     int        *signal_strength)
+ {
++  struct an_ltv_status *sts;
++  struct an_req         areq;
+ #ifdef AN_RID_RSSI_MAP
+   struct an_ltv_rssi_map  an_rssimap;
+ #endif
+-  struct an_req         areq;
+-  struct an_ltv_status *sts;
+   int                   level;
+   char                 *error = NULL;
+   gboolean              rssimap_valid = FALSE;
+@@ -486,11 +500,11 @@ get_wi_data (const char *iface,
+   level = (int) wreq.wi_val[1];
+ 
+ #ifdef WI_RID_READ_APS
+-  if (signal_strength <= 0)
++  if (level <= 0)
+     {
+       /* we fail to get signal strength by usual means, try another way */
+       static time_t   last_scan;
+-      static long int cached;
++      static int cached;
+       time_t          now;
+ 
+       now = time (NULL);
+@@ -510,15 +524,15 @@ get_wi_data (const char *iface,
+           if (nstations > 0)
+ 	    {
+               w = (struct wi_apinfo *)(((char *) &wreq.wi_val) + sizeof (int));
+-              signal_strength = (long int) w->signal;
++              level = w->signal;
+             }
+ 
+-            cached = signal_strength;
++            cached = level;
+             last_scan = now;
+           }
+         else
+ 	  {
+-            signal_strength = cached;
++            level = cached;
+           }
+     }
+ #endif
+@@ -527,6 +541,77 @@ get_wi_data (const char *iface,
+ 
+   return error;
+ }
++#endif
++
++#if __FreeBSD_version >= 602000
++static inline char *
++get_net80211_data (const char *iface,
++		   int        *signal_strength)
++{
++  struct ieee80211req_sta_info *si;
++  struct ieee80211req           ireq;
++  int                           level;
++  int                           s;
++  uint8_t                       mac[IEEE80211_ADDR_LEN];
++  int8_t                        noise;
++  char                         *error = NULL;
++  union {
++    struct ieee80211req_sta_req info;
++    char buf[1024];
++  } u_info;
++
++  memset (&u_info, 0, sizeof (u_info));
++  memset (&ireq, 0, sizeof (ireq));
++
++  strlcpy (ireq.i_name, iface, sizeof (ireq.i_name));
++  ireq.i_type = IEEE80211_IOC_BSSID;
++  ireq.i_data = mac;
++  ireq.i_len = IEEE80211_ADDR_LEN;
++
++  s = socket (AF_INET, SOCK_DGRAM, 0);
++  if (s == -1)
++    {
++      error = g_strdup_printf (_("Could not connect to interface, '%s'"), iface);
++      return error;
++    }
++
++  if (ioctl (s, SIOCG80211, &ireq) == -1)
++    {
++      error = g_strdup_printf (_("Could not get MAC for interface, '%s'"), iface);
++      close (s);
++      return error;
++    }
++
++  IEEE80211_ADDR_COPY (u_info.info.is_u.macaddr, mac);
++  ireq.i_type = IEEE80211_IOC_STA_INFO;
++  ireq.i_data = (caddr_t) &u_info;
++  ireq.i_len = sizeof (u_info);
++
++  if (ioctl (s, SIOCG80211, &ireq) == -1)
++    {
++      error = g_strdup_printf (_("Could not send ioctl to interface, '%s'"), iface);
++      close (s);
++      return error;
++    }
++
++  close (s);
++
++  si = &u_info.info.info[0];
++  noise = si->isi_noise;
++  if (si->isi_rssi == 0)
++    level = 0;
++  else
++    {
++      if (noise == 0)
++        noise = -95;
++      level = (int) abs (rint ((si->isi_rssi / (si->isi_rssi/2. + noise)) * 100.0));
++      level = CLAMP (level, 0, 100);
++    }
++
++  memcpy (signal_strength, &level, sizeof (signal_strength));
++  return error;
++}
++#endif
+ 
+ char *
+ netstatus_sysdeps_read_iface_wireless_details (const char *iface,
+@@ -544,25 +629,52 @@ netstatus_sysdeps_read_iface_wireless_de
+   if (signal_strength)
+     *signal_strength = 0;
+ 
++#if __FreeBSD_version < 800036
+   if (g_strncasecmp (iface, "an",   2) &&
+       g_strncasecmp (iface, "wi",   2) &&
+       g_strncasecmp (iface, "ath",  3) &&
+       g_strncasecmp (iface, "ndis", 4) &&
++      g_strncasecmp (iface, "ural", 4) &&
++      g_strncasecmp (iface, "ral",  3) &&
+       g_strncasecmp (iface, "ipw",  3) &&
+       g_strncasecmp (iface, "iwi",  3) &&
++      g_strncasecmp (iface, "rum",  3) &&
++      g_strncasecmp (iface, "ray",  3) &&
+       g_strncasecmp (iface, "acx",  3))
++#else
++  if (g_strncasecmp (iface, "wlan", 4))
++#endif
+     return error_message;
+ 
++#if __FreeBSD_version < 700046
+   if (g_strncasecmp (iface, "an", 2) == 0)
+     {
+       error_message = get_an_data (iface, signal_strength);
+       *is_wireless = TRUE;
+     }
++#endif
++#if __FreeBSD_version >= 602000
++#if __FreeBSD_version < 700046
++  else if (g_strncasecmp (iface, "wi", 2) == 0)
++    {
++      error_message = get_wi_data (iface, signal_strength);
++      *is_wireless = TRUE;
++    }
++  else
++#endif
++    {
++      error_message = get_net80211_data (iface, signal_strength);
++      *is_wireless = TRUE;
++    }
++#else
++#if __FreeBSD_version < 700046
+   else
+     {
+       error_message = get_wi_data (iface, signal_strength);
+       *is_wireless = TRUE;
+     }
++#endif
++#endif
+ 
+   return error_message;
+ }


More information about the Midnightbsd-cvs mailing list