print-raw.c revision 190207
11590Srgrimes/* 21590Srgrimes * Copyright (c) 1996 31590Srgrimes * The Regents of the University of California. All rights reserved. 41590Srgrimes * 51590Srgrimes * Redistribution and use in source and binary forms, with or without 61590Srgrimes * modification, are permitted provided that: (1) source code distributions 71590Srgrimes * retain the above copyright notice and this paragraph in its entirety, (2) 81590Srgrimes * distributions including binary code include the above copyright notice and 91590Srgrimes * this paragraph in its entirety in the documentation or other materials 101590Srgrimes * provided with the distribution, and (3) all advertising materials mentioning 111590Srgrimes * features or use of this software display the following acknowledgement: 121590Srgrimes * ``This product includes software developed by the University of California, 131590Srgrimes * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 141590Srgrimes * the University nor the names of its contributors may be used to endorse 151590Srgrimes * or promote products derived from this software without specific prior 161590Srgrimes * written permission. 171590Srgrimes * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 181590Srgrimes * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 191590Srgrimes * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 201590Srgrimes */ 211590Srgrimes 221590Srgrimes#ifndef lint 231590Srgrimesstatic const char rcsid[] _U_ = 241590Srgrimes "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.41 2003-11-16 09:36:34 guy Exp $ (LBL)"; 251590Srgrimes#endif 261590Srgrimes 271590Srgrimes#ifdef HAVE_CONFIG_H 281590Srgrimes#include "config.h" 291590Srgrimes#endif 301590Srgrimes 311590Srgrimes#include <tcpdump-stdinc.h> 321590Srgrimes 331590Srgrimes#include <pcap.h> 341590Srgrimes#include <stdio.h> 351590Srgrimes#include <string.h> 361590Srgrimes 371590Srgrimes#include "addrtoname.h" 381590Srgrimes#include "interface.h" 391590Srgrimes 401590Srgrimes/* 411590Srgrimes * The DLT_RAW packet has no header. It contains a raw IP packet. 421590Srgrimes */ 431590Srgrimes 4432069Salexu_int 4532069Salexraw_if_print(const struct pcap_pkthdr *h, const u_char *p) 461590Srgrimes{ 4732069Salex if (eflag) 4832069Salex printf("ip: "); 491590Srgrimes 501590Srgrimes ipN_print(p, h->len); 511590Srgrimes 521590Srgrimes return (0); 531590Srgrimes} 541590Srgrimes