]> sjero.net Git - ltp2tcp/blob - ltp.h
Updated commandline args: Added -V for version, -h for help, changed -d to -v for...
[ltp2tcp] / ltp.h
1 /******************************************************************************
2 Utility to convert a LTP flow to a TCP flow for LTP analysis via tcptrace.
3 LTP Header information
4
5 Copyright (C) 2013  Samuel Jero <sj323707@ohio.edu>
6
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.
11
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.
16
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/>.
19
20 Author: Samuel Jero <sj323707@ohio.edu>
21 Date: 06/2013
22
23 Notes:
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
27                 be added in ltp2tcp.
28         2)Uses some special types from Linux (u_char, u_int32_t)
29 ******************************************************************************/
30
31 #ifndef LTP_H_
32 #define LTP_H_
33 #include <stdlib.h>
34
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
39  */
40 struct ltp_hdr_d{
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 */
54 };
55
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);
59
60 #endif