#ifndef __RELAY_H__ #define __RELAY_H__ #include #include "ptwist.h" #define MAX_FLOWS 10 #define TLS_CLNT_HELLO 0x01 #define TLS_SERV_HELLO 0x02 #define TLS_KEY_EXCHG 0x04 #define TLS_NEW_SESS 0x08 #define TLS_FINISHED 0x10 typedef struct tcp_state_st { int sequence_number; } TCP_state; typedef struct flow_st { struct in_addr src_ip, dst_ip; /* Source and Destination addresses */ u_short src_port, dst_port; /* Source and Destination ports */ u_int seq_num; /* sequence number */ byte key[16]; /* negotiated key */ int tls_state; /* TLS handshake state */ int encrypted; /* indicates whether flow is encrypted */ } flow; typedef struct flow_table_st { flow *table; int len; int max_len; } flow_table; int init_flow_table (void); int add_flow(flow newFlow); int update_flow(int index, int code); int remove_flow(int index); int check_flow(flow observed); flow *get_flow(int index); #endif /* __RELAY_H__ */