1 /******************************************************************************
2 Utility to create a pcap file of a 6in4 stream present in an origin pcap file
4 Copyright (C) 2013 Samuel Jero <sj323707@ohio.edu>
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.
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.
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/>.
19 Author: Samuel Jero <sj323707@ohio.edu>
21 ******************************************************************************/
26 * All Conversion functions use these standard arguments:
27 * struct packet *new: The New packet. It contains the following fields.
29 * struct pcap_pkthdr *h: This is a copy of the libpcap packet structure.
30 * You are free to modify and use the fields.
32 * u_char *data: This is a pointer to a buffer for the new packet.
33 * Each encapsulation has the responsibility to call
34 * When a function is called, this will point at the
35 * location for that protocol's header to start.
37 * int length: The length of the new packet. Each encapsulation
38 * can rely on this to contain the remaining buffer
39 * space AND must return with this parameter containing
40 * the length of the new packet at that layer.
42 * struct const_packet *old: The Old packet. It contains the following fields.
44 * u_char* data: This is a pointer to the buffer containing the
45 * old packet. When a function is called, this will
46 * point at the location of that protocol's header.
48 * int length: The length of the old packet. Each encapsulation
49 * layer MUST decrement this by the amount of it's
50 * headers. An encapsulation layer MUST never read
51 * beyond this into old->data.
56 * Does de-encapsulation
58 int decap_packet(const struct const_packet* old);
60 /*Standard Encapsulation Functions*/
61 int ethernet_encap(const struct const_packet *old);
62 int ethernet_vlan_encap(const struct const_packet *old);
63 int linux_cooked_encap(const struct const_packet *old);
64 int ipv4_encap(const struct const_packet *old);
65 int ipv6_encap(const struct const_packet *old);