new library routines
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 6 Oct 1982 14:18:13 +0000 (06:18 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 6 Oct 1982 14:18:13 +0000 (06:18 -0800)
SCCS-vsn: usr.bin/netstat/inet.c 4.2
SCCS-vsn: usr.bin/netstat/route.c 4.2

usr/src/usr.bin/netstat/inet.c
usr/src/usr.bin/netstat/route.c

index 14fe7e8..bc1be27 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)inet.c     4.1 82/08/25";
+static char sccsid[] = "@(#)inet.c     4.2 82/10/05";
 #endif
 
 #include <sys/types.h>
 #endif
 
 #include <sys/types.h>
@@ -115,7 +115,7 @@ inetprint(in, port, proto)
        port = ntohs((u_short)port);
 #endif
        if (!nflag && port)
        port = ntohs((u_short)port);
 #endif
        if (!nflag && port)
-               sp = getservport(port, proto);
+               sp = getservbyport(port, proto);
        if (sp || port == 0)
                sprintf(cp, "%.8s", sp ? sp->s_name : "*");
        else
        if (sp || port == 0)
                sprintf(cp, "%.8s", sp ? sp->s_name : "*");
        else
@@ -178,13 +178,14 @@ inetname(in)
 
        if (!nflag) {
                if (in_lnaof(in) == INADDR_ANY) {
 
        if (!nflag) {
                if (in_lnaof(in) == INADDR_ANY) {
-                       struct netent *np = getnetaddr(in_netof(in));
+                       struct netent *np = getnetbyaddr(in_netof(in));
 
                        if (np)
                                cp = np->n_name;
                } else {
 
                        if (np)
                                cp = np->n_name;
                } else {
-                       struct hostent *hp = gethostaddr(in.s_addr);
+                       struct hostent *hp;
 
 
+                       hp = gethostbyaddr(&in, sizeof (struct in_addr));
                        if (hp)
                                cp = hp->h_name;
                }
                        if (hp)
                                cp = hp->h_name;
                }
index b596659..0a2a6b4 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)route.c    4.1 82/08/25";
+static char sccsid[] = "@(#)route.c    4.2 82/10/05";
 #endif
 
 #include <sys/types.h>
 #endif
 
 #include <sys/types.h>
@@ -113,13 +113,14 @@ routename(in)
        lna = in_lnaof(in);
        if (!nflag) {
                if (lna == INADDR_ANY) {
        lna = in_lnaof(in);
        if (!nflag) {
                if (lna == INADDR_ANY) {
-                       struct netent *np = getnetaddr(net);
+                       struct netent *np = getnetbyaddr(net);
 
                        if (np)
                                cp = np->n_name;
                } else {
 
                        if (np)
                                cp = np->n_name;
                } else {
-                       struct hostent *hp = gethostaddr(in.s_addr);
+                       struct hostent *hp;
 
 
+                       hp = gethostbyaddr(&in, sizeof (struct in_addr));
                        if (hp)
                                cp = hp->h_name;
                }
                        if (hp)
                                cp = hp->h_name;
                }