* io_uring使用buffer pool避免内存分配与释放
* packet io thread与worker thread无锁访问cmsg
* 为解密流量的fd设置默认的TTL
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
#ifndef _TFE_TCP_RESTORE_H
|
|
#define _TFE_TCP_RESTORE_H
|
|
|
|
#ifdef __cpluscplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
enum tcp_restore_pkt_dir
|
|
{
|
|
PKT_DIR_NOT_SET = 0x0,
|
|
PKT_DIR_C2S = 0x1,
|
|
PKT_DIR_S2C = 0x2
|
|
};
|
|
|
|
struct tcp_restore_endpoint
|
|
{
|
|
struct sockaddr_storage addr;
|
|
uint32_t seq;
|
|
uint32_t ack;
|
|
uint32_t ts_val;
|
|
uint16_t mss;
|
|
uint16_t window;
|
|
uint8_t wscale;
|
|
bool wscale_perm;
|
|
bool timestamp_perm;
|
|
bool sack_perm;
|
|
};
|
|
|
|
struct tcp_restore_info
|
|
{
|
|
enum tcp_restore_pkt_dir cur_dir;
|
|
struct tcp_restore_endpoint client;
|
|
struct tcp_restore_endpoint server;
|
|
|
|
char cmsg[2048];
|
|
unsigned int cmsg_len;
|
|
};
|
|
|
|
void tfe_tcp_restore_info_dump(const struct tcp_restore_info *info);
|
|
int tfe_tcp_restore_fd_create(const struct tcp_restore_endpoint *endpoint, const struct tcp_restore_endpoint *peer, const char *devname, unsigned int fd_so_mask);
|
|
|
|
int tfe_tcp_restore_syn_packet(struct tcp_restore_info *info, struct ether_addr *client_mac, struct ether_addr *server_mac, char *buffer, int size);
|
|
int tfe_tcp_restore_synack_packet(struct tcp_restore_info *info, struct ether_addr *client_mac, struct ether_addr *server_mac, char *buffer, int size);
|
|
int tfe_tcp_restore_ack_packet(struct tcp_restore_info *info, struct ether_addr *client_mac, struct ether_addr *server_mac, char *buffer, int size);
|
|
|
|
#ifdef __cpluscplus
|
|
}
|
|
#endif
|
|
|
|
#endif |