#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.43 2002-08-01 08:53:22 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.47 2002-12-19 09:39:13 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#define SWAPLONG(y) \
((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
-void
-null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+u_int
+null_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
- u_int caplen = h->caplen;
const struct ip *ip;
u_int family;
- ++infodelay;
- ts_print(&h->ts);
-
memcpy((char *)&family, (char *)p, sizeof(family));
/*
if ((family & 0xFFFF0000) != 0)
family = SWAPLONG(family);
- /*
- * Some printers want to get back at the link level addresses,
- * and/or check that they're not walking off the end of the packet.
- * Rather than pass them all the way down, we set these globals.
- */
- packetp = p;
- snapend = p + caplen;
-
length -= NULL_HDRLEN;
ip = (struct ip *)(p + NULL_HDRLEN);
break;
}
- if (xflag)
- default_print((const u_char *)ip, caplen - NULL_HDRLEN);
- putchar('\n');
- --infodelay;
- if (infoprint)
- info(0);
+ return (NULL_HDRLEN);
}