Home | History | Annotate | Line # | Download | only in common
print.c revision 1.5
      1 /*	$NetBSD: print.c,v 1.5 2009/10/20 00:51:13 snj Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1993-96 Mats O Jansson.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25  */
     26 
     27 #include <sys/cdefs.h>
     28 #ifndef lint
     29 __RCSID("$NetBSD: print.c,v 1.5 2009/10/20 00:51:13 snj Exp $");
     30 #endif
     31 
     32 #include <sys/types.h>
     33 #include <stdio.h>
     34 
     35 #include "os.h"
     36 #include "cmp.h"
     37 #include "get.h"
     38 #include "mopdef.h"
     39 #include "nma.h"
     40 #include "nmadef.h"
     41 #include "print.h"
     42 
     43 #define SHORT_PRINT
     44 
     45 void
     46 mopPrintHWA(fd, ap)
     47 	FILE	*fd;
     48         u_char *ap;
     49 {
     50 	(void)fprintf(fd, "%x:%x:%x:%x:%x:%x",
     51 		      ap[0],ap[1],ap[2],ap[3],ap[4],ap[5]);
     52 	if (ap[0] < 10) (void)fprintf(fd, " ");
     53 	if (ap[1] < 10) (void)fprintf(fd, " ");
     54 	if (ap[2] < 10) (void)fprintf(fd, " ");
     55 	if (ap[3] < 10) (void)fprintf(fd, " ");
     56 	if (ap[4] < 10) (void)fprintf(fd, " ");
     57 	if (ap[5] < 10) (void)fprintf(fd, " ");
     58 }
     59 
     60 void
     61 mopPrintBPTY(fd, bpty)
     62 	FILE	*fd;
     63 	u_char 	bpty;
     64 {
     65 	switch(bpty) {
     66 	case MOP_K_BPTY_SYS:
     67 		(void)fprintf(fd, "System Processor");
     68 		break;
     69 	case MOP_K_BPTY_COM:
     70 		(void)fprintf(fd, "Communication Processor");
     71 		break;
     72 	default:
     73 		(void)fprintf(fd, "Unknown");
     74 		break;
     75 	};
     76 };
     77 
     78 void
     79 mopPrintPGTY(fd, pgty)
     80 	FILE	*fd;
     81 	u_char 	pgty;
     82 {
     83 	switch(pgty) {
     84 	case MOP_K_PGTY_SECLDR:
     85 		(void)fprintf(fd, "Secondary Loader");
     86 		break;
     87 	case MOP_K_PGTY_TERLDR:
     88 		(void)fprintf(fd, "Tertiary Loader");
     89 		break;
     90 	case MOP_K_PGTY_OPRSYS:
     91 		(void)fprintf(fd, "Operating System");
     92 		break;
     93 	case MOP_K_PGTY_MGNTFL:
     94 		(void)fprintf(fd, "Management File");
     95 		break;
     96 	default:
     97 		(void)fprintf(fd, "Unknown");
     98 		break;
     99 	};
    100 }
    101 
    102 void
    103 mopPrintOneline(fd, pkt, trans)
    104 	FILE	*fd;
    105 	u_char	*pkt;
    106 	int	 trans;
    107 {
    108 	int	 idx = 0;
    109 	u_char	*dst, *src, code;
    110 	u_short	 proto;
    111 	int	 len;
    112 
    113 	trans = mopGetTrans(pkt, trans);
    114 	mopGetHeader(pkt, &idx, &dst, &src, &proto, &len, trans);
    115 	code = mopGetChar(pkt, &idx);
    116 
    117 	switch (proto) {
    118 	case MOP_K_PROTO_DL:
    119 		(void)fprintf(fd, "MOP DL ");
    120 		break;
    121 	case MOP_K_PROTO_RC:
    122 		(void)fprintf(fd, "MOP RC ");
    123 		break;
    124 	case MOP_K_PROTO_LP:
    125 		(void)fprintf(fd, "MOP LP ");
    126 		break;
    127 	default:
    128 		switch((proto % 256)*256 + (proto / 256)) {
    129 		case MOP_K_PROTO_DL:
    130 			(void)fprintf(fd, "MOP DL ");
    131 			proto = MOP_K_PROTO_DL;
    132 			break;
    133 		case MOP_K_PROTO_RC:
    134 			(void)fprintf(fd, "MOP RC ");
    135 			proto = MOP_K_PROTO_RC;
    136 			break;
    137 		case MOP_K_PROTO_LP:
    138 			(void)fprintf(fd, "MOP LP ");
    139 			proto = MOP_K_PROTO_LP;
    140 			break;
    141 		default:
    142 			(void)fprintf(fd, "MOP ?? ");
    143 			break;
    144 		}
    145 	}
    146 
    147 	if (trans == TRANS_8023) {
    148 		(void)fprintf(fd, "802.3 ");
    149 	}
    150 
    151 	mopPrintHWA(fd, src); (void)fprintf(fd," > ");
    152 	mopPrintHWA(fd, dst);
    153 	if (len < 1600) {
    154         	(void)fprintf(fd, " len %4d code %02x ",len,code);
    155 	} else {
    156 		(void)fprintf(fd, " len %4d code %02x ",
    157 			      (len % 256)*256 + (len /256), code);
    158 	}
    159 
    160 	switch (proto) {
    161 	case MOP_K_PROTO_DL:
    162         	switch (code) {
    163 		case MOP_K_CODE_MLT:
    164 			(void)fprintf(fd, "MLT ");
    165 			break;
    166 		case MOP_K_CODE_DCM:
    167 			(void)fprintf(fd, "DCM ");
    168 			break;
    169 		case MOP_K_CODE_MLD:
    170 			(void)fprintf(fd, "MLD ");
    171 			break;
    172 		case MOP_K_CODE_ASV:
    173 			(void)fprintf(fd, "ASV ");
    174 			break;
    175 		case MOP_K_CODE_RMD:
    176 			(void)fprintf(fd, "RMD ");
    177 			break;
    178 		case MOP_K_CODE_RPR:
    179 			(void)fprintf(fd, "RPR ");
    180 			break;
    181 		case MOP_K_CODE_RML:
    182 			(void)fprintf(fd, "RML ");
    183 			break;
    184 	        case MOP_K_CODE_RDS:
    185 			(void)fprintf(fd, "RDS ");
    186 			break;
    187 		case MOP_K_CODE_MDD:
    188 			(void)fprintf(fd, "MDD ");
    189 			break;
    190 		case MOP_K_CODE_PLT:
    191 			(void)fprintf(fd, "PLT ");
    192 			break;
    193 	        default:
    194 			(void)fprintf(fd, "??? ");
    195 			break;
    196 		}
    197 		break;
    198 	case MOP_K_PROTO_RC:
    199 		switch (code) {
    200 		case MOP_K_CODE_RID:
    201 			(void)fprintf(fd, "RID ");
    202 			break;
    203 		case MOP_K_CODE_BOT:
    204 			(void)fprintf(fd, "BOT ");
    205 			break;
    206 		case MOP_K_CODE_SID:
    207 			(void)fprintf(fd, "SID ");
    208 			break;
    209 		case MOP_K_CODE_RQC:
    210 			(void)fprintf(fd, "RQC ");
    211 			break;
    212 		case MOP_K_CODE_CNT:
    213 			(void)fprintf(fd, "CNT ");
    214 			break;
    215 		case MOP_K_CODE_RVC:
    216 			(void)fprintf(fd, "RVC ");
    217 			break;
    218 		case MOP_K_CODE_RLC:
    219 			(void)fprintf(fd, "RLC ");
    220 			break;
    221 		case MOP_K_CODE_CCP:
    222 			(void)fprintf(fd, "CCP ");
    223 			break;
    224 		case MOP_K_CODE_CRA:
    225 			(void)fprintf(fd, "CRA ");
    226 			break;
    227 		default:
    228 			(void)fprintf(fd, "??? ");
    229 			break;
    230 		}
    231 		break;
    232 	case MOP_K_PROTO_LP:
    233 		switch (code) {
    234 		case MOP_K_CODE_ALD:
    235 			(void)fprintf(fd, "ALD ");
    236 			break;
    237 		case MOP_K_CODE_PLD:
    238 			(void)fprintf(fd, "PLD ");
    239 			break;
    240 		default:
    241 			(void)fprintf(fd, "??? ");
    242 			break;
    243 		}
    244 		break;
    245 	default:
    246 		(void)fprintf(fd, "??? ");
    247 		break;
    248 	}
    249 	(void)fprintf(fd, "\n");
    250 }
    251 
    252 void
    253 mopPrintHeader(fd, pkt, trans)
    254 	FILE	*fd;
    255 	u_char	*pkt;
    256 	int	 trans;
    257 {
    258 	u_char	*dst, *src;
    259 	u_short	 proto;
    260 	int	 len, idx = 0;
    261 
    262 	trans = mopGetTrans(pkt, trans);
    263 	mopGetHeader(pkt, &idx, &dst, &src, &proto, &len, trans);
    264 
    265 	(void)fprintf(fd,"\nDst          : ");
    266 	mopPrintHWA(fd, dst);
    267 	if (mopCmpEAddr(dl_mcst,dst) == 0) {
    268 		(void)fprintf(fd," MOP Dump/Load Multicast");
    269 	};
    270 	if (mopCmpEAddr(rc_mcst,dst) == 0) {
    271 		(void)fprintf(fd," MOP Remote Console Multicast");
    272 	};
    273 	(void)fprintf(fd,"\n");
    274 
    275 	(void)fprintf(fd,"Src          : ");
    276 	mopPrintHWA(fd, src);
    277 	(void)fprintf(fd,"\n");
    278 	(void)fprintf(fd,"Proto        : %04x ",proto);
    279 	switch (proto) {
    280 	case MOP_K_PROTO_DL:
    281 		switch (trans) {
    282 		case TRANS_8023:
    283 			(void)fprintf(fd, "MOP Dump/Load (802.3)\n");
    284 			break;
    285 		default:
    286 			(void)fprintf(fd, "MOP Dump/Load\n");
    287 		}
    288 		break;
    289 	case MOP_K_PROTO_RC:
    290 		switch (trans) {
    291 		case TRANS_8023:
    292 			(void)fprintf(fd, "MOP Remote Console (802.3)\n");
    293 			break;
    294 		default:
    295 			(void)fprintf(fd, "MOP Remote Console\n");
    296 		}
    297 		break;
    298 	case MOP_K_PROTO_LP:
    299 		switch (trans) {
    300 		case TRANS_8023:
    301 			(void)fprintf(fd, "MOP Loopback (802.3)\n");
    302 			break;
    303 		default:
    304 			(void)fprintf(fd, "MOP Loopback\n");
    305 		}
    306 		break;
    307 	default:
    308 		(void)fprintf(fd, "\n");
    309 		break;
    310 	}
    311 
    312 
    313         (void)fprintf(fd,"Length       : %04x (%d)\n",len,len);
    314 }
    315 
    316 void
    317 mopPrintMopHeader(fd, pkt, trans)
    318 	FILE	*fd;
    319 	u_char	*pkt;
    320 	int	 trans;
    321 {
    322 	u_char	*dst, *src;
    323 	u_short	 proto;
    324 	int	 len, idx = 0;
    325 	u_char   code;
    326 
    327 	trans = mopGetTrans(pkt, trans);
    328 	mopGetHeader(pkt, &idx, &dst, &src, &proto, &len, trans);
    329 
    330 	code = mopGetChar(pkt, &idx);
    331 
    332 	(void)fprintf(fd, "Code         :   %02x ",code);
    333 
    334 	switch (proto) {
    335 	case MOP_K_PROTO_DL:
    336 		switch (code) {
    337 		case MOP_K_CODE_MLT:
    338 			(void)fprintf(fd,
    339 				      "Memory Load with transfer address\n");
    340 			break;
    341 		case MOP_K_CODE_DCM:
    342 			(void)fprintf(fd, "Dump Complete\n");
    343 			break;
    344 		case MOP_K_CODE_MLD:
    345 			(void)fprintf(fd, "Memory Load\n");
    346 			break;
    347 		case MOP_K_CODE_ASV:
    348 			(void)fprintf(fd, "Assistance volunteer\n");
    349 			break;
    350 		case MOP_K_CODE_RMD:
    351 			(void)fprintf(fd, "Request memory dump\n");
    352 			break;
    353 		case MOP_K_CODE_RPR:
    354 			(void)fprintf(fd, "Request program\n");
    355 			break;
    356 		case MOP_K_CODE_RML:
    357 			(void)fprintf(fd, "Request memory load\n");
    358 			break;
    359 		case MOP_K_CODE_RDS:
    360 			(void)fprintf(fd, "Request Dump Service\n");
    361 			break;
    362 		case MOP_K_CODE_MDD:
    363 			(void)fprintf(fd, "Memory dump data\n");
    364 			break;
    365 		case MOP_K_CODE_PLT:
    366 			(void)fprintf(fd,
    367 				      "Parameter load with transfer addres\n");
    368 			break;
    369 		default:
    370 			(void)fprintf(fd, "(unknown)\n");
    371 			break;
    372 		}
    373 		break;
    374 	case MOP_K_PROTO_RC:
    375 		switch (code) {
    376 		case MOP_K_CODE_RID:
    377 			(void)fprintf(fd, "Request ID\n");
    378 			break;
    379 		case MOP_K_CODE_BOT:
    380 			(void)fprintf(fd, "Boot\n");
    381 			break;
    382 		case MOP_K_CODE_SID:
    383 			(void)fprintf(fd, "System ID\n");
    384 			break;
    385 		case MOP_K_CODE_RQC:
    386 			(void)fprintf(fd, "Request Counters\n");
    387 			break;
    388 		case MOP_K_CODE_CNT:
    389 			(void)fprintf(fd, "Counters\n");
    390 			break;
    391 		case MOP_K_CODE_RVC:
    392 			(void)fprintf(fd, "Reserve Console\n");
    393 			break;
    394 		case MOP_K_CODE_RLC:
    395 			(void)fprintf(fd, "Release Console\n");
    396 			break;
    397 		case MOP_K_CODE_CCP:
    398 			(void)fprintf(fd, "Console Command and Poll\n");
    399 			break;
    400 		case MOP_K_CODE_CRA:
    401 			(void)fprintf(fd,
    402 				      "Console Response and Acknnowledge\n");
    403 			break;
    404 		default:
    405 			(void)fprintf(fd, "(unknown)\n");
    406 			break;
    407 		}
    408 		break;
    409 	case MOP_K_PROTO_LP:
    410 		switch (code) {
    411 		case MOP_K_CODE_ALD:
    412 			(void)fprintf(fd, "Active loop data\n");
    413 			break;
    414 		case MOP_K_CODE_PLD:
    415 			(void)fprintf(fd, "Passive looped data\n");
    416 			break;
    417 		default:
    418 			(void)fprintf(fd, "(unknown)\n");
    419 			break;
    420 		}
    421 		break;
    422 	default:
    423 		(void)fprintf(fd, "(unknown)\n");
    424 		break;
    425 	}
    426 }
    427 
    428 void
    429 mopPrintDevice(fd, device)
    430 	FILE	*fd;
    431         u_char device;
    432 {
    433 	const char	*sname, *name;
    434 
    435 	sname = nmaGetShort((int) device);
    436 	name  = nmaGetDevice((int) device);
    437 
    438         (void)fprintf(fd, "%s '%s'",sname,name);
    439 }
    440 
    441 void
    442 mopPrintTime(fd, ap)
    443 	FILE	*fd;
    444         u_char *ap;
    445 {
    446 	(void)fprintf(fd,
    447 		      "%04d-%02d-%02d %02d:%02d:%02d.%02d %d:%02d",
    448 		      ap[0]*100 + ap[1],
    449 		      ap[2],ap[3],ap[4],ap[5],ap[6],ap[7],ap[8],ap[9]);
    450 }
    451 
    452 void
    453 mopPrintInfo(fd, pkt, idx, moplen, mopcode, trans)
    454 	FILE	*fd;
    455 	u_char  *pkt, mopcode;
    456 	int     *idx, trans;
    457 	u_short moplen;
    458 {
    459         u_short itype,tmps;
    460 	u_char  ilen ,tmpc,device;
    461 	u_char  uc1,uc2,uc3,*ucp;
    462 	int     i;
    463 
    464 	device = 0;
    465 
    466 	switch(trans) {
    467 	case TRANS_ETHER:
    468 		moplen = moplen + 16;
    469 		break;
    470 	case TRANS_8023:
    471 		moplen = moplen + 14;
    472 		break;
    473 	}
    474 
    475 	itype = mopGetShort(pkt,idx);
    476 
    477 	while (*idx < (int)(moplen + 2)) {
    478 		ilen  = mopGetChar(pkt,idx);
    479 		switch (itype) {
    480 		case 0:
    481 			tmpc  = mopGetChar(pkt,idx);
    482 			*idx = *idx + tmpc;
    483 			break;
    484 		case MOP_K_INFO_VER:
    485 			uc1 = mopGetChar(pkt,idx);
    486 			uc2 = mopGetChar(pkt,idx);
    487 			uc3 = mopGetChar(pkt,idx);
    488 			(void)fprintf(fd,"Maint Version: %d.%d.%d\n",
    489 				      uc1,uc2,uc3);
    490 			break;
    491 		case MOP_K_INFO_MFCT:
    492 			tmps = mopGetShort(pkt,idx);
    493 			(void)fprintf(fd,"Maint Funcion: %04x ( ",tmps);
    494 			if (tmps &   1) (void)fprintf(fd, "Loop ");
    495 			if (tmps &   2) (void)fprintf(fd, "Dump ");
    496 			if (tmps &   4) (void)fprintf(fd, "Pldr ");
    497 			if (tmps &   8) (void)fprintf(fd, "MLdr ");
    498 			if (tmps &  16) (void)fprintf(fd, "Boot ");
    499 			if (tmps &  32) (void)fprintf(fd, "CC ");
    500 			if (tmps &  64) (void)fprintf(fd, "DLC ");
    501 			if (tmps & 128) (void)fprintf(fd, "CCR ");
    502 			(void)fprintf(fd, ")\n");
    503 			break;
    504 		case MOP_K_INFO_CNU:
    505 			ucp = pkt + *idx; *idx = *idx + 6;
    506 			(void)fprintf(fd,"Console User : ");
    507 			mopPrintHWA(fd, ucp);
    508 			(void)fprintf(fd, "\n");
    509 			break;
    510 		case MOP_K_INFO_RTM:
    511 			tmps = mopGetShort(pkt,idx);
    512 			(void)fprintf(fd,"Reserv Timer : %04x (%d)\n",
    513 				      tmps,tmps);
    514 			break;
    515 		case MOP_K_INFO_CSZ:
    516 			tmps = mopGetShort(pkt,idx);
    517 			(void)fprintf(fd,"Cons Cmd Size: %04x (%d)\n",
    518 				      tmps,tmps);
    519 			break;
    520 		case MOP_K_INFO_RSZ:
    521 			tmps = mopGetShort(pkt,idx);
    522 			(void)fprintf(fd,"Cons Res Size: %04x (%d)\n",
    523 				      tmps,tmps);
    524 			break;
    525 		case MOP_K_INFO_HWA:
    526 			ucp = pkt + *idx; *idx = *idx + 6;
    527 			(void)fprintf(fd,"Hardware Addr: ");
    528 			mopPrintHWA(fd, ucp);
    529 			(void)fprintf(fd, "\n");
    530 			break;
    531 		case MOP_K_INFO_TIME:
    532 			ucp = pkt + *idx; *idx = *idx + 10;
    533 			(void)fprintf(fd,"System Time: ");
    534 			mopPrintTime(fd, ucp);
    535 			(void)fprintf(fd,"\n");
    536 			break;
    537 		case MOP_K_INFO_SOFD:
    538 			device = mopGetChar(pkt,idx);
    539 			(void)fprintf(fd,"Comm Device  :   %02x ",device);
    540 			mopPrintDevice(fd, device);
    541 			(void)fprintf(fd, "\n");
    542 			break;
    543 		case MOP_K_INFO_SFID:
    544 			tmpc = mopGetChar(pkt,idx);
    545 			(void)fprintf(fd,"Software ID  :   %02x ",tmpc);
    546 			if ((tmpc == 0)) {
    547 				(void)fprintf(fd,"No software id");
    548 			}
    549 			if ((tmpc == 254)) {
    550 				(void)fprintf(fd,"Maintenance system");
    551 				tmpc = 0;
    552 			}
    553 			if ((tmpc == 255)) {
    554 				(void)fprintf(fd,"Standard operating system");
    555 				tmpc = 0;
    556 			}
    557 			if ((tmpc > 0)) {
    558 				(void)fprintf(fd,"'");
    559 				for (i = 0; i < ((int) tmpc); i++) {
    560 					(void)fprintf(fd,"%c",
    561 						     mopGetChar(pkt,idx));
    562 				}
    563 				(void)fprintf(fd,"'");
    564 			}
    565 			(void)fprintf(fd,"\n");
    566 			break;
    567 		case MOP_K_INFO_PRTY:
    568 			tmpc = mopGetChar(pkt,idx);
    569 			(void)fprintf(fd,"System Proc  :   %02x ",tmpc);
    570 			switch (tmpc) {
    571 			case MOP_K_PRTY_11:
    572 				(void)fprintf(fd, "PDP-11\n");
    573 				break;
    574 			case MOP_K_PRTY_CMSV:
    575 				(void)fprintf(fd,
    576 					      "Communication Server\n");
    577 				break;
    578 			case MOP_K_PRTY_PRO:
    579 				(void)fprintf(fd, "Professional\n");
    580 				break;
    581 			case MOP_K_PRTY_SCO:
    582 				(void)fprintf(fd, "Scorpio\n");
    583 				break;
    584 			case MOP_K_PRTY_AMB:
    585 				(void)fprintf(fd, "Amber\n");
    586 				break;
    587 			case MOP_K_PRTY_BRI:
    588 				(void)fprintf(fd, "XLII Bridge\n");
    589 				break;
    590 			default:
    591 				(void)fprintf(fd, "Unknown\n");
    592 				break;
    593 			};
    594 			break;
    595 		case MOP_K_INFO_DLTY:
    596 			tmpc = mopGetChar(pkt,idx);
    597 			(void)fprintf(fd,"Data Link Typ:   %02x ",tmpc);
    598 			switch (tmpc) {
    599 			case MOP_K_DLTY_NI:
    600 				(void)fprintf(fd, "Ethernet\n");
    601 				break;
    602 			case MOP_K_DLTY_DDCMP:
    603 				(void)fprintf(fd, "DDCMP\n");
    604 				break;
    605 			case MOP_K_DLTY_LAPB:
    606 				(void)fprintf(fd, "LAPB (X.25)\n");
    607 				break;
    608 			default:
    609 				(void)fprintf(fd, "Unknown\n");
    610 				break;
    611 			};
    612 			break;
    613 		case MOP_K_INFO_DLBSZ:
    614 			tmps = mopGetShort(pkt,idx);
    615 			(void)fprintf(fd,"DL Buff Size : %04x (%d)\n",
    616 				      tmps,tmps);
    617 			break;
    618 		default:
    619 			if (((device = NMA_C_SOFD_LCS) ||   /* DECserver 100 */
    620 			     (device = NMA_C_SOFD_DS2) ||   /* DECserver 200 */
    621 			     (device = NMA_C_SOFD_DP2) ||   /* DECserver 250 */
    622 			     (device = NMA_C_SOFD_DS3)) &&  /* DECserver 300 */
    623 			    ((itype > 101) && (itype < 107)))
    624 			{
    625 		        	switch (itype) {
    626 				case 102:
    627 					ucp = pkt + *idx;
    628 					*idx = *idx + ilen;
    629 					(void)fprintf(fd,
    630 						     "ROM Sftwr Ver:   %02x '",
    631 						      ilen);
    632 					for (i = 0; i < ilen; i++) {
    633 						(void)fprintf(fd,"%c",ucp[i]);
    634 					}
    635 					(void)fprintf(fd, "'\n");
    636 					break;
    637 				case 103:
    638 					ucp = pkt + *idx;
    639 					*idx = *idx + ilen;
    640 					(void)fprintf(fd,
    641 						     "Software Ver :   %02x '",
    642 						      ilen);
    643 					for (i = 0; i < ilen; i++) {
    644 						(void)fprintf(fd, "%c",ucp[i]);
    645 					}
    646 					(void)fprintf(fd, "'\n");
    647 					break;
    648 				case 104:
    649 					tmps = mopGetShort(pkt,idx);
    650 					(void)fprintf(fd,
    651 						"DECnet Addr  : %d.%d (%d)\n",
    652 						      tmps / 1024,
    653 						      tmps % 1024,
    654 						      tmps);
    655 					break;
    656 				case 105:
    657 					ucp = pkt + *idx;
    658 					*idx = *idx + ilen;
    659 					(void)fprintf(fd,
    660 						     "Node Name    :   %02x '",
    661 						      ilen);
    662 					for (i = 0; i < ilen; i++) {
    663 						(void)fprintf(fd, "%c",ucp[i]);
    664 					}
    665 					(void)fprintf(fd, "'\n");
    666 					break;
    667 				case 106:
    668 					ucp = pkt + *idx;
    669 					*idx = *idx + ilen;
    670 					(void)fprintf(fd,
    671 						     "Node Ident   :   %02x '",
    672 						      ilen);
    673 					for (i = 0; i < ilen; i++) {
    674 						(void)fprintf(fd, "%c",ucp[i]);
    675 					}
    676 					(void)fprintf(fd, "'\n");
    677 					break;
    678 				};
    679 			} else {
    680 				ucp = pkt + *idx; *idx = *idx + ilen;
    681 				(void)fprintf(fd, "Info Type    : %04x (%d)\n",
    682 					      itype,
    683 					      itype);
    684 				(void)fprintf(fd, "Info Data    :   %02x ",
    685 					      ilen);
    686 				for (i = 0; i < ilen; i++) {
    687 					if ((i % 16) == 0) {
    688 						if ((i / 16) == 0) {
    689 						} else {
    690 							(void)fprintf(fd,
    691 						     "\n                    ");
    692 						};
    693 					};
    694 					(void)fprintf(fd, "%02x ",ucp[i]);
    695 				}
    696 				(void)fprintf(fd, "\n");
    697 			};
    698 		}
    699 		itype = mopGetShort(pkt,idx);
    700         }
    701 }
    702 
    703