diff -rc tcpdump-3.4/VERSION tcpdump-3.4f/VERSION
*** tcpdump-3.4/VERSION	Sat Jul 25 19:41:23 1998
--- tcpdump-3.4f/VERSION	Fri Aug 20 12:32:09 1999
***************
*** 1 ****
! 3.4
--- 1 ----
! 3.4f2
diff -rc tcpdump-3.4/interface.h tcpdump-3.4f/interface.h
*** tcpdump-3.4/interface.h	Wed May 28 19:54:45 1997
--- tcpdump-3.4f/interface.h	Wed Aug  5 14:48:07 1998
***************
*** 45,50 ****
--- 45,51 ----
  extern int tflag;		/* print packet arrival time */
  extern int vflag;		/* verbose */
  extern int xflag;		/* print packet in hex */
+ extern int zflag;		/* print packet in ascii */
  
  extern int packettype;		/* as specified by -T */
  #define PT_VAT		1	/* Visual Audio Tool */
diff -rc tcpdump-3.4/print-atm.c tcpdump-3.4f/print-atm.c
*** tcpdump-3.4/print-atm.c	Wed May 28 19:52:47 1997
--- tcpdump-3.4f/print-atm.c	Wed Aug  5 14:41:44 1998
***************
*** 138,148 ****
  			       p[0], p[1], p[2], /* dsap/ssap/ctrl */
  			       p[3], p[4], p[5], /* manufacturer's code */
  			       ethertype);
! 		if (!xflag && !qflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
   out:
  	putchar('\n');
  }
--- 138,150 ----
  			       p[0], p[1], p[2], /* dsap/ssap/ctrl */
  			       p[3], p[4], p[5], /* manufacturer's code */
  			       ethertype);
! 		if (!xflag && !qflag && !zflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
+ 	if (zflag)
+ 		ascii_print(p, caplen);
   out:
  	putchar('\n');
  }
diff -rc tcpdump-3.4/print-ether.c tcpdump-3.4f/print-ether.c
*** tcpdump-3.4/print-ether.c	Tue May 27 00:19:00 1997
--- tcpdump-3.4f/print-ether.c	Wed Aug  5 14:44:26 1998
***************
*** 126,143 ****
  				printf("(LLC %s) ",
  			       etherproto_string(htons(extracted_ethertype)));
  			}
! 			if (!xflag && !qflag)
  				default_print(p, caplen);
  		}
  	} else if (ether_encap_print(ether_type, p, length, caplen) == 0) {
  		/* ether_type not known, print raw packet */
  		if (!eflag)
  			ether_print((u_char *)ep, length + sizeof(*ep));
! 		if (!xflag && !qflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
   out:
  	putchar('\n');
  }
--- 126,145 ----
  				printf("(LLC %s) ",
  			       etherproto_string(htons(extracted_ethertype)));
  			}
! 			if (!xflag && !qflag && !zflag)
  				default_print(p, caplen);
  		}
  	} else if (ether_encap_print(ether_type, p, length, caplen) == 0) {
  		/* ether_type not known, print raw packet */
  		if (!eflag)
  			ether_print((u_char *)ep, length + sizeof(*ep));
! 		if (!xflag && !qflag && !zflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
+ 	if (zflag)
+ 		ascii_print(p, caplen);
   out:
  	putchar('\n');
  }
diff -rc tcpdump-3.4/print-fddi.c tcpdump-3.4f/print-fddi.c
*** tcpdump-3.4/print-fddi.c	Tue May 27 00:13:44 1997
--- tcpdump-3.4f/print-fddi.c	Wed Aug  5 14:43:58 1998
***************
*** 318,324 ****
  				printf("(LLC %s) ",
  			etherproto_string(htons(extracted_ethertype)));
  			}
! 			if (!xflag && !qflag)
  				default_print(p, caplen);
  		}
  	} else if ((fddip->fddi_fc & FDDIFC_CLFF) == FDDIFC_SMT)
--- 318,324 ----
  				printf("(LLC %s) ",
  			etherproto_string(htons(extracted_ethertype)));
  			}
! 			if (!xflag && !qflag && !zflag)
  				default_print(p, caplen);
  		}
  	} else if ((fddip->fddi_fc & FDDIFC_CLFF) == FDDIFC_SMT)
***************
*** 327,337 ****
  		/* Some kinds of FDDI packet we cannot handle intelligently */
  		if (!eflag)
  			fddi_print(fddip, length, ESRC(&ehdr), EDST(&ehdr));
! 		if (!xflag && !qflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
  out:
  	putchar('\n');
  }
--- 327,339 ----
  		/* Some kinds of FDDI packet we cannot handle intelligently */
  		if (!eflag)
  			fddi_print(fddip, length, ESRC(&ehdr), EDST(&ehdr));
! 		if (!xflag && !qflag && !zflag)
  			default_print(p, caplen);
  	}
  	if (xflag)
  		default_print(p, caplen);
+ 	if (zflag)
+ 		ascii_print(p, caplen);
  out:
  	putchar('\n');
  }
diff -rc tcpdump-3.4/print-null.c tcpdump-3.4f/print-null.c
*** tcpdump-3.4/print-null.c	Wed May 28 19:52:48 1997
--- tcpdump-3.4f/print-null.c	Wed Aug  5 14:46:04 1998
***************
*** 118,123 ****
--- 118,125 ----
  
  	if (xflag)
  		default_print((const u_char *)ip, caplen - NULL_HDRLEN);
+ 	if (zflag)
+ 		ascii_print((const u_char *)ip, caplen - NULL_HDRLEN);
  	putchar('\n');
  }
  
