]> sjero.net Git - strip6in4/blob - strip6in4.h
Modify to output RAW packet capture correctly
[strip6in4] / strip6in4.h
1 /******************************************************************************
2 Utility to create a pcap file of a 6in4 stream present in an origin pcap file
3
4 Copyright (C) 2013  Samuel Jero <sj323707@ohio.edu>
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 Author: Samuel Jero <sj323707@ohio.edu>
20 Date: 03/2013
21 ******************************************************************************/
22 #ifndef _STRIP6IN4_H
23 #define _STRIP6IN4_H
24
25 #include <stdarg.h>
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include <unistd.h>
30 #include <pcap.h>
31
32
33 #define TRUE 1
34 #define FALSE 0
35
36 /*Packet structure*/
37 struct packet{
38         struct pcap_pkthdr      *h;             /*libpcap header*/
39         u_char                          *data;  /*Packet Data*/
40         int                                     length; /*Packet length*/
41         void                            *private; /*Private data from libpcap*/
42 };
43
44 /*Constant Packet structure*/
45 struct const_packet{
46         const struct pcap_pkthdr *h;    /*libpcap header*/
47         const u_char                    *data;  /*Packet Data*/
48         int                                             length; /*Packet length*/
49         void                                    *private; /*Private data from libpcap*/
50 };
51
52 /*Function to parse encapsulation*/
53 int do_encap(int link, const struct const_packet *old);
54
55 /*debug printf
56  * Levels:
57  *      0) Always print even if debug isn't specified
58  *  1) Errors and warnings... Don't overload the screen with too much output
59  *  2) Notes and per-packet processing info... as verbose as needed
60  */
61 extern int debug;
62 void dbgprintf(int level, const char *fmt, ...);
63
64 #endif