| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef __RELAY_H__
- #define __RELAY_H__
- #include <netinet/in.h>
- #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__ */
|