diff -rc tcpdump-3.4/print-ppp.c tcpdump-3.4f/print-ppp.c
*** tcpdump-3.4/print-ppp.c	Thu Jun 12 21:21:35 1997
--- tcpdump-3.4f/print-ppp.c	Wed Aug  5 14:46:51 1998
***************
*** 86,91 ****
--- 86,93 ----
  
  	if (xflag)
  		default_print((const u_char *)ip, caplen - PPP_HDRLEN);
+ 	if (zflag)
+ 		ascii_print((const u_char *)ip, caplen - PPP_HDRLEN);
  out:
  	putchar('\n');
  }
***************
*** 163,168 ****
--- 165,172 ----
  
  	if (xflag)
  		default_print((const u_char *)p, caplen - hdrlength);
+ 	if (zflag)
+ 		ascii_print((const u_char *)p, caplen - hdrlength);
  out:
  	putchar('\n');
  }
diff -rc tcpdump-3.4/print-raw.c tcpdump-3.4f/print-raw.c
*** tcpdump-3.4/print-raw.c	Mon Dec 23 06:18:15 1996
--- tcpdump-3.4f/print-raw.c	Wed Aug  5 14:47:26 1998
***************
*** 84,88 ****
--- 84,90 ----
  
  	if (xflag)
  		default_print(p, caplen);
+ 	if (zflag)
+ 		ascii_print(p, caplen);
  	putchar('\n');
  }
diff -rc tcpdump-3.4/print-sl.c tcpdump-3.4f/print-sl.c
*** tcpdump-3.4/print-sl.c	Thu Jun 12 21:21:36 1997
--- tcpdump-3.4f/print-sl.c	Wed Aug  5 14:59:03 1998
***************
*** 108,113 ****
--- 108,115 ----
  
  	if (xflag)
  		default_print((u_char *)ip, caplen - SLIP_HDRLEN);
+ 	if (zflag)
+ 		ascii_print((u_char *)ip, caplen - SLIP_HDRLEN);
   out:
  	putchar('\n');
  }
***************
*** 147,152 ****
--- 149,156 ----
  
  	if (xflag)
  		default_print((u_char *)ip, caplen - SLIP_HDRLEN);
+ 	if (zflag)
+ 		ascii_print((u_char *)ip, caplen - SLIP_HDRLEN);
   out:
  	putchar('\n');
  }
diff -rc tcpdump-3.4/tcpdump.1 tcpdump-3.4f/tcpdump.1
*** tcpdump-3.4/tcpdump.1	Mon Jun 30 23:32:09 1997
--- tcpdump-3.4f/tcpdump.1	Wed Aug  5 15:11:48 1998
***************
*** 215,220 ****
--- 215,226 ----
  The smaller of the entire packet or
  .I snaplen
  bytes will be printed.
+ .TP
+ .B \-z
+ Print each packet (minus its link level header) in ascii.
+ The smaller of the entire packet or
+ .I snaplen
+ bytes will be printed.
  .IP "\fI expression\fP"
  .RS
  selects which packets will be dumped.  If no \fIexpression\fP
diff -rc tcpdump-3.4/tcpdump.c tcpdump-3.4f/tcpdump.c
*** tcpdump-3.4/tcpdump.c	Sat Oct 18 20:50:17 1997
--- tcpdump-3.4f/tcpdump.c	Fri Aug 20 12:50:34 1999
***************
*** 46,51 ****
--- 46,52 ----
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
+ #include <ctype.h>
  
  #include "interface.h"
  #include "addrtoname.h"
***************
*** 66,71 ****
--- 67,73 ----
  int tflag = 1;			/* print packet arrival time */
  int vflag;			/* verbose */
  int xflag;			/* print packet in hex */
+ int zflag;			/* print packet in ascii */
  
  int packettype;
  
***************
*** 149,155 ****
  
  	opterr = 0;
  	while (
! 	    (op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xY")) != EOF)
  		switch (op) {
  
  		case 'a':
--- 151,157 ----
  
  	opterr = 0;
  	while (
! 	    (op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xYz")) != EOF)
  		switch (op) {
  
  		case 'a':
***************
*** 263,268 ****
--- 265,274 ----
  			++xflag;
  			break;
  
+ 		case 'z':
+ 			++zflag;
+ 			break;
+ 
  		default:
  			usage();
  			/* NOTREACHED */
***************
*** 408,413 ****
--- 414,425 ----
   *
   * (BTW, please don't send us patches to print the packet out in ascii)
   */
+ /*
+  * The developers of tcpdump are fascist bastards.
+  * (And fuckwits, too. (void)printf("foo")? Bunch of arse.
+  * They should be writing if (printf("foo") < 0)
+  * { perror("stdout"); exit(EXIT_FAILURE); }
+  */
  void
  default_print(register const u_char *bp, register u_int length)
  {
***************
*** 432,437 ****
--- 444,478 ----
  			(void)printf("\n\t\t\t");
  		(void)printf(" %02x", *(u_char *)sp);
  	}
+ }
+ 
+ /*
+  * print the packet out in ascii
+  */
+ void
+ ascii_print(register const u_char *bp, register int length)
+ {
+ 	register u_int i, j;
+ 
+ 	for (i = 0; i < length; i += 16, bp += 16) {
+ 		fputs("\n ", stdout);
+ 		for (j = 0; j < 16; j++) {
+ 			if (i + j < length)
+ 				printf(" %02X", bp[j]);
+ 			else
+ 				printf("   ");
+ 			if (j % 4 == 3)
+ 				fputs("  ", stdout);
+ 		}
+ 		fputs("  ", stdout);
+ 		for (j = 0; j < 16; j++) {
+ 			if (i + j < length)
+ 				putchar(isprint(bp[j]) ? bp[j] : '.');
+ 			if (j % 4 == 3)
+ 				putchar(' ');
+ 		}
+ 	}
+ 	putchar('\n');
  }
  
  __dead void
