Index: branches/2017Q3/net/wmwifi/Makefile =================================================================== --- branches/2017Q3/net/wmwifi/Makefile (revision 448003) +++ branches/2017Q3/net/wmwifi/Makefile (revision 448004) @@ -1,23 +1,26 @@ # Created by: Ulrich Spoerlein # $FreeBSD$ PORTNAME= wmwifi PORTVERSION= 0.4 DISTVERSIONSUFFIX=-bsd -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MASTER_SITES= http://digitalssg.net/debian/ \ LOCAL/uqs MAINTAINER= uqs@FreeBSD.org COMMENT= Dockapp displaying the signal strength of WiFi connection -GNU_CONFIGURE= yes -USE_XORG= x11 xpm -USES= gmake +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING -CPPFLAGS+= -I${LOCALBASE}/include +USES= gmake localbase +USE_XORG= x11 xext xpm + +CONFIGURE_ENV= X_CFLAGS="${CFLAGS}" +GNU_CONFIGURE= yes PLIST_FILES= bin/wmwifi .include Index: branches/2017Q3/net/wmwifi/files/patch-configure.in =================================================================== --- branches/2017Q3/net/wmwifi/files/patch-configure.in (revision 448003) +++ branches/2017Q3/net/wmwifi/files/patch-configure.in (nonexistent) @@ -1,11 +0,0 @@ ---- configure.in.orig Sat Jul 2 14:29:13 2005 -+++ configure.in Sat Jul 2 14:29:20 2005 -@@ -11,7 +11,7 @@ - AC_PATH_XTRA - AC_PATH_X - dnl echo $X_CFLAGS $X_LIBS --CFLAGS="$X_CFLAGS $X_LIBS" -+CFLAGS="$CFLAGS $X_CFLAGS $X_LIBS" - AC_CHECK_LIB(X11, XCopyArea, [], [], $X_LIBS) - AC_CHECK_LIB(Xext, XShapeCombineMask, [], [], $X_LIBS) - AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [], [], $X_LIBS) Property changes on: branches/2017Q3/net/wmwifi/files/patch-configure.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: branches/2017Q3/net/wmwifi/files/patch-wireless.c =================================================================== --- branches/2017Q3/net/wmwifi/files/patch-wireless.c (revision 448003) +++ branches/2017Q3/net/wmwifi/files/patch-wireless.c (revision 448004) @@ -1,128 +1,149 @@ ---- src/wireless.c.orig 2004-03-09 20:39:17.000000000 +0100 -+++ src/wireless.c 2007-11-01 17:58:13.170763665 +0100 +--- src/wireless.c.orig 2004-03-09 19:39:17 UTC ++++ src/wireless.c @@ -25,7 +25,13 @@ #include #include #include +#include +#if __FreeBSD_version > 700045 +#include +#include +#else #include +#endif #else #error "sorry, your OS is not supported yet" #endif -@@ -143,6 +149,7 @@ +@@ -138,11 +144,13 @@ int get_wlaniface(int old, int dir) + int i, max, step, found, index; + struct ifmibdata ifmd; + struct ifmediareq ifmr; +- int name[6], len, s; ++ int name[6], s; ++ size_t len; + char *iface[IFNAMSIZ]; max = get_max_ifs(); step = 0; + found = 0; if (old > max) old = max; /* just be sure to not be out of bounds */ -@@ -178,8 +185,8 @@ +@@ -178,8 +186,8 @@ int get_wlaniface(int old, int dir) len = sizeof(ifmd); sysctl(name, 6, &ifmd, &len, NULL, 0); - /* skip loopback interface */ - if (!strcmp(ifmd.ifmd_name, "lo0")) + /* skip loopback and point-to-point interfaces */ + if ((ifmd.ifmd_flags&(IFF_LOOPBACK|IFF_POINTOPOINT))!=0) continue; s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -193,9 +200,11 @@ +@@ -193,9 +201,11 @@ int get_wlaniface(int old, int dir) if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) { - perror("ioctl"); + char str[128]; + snprintf(str, 128, "ioctl for interface %s failed", ifmr.ifm_name); close(s); - exit(1); + warn(str); + continue; } close(s); /* we cannot monitor interfaces in hostap mode, so just -@@ -207,6 +216,10 @@ +@@ -207,12 +217,17 @@ int get_wlaniface(int old, int dir) found++; } } + + if (!found) + return -1; + return index; } /* how many interfaces do we have? this includes non-wireless! */ -@@ -224,9 +237,18 @@ + int get_max_ifs(void) + { +- int count, len; ++ int count; ++ size_t len; + + len = sizeof(count); + sysctlbyname("net.link.generic.system.ifcount", &count, &len, NULL, 0); +@@ -220,13 +235,23 @@ int get_max_ifs(void) + } + int wifi_info(struct wifi *wfi) + { +- int name[6], len; /* interface name */ ++ int name[6]; /* interface name */ ++ size_t len; struct ifmibdata ifmd; struct ifreq ifr; /* interface stats */ +#if __FreeBSD_version > 700045 + uint8_t buf[24*1024]; + struct ieee80211req ireq; + const struct ieee80211req_scan_result *sr; +#else struct wi_req wireq; +#endif int s; + wfi->link = 0; + wfi->max_qual = 128; + /* lets find the current interface name */ name[0] = CTL_NET; name[1] = PF_LINK; -@@ -247,13 +269,38 @@ +@@ -247,13 +272,38 @@ int wifi_info(struct wifi *wfi) perror("socket"); exit(1); } - bzero(&ifr, sizeof(ifr)); /* struct ifreq interface name can only be 16 Bytes long as of now */ if (strlen(wfi->ifname) >= IFNAMSIZ) { fprintf(stderr, "ERROR: interface name too long\n"); exit(1); } +#if __FreeBSD_version > 700045 + bzero(&ireq, sizeof(ireq)); + strncpy(ireq.i_name, wfi->ifname, sizeof(ireq.i_name)); + + ireq.i_type = IEEE80211_IOC_SCAN_RESULTS; + ireq.i_data = buf; + ireq.i_len = sizeof(buf); + if (ioctl(s, SIOCG80211, &ireq) < 0) { + perror("ioctl"); + exit(1); + } + close (s); + + if (ireq.i_len < sizeof(struct ieee80211req_scan_result)) { + return 1; + } + + sr = (const struct ieee80211req_scan_result *) buf; + + /* + * sr->isr_rssi Signal Strength + * sr->isr_noise Noise + */ + wfi->link = (int) sr->isr_rssi; +#else + bzero(&ifr, sizeof(ifr)); strncpy(ifr.ifr_name, wfi->ifname, strlen(wfi->ifname)); wireq.wi_type = WI_RID_COMMS_QUALITY; wireq.wi_len = WI_MAX_DATALEN; -@@ -272,7 +319,7 @@ +@@ -272,7 +322,7 @@ int wifi_info(struct wifi *wfi) * wi_val[2] = noise */ wfi->link = (int) wireq.wi_val[1]; - wfi->max_qual = 128; +#endif return 1; } Index: branches/2017Q3 =================================================================== --- branches/2017Q3 (revision 448003) +++ branches/2017Q3 (revision 448004) Property changes on: branches/2017Q3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r448001