Deleted Added
full compact
print-null.c (127675) print-null.c (146778)
1/*
2 * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 4 unchanged lines hidden (view full) ---

13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
1/*
2 * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 4 unchanged lines hidden (view full) ---

13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * $FreeBSD: head/contrib/tcpdump/print-null.c 127675 2004-03-31 14:57:24Z bms $
21 * $FreeBSD: head/contrib/tcpdump/print-null.c 146778 2005-05-29 19:09:28Z sam $
22 */
23
24#ifndef lint
25static const char rcsid[] _U_ =
22 */
23
24#ifndef lint
25static const char rcsid[] _U_ =
26 "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.49.2.2 2003/11/16 08:51:36 guy Exp $ (LBL)";
26 "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.53 2005/04/06 21:32:41 mcr Exp $ (LBL)";
27#endif
28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <tcpdump-stdinc.h>
34

--- 87 unchanged lines hidden (view full) ---

122 * big-endian platforms.)
123 */
124#define SWAPLONG(y) \
125((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
126
127/*
128 * This is the top level routine of the printer. 'p' points
129 * to the ether header of the packet, 'h->ts' is the timestamp,
27#endif
28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <tcpdump-stdinc.h>
34

--- 87 unchanged lines hidden (view full) ---

122 * big-endian platforms.)
123 */
124#define SWAPLONG(y) \
125((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
126
127/*
128 * This is the top level routine of the printer. 'p' points
129 * to the ether header of the packet, 'h->ts' is the timestamp,
130 * 'h->length' is the length of the packet off the wire, and 'h->caplen'
130 * 'h->len' is the length of the packet off the wire, and 'h->caplen'
131 * is the number of bytes actually captured.
132 */
133u_int
134null_if_print(const struct pcap_pkthdr *h, const u_char *p)
135{
136 u_int length = h->len;
137 u_int caplen = h->caplen;
138 u_int family;

--- 21 unchanged lines hidden (view full) ---

160 p += NULL_HDRLEN;
161
162 if (eflag)
163 null_print(family, length);
164
165 switch (family) {
166
167 case BSD_AF_INET:
131 * is the number of bytes actually captured.
132 */
133u_int
134null_if_print(const struct pcap_pkthdr *h, const u_char *p)
135{
136 u_int length = h->len;
137 u_int caplen = h->caplen;
138 u_int family;

--- 21 unchanged lines hidden (view full) ---

160 p += NULL_HDRLEN;
161
162 if (eflag)
163 null_print(family, length);
164
165 switch (family) {
166
167 case BSD_AF_INET:
168 ip_print(p, length);
168 ip_print(gndo, p, length);
169 break;
170
171#ifdef INET6
172 case BSD_AF_INET6_BSD:
173 case BSD_AF_INET6_FREEBSD:
174 case BSD_AF_INET6_DARWIN:
175 ip6_print(p, length);
176 break;

--- 17 unchanged lines hidden (view full) ---

194 null_print(family, length + NULL_HDRLEN);
195 if (!xflag && !qflag)
196 default_print(p, caplen);
197 }
198
199 return (NULL_HDRLEN);
200}
201
169 break;
170
171#ifdef INET6
172 case BSD_AF_INET6_BSD:
173 case BSD_AF_INET6_FREEBSD:
174 case BSD_AF_INET6_DARWIN:
175 ip6_print(p, length);
176 break;

--- 17 unchanged lines hidden (view full) ---

194 null_print(family, length + NULL_HDRLEN);
195 if (!xflag && !qflag)
196 default_print(p, caplen);
197 }
198
199 return (NULL_HDRLEN);
200}
201
202/*
203 * Local Variables:
204 * c-style: whitesmith
205 * c-basic-offset: 8
206 * End:
207 */