1: 
   2: /*
   3:  * Hyperchannel Log Printer
   4:  *
   5:  * Copyright (c) 1983, Tektronix Inc.
   6:  * All Rights Reserved
   7:  *
   8:  */
   9: 
  10: 
  11: char _rcsid[] = "$Header$$Locker$";
  12: 
  13: #define ok(x) (((int)(x)) & 0x7fffffff)
  14: #define HYELOG
  15: 
  16: #include <stdio.h>
  17: #include <nlist.h>
  18: #include <sys/types.h>
  19: #include <sys/socket.h>
  20: #include <sys/ioctl.h>
  21: #include <netinet/in.h>
  22: #include <net/if.h>
  23: #include <vaxif/if_hyreg.h>
  24: #include <vaxif/if_hy.h>
  25: 
  26: struct nlist nl[2] = {
  27:     { "_hy_elog" },
  28:     { 0 }
  29: };
  30: 
  31: u_long hy_elog[HYE_SIZE];
  32: 
  33: char *hye_code[] = {
  34:     "message code 0 - INVALID",     /* 00 */
  35:     "adapter rcv data from trunk",      /* 01 */
  36:     "bad message length",           /* 02 */
  37:     "no space for message",         /* 03 */
  38:     "to port marked down",          /* 04 */
  39:     "no space for assoc data",      /* 05 */
  40:     "assoc data too big",           /* 06 */
  41:     "illegal function code",        /* 07 */
  42:     "message code 8 - INVALID",     /* 08 */
  43:     "message code 9 - INVALID",     /* 09 */
  44:     "not enough parameters",        /* 0A */
  45:     "too many parameters",          /* 0B */
  46:     "not enough data send to adapter",  /* 0C */
  47:     "too much data sent to adapter",    /* 0D */
  48:     "not all data read from buffer",    /* 0E */
  49:     "host tried to read too much data", /* 0F */
  50:     "no messages queued for this port", /* 10 */
  51:     "host master cleared during xfer",  /* 11 */
  52:     "host quit early",          /* 12 */
  53:     "parity error from arapter to host",    /* 13 */
  54:     "trunk transmission aborted",       /* 14 */
  55:     "device reserved to this adapter",  /* 15 */
  56:     "trunk xmit retry counter expired", /* 16 */
  57:     "other adapter didn't send assoc data", /* 17 */
  58:     "message code out of range"     /* 18 */
  59: };
  60: 
  61: 
  62: main()
  63: {
  64:     register unsigned char *p, *ep;
  65:     register unsigned i;
  66:     int mem;
  67: 
  68:     nlist("/vmunix", nl);
  69:     if (nl[0].n_type == 0)
  70:         done("No namelist\n");
  71:     if ((mem = open("/dev/kmem", 0)) < 0)
  72:         done("Can't oper /dev/kmem\n");
  73:     lseek(mem, (long)nl[0].n_value, 0);
  74:     read(mem, hy_elog, sizeof(hy_elog));
  75: 
  76:     printf("Error	Other	XMITMSG	LSTDATA	LOCMSG	Error Description\n");
  77:     for (i = 0; i <= HYE_MAX; i++) {
  78:         printf("%02x	%6d	%6d	%6d	%6d - %s\n", i,
  79:             hy_elog[i],
  80:             hy_elog[i + (HYE_MAX+1)],
  81:             hy_elog[i + 2*(HYE_MAX+1)],
  82:             hy_elog[i + 3*(HYE_MAX+1)],
  83:             hye_code[i]);
  84:     }
  85: }
  86: 
  87: done(s, p)
  88:     char *s;
  89:     int p;
  90: {
  91:     fprintf(stderr, s, &p);
  92:     exit(1);
  93: }

Defined functions

done defined in line 87; used 2 times
main defined in line 62; never used

Defined variables

_rcsid defined in line 11; never used
hye_code defined in line 33; used 1 times
  • in line 83
nl defined in line 26; used 3 times

Defined macros

HYELOG defined in line 14; never used
ok defined in line 13; never used
Last modified: 1984-05-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 988
Valid CSS Valid XHTML 1.0 Strict