*** tcpdump.c.orig	Wed Nov 26 15:49:43 1997
--- tcpdump.c	Wed Nov 26 16:49:29 1997
***************
*** 62,67 ****
--- 62,68 ----
  int xflag;			/* print packet in hex */
  int Oflag = 1;			/* run filter code optimizer */
  int Sflag;			/* print raw TCP sequence numbers */
+ int Dflag;			/* print packet contents as char */
  int packettype;
  
  int dflag;			/* print filter code */
***************
*** 145,151 ****
  		error("%s", ebuf);
  
  	opterr = 0;
! 	while ((op = getopt(argc, argv, "c:defF:i:lnNOpqr:s:StT:vw:xY")) != EOF)
  		switch (op) {
  		case 'c':
  			cnt = atoi(optarg);
--- 146,152 ----
  		error("%s", ebuf);
  
  	opterr = 0;
! 	while ((op = getopt(argc, argv, "c:defF:i:lnNOpqr:s:StT:vw:xDY")) != EOF)
  		switch (op) {
  		case 'c':
  			cnt = atoi(optarg);
***************
*** 254,259 ****
--- 255,268 ----
  			++xflag;
  			break;
  
+ 		case 'D':
+ 		  {
+ 		    /* print data as char. sets -x as well */
+ 			if (!xflag) ++xflag;
+ 			++Dflag;
+ 		  }
+ 			break;
+ 
  		default:
  			usage();
  			/* NOTREACHED */
***************
*** 387,392 ****
--- 396,418 ----
  }
  
  void
+ default_D_print(register const u_char *cp, register u_int length)
+ {
+ 	register u_int i;
+ 
+ 	if ( Dflag == 1)
+ 	  i = 0;
+ 	else
+ 	  i = (length > 40) ? 40 : 0;
+ 
+ 	putchar('\n');
+ 
+ 	for ( ; i < length; i+=2) {
+ 	  putchar(cp[i]); putchar(cp[i + 1]);
+ 	}
+ }
+ 
+ void
  default_print(register const u_char *bp, register u_int length)
  {
  	register const u_short *sp;
***************
*** 397,414 ****
  		default_print_unaligned(bp, length);
  		return;
  	}
  	sp = (u_short *)bp;
  	nshorts = (u_int) length / sizeof(u_short);
  	i = 0;
  	while (--nshorts >= 0) {
  		if ((i++ % 8) == 0)
  			(void)printf("\n\t\t\t");
! 		(void)printf(" %04x", ntohs(*sp++));
  	}
  	if (length & 1) {
  		if ((i % 8) == 0)
  			(void)printf("\n\t\t\t");
! 		(void)printf(" %02x", *(u_char *)sp);
  	}
  }
  
--- 423,447 ----
  		default_print_unaligned(bp, length);
  		return;
  	}
+ 
+ 	if (Dflag) {
+ 	  default_D_print(bp, length);
+ 	  return;
+ 	}
+ 
  	sp = (u_short *)bp;
+ 
  	nshorts = (u_int) length / sizeof(u_short);
  	i = 0;
  	while (--nshorts >= 0) {
  		if ((i++ % 8) == 0)
  			(void)printf("\n\t\t\t");
! 		  (void)printf(" %04x", ntohs(*sp++));
  	}
  	if (length & 1) {
  		if ((i % 8) == 0)
  			(void)printf("\n\t\t\t");
! 		  (void)printf(" %02x", *(u_char *)sp);
  	}
  }
  
***************
*** 419,425 ****
  
  	(void)fprintf(stderr, "Version %s\n", version);
  	(void)fprintf(stderr,
! "Usage: tcpdump [-deflnNOpqStvx] [-c count] [ -F file ]\n");
  	(void)fprintf(stderr,
  "\t\t[ -i interface ] [ -r file ] [ -s snaplen ]\n");
  	(void)fprintf(stderr,
--- 452,458 ----
  
  	(void)fprintf(stderr, "Version %s\n", version);
  	(void)fprintf(stderr,
! "Usage: tcpdump [-deflnNOpqStvxD] [-c count] [ -F file ]\n");
  	(void)fprintf(stderr,
  "\t\t[ -i interface ] [ -r file ] [ -s snaplen ]\n");
  	(void)fprintf(stderr,

