Initial import of wmwave-0.4
Window Maker dockapp to display wavelan statistics Submitted by: Joshua Stein <jcs@rt.fm>
This commit is contained in:
parent
8c9733fab2
commit
3dacc626ae
27
net/wmwave/Makefile
Normal file
27
net/wmwave/Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2001/03/14 14:10:49 wilfried Exp $
|
||||
|
||||
DISTNAME= wmwave-0-4
|
||||
PKGNAME= wmwave-0.4
|
||||
EXTRACT_SUFX= .tgz
|
||||
HOMEPAGE= http://www.schuermann.org/~dockapps/
|
||||
MASTER_SITES= ${HOMEPAGE}dist/ \
|
||||
ftp://rt.fm/pub/wmwave/
|
||||
|
||||
CATEGORIES= net x11 x11/windowmaker
|
||||
NEED_VERSION= 1.359
|
||||
|
||||
MAINTAINER= Joshua Stein <jcs@rt.fm>
|
||||
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
USE_X11= Yes
|
||||
WRKDIST= ${WRKDIR}/wmwave
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/wmwave ${PREFIX}/bin
|
||||
${INSTALL_MAN} ${WRKSRC}/wmwave.1 ${PREFIX}/man/man1/wmwave.1
|
||||
|
||||
.include <bsd.port.mk>
|
3
net/wmwave/files/md5
Normal file
3
net/wmwave/files/md5
Normal file
@ -0,0 +1,3 @@
|
||||
MD5 (wmwave-0-4.tgz) = 24e985599a85d7165e5905b9d34cd81d
|
||||
SHA1 (wmwave-0-4.tgz) = 7b9ab646a7b3ec037b266c27f198ab3cc6683045
|
||||
RMD160 (wmwave-0-4.tgz) = 6dc31231175a9a5a67a4a39fdfce17960e9a768c
|
31
net/wmwave/patches/patch-wmwave_Makefile
Normal file
31
net/wmwave/patches/patch-wmwave_Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
$OpenBSD: patch-wmwave_Makefile,v 1.1.1.1 2001/03/14 14:10:49 wilfried Exp $
|
||||
--- Makefile.orig Tue Mar 13 13:53:09 2001
|
||||
+++ Makefile Wed Mar 14 07:38:32 2001
|
||||
@@ -6,22 +6,20 @@
|
||||
# Revision 1.1 1999/08/15 15:38:09 carsten
|
||||
# Added wmwave project to repository
|
||||
|
||||
-LIBDIR = -L/usr/X11R6/lib
|
||||
+LIBDIR = -L${X11BASE}/lib
|
||||
LIBS = -lXpm -lXext -lX11 -lm
|
||||
-FLAGS = -O6
|
||||
-OBJS = \
|
||||
- wmgeneral.o \
|
||||
+OBJS = wmgeneral.o
|
||||
|
||||
default:all
|
||||
|
||||
.c.o:
|
||||
- cc -I/usr/X11R6/share/include $(FLAGS) -c -Wall $< -o $*.o
|
||||
+ ${CC} -I${X11BASE}/include $(CFLAGS) -c -Wall $< -o $*.o
|
||||
|
||||
wmwave.o: wmwave.c wmwave-master.xpm
|
||||
- cc -I/usr/X11R6/share/include $(FLAGS) -c -Wall wmwave.c -o $*.o
|
||||
+ ${CC} -I${X11BASE}/include $(CFLAGS) -c -Wall wmwave.c -o $*.o
|
||||
|
||||
wmwave: $(OBJS) wmwave.o
|
||||
- cc $(FLAGS) -o wmwave $(OBJS) -lXext $(LIBDIR) $(LIBS) wmwave.o
|
||||
+ ${CC} $(CFLAGS) -o wmwave $(OBJS) -lXext $(LIBDIR) $(LIBS) wmwave.o
|
||||
|
||||
all:: wmwave
|
||||
|
546
net/wmwave/patches/patch-wmwave_wmwave_c
Normal file
546
net/wmwave/patches/patch-wmwave_wmwave_c
Normal file
@ -0,0 +1,546 @@
|
||||
$OpenBSD: patch-wmwave_wmwave_c,v 1.1.1.1 2001/03/14 14:10:50 wilfried Exp $
|
||||
--- wmwave.c.orig Tue Mar 13 13:53:05 2001
|
||||
+++ wmwave.c Tue Mar 13 12:47:28 2001
|
||||
@@ -32,7 +32,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
-
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
@@ -44,6 +43,7 @@
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
+#include <err.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <sys/wait.h>
|
||||
@@ -57,6 +57,11 @@
|
||||
#include <X11/xpm.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
|
||||
+#include <sys/socket.h>
|
||||
+#include <net/if.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <netinet/if_ether.h>
|
||||
+#include <dev/pcmcia/if_wavelan_ieee.h>
|
||||
|
||||
#include "wmgeneral.h"
|
||||
|
||||
@@ -67,6 +72,9 @@
|
||||
int wmwave_mask_height = 64;
|
||||
|
||||
#define WMWAVE_VERSION "0.4"
|
||||
+#define WI_WORDS 0x03
|
||||
+
|
||||
+#define WI_INTERFACE "wi0"
|
||||
|
||||
int update_rate=100000;
|
||||
|
||||
@@ -75,8 +83,8 @@
|
||||
time_t curtime;
|
||||
time_t prevtime;
|
||||
|
||||
-int mode = 0; // default: no card detected
|
||||
-int screen = 0; // default: Quality screen is displayed
|
||||
+int mode = 0; // default: no card detected
|
||||
+int screen = 0; // default: Quality screen is displayed
|
||||
|
||||
void usage(void);
|
||||
void printversion(void);
|
||||
@@ -86,272 +94,268 @@
|
||||
void DrawBar(float percent, int dx, int dy);
|
||||
void DrawGreenBar(float percent, int dx, int dy);
|
||||
|
||||
+static void wi_getval __P((struct wi_req *));
|
||||
+
|
||||
inline void DrawBar(float percent, int dx, int dy) {
|
||||
- int tx;
|
||||
-
|
||||
- tx = (float)((float)54 * ((float)percent / (float)100.0));
|
||||
- copyXPMArea(67, 36, tx, 4, dx, dy);
|
||||
- copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy);
|
||||
-}
|
||||
+ int tx;
|
||||
|
||||
+ tx = (float)((float)54 * ((float)percent / (float)100.0));
|
||||
+ copyXPMArea(67, 36, tx, 4, dx, dy);
|
||||
+ copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy);
|
||||
+}
|
||||
|
||||
inline void DrawGreenBar(float percent, int dx, int dy) {
|
||||
- int tx;
|
||||
-
|
||||
- tx = (float)((float)54 * ((float)percent / (float)100.0));
|
||||
- copyXPMArea(67, 58, tx, 4, dx, dy);
|
||||
- copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy);
|
||||
+ int tx;
|
||||
+
|
||||
+ tx = (float)((float)54 * ((float)percent / (float)100.0));
|
||||
+ copyXPMArea(67, 58, tx, 4, dx, dy);
|
||||
+ copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy);
|
||||
}
|
||||
|
||||
inline void DrawRedDot() {
|
||||
- copyXPMArea(80, 65, 6, 6, 52, 5);
|
||||
+ copyXPMArea(80, 65, 6, 6, 52, 5);
|
||||
}
|
||||
|
||||
inline void DrawYellowDot() {
|
||||
- copyXPMArea(86, 65, 6, 6, 52, 5);
|
||||
+ copyXPMArea(86, 65, 6, 6, 52, 5);
|
||||
}
|
||||
|
||||
inline void DrawGreenDot() {
|
||||
- copyXPMArea(92, 65, 6, 6, 52, 5);
|
||||
+ copyXPMArea(92, 65, 6, 6, 52, 5);
|
||||
}
|
||||
|
||||
inline void DrawEmptyDot() {
|
||||
- copyXPMArea(98, 65, 6, 6, 52, 5);
|
||||
+ copyXPMArea(98, 65, 6, 6, 52, 5);
|
||||
}
|
||||
|
||||
float min (float x, float y) {
|
||||
- if (x < y) {return x;}
|
||||
- else {return y;}
|
||||
+ if (x < y) {
|
||||
+ return x;
|
||||
+ } else {
|
||||
+ return y;
|
||||
+ }
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Find CPU times for all processes
|
||||
- */
|
||||
void DisplayWireless(void) {
|
||||
- FILE *wireless; // File handle for /proc/net/wireless
|
||||
-
|
||||
- char line[255];
|
||||
- char iface[5];
|
||||
- char status [3];
|
||||
- float link = 0;
|
||||
- float level = 0;
|
||||
- float noise = 0;
|
||||
- int nwid = 0;
|
||||
- int crypt = 0;
|
||||
- int misc = 0;
|
||||
-
|
||||
- if ((wireless = fopen ("/proc/net/wireless", "r")) != NULL)
|
||||
- {
|
||||
- fgets(line,sizeof(line),wireless);
|
||||
- fgets(line,sizeof(line),wireless);
|
||||
- if (fgets(line,sizeof(line),wireless) == NULL) {
|
||||
- mode = 0;
|
||||
- }
|
||||
- else {
|
||||
- sscanf(line,"%s %s %f %f %f %d %d %d",
|
||||
- iface,status,&link,&level,&noise,&nwid,&crypt,&misc);
|
||||
- mode = 1;
|
||||
- }
|
||||
- fclose(wireless);
|
||||
-
|
||||
-
|
||||
- /* Print channel information, and signal ratio */
|
||||
-
|
||||
- switch (mode) {
|
||||
- case 1: BlitString("Quality",4,4);
|
||||
- if (link<=10) {DrawRedDot ();}
|
||||
- else if (link<=20) {DrawYellowDot ();}
|
||||
- else {DrawGreenDot();};
|
||||
- BlitString("Link ", 4,18);
|
||||
- DrawBar(min ((int)(link * 1.8), 100.0), 4, 27);
|
||||
- BlitString("Level ", 4,32);
|
||||
- DrawGreenBar(min ((int)(level * 0.3), 100.0), 4, 41);
|
||||
- BlitString("Noise ", 4,46);
|
||||
- DrawGreenBar(min ((int)(noise * 0.3), 100.0), 4, 55);
|
||||
- break;
|
||||
- case 0: BlitString("NO CARD",4,4);
|
||||
- DrawEmptyDot();
|
||||
- BlitString(" ", 4,18);
|
||||
- DrawBar(0.0, 4, 27);
|
||||
- BlitString(" ", 4,32);
|
||||
- DrawGreenBar(0.0, 4, 41);
|
||||
- BlitString(" ", 4,46);
|
||||
- DrawGreenBar(0.0, 4, 55);
|
||||
- break;
|
||||
- };
|
||||
- }
|
||||
- else {
|
||||
- printf ("Wirless device /proc/net/wireless not found\nEnable radio networking and recompile your kernel\n");
|
||||
- exit (0);
|
||||
- }
|
||||
+ float link = 0;
|
||||
+ float level = 0;
|
||||
+ float noise = 0;
|
||||
+ struct wi_req wreq;
|
||||
+
|
||||
+ bzero((char *)&wreq, sizeof(wreq));
|
||||
+
|
||||
+ wreq.wi_len = WI_MAX_DATALEN;
|
||||
+ wreq.wi_type = WI_RID_COMMS_QUALITY;
|
||||
+
|
||||
+ wi_getval(&wreq);
|
||||
+
|
||||
+ link = wreq.wi_val[0];
|
||||
+ level = wreq.wi_val[1];
|
||||
+ noise = wreq.wi_val[2];
|
||||
+
|
||||
+ switch (mode) {
|
||||
+ case 1:
|
||||
+ BlitString("Quality",4,4);
|
||||
+ if (link <= 10) {
|
||||
+ DrawRedDot();
|
||||
+ } else if (link <= 40) {
|
||||
+ DrawYellowDot();
|
||||
+ } else {
|
||||
+ DrawGreenDot();
|
||||
+ }
|
||||
+ BlitString("Link ", 4, 18);
|
||||
+ DrawBar(min (link, 100.0), 4, 27);
|
||||
+ BlitString("Level ", 4, 32);
|
||||
+ if (level == 0)
|
||||
+ DrawGreenBar(min ((level), 100.0), 4, 41);
|
||||
+ else
|
||||
+ DrawGreenBar(min ((level - 27), 100.0), 4, 41);
|
||||
+ BlitString("Noise ", 4, 46);
|
||||
+ DrawGreenBar(min ((noise - 27), 100.0), 4, 55);
|
||||
+ break;
|
||||
+ case 0:
|
||||
+ BlitString("NO CARD", 4, 4);
|
||||
+ DrawEmptyDot();
|
||||
+ BlitString(" ", 4, 18);
|
||||
+ DrawBar(0.0, 4, 27);
|
||||
+ BlitString(" ", 4, 32);
|
||||
+ DrawGreenBar(0.0, 4, 41);
|
||||
+ BlitString(" ", 4, 46);
|
||||
+ DrawGreenBar(0.0, 4, 55);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* SIGCHLD handler */
|
||||
void sig_chld(int signo)
|
||||
{
|
||||
- waitpid((pid_t) -1, NULL, WNOHANG);
|
||||
- signal(SIGCHLD, sig_chld);
|
||||
+ waitpid((pid_t) -1, NULL, WNOHANG);
|
||||
+ signal(SIGCHLD, sig_chld);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
- int i;
|
||||
-
|
||||
- /* Parse Command Line */
|
||||
-
|
||||
- signal(SIGCHLD, sig_chld);
|
||||
- ProgName = argv[0];
|
||||
- if (strlen(ProgName) >= 5)
|
||||
- ProgName += (strlen(ProgName) - 5);
|
||||
-
|
||||
- for (i=1; i<argc; i++) {
|
||||
- char *arg = argv[i];
|
||||
-
|
||||
- if (*arg=='-') {
|
||||
- switch (arg[1]) {
|
||||
- case 'd' :
|
||||
- if (strcmp(arg+1, "display")) {
|
||||
- usage();
|
||||
- exit(1);
|
||||
- }
|
||||
- break;
|
||||
- case 'g' :
|
||||
- if (strcmp(arg+1, "geometry")) {
|
||||
- usage();
|
||||
- exit(1);
|
||||
- }
|
||||
- break;
|
||||
- case 'v' :
|
||||
- printversion();
|
||||
- exit(0);
|
||||
- break;
|
||||
- case 'r':
|
||||
- if (argc > (i+1)) {
|
||||
- update_rate = (atoi(argv[i+1]) * 1000);
|
||||
- i++;
|
||||
+ int i;
|
||||
+
|
||||
+ /* Parse Command Line */
|
||||
+ signal(SIGCHLD, sig_chld);
|
||||
+ ProgName = argv[0];
|
||||
+ if (strlen(ProgName) >= 5)
|
||||
+ ProgName += (strlen(ProgName) - 5);
|
||||
+
|
||||
+ for (i=1; i<argc; i++) {
|
||||
+ char *arg = argv[i];
|
||||
+
|
||||
+ if (*arg == '-') {
|
||||
+ switch (arg[1]) {
|
||||
+ case 'd':
|
||||
+ if (strcmp(arg + 1, "display")) {
|
||||
+ usage();
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ break;
|
||||
+ case 'g':
|
||||
+ if (strcmp(arg + 1, "geometry")) {
|
||||
+ usage();
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ break;
|
||||
+ case 'v':
|
||||
+ printversion();
|
||||
+ exit(0);
|
||||
+ break;
|
||||
+ case 'r':
|
||||
+ if (argc > (i + 1)) {
|
||||
+ update_rate = (atoi(argv[i + 1]) * 1000);
|
||||
+ i++;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ usage();
|
||||
+ exit(0);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
- break;
|
||||
- default:
|
||||
- usage();
|
||||
- exit(0);
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- wmwave_routine(argc, argv);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * Main loop
|
||||
- */
|
||||
+
|
||||
+ wmwave_routine(argc, argv);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Main loop */
|
||||
void wmwave_routine(int argc, char **argv) {
|
||||
- XEvent Event;
|
||||
- struct timeval tv={0,0};
|
||||
- struct timeval last={0,0};
|
||||
-
|
||||
- createXBMfromXPM(wmwave_mask_bits, wmwave_master_xpm, wmwave_mask_width, wmwave_mask_height);
|
||||
-
|
||||
- openXwindow(argc, argv, wmwave_master_xpm, wmwave_mask_bits, wmwave_mask_width, wmwave_mask_height);
|
||||
-
|
||||
- RedrawWindow();
|
||||
-
|
||||
-
|
||||
- while (1) {
|
||||
-
|
||||
- curtime = time(0);
|
||||
-
|
||||
- if (1) {
|
||||
- memcpy(&last, &tv, sizeof(tv));
|
||||
-
|
||||
- /*
|
||||
- * Update display
|
||||
- */
|
||||
- DisplayWireless();
|
||||
-
|
||||
- RedrawWindow();
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * X Events
|
||||
- */
|
||||
- while (XPending(display)) {
|
||||
- XNextEvent(display, &Event);
|
||||
- switch (Event.type) {
|
||||
- case Expose:
|
||||
+ XEvent Event;
|
||||
+ struct timeval tv={0,0};
|
||||
+ struct timeval last={0,0};
|
||||
+
|
||||
+ createXBMfromXPM(wmwave_mask_bits, wmwave_master_xpm, wmwave_mask_width, wmwave_mask_height);
|
||||
+
|
||||
+ openXwindow(argc, argv, wmwave_master_xpm, wmwave_mask_bits, wmwave_mask_width, wmwave_mask_height);
|
||||
+
|
||||
RedrawWindow();
|
||||
- break;
|
||||
- case DestroyNotify:
|
||||
- XCloseDisplay(display);
|
||||
- exit(0);
|
||||
- case ButtonPress:
|
||||
- switch (screen) {
|
||||
- case 0: screen=1; break;
|
||||
- case 1: screen=0; break;
|
||||
- };
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- usleep(update_rate);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * Blits a string at given co-ordinates
|
||||
- */
|
||||
+
|
||||
+ while (1) {
|
||||
+ curtime = time(0);
|
||||
+ memcpy(&last, &tv, sizeof(tv));
|
||||
+
|
||||
+ /* Update display */
|
||||
+ DisplayWireless();
|
||||
+ RedrawWindow();
|
||||
+
|
||||
+ /* X Events */
|
||||
+ while (XPending(display)) {
|
||||
+ XNextEvent(display, &Event);
|
||||
+ switch (Event.type) {
|
||||
+ case Expose:
|
||||
+ RedrawWindow();
|
||||
+ break;
|
||||
+ case DestroyNotify:
|
||||
+ XCloseDisplay(display);
|
||||
+ exit(0);
|
||||
+ case ButtonPress:
|
||||
+ switch (screen) {
|
||||
+ case 0: screen=1; break;
|
||||
+ case 1: screen=0; break;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ usleep(update_rate);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* Blits a string at given co-ordinates */
|
||||
void BlitString(char *name, int x, int y) {
|
||||
- int i;
|
||||
- int c;
|
||||
- int k;
|
||||
-
|
||||
- k = x;
|
||||
- for (i=0; name[i]; i++)
|
||||
- {
|
||||
-
|
||||
- c = toupper(name[i]);
|
||||
- if (c >= 'A' && c <= 'Z')
|
||||
- { // its a letter
|
||||
- c -= 'A';
|
||||
- copyXPMArea(c * 6, 74, 6, 8, k, y);
|
||||
- k += 6;
|
||||
- } else
|
||||
- if (c>='0' && c<='9') { // its a number or symbol
|
||||
- c -= '0';
|
||||
- copyXPMArea(c * 6, 64, 6, 8, k, y);
|
||||
- k += 6;
|
||||
- } else {
|
||||
- copyXPMArea(5, 84, 6, 8, k, y);
|
||||
- k += 6;
|
||||
-
|
||||
- }
|
||||
- }
|
||||
+ int i;
|
||||
+ int c;
|
||||
+ int k;
|
||||
+
|
||||
+ k = x;
|
||||
+ for (i=0; name[i]; i++) {
|
||||
+ c = toupper(name[i]);
|
||||
+ if (c >= 'A' && c <= 'Z') {
|
||||
+ // its a letter
|
||||
+ c -= 'A';
|
||||
+ copyXPMArea(c * 6, 74, 6, 8, k, y);
|
||||
+ k += 6;
|
||||
+ } else if (c >= '0' && c <= '9') {
|
||||
+ // its a number or symbol
|
||||
+ c -= '0';
|
||||
+ copyXPMArea(c * 6, 64, 6, 8, k, y);
|
||||
+ k += 6;
|
||||
+ } else {
|
||||
+ copyXPMArea(5, 84, 6, 8, k, y);
|
||||
+ k += 6;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
void BlitNum(int num, int x, int y) {
|
||||
- char buf[1024];
|
||||
- int newx=x;
|
||||
-
|
||||
- sprintf(buf, "%03i", num);
|
||||
-
|
||||
- BlitString(buf, newx, y);
|
||||
+ char buf[1024];
|
||||
+ int newx = x;
|
||||
+
|
||||
+ sprintf(buf, "%03i", num);
|
||||
+
|
||||
+ BlitString(buf, newx, y);
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Usage
|
||||
- */
|
||||
+/* Usage */
|
||||
void usage(void) {
|
||||
- fprintf(stderr, "\nWmwave - Carsten Schuermann <carsten@schuermann.org> http://www.schuermann.org/~dockapps\n\n");
|
||||
- fprintf(stderr, "usage:\n");
|
||||
- fprintf(stderr, " -display <display name>\n");
|
||||
- fprintf(stderr, " -r update rate in milliseconds (default:100)\n");
|
||||
- fprintf(stderr, "\n");
|
||||
+ fprintf(stderr, "\nWmwave - Carsten Schuermann <carsten@schuermann.org>\n");
|
||||
+ fprintf(stderr, " http://www.schuermann.org/~dockapps\n\n");
|
||||
+ fprintf(stderr, "usage:\n");
|
||||
+ fprintf(stderr, " -display <display name>\n");
|
||||
+ fprintf(stderr, " -r update rate in milliseconds (default:100)\n");
|
||||
+ fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
-/*
|
||||
- * printversion
|
||||
- */
|
||||
+/* printversion */
|
||||
void printversion(void) {
|
||||
- fprintf(stderr, "wmwave v%s\n", WMWAVE_VERSION);
|
||||
+ fprintf(stderr, "wmwave v%s\n", WMWAVE_VERSION);
|
||||
+}
|
||||
+
|
||||
+static void wi_getval(wreq)
|
||||
+ struct wi_req *wreq;
|
||||
+{
|
||||
+ struct ifreq ifr;
|
||||
+ int s;
|
||||
+
|
||||
+ bzero((char *)&ifr, sizeof(ifr));
|
||||
+
|
||||
+ strcpy(ifr.ifr_name, WI_INTERFACE);
|
||||
+ ifr.ifr_data = (caddr_t)wreq;
|
||||
+
|
||||
+ s = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
+
|
||||
+ if (s == -1)
|
||||
+ err(1, "socket");
|
||||
+
|
||||
+ if (ioctl(s, SIOCGWAVELAN, &ifr) == -1) {
|
||||
+ mode = 0;
|
||||
+ } else {
|
||||
+ mode = 1;
|
||||
+ }
|
||||
+
|
||||
+ close(s);
|
||||
+ return;
|
||||
}
|
1
net/wmwave/pkg/COMMENT
Normal file
1
net/wmwave/pkg/COMMENT
Normal file
@ -0,0 +1 @@
|
||||
Window Maker dockapp to display wavelan statistics
|
4
net/wmwave/pkg/DESCR
Normal file
4
net/wmwave/pkg/DESCR
Normal file
@ -0,0 +1,4 @@
|
||||
wmwave is a Window Maker dockapp to display statistical
|
||||
information about a current wireless ethernet connection.
|
||||
|
||||
WWW: ${HOMEPAGE}
|
3
net/wmwave/pkg/PLIST
Normal file
3
net/wmwave/pkg/PLIST
Normal file
@ -0,0 +1,3 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/03/14 14:10:50 wilfried Exp $
|
||||
bin/wmwave
|
||||
man/man1/wmwave.1
|
Loading…
Reference in New Issue
Block a user