1 /******************************************************************************
2 Utility to convert a LTP flow to a TCP flow for LTP analysis via tcptrace.
5 Copyright (C) 2013 Samuel Jero <sj323707@ohio.edu>
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Author: Samuel Jero <sj323707@ohio.edu>
24 1)Only handles one LTP "connection". There isn't a good way to separate
25 different LTP "connections" from new sessions of the same "connection".
26 Use Tcpdump filters to separate connections. Libpcap filtering could also
28 2)Uses some special types from Linux (u_char, u_int32_t)
29 ******************************************************************************/
35 /* structure to hold all the data from an LTP header.
36 * Note that this isn't the RAW header like in IP,TCP;
37 * it is a structure to hold all the information. The
38 * RAW header is mostly SDNV values
41 u_char vers_ctl; /* Version and Control Field*/
42 int sender_id; /* Session sender id*/
43 int session_num; /* session number */
44 u_char extensions; /* number of extensions field (split header/trailer)*/
45 int cls_id; /* Data segment Client Service ID */
46 int offset; /* Data segment data offset*/
47 int length; /* Data segment data length*/
48 int checkpoint; /* Checkpoint number */
49 int report; /* Report Number */
50 int ubound; /* Report Upper Bound*/
51 int lbound; /* Report Lower Bound*/
52 int rclaims; /* Number of Reception Claims for Report */
53 int reason; /* Cancellation Reason code */
56 /* SDNV manipulation functions*/
57 int evaluate_sdnv(const u_char* loc, int *bytecount);
58 long long evaluate_sdnv_64(const u_char* loc, int *bytecount);