2024-10-28 11:32:24 +05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include "params.h"
|
|
|
|
|
|
|
|
#define SPLIT_FLAG_DISORDER 0x01
|
|
|
|
#define SPLIT_FLAG_OOB 0x02
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
// common state
|
|
|
|
t_l7proto l7proto;
|
|
|
|
bool bTamperInCutoff;
|
2024-11-22 14:42:33 +05:00
|
|
|
bool b_host_checked,b_host_matches,b_ah_check;
|
2024-10-28 11:32:24 +05:00
|
|
|
char *hostname;
|
|
|
|
struct desync_profile *dp; // desync profile cache
|
|
|
|
} t_ctrack;
|
|
|
|
|
|
|
|
void apply_desync_profile(t_ctrack *ctrack, const struct sockaddr *dest);
|
|
|
|
|
2024-11-14 00:05:06 +05:00
|
|
|
void tamper_out(t_ctrack *ctrack, const struct sockaddr *dest, uint8_t *segment,size_t segment_buffer_size,size_t *size, size_t *multisplit_pos, int *multisplit_count, uint8_t *split_flags);
|
2024-10-15 13:23:37 +05:00
|
|
|
void tamper_in(t_ctrack *ctrack, const struct sockaddr *client, uint8_t *segment,size_t segment_buffer_size,size_t *size);
|
2024-10-28 11:32:24 +05:00
|
|
|
// connection reset by remote leg
|
2024-10-15 13:23:37 +05:00
|
|
|
void rst_in(t_ctrack *ctrack, const struct sockaddr *client);
|
2024-10-28 11:32:24 +05:00
|
|
|
// local leg closed connection (timeout waiting response ?)
|
2024-10-15 13:23:37 +05:00
|
|
|
void hup_out(t_ctrack *ctrack, const struct sockaddr *client);
|
2024-11-14 16:03:37 +05:00
|
|
|
|
|
|
|
void packet_debug(const uint8_t *data, size_t sz);
|