fix gethostname() length parameter type.
[unix-history] / usr / src / old / implog / implog.c
index cfeb1d1..bb94768 100644 (file)
@@ -1,15 +1,19 @@
-/*     implog.c        4.1     82/04/04        */
+#ifndef lint
+static char sccsid[] = "@(#)implog.c   4.4 (Berkeley) %G%";
+#endif
 
 #include <stdio.h>
 
 #include <stdio.h>
-#include <time.h>
 #include <signal.h>
 #include <sgtty.h>
 #include <signal.h>
 #include <sgtty.h>
+
+#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
-#include <net/in.h>
+
+#include <netinet/in.h>
 #define        IMPLEADERS
 #define        IMPLEADERS
-#include <net/if_imp.h>
+#include <netimp/if_imp.h>
 
 #define        min(a, b)       ((a) < (b) ? (a) : (b))
 
 
 #define        min(a, b)       ((a) < (b) ? (a) : (b))
 
@@ -102,7 +106,7 @@ main(argc, argv)
                        argv++, argc--;;
                        continue;
                }
                        argv++, argc--;;
                        continue;
                }
-               printf("usage: prlog [ -D ] [ -c ] [ -f ] [-h #] [-i #] [ -t # ] [-l [#]] [logfile]\n");
+               printf("usage: implog [ -D ] [ -c ] [ -f ] [-h #] [-i #] [ -t # ] [-l [#]] [logfile]\n");
                exit(2);
        }
        if (argc > 0)
                exit(2);
        }
        if (argc > 0)
@@ -185,9 +189,7 @@ process(l, f)
                return;
        }
        ip = (struct imp_leader *)buf;
                return;
        }
        ip = (struct imp_leader *)buf;
-#if vax
-       ip->il_imp = ntohs(ip->il_imp);
-#endif
+       ip->il_imp = ntohs((u_short)ip->il_imp);
        for (mp = mtypes; mp->m_type != -1; mp++)
                if (mp->m_type == ip->il_mtype)
                        break;
        for (mp = mtypes; mp->m_type != -1; mp++)
                if (mp->m_type == ip->il_mtype)
                        break;
@@ -206,12 +208,12 @@ process(l, f)
 impdata(ip, cc)
        register struct imp_leader *ip;
 {
 impdata(ip, cc)
        register struct imp_leader *ip;
 {
-       printf("<%d/%d, DATA, link=", ip->il_host, ntohs(ip->il_imp));
+       printf("<%d/%d, DATA, link=", ip->il_host, ntohs((u_short)ip->il_imp));
        if (ip->il_link == IMPLINK_IP)
                printf("ip,");
        else
                printf("%d,", ip->il_link);
        if (ip->il_link == IMPLINK_IP)
                printf("ip,");
        else
                printf("%d,", ip->il_link);
-       printf(" len=%d bytes>\n", ntohs(ip->il_length) >> 3);
+       printf(" len=%d bytes>\n", ntohs((u_short)ip->il_length) >> 3);
        if (showcontents) {
                register u_char *cp = ((u_char *)ip) + sizeof(*ip);
                register int i;
        if (showcontents) {
                register u_char *cp = ((u_char *)ip) + sizeof(*ip);
                register int i;
@@ -272,7 +274,8 @@ impdown(ip)
 impnoop(ip)
        register struct imp_leader *ip;
 {
 impnoop(ip)
        register struct imp_leader *ip;
 {
-       printf("noop: host %d, imp %d\n", ip->il_host, ntohs(ip->il_imp));
+       printf("noop: host %d, imp %d\n", ip->il_host,
+               ntohs((u_short)ip->il_imp));
 }
 
 imprfnm(ip)
 }
 
 imprfnm(ip)
@@ -288,7 +291,7 @@ imprfnm(ip)
 }
 
 char *hostdead[] = {
 }
 
 char *hostdead[] = {
-       "???",
+       "#0",
        "ready-line negated",
        "tardy receiving messages",
        "ncc doesn't know host",
        "ready-line negated",
        "tardy receiving messages",
        "ncc doesn't know host",
@@ -301,8 +304,8 @@ char *hostdead[] = {
        "host stopped at a breakpoint",
        "host down due to hardware failure",
        "host not scheduled to be up",
        "host stopped at a breakpoint",
        "host down due to hardware failure",
        "host not scheduled to be up",
-       "???",
-       "???",
+       "#13",
+       "#14",
        "host in the process of coming up"
 };
 
        "host in the process of coming up"
 };
 
@@ -393,8 +396,8 @@ impretry(ip)
 }
 
 char *notify[] = {
 }
 
 char *notify[] = {
-       "???",
-       "???",
+       "#0",
+       "#1",
        "connection not available",
        "reassembly space not available at destination",
        "message number not available",
        "connection not available",
        "reassembly space not available at destination",
        "message number not available",