1 /******************************************************************************
9 Description: Header file for LTP 2 TCP Conversion
15 ******************************************************************************/
22 #include <arpa/inet.h>
23 #include <netinet/tcp.h>
31 extern int debug; /*set to 1 to turn on debugging information, see ltp2tcp.c*/
32 extern int MAX_SESSION; /* max session size, see ltp2tcp.c*/
39 int max; /*max used session*/
40 struct tbl *table; /*session table */
41 int size; /*session table size */
44 /*session table structure*/
46 int num; /*LTP session num */
47 u_int32_t start; /*start sequence number*/
48 int acked; /* length of session that has been acked */
49 int length; /* length of session */
50 int seq_id; /*sequential Session id*/
51 struct cl* a_lst; /*list of claims*/
56 struct cl* next; /*pointer to next claim*/
57 int offset; /*offset for this data piece*/
58 int length; /*length of this data peice*/
62 struct conversion_state{
63 int seq_num; /* Largest TCP sequence Number used*/
64 int ack_num; /* Largest TCP acknowledgment Number used*/
65 int win; /* Largest TCP window used*/
66 int started; /* 1 if we have found any LTP so far, 0 otherwise*/
67 int sender_id; /* LTP sender ID for this connection*/
68 int seq_ses_id; /* Number of LTP sessions in this connection so far*/
69 struct session ses; /* Session Table Structure*/
70 void* en_priv; /* Pointer for Encapsulation data*/
71 struct encap_ops* en_ops; /* Pointer to encapsulation operations*/
72 pcap_t* in; /*libpcap input file discriptor*/
73 pcap_dumper_t* out; /*libpcap output file discriptor*/
74 int ses_min; /*session filtering: low*/
75 int ses_max; /*session filtering: high*/
77 struct conversion_state state;
79 #define MAX_PACKET 1600 /*Maximum size of TCP packet*/
80 #define WIN_FACTOR 10000 /*Size of TCP window*/
81 #define TBL_SZ 10000 /*Size of Session Table*/
87 * 0) Always print even if debug isn't specified
88 * 1) Errors and warnings... Don't overload the screen with too much output
89 * 2) Notes and per-packet processing info... as verbose as needed
91 void dbgprintf(int level, const char *fmt, ...);