date and time created 83/02/11 15:45:10 by rrh
[unix-history] / usr / src / usr.bin / netstat / route.c
index 0a2a6b4..220a2c2 100644 (file)
@@ -1,14 +1,16 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)route.c    4.2 82/10/05";
+static char sccsid[] = "@(#)route.c    4.5 82/11/14";
 #endif
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/mbuf.h>
 #endif
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/mbuf.h>
+
 #include <net/if.h>
 #include <net/if.h>
-#include <net/in.h>
 #define        KERNEL          /* to get routehash and RTHASHSIZ */
 #include <net/route.h>
 #define        KERNEL          /* to get routehash and RTHASHSIZ */
 #include <net/route.h>
+#include <netinet/in.h>
+
 #include <netdb.h>
 
 extern int kmem;
 #include <netdb.h>
 
 extern int kmem;
@@ -109,18 +111,19 @@ routename(in)
        static char line[50];
        int lna, net;
 
        static char line[50];
        int lna, net;
 
-       net = in_netof(in);
-       lna = in_lnaof(in);
+       net = inet_netof(in);
+       lna = inet_lnaof(in);
        if (!nflag) {
                if (lna == INADDR_ANY) {
        if (!nflag) {
                if (lna == INADDR_ANY) {
-                       struct netent *np = getnetbyaddr(net);
+                       struct netent *np = getnetbyaddr(net, AF_INET);
 
                        if (np)
                                cp = np->n_name;
                } else {
                        struct hostent *hp;
 
 
                        if (np)
                                cp = np->n_name;
                } else {
                        struct hostent *hp;
 
-                       hp = gethostbyaddr(&in, sizeof (struct in_addr));
+                       hp = gethostbyaddr(&in, sizeof (struct in_addr),
+                               AF_INET);
                        if (hp)
                                cp = hp->h_name;
                }
                        if (hp)
                                cp = hp->h_name;
                }