mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-12-31 11:45:49 +03:00
Add skeleton for module and userspace iptables management
Special thanks to https://github.com/drivenets/iptables_extensions repository with detailed explanations of iptables userspace interaction with the kernel module.
This commit is contained in:
26
libipt_YTUNBLOCK.c
Normal file
26
libipt_YTUNBLOCK.c
Normal file
@@ -0,0 +1,26 @@
|
||||
// Used to register target in iptables
|
||||
#include <stdio.h>
|
||||
#include <xtables.h>
|
||||
|
||||
#include <linux/netfilter_ipv4/ip_tables.h>
|
||||
#include "ipt_YTUNBLOCK.h"
|
||||
|
||||
#define _init __attribute__((constructor)) _INIT
|
||||
#define __maybe_unused __attribute__((__unused__))
|
||||
|
||||
static void YTKB_help(void) {
|
||||
printf("Youtube Unblock - bypass youtube slowdown DPI in Russia\n");
|
||||
}
|
||||
|
||||
static struct xtables_target ykb_tg_reg = {
|
||||
.name = "YTUNBLOCK",
|
||||
.version = XTABLES_VERSION,
|
||||
.family = NFPROTO_IPV4,
|
||||
.size = XT_ALIGN(sizeof(struct xt_ytunblock_tginfo)),
|
||||
.userspacesize = XT_ALIGN(sizeof(struct xt_ytunblock_tginfo)),
|
||||
.help = YTKB_help,
|
||||
};
|
||||
|
||||
void _init(void) {
|
||||
xtables_register_target(&ykb_tg_reg);
|
||||
}
|
||||
Reference in New Issue
Block a user