xref: /freebsd/contrib/tcpdump/print-raw.c (revision 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9)
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 
24*ee67461eSJoseph Mingrone #include <config.h>
254644f044SBill Fenner 
26*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
274644f044SBill Fenner 
283340d773SGleb Smirnoff #include "netdissect.h"
294644f044SBill Fenner 
304644f044SBill Fenner /*
314644f044SBill Fenner  * The DLT_RAW packet has no header. It contains a raw IP packet.
324644f044SBill Fenner  */
334644f044SBill Fenner 
34*ee67461eSJoseph Mingrone void
raw_if_print(netdissect_options * ndo,const struct pcap_pkthdr * h,const u_char * p)353c602fabSXin LI raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
364644f044SBill Fenner {
37*ee67461eSJoseph Mingrone 	ndo->ndo_protocol = "raw";
38*ee67461eSJoseph Mingrone 	ndo->ndo_ll_hdr_len += 0;
393c602fabSXin LI 	if (ndo->ndo_eflag)
40*ee67461eSJoseph Mingrone 		ND_PRINT("ip: ");
414644f044SBill Fenner 
423c602fabSXin LI 	ipN_print(ndo, p, h->len);
434644f044SBill Fenner }
44