1 /******************************************************************************
6 Description: Header file for Encapsulation Functions for DCCP to TCP conversion
8 ******************************************************************************/
13 * All Conversion functions use these standard arguments:
14 * struct packet *new: The New packet. It contains the following fields.
16 * struct pcap_pkthdr *h: This is a copy of the libpcap packet structure.
17 * You are free to modify and use the fields.
19 * u_char *data: This is a pointer to a buffer for the new packet.
20 * Each encapsulation has the responsibility to call
21 * When a function is called, this will point at the
22 * location for that protocol's header to start.
24 * int length: The length of the new packet. Each encapsulation
25 * can rely on this to contain the remaining buffer
26 * space AND must return with this parameter containing
27 * the length of the new packet at that layer.
29 * uint32_t src_id: This is an ID for the source host. If you are going to
30 * demultiplex DCCP on anything but Port Numbers, you
31 * need to set this field. Typically this would be an
34 * uint32_t dest_id: This is an ID for the destination host. If you are going to
35 * demultiplex DCCP on anything but Port Numbers, you
36 * need to set this field. Typically this would be an
39 * struct const_packet *old: The Old packet. It contains the following fields.
41 * u_char* data: This is a pointer to the buffer containing the
42 * old packet. When a function is called, this will
43 * point at the location of that protocol's header.
45 * int length: The length of the old packet. Each encapsulation
46 * layer MUST decrement this by the amount of it's
47 * headers. An encapsulation layer MUST never read
48 * beyond this into old->data.
52 * Last Level Conversion Function
53 * Converts DCCP to TCP for analysis by TCPTRACE
55 int convert_packet(struct packet *new, const struct const_packet *old);
57 /*Standard Encapsulation Functions*/
58 int ethernet_encap(struct packet *new, const struct const_packet *old);
59 int linux_cooked_encap(struct packet *new, const struct const_packet *old);
60 int ipv4_encap(struct packet *new, const struct const_packet *old);