1 /******************************************************************************
6 Description: Header file for Encapsulation Functions for DCCP to TCP conversion
8 ******************************************************************************/
13 * All Conversion functions use these standard arguments:
14 * struct pcap_pkthdr *h: This is a copy of the libpcap packet structure.
15 * You are free to modify and use the fields.
17 * u_char **nptr: This is a pointer to a buffer for the new packet.
18 * Each encapsulation has the responsibility to call
19 * When a function is called, this will point at the
20 * location for that protocol's header to start.
22 * int *nlength: The length of the new packet. Each encapsulation
23 * can rely on this to contain the remaining buffer
24 * space AND must return with this parameter containing
25 * the length of the new packet at that layer.
27 * u_char** optr: This is a pointer to the buffer containing the
28 * old packet. When a functio is called, this will
29 * point at the location of that protocol's header.
31 * int* length: The length of the old packet. Each encapsulation
32 * layer MUST decrement this by the amount of it's
33 * headers. An encapsulation layer MUST never read
34 * beyond this into optr.
38 * Last Level Conversion Function
39 * Converts DCCP to TCP for analysis by TCPTRACE
41 int convert_packet(struct pcap_pkthdr *h, u_char **nptr, int *nlength, const u_char **optr, int *length);
43 /*Standard Encapsulation Functions*/
44 int ethernet_encap(struct pcap_pkthdr *h, u_char **nptr, int *nlength, const u_char **optr, int *length);
45 int linux_cooked_encap(struct pcap_pkthdr *h, u_char **nptr, int *nlength, const u_char **optr, int *length);
46 int ipv4_encap(struct pcap_pkthdr *h, u_char **nptr, int *nlength, const u_char **optr, int *length);