]> sjero.net Git - ltp2tcp/blob - ltp.h
dec5be98ea2e2b524b30fcbcbe9cd69dfa09fcf9
[ltp2tcp] / ltp.h
1 /******************************************************************************
2
3 File: ltp.h
4
5 Author: Samuel Jero
6
7 Date: 12/2010
8
9 Description:  LTP Header information
10
11 ******************************************************************************/
12
13 #ifndef LTP_H_
14 #define LTP_H_
15 #include <stdlib.h>
16
17 /* structure to hold all the data from an LTP header.
18  *  Note that this isn't the RAW header like in IP,TCP;
19  *  it is a structure to hold all the information. The
20  *  RAW header is mostly SDNV values
21  */
22 struct ltp_hdr_d{
23         u_char  vers_ctl;               /* Version and Control Field*/
24         int     sender_id;              /* Session sender id*/
25         int     session_num;    /* session number */
26         u_char  extensions;             /* number of extensions field (split header/trailer)*/
27         int     cls_id;                 /* Data segment Client Service ID */
28         int     offset;                 /* Data segment data offset*/
29         int     length;                 /* Data segment data length*/
30         int     checkpoint;             /* Checkpoint number */
31         int     report;                 /* Report Number */
32         int     ubound;                 /* Report Upper Bound*/
33         int     lbound;                 /* Report Lower Bound*/
34         int     rclaims;                /* Number of Reception Claims for Report */
35         int     reason;                 /* Cancellation Reason code */
36 };
37
38 /* SDNV manipulation functions*/
39 int evaluate_sdnv(const u_char* loc, int *bytecount);
40 long long evaluate_sdnv_64(const u_char* loc, int *bytecount);
41
42 #endif