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 * int id_len: Length of the source and destination ID.
31 * u_char *src_id: This is an ID for the source host. If you are going to
32 * demultiplex DCCP on anything but Port Numbers, you
33 * need to set this field. Typically this would be an
36 * u_char *dest_id: This is an ID for the destination host. If you are going to
37 * demultiplex DCCP on anything but Port Numbers, you
38 * need to set this field. Typically this would be an
41 * struct const_packet *old: The Old packet. It contains the following fields.
43 * u_char* data: This is a pointer to the buffer containing the
44 * old packet. When a function is called, this will
45 * point at the location of that protocol's header.
47 * int length: The length of the old packet. Each encapsulation
48 * layer MUST decrement this by the amount of it's
49 * headers. An encapsulation layer MUST never read
50 * beyond this into old->data.
54 * Last Level Conversion Function
55 * Converts DCCP to TCP for analysis by TCPTRACE
57 int convert_packet(struct packet *new, const struct const_packet *old);
59 /*Standard Encapsulation Functions*/
60 int ethernet_encap(struct packet *new, const struct const_packet *old);
61 int linux_cooked_encap(struct packet *new, const struct const_packet *old);
62 int ipv4_encap(struct packet *new, const struct const_packet *old);
63 int ipv6_encap(struct packet *new, const struct const_packet *old);