+ pcap_dump((u_char *)dump_info->p, h, sp);
+
+ --infodelay;
+ if (infoprint)
+ info(0);
+}
+
+static void
+dump_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
+{
+ ++infodelay;
+
+ pcap_dump(user, h, sp);
+
+ --infodelay;
+ if (infoprint)
+ info(0);
+}
+
+static void
+print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
+{
+ struct print_info *print_info;
+ u_int hdrlen;
+
+ ++infodelay;
+ ts_print(&h->ts);
+
+ print_info = (struct print_info *)user;
+
+ /*
+ * Some printers want to check that they're not walking off the
+ * end of the packet.
+ * Rather than pass it all the way down, we set this global.
+ */
+ snapend = sp + h->caplen;
+
+ hdrlen = (*print_info->printer)(h, sp);
+ if (xflag) {
+ /*
+ * Print the raw packet data.
+ */
+ if (xflag > 1) {
+ /*
+ * Include the link-layer header.
+ */
+ default_print_unaligned(sp, h->caplen);
+ } else {
+ /*
+ * Don't include the link-layer header - and if
+ * we have nothing past the link-layer header,
+ * print nothing.
+ */
+ if (h->caplen > hdrlen)
+ default_print_unaligned(sp + hdrlen,
+ h->caplen - hdrlen);
+ }
+ }
+
+ putchar('\n');
+
+ --infodelay;
+ if (infoprint)
+ info(0);