xref: /freebsd/contrib/tcpdump/print-raw.c (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
14644f044SBill Fenner /*
24644f044SBill Fenner  * Copyright (c) 1996
34644f044SBill Fenner  *	The Regents of the University of California.  All rights reserved.
44644f044SBill Fenner  *
54644f044SBill Fenner  * Redistribution and use in source and binary forms, with or without
64644f044SBill Fenner  * modification, are permitted provided that: (1) source code distributions
74644f044SBill Fenner  * retain the above copyright notice and this paragraph in its entirety, (2)
84644f044SBill Fenner  * distributions including binary code include the above copyright notice and
94644f044SBill Fenner  * this paragraph in its entirety in the documentation or other materials
104644f044SBill Fenner  * provided with the distribution, and (3) all advertising materials mentioning
114644f044SBill Fenner  * features or use of this software display the following acknowledgement:
124644f044SBill Fenner  * ``This product includes software developed by the University of California,
134644f044SBill Fenner  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
144644f044SBill Fenner  * the University nor the names of its contributors may be used to endorse
154644f044SBill Fenner  * or promote products derived from this software without specific prior
164644f044SBill Fenner  * written permission.
174644f044SBill Fenner  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
184644f044SBill Fenner  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
194644f044SBill Fenner  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
204644f044SBill Fenner  */
214644f044SBill Fenner 
223340d773SGleb Smirnoff /* \summary: Raw IP printer */
233340d773SGleb Smirnoff 
24b0453382SBill Fenner #ifdef HAVE_CONFIG_H
25*ee67461eSJoseph Mingrone #include <config.h>
264644f044SBill Fenner #endif
274644f044SBill Fenner 
28*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
294644f044SBill Fenner 
303340d773SGleb Smirnoff #include "netdissect.h"
314644f044SBill Fenner 
324644f044SBill Fenner /*
334644f044SBill Fenner  * The DLT_RAW packet has no header. It contains a raw IP packet.
344644f044SBill Fenner  */
354644f044SBill Fenner 
36*ee67461eSJoseph Mingrone void
373c602fabSXin LI raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
384644f044SBill Fenner {
39*ee67461eSJoseph Mingrone 	ndo->ndo_protocol = "raw";
40*ee67461eSJoseph Mingrone 	ndo->ndo_ll_hdr_len += 0;
413c602fabSXin LI 	if (ndo->ndo_eflag)
42*ee67461eSJoseph Mingrone 		ND_PRINT("ip: ");
434644f044SBill Fenner 
443c602fabSXin LI 	ipN_print(ndo, p, h->len);
454644f044SBill Fenner }
46