2024-07-30 20:10:00 +00:00
|
|
|
#ifndef YU_MANGLE_H
|
|
|
|
#define YU_MANGLE_H
|
2024-08-03 22:29:57 +00:00
|
|
|
|
2024-08-12 22:59:04 +00:00
|
|
|
#include "types.h"
|
2024-10-12 09:19:33 +00:00
|
|
|
#include "tls.h"
|
2024-07-30 20:10:00 +00:00
|
|
|
|
2024-08-10 23:10:18 +00:00
|
|
|
#define PKT_ACCEPT 0
|
|
|
|
#define PKT_DROP 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Processes the packet and returns verdict.
|
|
|
|
* This is the primary function that traverses the packet.
|
|
|
|
*/
|
|
|
|
int process_packet(const uint8_t *packet, uint32_t packet_len);
|
2024-08-11 21:23:08 +00:00
|
|
|
|
2024-08-13 17:48:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Processe the TCP packet.
|
|
|
|
* Returns verdict.
|
|
|
|
*/
|
2024-08-27 16:27:27 +00:00
|
|
|
int process_tcp_packet(const uint8_t *raw_payload, uint32_t raw_payload_len);
|
2024-08-13 17:48:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Processes the UDP packet.
|
|
|
|
* Returns verdict.
|
|
|
|
*/
|
2024-09-01 16:56:38 +00:00
|
|
|
int process_udp_packet(const uint8_t *pkt, uint32_t pktlen);
|
2024-08-13 17:48:35 +00:00
|
|
|
|
2024-10-12 09:19:33 +00:00
|
|
|
|
|
|
|
|
2024-08-11 21:23:08 +00:00
|
|
|
/**
|
|
|
|
* Sends fake client hello.
|
|
|
|
*/
|
2024-10-12 09:19:33 +00:00
|
|
|
int post_fake_sni(struct fake_type f_type,
|
|
|
|
const void *iph, unsigned int iph_len,
|
|
|
|
const struct tcphdr *tcph, unsigned int tcph_len);
|
2024-08-11 21:23:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Splits packet by poses and posts.
|
|
|
|
* Poses are relative to start of TCP payload.
|
|
|
|
* dvs used internally and should be zero.
|
|
|
|
*/
|
2024-08-27 16:27:27 +00:00
|
|
|
int send_tcp_frags(
|
2024-08-11 21:23:08 +00:00
|
|
|
const uint8_t *packet, uint32_t pktlen,
|
|
|
|
const uint32_t *poses, uint32_t poses_len, uint32_t dvs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Splits packet by poses and posts.
|
|
|
|
* Poses are relative to start of TCP payload.
|
|
|
|
* dvs used internally and should be zero.
|
|
|
|
*/
|
|
|
|
int send_ip4_frags(
|
|
|
|
const uint8_t *packet, uint32_t pktlen,
|
|
|
|
const uint32_t *poses, uint32_t poses_len, uint32_t dvs);
|
2024-07-30 20:10:00 +00:00
|
|
|
#endif /* YU_MANGLE_H */
|