BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / systat / netcmds.c
index 7e96ec9..7478a42 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)netcmds.c  5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)netcmds.c  5.4 (Berkeley) 4/11/90";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -21,6 +21,7 @@ static char sccsid[] = "@(#)netcmds.c 5.1 (Berkeley) %G%";
 
 #include <net/route.h>
 #include <netinet/in_systm.h>
 
 #include <net/route.h>
 #include <netinet/in_systm.h>
+#include <netinet/ip.h>
 #include <netinet/in_pcb.h>
 
 #define        streq(a,b)      (strcmp(a,b)==0)
 #include <netinet/in_pcb.h>
 
 #define        streq(a,b)      (strcmp(a,b)==0)
@@ -70,7 +71,6 @@ changeitems(args, onoff)
        int onoff;
 {
        register char *cp;
        int onoff;
 {
        register char *cp;
-       register int i;
        struct servent *sp;
        struct hostent *hp;
        struct in_addr in;
        struct servent *sp;
        struct hostent *hp;
        struct in_addr in;
@@ -92,7 +92,7 @@ changeitems(args, onoff)
                sp = getservbyname(args,
                    protos == TCP ? "tcp" : protos == UDP ? "udp" : 0);
                if (sp) {
                sp = getservbyname(args,
                    protos == TCP ? "tcp" : protos == UDP ? "udp" : 0);
                if (sp) {
-                       selectport(sp->s_name, onoff);
+                       selectport(sp->s_port, onoff);
                        continue;
                }
                hp = gethostbyname(args);
                        continue;
                }
                hp = gethostbyname(args);
@@ -145,7 +145,7 @@ selectport(port, onoff)
        long port;
        int onoff;
 {
        long port;
        int onoff;
 {
-       register struct pitem *p, *open;
+       register struct pitem *p;
 
        if (port == -1) {
                if (ports == 0)
 
        if (port == -1) {
                if (ports == 0)
@@ -154,7 +154,6 @@ selectport(port, onoff)
                nports = 0;
                return (1);
        }
                nports = 0;
                return (1);
        }
-       open = 0;
        for (p = ports; p < ports+nports; p++)
                if (p->port == port) {
                        p->onoff = onoff;
        for (p = ports; p < ports+nports; p++)
                if (p->port == port) {
                        p->onoff = onoff;