+#define MAX_COLUMNS 8
+/*
+ * Dump the buffer to the screen in a readable format. Format is:
+ *
+ * hex/dec where hex is the hex format, dec is the decimal format.
+ * columns of hex/dec numbers will be printed, followed by the
+ * character representations (if printable).
+ */
+Dump_buf(buf, len)
+caddr_t buf;
+int len;
+{
+ int i,j;
+
+ printf("Dump buf 0x%x len 0x%x\n", buf, len);
+ for (i = 0; i < len; i += MAX_COLUMNS) {
+ printf("+%d:\t", i);
+ for (j = 0; j < MAX_COLUMNS; j++) {
+ if (i + j < len) {
+ printf("%x/%d\t", buf[i+j]&0xff, buf[i+j]);
+ } else {
+ printf(" ");
+ }
+ }
+
+ for (j = 0; j < MAX_COLUMNS; j++) {
+ if (i + j < len) {
+ if (((buf[i+j]) > 31) && ((buf[i+j]) < 128))
+ printf("%c", buf[i+j]&0xff);
+ else
+ printf(".");
+ }
+ }
+ printf("\n");
+ }
+}
+
+