+ iso_protopr1((u_long)next, 0);
+ putchar('\n');
+ prev = next;
+ }
+}
+
+void
+iso_protopr1(kern_addr, istp)
+ u_long kern_addr;
+ int istp;
+{
+ if (first) {
+ printf("Active ISO net connections");
+ if (aflag)
+ printf(" (including servers)");
+ putchar('\n');
+ if (Aflag)
+ printf("%-8.8s ", "PCB");
+ printf(Aflag ?
+ "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s %s\n" :
+ "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s %s\n",
+ "Proto", "Recv-Q", "Send-Q",
+ "Local Address", "Foreign Address", "(state)");
+ first = 0;
+ }
+ if (Aflag)
+ printf("%8x ",
+ (sockb.so_pcb ? (void *)sockb.so_pcb : (void *)kern_addr));
+ printf("%-5.5s %6d %6d ", "tp", sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
+ if (istp && tpcb.tp_lsuffixlen) {
+ hexprint(tpcb.tp_lsuffixlen, tpcb.tp_lsuffix, "()");
+ printf("\t");
+ } else if (isopcb.isop_laddr == 0)
+ printf("*.*\t");
+ else {
+ if ((char *)isopcb.isop_laddr == ((char *)kern_addr) +
+ _offsetof(struct isopcb, isop_sladdr))
+ laddr.siso = isopcb.isop_sladdr;
+ else
+ kget(isopcb.isop_laddr, laddr);
+ isonetprint((struct sockaddr_iso *)&laddr, 1);
+ }
+ if (istp && tpcb.tp_fsuffixlen) {
+ hexprint(tpcb.tp_fsuffixlen, tpcb.tp_fsuffix, "()");
+ printf("\t");
+ } else if (isopcb.isop_faddr == 0)
+ printf("*.*\t");
+ else {
+ if ((char *)isopcb.isop_faddr == ((char *)kern_addr) +
+ _offsetof(struct isopcb, isop_sfaddr))
+ faddr.siso = isopcb.isop_sfaddr;
+ else
+ kget(isopcb.isop_faddr, faddr);
+ isonetprint((struct sockaddr_iso *)&faddr, 0);
+ }
+}
+
+void
+tp_protopr(off, name)
+ u_long off;
+ char *name;
+{
+ extern char *tp_sstring[];
+ struct tp_ref *tpr, *tpr_base;
+ struct tp_refinfo tpkerninfo;
+ int size;
+
+ kget(off, tpkerninfo);
+ size = tpkerninfo.tpr_size * sizeof (*tpr);
+ tpr_base = (struct tp_ref *)malloc(size);
+ if (tpr_base == 0)
+ return;
+ kread((u_long)(tpkerninfo.tpr_base), (char *)tpr_base, size);
+ for (tpr = tpr_base; tpr < tpr_base + tpkerninfo.tpr_size; tpr++) {
+ if (tpr->tpr_pcb == 0)
+ continue;
+ kget(tpr->tpr_pcb, tpcb);