[Pkg-wmaker-commits] [wmifinfo] 15/49: wmifinfo: bump to version 0.7.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 18 02:07:42 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmifinfo.

commit aa83b2f8c9479decdf0f592a81ae19628c214daf
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Mon Jul 28 22:50:59 2014 -0500

    wmifinfo: bump to version 0.7.
---
 Changelog  |  8 +++++++-
 Makefile   |  7 +++++--
 README     |  3 ++-
 nwn.c      |  2 ++
 wmifinfo.c | 50 +++++++++++++++++++++++++++++++++++++++-----------
 xutils.c   |  5 +++--
 6 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/Changelog b/Changelog
index 23710b4..4688faf 100644
--- a/Changelog
+++ b/Changelog
@@ -32,9 +32,15 @@
 
 0.06	Added openBSD support
 	
-	- Peter Stromberg <wilfried at openbsd.org> supplied a patch for
+	- Peter Stromberg <wilfried at openbsd dot org> supplied a patch for
 	  OpenBSD support. I have not tried this myself since I don't have
 	  access to this OS. I will probably split the code into several
 	  OS-dependend modules later, for now the main .c file has some
 	  #ifdefs for linux and OpenBSD.
 
+
+0.07	New feature
+
+	- On request of Jesper Anderson <jesper at pobox dot com>, wmifinfo
+	  now always switches to new interfaces when they become available;
+	  handy for new established PPP links or inserted PCMCIA cards
diff --git a/Makefile b/Makefile
index 009e7f5..ddb2121 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ ENABLE_NWN_SUPPORT=n
 # Nothing to configure under here
 
 NAME=wmifinfo
-VERSION=0.06
+VERSION=0.07
 
 CC = gcc
 LD = gcc
@@ -40,4 +40,7 @@ install:
 	cp $(BIN) $(BINDIR)
 
 dist:	clean
-	cd .. && tar -zcvf dist/wmifinfo-$(VERSION).tgz wmifinfo-$(VERSION)/
+	rm -rf /tmp/wmifinfo-$(VERSION)
+	cd .. && cp -a wmifinfo /tmp/wmifinfo-$(VERSION)
+	cd /tmp && tar --exclude CVS -zcvf wmifinfo-$(VERSION).tgz wmifinfo-$(VERSION)/
+	
diff --git a/README b/README
index e3543f9..1329b77 100644
--- a/README
+++ b/README
@@ -90,6 +90,7 @@ COPYRIGHT
 
   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
 
     
\ No newline at end of file
diff --git a/nwn.c b/nwn.c
index 4278127..6c23c64 100644
--- a/nwn.c
+++ b/nwn.c
@@ -4,6 +4,8 @@
  * cards. Since there seems to be no official range for the 'Quality' value I assume
  * it's between 0 and 15, and multiply by 4 to get the range 0-63...
  *
+ * $Id: nwn.c,v 1.2 2002/09/15 14:31:41 ico Exp $
+ *
  */
 
 #ifdef ENABLE_NWN_SUPPORT
diff --git a/wmifinfo.c b/wmifinfo.c
index 9c6b8a7..f390123 100644
--- a/wmifinfo.c
+++ b/wmifinfo.c
@@ -1,4 +1,7 @@
-	 
+/*
+ * $Id: wmifinfo.c,v 1.3 2004/03/03 18:29:50 ico Exp $
+ */
+ 	 
 #include <stdio.h>
 #include <unistd.h>
 #ifdef linux
@@ -630,10 +633,6 @@ void addifname(char *name)
 
 	strcpy(ifname[ifaces], name);
 	
-	if(strcasecmp(name, startif) == 0) {
-		ifno = ifaces;
-		startif[0] = 0;
-	}
 	
 	ifaces++;
 	
@@ -647,14 +646,24 @@ void addifname(char *name)
  
 void getifnames(void)
 {	
+	char pifname[MAXIFS][16];
+	int pifaces;
+	int i,j;
+	int isnew;
+	
+	/* 
+	 * Copy list of interface names and clean the old list
+	 */
+	 
+	for(i=0; i<ifaces; i++) strncpy(pifname[i], ifname[i], sizeof(pifname[i]));
+	pifaces = ifaces;
+	ifaces = 0;
+
 #ifdef linux
 	FILE *f;
 	char buf[128];
 	char *p1, *p2;
 	int ifcount;
-	int i;
-	
-	ifaces = 0;
 	
 	f = fopen("/proc/net/dev", "r");
 	
@@ -689,14 +698,13 @@ void getifnames(void)
 	for(i=0; i<ifcount; i++) {
 		addifname(ifc.ifc_req[i].ifr_name);
 	}
-#elif defined(__OpenBSD__)
+#endif
+#ifdef __OpenBSD__
 	struct ifreq ibuf[32];
 	struct ifconf ifc;
 	struct ifreq *ifrp, *ifend;
 	int r;
 
-	ifaces = 0;
-
 	ifc.ifc_len = sizeof(ibuf);
 	ifc.ifc_buf = (caddr_t) ibuf;
 	if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) == -1 ||
@@ -719,4 +727,24 @@ void getifnames(void)
 		ifrp = (struct ifreq *) ((char *) ifrp + r);
 	}
 #endif
+
+	/*
+	 * Check if the new list contains interfaces that were not in the old list. If a new
+	 * interface is found, make it the current one to display. (-i will override)
+	 */
+	
+	for(i=0; i<ifaces; i++) {
+		isnew = 1;
+		for(j=0; j<pifaces; j++) if(strcmp(ifname[i], pifname[j]) == 0) isnew = 0;
+		if(isnew) ifno = i;
+	}
+
+	for(i=0; i<ifaces; i++) {
+		if(strcasecmp(ifname[i], startif) == 0) {
+			printf("whop\n");
+			ifno = ifaces;
+			startif[0] = 0;
+		}
+	}
+	 
 }
diff --git a/xutils.c b/xutils.c
index 1f0df15..80a7afe 100644
--- a/xutils.c
+++ b/xutils.c
@@ -21,10 +21,11 @@
  *
  *      You should have received a copy of the GNU General Public License
  *      along with this program (see the file COPYING); if not, write to the
- *      Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *      Boston, MA 02110-1301 USA
+ *      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ *      Boston, MA  02111-1307, USA
  *
  *
+ * $Id: xutils.c,v 1.2 2002/09/15 14:31:41 ico Exp $
  *
  *
  */  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifinfo.git



More information about the Pkg-wmaker-commits mailing list