zapret/nfq/desync.h
2020-02-02 15:48:26 +03:00

28 lines
610 B
C

#pragma once
#include "darkmagic.h"
#include <stdint.h>
#include <stdbool.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#define DPI_DESYNC_FWMARK_DEFAULT 0x40000000
#define DPI_DESYNC_MAX_FAKE_LEN 1500
enum dpi_desync_mode {
DESYNC_NONE=0,
DESYNC_FAKE,
DESYNC_RST,
DESYNC_RSTACK,
DESYNC_DISORDER,
DESYNC_DISORDER2,
DESYNC_SPLIT,
DESYNC_SPLIT2
};
void desync_init();
bool dpi_desync_packet(const uint8_t *data_pkt, size_t len_pkt, struct iphdr *iphdr, struct ip6_hdr *ip6hdr, struct tcphdr *tcphdr, uint8_t *data_payload, size_t len_payload);