/* pdumpq - Pcap Dump for Linux/Netfilter QUEUE * * Copyright (C) 2001 Ian Jones * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TCPDUMP_MAGIC 0xa1b2c3d4 /* normal tcpdump */ /* #define TCPDUMP_MAGIC 0xa1b2cd34 *//* patched (RH) tcpdump */ #define PCAP_VERSION_MAJOR 2 #define PCAP_VERSION_MINOR 4 #ifndef DLT_RAW #define DLT_RAW 12 #endif /* DLT_RAW */ typedef int bpf_int32; typedef u_int bpf_u_int32; struct pcap_file_header { bpf_u_int32 magic; u_short version_major; u_short version_minor; bpf_int32 thiszone; /* gmt to local correction */ bpf_u_int32 sigfigs; /* accuracy of timestamps */ bpf_u_int32 snaplen; /* max length saved portion of each pkt */ bpf_u_int32 linktype; /* data link type (DLT_*) */ }; struct pcap_pkthdr { struct timeval ts; /* time stamp */ bpf_u_int32 caplen; /* length of portion present */ bpf_u_int32 len; /* length this packet (off wire) */ }; int write_file_header (FILE * out); int dump_pkt (ipq_packet_msg_t * m, FILE * out);