1 /*
2 ** Copyright (C) 2007-2009 Sourcefire, Inc.
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License Version 2 as
6 ** published by the Free Software Foundation.  You may not use, modify or
7 ** distribute this program under any other version of the GNU General
8 ** Public License.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19 
20 #ifndef __PCAP_PKTHDR32_H__
21 #define __PCAP_PKTHDR32_H__
22 
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26 
27 #ifdef WIN32
28 #include <winsock2.h>
29 #else
30 #include <sys/time.h>
31 #endif
32 
33 #include <stdlib.h>
34 #include <time.h>
35 #include <sys/types.h>
36 
37 #include "sf_types.h"
38 
39 
40 /* we must use fixed size of 32 bits, because on-disk
41  * format of savefiles uses 32-bit tv_sec (and tv_usec)
42  */
43 struct sf_timeval32
44 {
45     uint32_t tv_sec;      /* seconds */
46     uint32_t tv_usec;     /* microseconds */
47 };
48 
49 /* this is equivalent to the pcap pkthdr struct, but we need
50  * a 32 bit one for unified output
51  */
52 struct pcap_pkthdr32
53 {
54     struct sf_timeval32 ts;   /* packet timestamp */
55     uint32_t caplen;      /* packet capture length */
56     uint32_t pktlen;      /* packet "real" length */
57 };
58 
59 
60 #endif // __PCAP_PKTHDR32_H__
61 
62