mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-23 11:29:46 +00:00
sys/linux: extend netfilter descriptions
This commit is contained in:
parent
5d7477249b
commit
08146b1a84
@ -71,6 +71,11 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE)
|
||||
#include <linux/net.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_FAULT_INJECTION)
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@ -947,6 +952,149 @@ static int do_sandbox_namespace(int executor_pid, bool enable_tun)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE)
|
||||
// checkpoint/reset_net_namespace partially resets net namespace to initial state
|
||||
// after each test. Currently it resets only ipv4 netfilter state.
|
||||
// Ideally, we just create a new net namespace for each test,
|
||||
// however it's too slow (1-1.5 seconds per namespace, not parallelizable).
|
||||
|
||||
// Linux headers do not compile for C++, so we have to define the structs manualy.
|
||||
struct ipt_getinfo {
|
||||
char name[32];
|
||||
unsigned int valid_hooks;
|
||||
unsigned int hook_entry[5];
|
||||
unsigned int underflow[5];
|
||||
unsigned int num_entries;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
struct ipt_get_entries {
|
||||
char name[32];
|
||||
unsigned int size;
|
||||
unsigned int pad;
|
||||
char entrytable[1024];
|
||||
};
|
||||
|
||||
struct xt_counters {
|
||||
uint64 pcnt, bcnt;
|
||||
};
|
||||
|
||||
struct ipt_replace {
|
||||
char name[32];
|
||||
unsigned int valid_hooks;
|
||||
unsigned int num_entries;
|
||||
unsigned int size;
|
||||
unsigned int hook_entry[5];
|
||||
unsigned int underflow[5];
|
||||
unsigned int num_counters;
|
||||
struct xt_counters* counters;
|
||||
char entrytable[1024];
|
||||
};
|
||||
|
||||
struct ipt_table_desc {
|
||||
const char* name;
|
||||
struct ipt_getinfo info;
|
||||
struct ipt_get_entries entries;
|
||||
struct ipt_replace replace;
|
||||
struct xt_counters counters[10];
|
||||
};
|
||||
|
||||
static struct ipt_table_desc ipv4_tables[] = {
|
||||
{.name = "filter"},
|
||||
{.name = "nat"},
|
||||
{.name = "mangle"},
|
||||
{.name = "raw"},
|
||||
{.name = "security"},
|
||||
};
|
||||
|
||||
#define IPT_BASE_CTL 64
|
||||
#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
|
||||
#define IPT_SO_GET_INFO (IPT_BASE_CTL)
|
||||
#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
|
||||
|
||||
static void checkpoint_net_namespace(void)
|
||||
{
|
||||
socklen_t optlen;
|
||||
unsigned i;
|
||||
int fd;
|
||||
|
||||
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (fd == -1)
|
||||
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
|
||||
for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) {
|
||||
struct ipt_table_desc* table = &ipv4_tables[i];
|
||||
strcpy(table->info.name, table->name);
|
||||
strcpy(table->entries.name, table->name);
|
||||
strcpy(table->replace.name, table->name);
|
||||
optlen = sizeof(table->info);
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &table->info, &optlen)) {
|
||||
switch (errno) {
|
||||
case EPERM:
|
||||
case ENOENT:
|
||||
case ENOPROTOOPT:
|
||||
continue;
|
||||
}
|
||||
fail("getsockopt(IPT_SO_GET_INFO)");
|
||||
}
|
||||
if (table->info.size > sizeof(table->entries.entrytable))
|
||||
fail("table size is too large: %u", table->info.size);
|
||||
if (table->info.num_entries > sizeof(table->counters) / sizeof(table->counters[0]))
|
||||
fail("too many counters: %u", table->info.num_entries);
|
||||
table->entries.size = table->info.size;
|
||||
optlen = sizeof(table->entries) - sizeof(table->entries.entrytable) + table->info.size;
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &table->entries, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_ENTRIES)");
|
||||
table->replace.valid_hooks = table->info.valid_hooks;
|
||||
table->replace.num_entries = table->info.num_entries;
|
||||
table->replace.counters = table->counters;
|
||||
table->replace.size = table->info.size;
|
||||
memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry));
|
||||
memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow));
|
||||
memcpy(table->replace.entrytable, table->entries.entrytable, table->info.size);
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void reset_net_namespace(void)
|
||||
{
|
||||
struct ipt_get_entries entries;
|
||||
struct ipt_getinfo info;
|
||||
socklen_t optlen;
|
||||
unsigned i;
|
||||
int fd;
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
memset(&entries, 0, sizeof(entries));
|
||||
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (fd == -1)
|
||||
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
|
||||
for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) {
|
||||
struct ipt_table_desc* table = &ipv4_tables[i];
|
||||
if (table->info.valid_hooks == 0)
|
||||
continue;
|
||||
strcpy(info.name, table->name);
|
||||
optlen = sizeof(info);
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &info, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_INFO)");
|
||||
if (memcmp(&table->info, &info, sizeof(table->info)) == 0) {
|
||||
strcpy(entries.name, table->name);
|
||||
entries.size = table->info.size;
|
||||
optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size;
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &entries, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_ENTRIES)");
|
||||
if (memcmp(&table->entries, &entries, optlen) == 0)
|
||||
continue;
|
||||
}
|
||||
debug("resetting iptable %s\n", table->name);
|
||||
table->replace.num_counters = info.num_entries;
|
||||
optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size;
|
||||
if (setsockopt(fd, SOL_IP, IPT_SO_SET_REPLACE, &table->replace, optlen))
|
||||
fail("setsockopt(IPT_SO_SET_REPLACE)");
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT) && defined(SYZ_USE_TMP_DIR))
|
||||
// One does not simply remove a directory.
|
||||
// There can be mounts, so we need to try to umount.
|
||||
@ -1068,6 +1216,9 @@ static void test();
|
||||
void loop()
|
||||
{
|
||||
int iter;
|
||||
#if defined(SYZ_RESET_NET_NAMESPACE)
|
||||
checkpoint_net_namespace();
|
||||
#endif
|
||||
for (iter = 0;; iter++) {
|
||||
#ifdef SYZ_USE_TMP_DIR
|
||||
char cwdbuf[256];
|
||||
@ -1108,6 +1259,9 @@ void loop()
|
||||
}
|
||||
#ifdef SYZ_USE_TMP_DIR
|
||||
remove_dir(cwdbuf);
|
||||
#endif
|
||||
#if defined(SYZ_RESET_NET_NAMESPACE)
|
||||
reset_net_namespace();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ void loop()
|
||||
{
|
||||
// Tell parent that we are ready to serve.
|
||||
reply_handshake();
|
||||
checkpoint_net_namespace();
|
||||
|
||||
for (int iter = 0;; iter++) {
|
||||
// Create a new private work dir for this test (removed at the end of the loop).
|
||||
@ -205,8 +206,9 @@ void loop()
|
||||
fail("child failed");
|
||||
if (status == kErrorStatus)
|
||||
error("child errored");
|
||||
remove_dir(cwdbuf);
|
||||
reply_execute(0);
|
||||
remove_dir(cwdbuf);
|
||||
reset_net_namespace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#if defined(__i386__) || 0
|
||||
#define GOARCH "386"
|
||||
#define SYZ_REVISION "e40ab07d179f415c45cf2ecb376828bda26f4141"
|
||||
unsigned syscall_count = 1575;
|
||||
#define SYZ_REVISION "a721e2aa93c1691bcd8e5cc8fa24a913235f2483"
|
||||
unsigned syscall_count = 1576;
|
||||
call_t syscalls[] = {
|
||||
{"accept4", 364},
|
||||
{"accept4$alg", 364},
|
||||
@ -1194,6 +1194,7 @@ call_t syscalls[] = {
|
||||
{"setsockopt", 366},
|
||||
{"setsockopt$ALG_SET_AEAD_AUTHSIZE", 366},
|
||||
{"setsockopt$ALG_SET_KEY", 366},
|
||||
{"setsockopt$IP6T_SO_SET_REPLACE", 366},
|
||||
{"setsockopt$IPT_SO_SET_REPLACE", 366},
|
||||
{"setsockopt$RDS_CANCEL_SENT_TO", 366},
|
||||
{"setsockopt$RDS_CONG_MONITOR", 366},
|
||||
@ -1586,8 +1587,8 @@ call_t syscalls[] = {
|
||||
|
||||
#if defined(__x86_64__) || 0
|
||||
#define GOARCH "amd64"
|
||||
#define SYZ_REVISION "94bcfe970dc4e9b561898e0fac423f4472ebae6a"
|
||||
unsigned syscall_count = 1628;
|
||||
#define SYZ_REVISION "bc125788702a194b20b8cd6fbe0891f5129b9246"
|
||||
unsigned syscall_count = 1629;
|
||||
call_t syscalls[] = {
|
||||
{"accept", 43},
|
||||
{"accept$alg", 43},
|
||||
@ -2819,6 +2820,7 @@ call_t syscalls[] = {
|
||||
{"setsockopt", 54},
|
||||
{"setsockopt$ALG_SET_AEAD_AUTHSIZE", 54},
|
||||
{"setsockopt$ALG_SET_KEY", 54},
|
||||
{"setsockopt$IP6T_SO_SET_REPLACE", 54},
|
||||
{"setsockopt$IPT_SO_SET_REPLACE", 54},
|
||||
{"setsockopt$RDS_CANCEL_SENT_TO", 54},
|
||||
{"setsockopt$RDS_CONG_MONITOR", 54},
|
||||
@ -3223,8 +3225,8 @@ call_t syscalls[] = {
|
||||
|
||||
#if defined(__arm__) || 0
|
||||
#define GOARCH "arm"
|
||||
#define SYZ_REVISION "ede3e4008d609f29bd0f3b8347254e4b85aef2a4"
|
||||
unsigned syscall_count = 1585;
|
||||
#define SYZ_REVISION "30d6c04729a43d9c1a297cd46ae6ecea4bbd2828"
|
||||
unsigned syscall_count = 1586;
|
||||
call_t syscalls[] = {
|
||||
{"accept", 285},
|
||||
{"accept$alg", 285},
|
||||
@ -4416,6 +4418,7 @@ call_t syscalls[] = {
|
||||
{"setsockopt", 294},
|
||||
{"setsockopt$ALG_SET_AEAD_AUTHSIZE", 294},
|
||||
{"setsockopt$ALG_SET_KEY", 294},
|
||||
{"setsockopt$IP6T_SO_SET_REPLACE", 294},
|
||||
{"setsockopt$IPT_SO_SET_REPLACE", 294},
|
||||
{"setsockopt$RDS_CANCEL_SENT_TO", 294},
|
||||
{"setsockopt$RDS_CONG_MONITOR", 294},
|
||||
@ -4817,8 +4820,8 @@ call_t syscalls[] = {
|
||||
|
||||
#if defined(__aarch64__) || 0
|
||||
#define GOARCH "arm64"
|
||||
#define SYZ_REVISION "42b28c68ad2166ea4c3543065f25bf48d8c40d64"
|
||||
unsigned syscall_count = 1557;
|
||||
#define SYZ_REVISION "3665ee48a0043014f610083086fb5983216220fa"
|
||||
unsigned syscall_count = 1558;
|
||||
call_t syscalls[] = {
|
||||
{"accept", 202},
|
||||
{"accept$alg", 202},
|
||||
@ -5991,6 +5994,7 @@ call_t syscalls[] = {
|
||||
{"setsockopt", 208},
|
||||
{"setsockopt$ALG_SET_AEAD_AUTHSIZE", 208},
|
||||
{"setsockopt$ALG_SET_KEY", 208},
|
||||
{"setsockopt$IP6T_SO_SET_REPLACE", 208},
|
||||
{"setsockopt$IPT_SO_SET_REPLACE", 208},
|
||||
{"setsockopt$RDS_CANCEL_SENT_TO", 208},
|
||||
{"setsockopt$RDS_CONG_MONITOR", 208},
|
||||
@ -6383,8 +6387,8 @@ call_t syscalls[] = {
|
||||
|
||||
#if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0
|
||||
#define GOARCH "ppc64le"
|
||||
#define SYZ_REVISION "442772ac6b8522876e25582e1d1d0e4dd1c1f371"
|
||||
unsigned syscall_count = 1544;
|
||||
#define SYZ_REVISION "d14f1cf09eff5bf9a0ba0c62ea72dadb8fa07165"
|
||||
unsigned syscall_count = 1545;
|
||||
call_t syscalls[] = {
|
||||
{"accept", 330},
|
||||
{"accept$alg", 330},
|
||||
@ -7545,6 +7549,7 @@ call_t syscalls[] = {
|
||||
{"setsockopt", 339},
|
||||
{"setsockopt$ALG_SET_AEAD_AUTHSIZE", 339},
|
||||
{"setsockopt$ALG_SET_KEY", 339},
|
||||
{"setsockopt$IP6T_SO_SET_REPLACE", 339},
|
||||
{"setsockopt$IPT_SO_SET_REPLACE", 339},
|
||||
{"setsockopt$RDS_CANCEL_SENT_TO", 339},
|
||||
{"setsockopt$RDS_CONG_MONITOR", 339},
|
||||
|
@ -96,6 +96,9 @@ func defineList(p *prog.Prog, opts Options) ([]string, error) {
|
||||
}
|
||||
if opts.WaitRepeat {
|
||||
defines = append(defines, "SYZ_WAIT_REPEAT")
|
||||
// TODO(dvyukov): this should have a separate option,
|
||||
// but for now it's bundled with WaitRepeat.
|
||||
defines = append(defines, "SYZ_RESET_NET_NAMESPACE")
|
||||
}
|
||||
if opts.Debug {
|
||||
defines = append(defines, "SYZ_DEBUG")
|
||||
|
@ -72,6 +72,11 @@ var commonHeaderLinux = `
|
||||
#include <sys/stat.h>
|
||||
#include <sys/uio.h>
|
||||
#endif
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE)
|
||||
#include <linux/net.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_FAULT_INJECTION)
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@ -1984,6 +1989,144 @@ static int do_sandbox_namespace(int executor_pid, bool enable_tun)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || defined(SYZ_RESET_NET_NAMESPACE)
|
||||
|
||||
struct ipt_getinfo {
|
||||
char name[32];
|
||||
unsigned int valid_hooks;
|
||||
unsigned int hook_entry[5];
|
||||
unsigned int underflow[5];
|
||||
unsigned int num_entries;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
struct ipt_get_entries {
|
||||
char name[32];
|
||||
unsigned int size;
|
||||
unsigned int pad;
|
||||
char entrytable[1024];
|
||||
};
|
||||
|
||||
struct xt_counters {
|
||||
uint64 pcnt, bcnt;
|
||||
};
|
||||
|
||||
struct ipt_replace {
|
||||
char name[32];
|
||||
unsigned int valid_hooks;
|
||||
unsigned int num_entries;
|
||||
unsigned int size;
|
||||
unsigned int hook_entry[5];
|
||||
unsigned int underflow[5];
|
||||
unsigned int num_counters;
|
||||
struct xt_counters* counters;
|
||||
char entrytable[1024];
|
||||
};
|
||||
|
||||
struct ipt_table_desc {
|
||||
const char* name;
|
||||
struct ipt_getinfo info;
|
||||
struct ipt_get_entries entries;
|
||||
struct ipt_replace replace;
|
||||
struct xt_counters counters[10];
|
||||
};
|
||||
|
||||
static struct ipt_table_desc ipv4_tables[] = {
|
||||
{.name = "filter"},
|
||||
{.name = "nat"},
|
||||
{.name = "mangle"},
|
||||
{.name = "raw"},
|
||||
{.name = "security"},
|
||||
};
|
||||
|
||||
#define IPT_BASE_CTL 64
|
||||
#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
|
||||
#define IPT_SO_GET_INFO (IPT_BASE_CTL)
|
||||
#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
|
||||
|
||||
static void checkpoint_net_namespace(void)
|
||||
{
|
||||
socklen_t optlen;
|
||||
unsigned i;
|
||||
int fd;
|
||||
|
||||
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (fd == -1)
|
||||
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
|
||||
for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) {
|
||||
struct ipt_table_desc* table = &ipv4_tables[i];
|
||||
strcpy(table->info.name, table->name);
|
||||
strcpy(table->entries.name, table->name);
|
||||
strcpy(table->replace.name, table->name);
|
||||
optlen = sizeof(table->info);
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &table->info, &optlen)) {
|
||||
switch (errno) {
|
||||
case EPERM:
|
||||
case ENOENT:
|
||||
case ENOPROTOOPT:
|
||||
continue;
|
||||
}
|
||||
fail("getsockopt(IPT_SO_GET_INFO)");
|
||||
}
|
||||
if (table->info.size > sizeof(table->entries.entrytable))
|
||||
fail("table size is too large: %u", table->info.size);
|
||||
if (table->info.num_entries > sizeof(table->counters) / sizeof(table->counters[0]))
|
||||
fail("too many counters: %u", table->info.num_entries);
|
||||
table->entries.size = table->info.size;
|
||||
optlen = sizeof(table->entries) - sizeof(table->entries.entrytable) + table->info.size;
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &table->entries, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_ENTRIES)");
|
||||
table->replace.valid_hooks = table->info.valid_hooks;
|
||||
table->replace.num_entries = table->info.num_entries;
|
||||
table->replace.counters = table->counters;
|
||||
table->replace.size = table->info.size;
|
||||
memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry));
|
||||
memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow));
|
||||
memcpy(table->replace.entrytable, table->entries.entrytable, table->info.size);
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void reset_net_namespace(void)
|
||||
{
|
||||
struct ipt_get_entries entries;
|
||||
struct ipt_getinfo info;
|
||||
socklen_t optlen;
|
||||
unsigned i;
|
||||
int fd;
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
memset(&entries, 0, sizeof(entries));
|
||||
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (fd == -1)
|
||||
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
|
||||
for (i = 0; i < sizeof(ipv4_tables) / sizeof(ipv4_tables[0]); i++) {
|
||||
struct ipt_table_desc* table = &ipv4_tables[i];
|
||||
if (table->info.valid_hooks == 0)
|
||||
continue;
|
||||
strcpy(info.name, table->name);
|
||||
optlen = sizeof(info);
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_INFO, &info, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_INFO)");
|
||||
if (memcmp(&table->info, &info, sizeof(table->info)) == 0) {
|
||||
strcpy(entries.name, table->name);
|
||||
entries.size = table->info.size;
|
||||
optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size;
|
||||
if (getsockopt(fd, SOL_IP, IPT_SO_GET_ENTRIES, &entries, &optlen))
|
||||
fail("getsockopt(IPT_SO_GET_ENTRIES)");
|
||||
if (memcmp(&table->entries, &entries, optlen) == 0)
|
||||
continue;
|
||||
}
|
||||
debug("resetting iptable %s\n", table->name);
|
||||
table->replace.num_counters = info.num_entries;
|
||||
optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size;
|
||||
if (setsockopt(fd, SOL_IP, IPT_SO_SET_REPLACE, &table->replace, optlen))
|
||||
fail("setsockopt(IPT_SO_SET_REPLACE)");
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT) && defined(SYZ_USE_TMP_DIR))
|
||||
static void remove_dir(const char* dir)
|
||||
{
|
||||
@ -2094,6 +2237,9 @@ static void test();
|
||||
void loop()
|
||||
{
|
||||
int iter;
|
||||
#if defined(SYZ_RESET_NET_NAMESPACE)
|
||||
checkpoint_net_namespace();
|
||||
#endif
|
||||
for (iter = 0;; iter++) {
|
||||
#ifdef SYZ_USE_TMP_DIR
|
||||
char cwdbuf[256];
|
||||
@ -2134,6 +2280,9 @@ void loop()
|
||||
}
|
||||
#ifdef SYZ_USE_TMP_DIR
|
||||
remove_dir(cwdbuf);
|
||||
#endif
|
||||
#if defined(SYZ_RESET_NET_NAMESPACE)
|
||||
reset_net_namespace();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,9 @@ func (opts Options) Check() error {
|
||||
// This does not affect generated code.
|
||||
return errors.New("Procs>1 without Repeat")
|
||||
}
|
||||
if !opts.Repeat && opts.WaitRepeat {
|
||||
return errors.New("WaitRepeat without Repeat")
|
||||
}
|
||||
if opts.Sandbox == "namespace" && !opts.UseTmpDir {
|
||||
// This is borken and never worked.
|
||||
// This tries to create syz-tmp dir in cwd,
|
||||
|
@ -789,6 +789,7 @@ var progSimplifies = []Simplify{
|
||||
return false
|
||||
}
|
||||
opts.Repeat = false
|
||||
opts.WaitRepeat = false
|
||||
opts.Procs = 1
|
||||
return true
|
||||
},
|
||||
|
@ -104,7 +104,7 @@ func foreachSubargImpl(arg Arg, parent *[]Arg, f func(arg, base Arg, parent *[]A
|
||||
rec(arg, nil, parent)
|
||||
}
|
||||
|
||||
func foreachSubarg(arg Arg, f func(arg, base Arg, parent *[]Arg)) {
|
||||
func ForeachSubarg(arg Arg, f func(arg, base Arg, parent *[]Arg)) {
|
||||
foreachSubargImpl(arg, nil, f)
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,7 @@ func testEachTargetRandom(t *testing.T, fn func(t *testing.T, target *Target, rs
|
||||
target := target
|
||||
rs := rand.NewSource(rs0.Int63())
|
||||
t.Run(fmt.Sprintf("%v/%v", target.OS, target.Arch), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
fn(t, target, rs, iters)
|
||||
})
|
||||
}
|
||||
|
242
prog/minimization.go
Normal file
242
prog/minimization.go
Normal file
@ -0,0 +1,242 @@
|
||||
// Copyright 2018 syzkaller project authors. All rights reserved.
|
||||
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
package prog
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Minimize minimizes program p into an equivalent program using the equivalence
|
||||
// predicate pred. It iteratively generates simpler programs and asks pred
|
||||
// whether it is equal to the orginal program or not. If it is equivalent then
|
||||
// the simplification attempt is committed and the process continues.
|
||||
func Minimize(p0 *Prog, callIndex0 int, pred0 func(*Prog, int) bool, crash bool) (*Prog, int) {
|
||||
pred := pred0
|
||||
if debug {
|
||||
pred = func(p *Prog, callIndex int) bool {
|
||||
if err := p.validate(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return pred0(p, callIndex)
|
||||
}
|
||||
}
|
||||
name0 := ""
|
||||
if callIndex0 != -1 {
|
||||
if callIndex0 < 0 || callIndex0 >= len(p0.Calls) {
|
||||
panic("bad call index")
|
||||
}
|
||||
name0 = p0.Calls[callIndex0].Meta.Name
|
||||
}
|
||||
|
||||
// Try to glue all mmap's together.
|
||||
s := analyze(nil, p0, nil)
|
||||
hi := -1
|
||||
lo := -1
|
||||
for i := 0; i < maxPages; i++ {
|
||||
if s.pages[i] {
|
||||
hi = i
|
||||
if lo == -1 {
|
||||
lo = i
|
||||
}
|
||||
}
|
||||
}
|
||||
if hi != -1 {
|
||||
p := p0.Clone()
|
||||
callIndex := callIndex0
|
||||
// Remove all mmaps.
|
||||
for i := 0; i < len(p.Calls); i++ {
|
||||
c := p.Calls[i]
|
||||
if i != callIndex && c.Meta == p.Target.MmapSyscall {
|
||||
p.removeCall(i)
|
||||
if i < callIndex {
|
||||
callIndex--
|
||||
}
|
||||
i--
|
||||
}
|
||||
}
|
||||
// Prepend uber-mmap.
|
||||
mmap := p0.Target.MakeMmap(uint64(lo), uint64(hi-lo)+1)
|
||||
p.Calls = append([]*Call{mmap}, p.Calls...)
|
||||
if callIndex != -1 {
|
||||
callIndex++
|
||||
}
|
||||
if pred(p, callIndex) {
|
||||
p0 = p
|
||||
callIndex0 = callIndex
|
||||
}
|
||||
}
|
||||
|
||||
// Try to remove all calls except the last one one-by-one.
|
||||
for i := len(p0.Calls) - 1; i >= 0; i-- {
|
||||
if i == callIndex0 {
|
||||
continue
|
||||
}
|
||||
callIndex := callIndex0
|
||||
if i < callIndex {
|
||||
callIndex--
|
||||
}
|
||||
p := p0.Clone()
|
||||
p.removeCall(i)
|
||||
if !pred(p, callIndex) {
|
||||
continue
|
||||
}
|
||||
p0 = p
|
||||
callIndex0 = callIndex
|
||||
}
|
||||
|
||||
var triedPaths map[string]bool
|
||||
|
||||
var rec func(p *Prog, call *Call, arg Arg, path string) bool
|
||||
rec = func(p *Prog, call *Call, arg Arg, path string) bool {
|
||||
path += fmt.Sprintf("-%v", arg.Type().FieldName())
|
||||
switch typ := arg.Type().(type) {
|
||||
case *StructType:
|
||||
a := arg.(*GroupArg)
|
||||
for _, innerArg := range a.Inner {
|
||||
if rec(p, call, innerArg, path) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
case *UnionType:
|
||||
a := arg.(*UnionArg)
|
||||
if rec(p, call, a.Option, path) {
|
||||
return true
|
||||
}
|
||||
case *PtrType:
|
||||
// TODO: try to remove optional ptrs
|
||||
a, ok := arg.(*PointerArg)
|
||||
if !ok {
|
||||
// Can also be *ConstArg.
|
||||
return false
|
||||
}
|
||||
if a.Res != nil {
|
||||
return rec(p, call, a.Res, path)
|
||||
}
|
||||
case *ArrayType:
|
||||
a := arg.(*GroupArg)
|
||||
for i, innerArg := range a.Inner {
|
||||
innerPath := fmt.Sprintf("%v-%v", path, i)
|
||||
if !triedPaths[innerPath] && !crash {
|
||||
if (typ.Kind == ArrayRangeLen && len(a.Inner) > int(typ.RangeBegin)) ||
|
||||
(typ.Kind == ArrayRandLen) {
|
||||
copy(a.Inner[i:], a.Inner[i+1:])
|
||||
a.Inner = a.Inner[:len(a.Inner)-1]
|
||||
removeArg(innerArg)
|
||||
p.Target.assignSizesCall(call)
|
||||
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
} else {
|
||||
triedPaths[innerPath] = true
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
if rec(p, call, innerArg, innerPath) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
case *IntType, *FlagsType, *ProcType:
|
||||
// TODO: try to reset bits in ints
|
||||
// TODO: try to set separate flags
|
||||
if crash {
|
||||
return false
|
||||
}
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
a := arg.(*ConstArg)
|
||||
if a.Val == typ.Default() {
|
||||
return false
|
||||
}
|
||||
v0 := a.Val
|
||||
a.Val = typ.Default()
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
return true
|
||||
} else {
|
||||
a.Val = v0
|
||||
}
|
||||
case *ResourceType:
|
||||
if crash {
|
||||
return false
|
||||
}
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
a := arg.(*ResultArg)
|
||||
if a.Res == nil {
|
||||
return false
|
||||
}
|
||||
r0 := a.Res
|
||||
a.Res = nil
|
||||
a.Val = typ.Default()
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
return true
|
||||
} else {
|
||||
a.Res = r0
|
||||
a.Val = 0
|
||||
}
|
||||
case *BufferType:
|
||||
// TODO: try to set individual bytes to 0
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
if typ.Kind != BufferBlobRand && typ.Kind != BufferBlobRange ||
|
||||
typ.Dir() == DirOut {
|
||||
return false
|
||||
}
|
||||
a := arg.(*DataArg)
|
||||
minLen := int(typ.RangeBegin)
|
||||
for step := len(a.Data()) - minLen; len(a.Data()) > minLen && step > 0; {
|
||||
if len(a.Data())-step >= minLen {
|
||||
a.data = a.Data()[:len(a.Data())-step]
|
||||
p.Target.assignSizesCall(call)
|
||||
if pred(p, callIndex0) {
|
||||
continue
|
||||
}
|
||||
a.data = a.Data()[:len(a.Data())+step]
|
||||
p.Target.assignSizesCall(call)
|
||||
}
|
||||
step /= 2
|
||||
if crash {
|
||||
break
|
||||
}
|
||||
}
|
||||
p0 = p
|
||||
case *VmaType, *LenType, *CsumType, *ConstType:
|
||||
// TODO: try to remove offset from vma
|
||||
return false
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown arg type '%+v'", typ))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Try to minimize individual args.
|
||||
for i := 0; i < len(p0.Calls); i++ {
|
||||
triedPaths = make(map[string]bool)
|
||||
again:
|
||||
p := p0.Clone()
|
||||
call := p.Calls[i]
|
||||
for j, arg := range call.Args {
|
||||
if rec(p, call, arg, fmt.Sprintf("%v", j)) {
|
||||
goto again
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if callIndex0 != -1 {
|
||||
if callIndex0 < 0 || callIndex0 >= len(p0.Calls) || name0 != p0.Calls[callIndex0].Meta.Name {
|
||||
panic(fmt.Sprintf("bad call index after minimization: ncalls=%v index=%v call=%v/%v",
|
||||
len(p0.Calls), callIndex0, name0, p0.Calls[callIndex0].Meta.Name))
|
||||
}
|
||||
}
|
||||
return p0, callIndex0
|
||||
}
|
748
prog/mutation.go
748
prog/mutation.go
@ -15,6 +15,7 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable, corpus []*Pro
|
||||
r := newRand(p.Target, rs)
|
||||
|
||||
retry := false
|
||||
outer:
|
||||
for stop := false; !stop || retry; stop = r.oneOf(3) {
|
||||
retry = false
|
||||
switch {
|
||||
@ -63,185 +64,26 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable, corpus []*Pro
|
||||
}
|
||||
s := analyze(ct, p, c)
|
||||
updateSizes := true
|
||||
for stop := false; !stop; stop = r.oneOf(3) {
|
||||
retryArg := false
|
||||
for stop := false; !stop || retryArg; stop = r.oneOf(3) {
|
||||
retryArg = false
|
||||
args, bases, parents := p.Target.mutationArgs(c)
|
||||
if len(args) == 0 {
|
||||
retry = true
|
||||
continue
|
||||
continue outer
|
||||
}
|
||||
idx := r.Intn(len(args))
|
||||
arg, base, parent := args[idx], bases[idx], parents[idx]
|
||||
var baseSize uint64
|
||||
if base != nil {
|
||||
b, ok := base.(*PointerArg)
|
||||
if !ok || b.Res == nil {
|
||||
panic("bad base arg")
|
||||
}
|
||||
baseSize = b.Res.Size()
|
||||
calls, ok := p.Target.mutateArg(r, s, arg, base, parent, &updateSizes)
|
||||
if !ok {
|
||||
retryArg = true
|
||||
continue
|
||||
}
|
||||
switch t := arg.Type().(type) {
|
||||
case *IntType, *FlagsType:
|
||||
a := arg.(*ConstArg)
|
||||
if r.bin() {
|
||||
arg1, calls1 := r.generateArg(s, arg.Type())
|
||||
p.replaceArg(c, arg, arg1, calls1)
|
||||
} else {
|
||||
switch {
|
||||
case r.nOutOf(1, 3):
|
||||
a.Val += uint64(r.Intn(4)) + 1
|
||||
case r.nOutOf(1, 2):
|
||||
a.Val -= uint64(r.Intn(4)) + 1
|
||||
default:
|
||||
a.Val ^= 1 << uint64(r.Intn(64))
|
||||
}
|
||||
}
|
||||
case *LenType:
|
||||
if !r.mutateSize(arg.(*ConstArg), *parent) {
|
||||
retry = true
|
||||
continue
|
||||
}
|
||||
updateSizes = false
|
||||
case *ResourceType, *VmaType, *ProcType:
|
||||
arg1, calls1 := r.generateArg(s, arg.Type())
|
||||
p.replaceArg(c, arg, arg1, calls1)
|
||||
case *BufferType:
|
||||
a := arg.(*DataArg)
|
||||
switch t.Kind {
|
||||
case BufferBlobRand, BufferBlobRange:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
minLen, maxLen := uint64(0), maxBlobLen
|
||||
if t.Kind == BufferBlobRange {
|
||||
minLen, maxLen = t.RangeBegin, t.RangeEnd
|
||||
}
|
||||
a.data = mutateData(r, data, minLen, maxLen)
|
||||
case BufferString:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
if r.bin() {
|
||||
minLen, maxLen := uint64(0), maxBlobLen
|
||||
if t.TypeSize != 0 {
|
||||
minLen, maxLen = t.TypeSize, t.TypeSize
|
||||
}
|
||||
a.data = mutateData(r, data, minLen, maxLen)
|
||||
} else {
|
||||
a.data = r.randString(s, t)
|
||||
}
|
||||
case BufferFilename:
|
||||
a.data = []byte(r.filename(s))
|
||||
case BufferText:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
a.data = r.mutateText(t.Text, data)
|
||||
default:
|
||||
panic("unknown buffer kind")
|
||||
}
|
||||
case *ArrayType:
|
||||
a := arg.(*GroupArg)
|
||||
count := uint64(0)
|
||||
switch t.Kind {
|
||||
case ArrayRandLen:
|
||||
for count == uint64(len(a.Inner)) {
|
||||
count = r.randArrayLen()
|
||||
}
|
||||
case ArrayRangeLen:
|
||||
if t.RangeBegin == t.RangeEnd {
|
||||
panic("trying to mutate fixed length array")
|
||||
}
|
||||
for count == uint64(len(a.Inner)) {
|
||||
count = r.randRange(t.RangeBegin, t.RangeEnd)
|
||||
}
|
||||
}
|
||||
if count > uint64(len(a.Inner)) {
|
||||
var calls []*Call
|
||||
for count > uint64(len(a.Inner)) {
|
||||
arg1, calls1 := r.generateArg(s, t.Type)
|
||||
a.Inner = append(a.Inner, arg1)
|
||||
for _, c1 := range calls1 {
|
||||
calls = append(calls, c1)
|
||||
s.analyze(c1)
|
||||
}
|
||||
}
|
||||
for _, c1 := range calls {
|
||||
p.Target.SanitizeCall(c1)
|
||||
}
|
||||
p.Target.SanitizeCall(c)
|
||||
p.insertBefore(c, calls)
|
||||
} else if count < uint64(len(a.Inner)) {
|
||||
for _, arg := range a.Inner[count:] {
|
||||
p.removeArg(c, arg)
|
||||
}
|
||||
a.Inner = a.Inner[:count]
|
||||
}
|
||||
// TODO: swap elements of the array
|
||||
case *PtrType:
|
||||
a, ok := arg.(*PointerArg)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
// TODO: we don't know size for out args
|
||||
size := uint64(1)
|
||||
if a.Res != nil {
|
||||
size = a.Res.Size()
|
||||
}
|
||||
arg1, calls1 := r.addr(s, t, size, a.Res)
|
||||
p.replaceArg(c, arg, arg1, calls1)
|
||||
case *StructType:
|
||||
gen := p.Target.SpecialStructs[t.Name()]
|
||||
if gen == nil {
|
||||
panic("bad arg returned by mutationArgs: StructType")
|
||||
}
|
||||
arg1, calls1 := gen(&Gen{r, s}, t, arg.(*GroupArg))
|
||||
for i, f := range arg1.(*GroupArg).Inner {
|
||||
p.replaceArg(c, arg.(*GroupArg).Inner[i], f, calls1)
|
||||
calls1 = nil
|
||||
}
|
||||
case *UnionType:
|
||||
a := arg.(*UnionArg)
|
||||
current := -1
|
||||
for i, option := range t.Fields {
|
||||
if a.Option.Type().FieldName() == option.FieldName() {
|
||||
current = i
|
||||
break
|
||||
}
|
||||
}
|
||||
if current == -1 {
|
||||
panic("can't find current option in union")
|
||||
}
|
||||
newIdx := r.Intn(len(t.Fields) - 1)
|
||||
if newIdx >= current {
|
||||
newIdx++
|
||||
}
|
||||
optType := t.Fields[newIdx]
|
||||
p.removeArg(c, a.Option)
|
||||
opt, calls := r.generateArg(s, optType)
|
||||
arg1 := MakeUnionArg(t, opt)
|
||||
p.replaceArg(c, arg, arg1, calls)
|
||||
case *CsumType:
|
||||
panic("bad arg returned by mutationArgs: CsumType")
|
||||
case *ConstType:
|
||||
panic("bad arg returned by mutationArgs: ConstType")
|
||||
default:
|
||||
panic(fmt.Sprintf("bad arg returned by mutationArgs: %#v, type=%#v", arg, arg.Type()))
|
||||
}
|
||||
|
||||
// Update base pointer if size has increased.
|
||||
if base != nil {
|
||||
b := base.(*PointerArg)
|
||||
if baseSize < b.Res.Size() {
|
||||
arg1, calls1 := r.addr(s, b.Type(), b.Res.Size(), b.Res)
|
||||
for _, c1 := range calls1 {
|
||||
p.Target.SanitizeCall(c1)
|
||||
}
|
||||
p.insertBefore(c, calls1)
|
||||
a1 := arg1.(*PointerArg)
|
||||
b.PageIndex = a1.PageIndex
|
||||
b.PageOffset = a1.PageOffset
|
||||
b.PagesNum = a1.PagesNum
|
||||
}
|
||||
}
|
||||
|
||||
// Update all len fields.
|
||||
p.insertBefore(c, calls)
|
||||
if updateSizes {
|
||||
p.Target.assignSizesCall(c)
|
||||
}
|
||||
p.Target.SanitizeCall(c)
|
||||
}
|
||||
default:
|
||||
// Remove a random call.
|
||||
@ -264,345 +106,248 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable, corpus []*Pro
|
||||
}
|
||||
}
|
||||
|
||||
// Minimize minimizes program p into an equivalent program using the equivalence
|
||||
// predicate pred. It iteratively generates simpler programs and asks pred
|
||||
// whether it is equal to the orginal program or not. If it is equivalent then
|
||||
// the simplification attempt is committed and the process continues.
|
||||
func Minimize(p0 *Prog, callIndex0 int, pred0 func(*Prog, int) bool, crash bool) (*Prog, int) {
|
||||
pred := pred0
|
||||
if debug {
|
||||
pred = func(p *Prog, callIndex int) bool {
|
||||
if err := p.validate(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return pred0(p, callIndex)
|
||||
func (target *Target) mutateArg(r *randGen, s *state, arg, base Arg, parent *[]Arg, updateSizes *bool) (calls []*Call, ok bool) {
|
||||
var baseSize uint64
|
||||
if base != nil {
|
||||
b, ok := base.(*PointerArg)
|
||||
if !ok || b.Res == nil {
|
||||
panic("bad base arg")
|
||||
}
|
||||
baseSize = b.Res.Size()
|
||||
}
|
||||
name0 := ""
|
||||
if callIndex0 != -1 {
|
||||
if callIndex0 < 0 || callIndex0 >= len(p0.Calls) {
|
||||
panic("bad call index")
|
||||
}
|
||||
name0 = p0.Calls[callIndex0].Meta.Name
|
||||
}
|
||||
|
||||
// Try to glue all mmap's together.
|
||||
s := analyze(nil, p0, nil)
|
||||
hi := -1
|
||||
lo := -1
|
||||
for i := 0; i < maxPages; i++ {
|
||||
if s.pages[i] {
|
||||
hi = i
|
||||
if lo == -1 {
|
||||
lo = i
|
||||
switch t := arg.Type().(type) {
|
||||
case *IntType, *FlagsType:
|
||||
a := arg.(*ConstArg)
|
||||
if r.bin() {
|
||||
var newArg Arg
|
||||
newArg, calls = r.generateArg(s, arg.Type())
|
||||
replaceArg(arg, newArg)
|
||||
} else {
|
||||
switch {
|
||||
case r.nOutOf(1, 3):
|
||||
a.Val += uint64(r.Intn(4)) + 1
|
||||
case r.nOutOf(1, 2):
|
||||
a.Val -= uint64(r.Intn(4)) + 1
|
||||
default:
|
||||
a.Val ^= 1 << uint64(r.Intn(64))
|
||||
}
|
||||
}
|
||||
}
|
||||
if hi != -1 {
|
||||
p := p0.Clone()
|
||||
callIndex := callIndex0
|
||||
// Remove all mmaps.
|
||||
for i := 0; i < len(p.Calls); i++ {
|
||||
c := p.Calls[i]
|
||||
if i != callIndex && c.Meta == p.Target.MmapSyscall {
|
||||
p.removeCall(i)
|
||||
if i < callIndex {
|
||||
callIndex--
|
||||
case *LenType:
|
||||
if !r.mutateSize(arg.(*ConstArg), *parent) {
|
||||
return nil, false
|
||||
}
|
||||
*updateSizes = false
|
||||
case *ResourceType, *VmaType, *ProcType:
|
||||
var newArg Arg
|
||||
newArg, calls = r.generateArg(s, arg.Type())
|
||||
replaceArg(arg, newArg)
|
||||
case *BufferType:
|
||||
a := arg.(*DataArg)
|
||||
switch t.Kind {
|
||||
case BufferBlobRand, BufferBlobRange:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
minLen, maxLen := uint64(0), maxBlobLen
|
||||
if t.Kind == BufferBlobRange {
|
||||
minLen, maxLen = t.RangeBegin, t.RangeEnd
|
||||
}
|
||||
a.data = mutateData(r, data, minLen, maxLen)
|
||||
case BufferString:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
if r.bin() {
|
||||
minLen, maxLen := uint64(0), maxBlobLen
|
||||
if t.TypeSize != 0 {
|
||||
minLen, maxLen = t.TypeSize, t.TypeSize
|
||||
}
|
||||
i--
|
||||
a.data = mutateData(r, data, minLen, maxLen)
|
||||
} else {
|
||||
a.data = r.randString(s, t)
|
||||
}
|
||||
case BufferFilename:
|
||||
a.data = []byte(r.filename(s))
|
||||
case BufferText:
|
||||
data := append([]byte{}, a.Data()...)
|
||||
a.data = r.mutateText(t.Text, data)
|
||||
default:
|
||||
panic("unknown buffer kind")
|
||||
}
|
||||
case *ArrayType:
|
||||
a := arg.(*GroupArg)
|
||||
count := uint64(0)
|
||||
switch t.Kind {
|
||||
case ArrayRandLen:
|
||||
for count == uint64(len(a.Inner)) {
|
||||
count = r.randArrayLen()
|
||||
}
|
||||
case ArrayRangeLen:
|
||||
if t.RangeBegin == t.RangeEnd {
|
||||
panic("trying to mutate fixed length array")
|
||||
}
|
||||
for count == uint64(len(a.Inner)) {
|
||||
count = r.randRange(t.RangeBegin, t.RangeEnd)
|
||||
}
|
||||
}
|
||||
// Prepend uber-mmap.
|
||||
mmap := p0.Target.MakeMmap(uint64(lo), uint64(hi-lo)+1)
|
||||
p.Calls = append([]*Call{mmap}, p.Calls...)
|
||||
if callIndex != -1 {
|
||||
callIndex++
|
||||
}
|
||||
if pred(p, callIndex) {
|
||||
p0 = p
|
||||
callIndex0 = callIndex
|
||||
}
|
||||
}
|
||||
|
||||
// Try to remove all calls except the last one one-by-one.
|
||||
for i := len(p0.Calls) - 1; i >= 0; i-- {
|
||||
if i == callIndex0 {
|
||||
continue
|
||||
}
|
||||
callIndex := callIndex0
|
||||
if i < callIndex {
|
||||
callIndex--
|
||||
}
|
||||
p := p0.Clone()
|
||||
p.removeCall(i)
|
||||
if !pred(p, callIndex) {
|
||||
continue
|
||||
}
|
||||
p0 = p
|
||||
callIndex0 = callIndex
|
||||
}
|
||||
|
||||
var triedPaths map[string]bool
|
||||
|
||||
var rec func(p *Prog, call *Call, arg Arg, path string) bool
|
||||
rec = func(p *Prog, call *Call, arg Arg, path string) bool {
|
||||
path += fmt.Sprintf("-%v", arg.Type().FieldName())
|
||||
switch typ := arg.Type().(type) {
|
||||
case *StructType:
|
||||
a := arg.(*GroupArg)
|
||||
for _, innerArg := range a.Inner {
|
||||
if rec(p, call, innerArg, path) {
|
||||
return true
|
||||
if count > uint64(len(a.Inner)) {
|
||||
for count > uint64(len(a.Inner)) {
|
||||
newArg, newCalls := r.generateArg(s, t.Type)
|
||||
a.Inner = append(a.Inner, newArg)
|
||||
calls = append(calls, newCalls...)
|
||||
for _, c := range newCalls {
|
||||
s.analyze(c)
|
||||
}
|
||||
}
|
||||
case *UnionType:
|
||||
} else if count < uint64(len(a.Inner)) {
|
||||
for _, arg := range a.Inner[count:] {
|
||||
removeArg(arg)
|
||||
}
|
||||
a.Inner = a.Inner[:count]
|
||||
}
|
||||
// TODO: swap elements of the array
|
||||
case *PtrType:
|
||||
a, ok := arg.(*PointerArg)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
// TODO: we don't know size for out args
|
||||
size := uint64(1)
|
||||
if a.Res != nil {
|
||||
size = a.Res.Size()
|
||||
}
|
||||
var newArg Arg
|
||||
newArg, calls = r.addr(s, t, size, a.Res)
|
||||
replaceArg(arg, newArg)
|
||||
case *StructType:
|
||||
gen := target.SpecialTypes[t.Name()]
|
||||
if gen == nil {
|
||||
panic("bad arg returned by mutationArgs: StructType")
|
||||
}
|
||||
var newArg Arg
|
||||
newArg, calls = gen(&Gen{r, s}, t, arg)
|
||||
for i, f := range newArg.(*GroupArg).Inner {
|
||||
replaceArg(arg.(*GroupArg).Inner[i], f)
|
||||
}
|
||||
case *UnionType:
|
||||
if gen := target.SpecialTypes[t.Name()]; gen != nil {
|
||||
var newArg Arg
|
||||
newArg, calls = gen(&Gen{r, s}, t, arg)
|
||||
replaceArg(arg, newArg)
|
||||
} else {
|
||||
a := arg.(*UnionArg)
|
||||
if rec(p, call, a.Option, path) {
|
||||
return true
|
||||
}
|
||||
case *PtrType:
|
||||
// TODO: try to remove optional ptrs
|
||||
a, ok := arg.(*PointerArg)
|
||||
if !ok {
|
||||
// Can also be *ConstArg.
|
||||
return false
|
||||
}
|
||||
if a.Res != nil {
|
||||
return rec(p, call, a.Res, path)
|
||||
}
|
||||
case *ArrayType:
|
||||
a := arg.(*GroupArg)
|
||||
for i, innerArg := range a.Inner {
|
||||
innerPath := fmt.Sprintf("%v-%v", path, i)
|
||||
if !triedPaths[innerPath] && !crash {
|
||||
if (typ.Kind == ArrayRangeLen && len(a.Inner) > int(typ.RangeBegin)) ||
|
||||
(typ.Kind == ArrayRandLen) {
|
||||
copy(a.Inner[i:], a.Inner[i+1:])
|
||||
a.Inner = a.Inner[:len(a.Inner)-1]
|
||||
p.removeArg(call, innerArg)
|
||||
p.Target.assignSizesCall(call)
|
||||
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
} else {
|
||||
triedPaths[innerPath] = true
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
if rec(p, call, innerArg, innerPath) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
case *IntType, *FlagsType, *ProcType:
|
||||
// TODO: try to reset bits in ints
|
||||
// TODO: try to set separate flags
|
||||
if crash {
|
||||
return false
|
||||
}
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
a := arg.(*ConstArg)
|
||||
if a.Val == typ.Default() {
|
||||
return false
|
||||
}
|
||||
v0 := a.Val
|
||||
a.Val = typ.Default()
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
return true
|
||||
} else {
|
||||
a.Val = v0
|
||||
}
|
||||
case *ResourceType:
|
||||
if crash {
|
||||
return false
|
||||
}
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
a := arg.(*ResultArg)
|
||||
if a.Res == nil {
|
||||
return false
|
||||
}
|
||||
r0 := a.Res
|
||||
a.Res = nil
|
||||
a.Val = typ.Default()
|
||||
if pred(p, callIndex0) {
|
||||
p0 = p
|
||||
return true
|
||||
} else {
|
||||
a.Res = r0
|
||||
a.Val = 0
|
||||
}
|
||||
case *BufferType:
|
||||
// TODO: try to set individual bytes to 0
|
||||
if triedPaths[path] {
|
||||
return false
|
||||
}
|
||||
triedPaths[path] = true
|
||||
if typ.Kind != BufferBlobRand && typ.Kind != BufferBlobRange ||
|
||||
typ.Dir() == DirOut {
|
||||
return false
|
||||
}
|
||||
a := arg.(*DataArg)
|
||||
minLen := int(typ.RangeBegin)
|
||||
for step := len(a.Data()) - minLen; len(a.Data()) > minLen && step > 0; {
|
||||
if len(a.Data())-step >= minLen {
|
||||
a.data = a.Data()[:len(a.Data())-step]
|
||||
p.Target.assignSizesCall(call)
|
||||
if pred(p, callIndex0) {
|
||||
continue
|
||||
}
|
||||
a.data = a.Data()[:len(a.Data())+step]
|
||||
p.Target.assignSizesCall(call)
|
||||
}
|
||||
step /= 2
|
||||
if crash {
|
||||
current := -1
|
||||
for i, option := range t.Fields {
|
||||
if a.Option.Type().FieldName() == option.FieldName() {
|
||||
current = i
|
||||
break
|
||||
}
|
||||
}
|
||||
p0 = p
|
||||
case *VmaType, *LenType, *CsumType, *ConstType:
|
||||
// TODO: try to remove offset from vma
|
||||
return false
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown arg type '%+v'", typ))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Try to minimize individual args.
|
||||
for i := 0; i < len(p0.Calls); i++ {
|
||||
triedPaths = make(map[string]bool)
|
||||
again:
|
||||
p := p0.Clone()
|
||||
call := p.Calls[i]
|
||||
for j, arg := range call.Args {
|
||||
if rec(p, call, arg, fmt.Sprintf("%v", j)) {
|
||||
goto again
|
||||
if current == -1 {
|
||||
panic("can't find current option in union")
|
||||
}
|
||||
newIdx := r.Intn(len(t.Fields) - 1)
|
||||
if newIdx >= current {
|
||||
newIdx++
|
||||
}
|
||||
optType := t.Fields[newIdx]
|
||||
removeArg(a.Option)
|
||||
var newOpt Arg
|
||||
newOpt, calls = r.generateArg(s, optType)
|
||||
replaceArg(arg, MakeUnionArg(t, newOpt))
|
||||
}
|
||||
case *CsumType:
|
||||
panic("bad arg returned by mutationArgs: CsumType")
|
||||
case *ConstType:
|
||||
panic("bad arg returned by mutationArgs: ConstType")
|
||||
default:
|
||||
panic(fmt.Sprintf("bad arg returned by mutationArgs: %#v, type=%#v", arg, arg.Type()))
|
||||
}
|
||||
|
||||
if callIndex0 != -1 {
|
||||
if callIndex0 < 0 || callIndex0 >= len(p0.Calls) || name0 != p0.Calls[callIndex0].Meta.Name {
|
||||
panic(fmt.Sprintf("bad call index after minimization: ncalls=%v index=%v call=%v/%v",
|
||||
len(p0.Calls), callIndex0, name0, p0.Calls[callIndex0].Meta.Name))
|
||||
// Update base pointer if size has increased.
|
||||
if base != nil {
|
||||
b := base.(*PointerArg)
|
||||
if baseSize < b.Res.Size() {
|
||||
newArg, newCalls := r.addr(s, b.Type(), b.Res.Size(), b.Res)
|
||||
calls = append(calls, newCalls...)
|
||||
a1 := newArg.(*PointerArg)
|
||||
b.PageIndex = a1.PageIndex
|
||||
b.PageOffset = a1.PageOffset
|
||||
b.PagesNum = a1.PagesNum
|
||||
}
|
||||
}
|
||||
return p0, callIndex0
|
||||
for _, c := range calls {
|
||||
target.SanitizeCall(c)
|
||||
}
|
||||
return calls, true
|
||||
}
|
||||
|
||||
func (p *Prog) TrimAfter(idx int) {
|
||||
if idx < 0 || idx >= len(p.Calls) {
|
||||
panic("trimming non-existing call")
|
||||
}
|
||||
for i := len(p.Calls) - 1; i > idx; i-- {
|
||||
c := p.Calls[i]
|
||||
foreachArg(c, func(arg, _ Arg, _ *[]Arg) {
|
||||
if a, ok := arg.(*ResultArg); ok && a.Res != nil {
|
||||
if used, ok := a.Res.(ArgUsed); ok {
|
||||
delete(*used.Used(), arg)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
p.Calls = p.Calls[:idx+1]
|
||||
}
|
||||
|
||||
func (target *Target) mutationArgs(c *Call) (args, bases []Arg, parents []*[]Arg) {
|
||||
foreachArg(c, func(arg, base Arg, parent *[]Arg) {
|
||||
switch typ := arg.Type().(type) {
|
||||
case *StructType:
|
||||
if target.SpecialStructs[typ.Name()] == nil {
|
||||
// For structs only individual fields are updated.
|
||||
return
|
||||
}
|
||||
// These special structs are mutated as a whole.
|
||||
case *UnionType:
|
||||
if len(typ.Fields) == 1 {
|
||||
return
|
||||
}
|
||||
case *ArrayType:
|
||||
// Don't mutate fixed-size arrays.
|
||||
if typ.Kind == ArrayRangeLen && typ.RangeBegin == typ.RangeEnd {
|
||||
return
|
||||
}
|
||||
case *CsumType:
|
||||
// Checksum is updated when the checksummed data changes.
|
||||
return
|
||||
case *ConstType:
|
||||
// Well, this is const.
|
||||
return
|
||||
case *BufferType:
|
||||
if typ.Kind == BufferString && len(typ.Values) == 1 {
|
||||
return // string const
|
||||
}
|
||||
func (target *Target) mutationSubargs(arg0 Arg) (args, bases []Arg, parents []*[]Arg) {
|
||||
ForeachSubarg(arg0, func(arg, base Arg, parent *[]Arg) {
|
||||
if target.needMutateArg(arg, base, parent) {
|
||||
args = append(args, arg)
|
||||
bases = append(bases, base)
|
||||
parents = append(parents, parent)
|
||||
}
|
||||
typ := arg.Type()
|
||||
if typ.Dir() == DirOut || !typ.Varlen() && typ.Size() == 0 {
|
||||
return
|
||||
}
|
||||
if base != nil {
|
||||
if _, ok := base.Type().(*StructType); ok &&
|
||||
target.SpecialStructs[base.Type().Name()] != nil {
|
||||
// These special structs are mutated as a whole.
|
||||
return
|
||||
}
|
||||
}
|
||||
args = append(args, arg)
|
||||
bases = append(bases, base)
|
||||
parents = append(parents, parent)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func swap16(v uint16) uint16 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v = 0
|
||||
v |= uint16(v1) << 0
|
||||
v |= uint16(v0) << 8
|
||||
return v
|
||||
func (target *Target) mutationArgs(c *Call) (args, bases []Arg, parents []*[]Arg) {
|
||||
foreachArg(c, func(arg, base Arg, parent *[]Arg) {
|
||||
if target.needMutateArg(arg, base, parent) {
|
||||
args = append(args, arg)
|
||||
bases = append(bases, base)
|
||||
parents = append(parents, parent)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func swap32(v uint32) uint32 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v2 := byte(v >> 16)
|
||||
v3 := byte(v >> 24)
|
||||
v = 0
|
||||
v |= uint32(v3) << 0
|
||||
v |= uint32(v2) << 8
|
||||
v |= uint32(v1) << 16
|
||||
v |= uint32(v0) << 24
|
||||
return v
|
||||
}
|
||||
|
||||
func swap64(v uint64) uint64 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v2 := byte(v >> 16)
|
||||
v3 := byte(v >> 24)
|
||||
v4 := byte(v >> 32)
|
||||
v5 := byte(v >> 40)
|
||||
v6 := byte(v >> 48)
|
||||
v7 := byte(v >> 56)
|
||||
v = 0
|
||||
v |= uint64(v7) << 0
|
||||
v |= uint64(v6) << 8
|
||||
v |= uint64(v5) << 16
|
||||
v |= uint64(v4) << 24
|
||||
v |= uint64(v3) << 32
|
||||
v |= uint64(v2) << 40
|
||||
v |= uint64(v1) << 48
|
||||
v |= uint64(v0) << 56
|
||||
return v
|
||||
func (target *Target) needMutateArg(arg, base Arg, parent *[]Arg) bool {
|
||||
switch typ := arg.Type().(type) {
|
||||
case *StructType:
|
||||
if target.SpecialTypes[typ.Name()] == nil {
|
||||
// For structs only individual fields are updated.
|
||||
return false
|
||||
}
|
||||
// These special structs are mutated as a whole.
|
||||
case *UnionType:
|
||||
if target.SpecialTypes[typ.Name()] == nil && len(typ.Fields) == 1 {
|
||||
return false
|
||||
}
|
||||
case *ArrayType:
|
||||
// Don't mutate fixed-size arrays.
|
||||
if typ.Kind == ArrayRangeLen && typ.RangeBegin == typ.RangeEnd {
|
||||
return false
|
||||
}
|
||||
case *CsumType:
|
||||
// Checksum is updated when the checksummed data changes.
|
||||
return false
|
||||
case *ConstType:
|
||||
// Well, this is const.
|
||||
return false
|
||||
case *BufferType:
|
||||
if typ.Kind == BufferString && len(typ.Values) == 1 {
|
||||
return false // string const
|
||||
}
|
||||
}
|
||||
typ := arg.Type()
|
||||
if typ.Dir() == DirOut || !typ.Varlen() && typ.Size() == 0 {
|
||||
return false
|
||||
}
|
||||
if base != nil {
|
||||
// TODO(dvyukov): need to check parent as well.
|
||||
// Say, timespec can be part of another struct and base
|
||||
// will point to that other struct, not timespec.
|
||||
// Strictly saying, we need to check parents all way up,
|
||||
// or better bail out from recursion when we reach
|
||||
// a special struct.
|
||||
_, isStruct := base.Type().(*StructType)
|
||||
_, isUnion := base.Type().(*UnionType)
|
||||
if (isStruct || isUnion) &&
|
||||
target.SpecialTypes[base.Type().Name()] != nil {
|
||||
// These special structs/unions are mutated as a whole.
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func mutateData(r *randGen, data []byte, minLen, maxLen uint64) []byte {
|
||||
@ -779,3 +524,46 @@ loop:
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
func swap16(v uint16) uint16 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v = 0
|
||||
v |= uint16(v1) << 0
|
||||
v |= uint16(v0) << 8
|
||||
return v
|
||||
}
|
||||
|
||||
func swap32(v uint32) uint32 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v2 := byte(v >> 16)
|
||||
v3 := byte(v >> 24)
|
||||
v = 0
|
||||
v |= uint32(v3) << 0
|
||||
v |= uint32(v2) << 8
|
||||
v |= uint32(v1) << 16
|
||||
v |= uint32(v0) << 24
|
||||
return v
|
||||
}
|
||||
|
||||
func swap64(v uint64) uint64 {
|
||||
v0 := byte(v >> 0)
|
||||
v1 := byte(v >> 8)
|
||||
v2 := byte(v >> 16)
|
||||
v3 := byte(v >> 24)
|
||||
v4 := byte(v >> 32)
|
||||
v5 := byte(v >> 40)
|
||||
v6 := byte(v >> 48)
|
||||
v7 := byte(v >> 56)
|
||||
v = 0
|
||||
v |= uint64(v7) << 0
|
||||
v |= uint64(v6) << 8
|
||||
v |= uint64(v5) << 16
|
||||
v |= uint64(v4) << 24
|
||||
v |= uint64(v3) << 32
|
||||
v |= uint64(v2) << 40
|
||||
v |= uint64(v1) << 48
|
||||
v |= uint64(v0) << 56
|
||||
return v
|
||||
}
|
||||
|
22
prog/prog.go
22
prog/prog.go
@ -345,15 +345,8 @@ func (p *Prog) insertBefore(c *Call, calls []*Call) {
|
||||
p.Calls = newCalls
|
||||
}
|
||||
|
||||
// replaceArg replaces arg with arg1 in call c in program p, and inserts calls before arg call.
|
||||
func (p *Prog) replaceArg(c *Call, arg, arg1 Arg, calls []*Call) {
|
||||
if debug {
|
||||
p.replaceArgCheck(c, arg, arg1, calls)
|
||||
}
|
||||
for _, c := range calls {
|
||||
p.Target.SanitizeCall(c)
|
||||
}
|
||||
p.insertBefore(c, calls)
|
||||
// replaceArg replaces arg with arg1 in a program.
|
||||
func replaceArg(arg, arg1 Arg) {
|
||||
switch a := arg.(type) {
|
||||
case *ConstArg:
|
||||
*a = *arg1.(*ConstArg)
|
||||
@ -368,7 +361,6 @@ func (p *Prog) replaceArg(c *Call, arg, arg1 Arg, calls []*Call) {
|
||||
default:
|
||||
panic(fmt.Sprintf("replaceArg: bad arg kind %#v", arg))
|
||||
}
|
||||
p.Target.SanitizeCall(c)
|
||||
}
|
||||
|
||||
func replaceResultArg(arg, arg1 *ResultArg) {
|
||||
@ -425,9 +417,9 @@ func (p *Prog) replaceArgCheck(c *Call, arg, arg1 Arg, calls []*Call) {
|
||||
}
|
||||
}
|
||||
|
||||
// removeArg removes all references to/from arg0 of call c from p.
|
||||
func (p *Prog) removeArg(c *Call, arg0 Arg) {
|
||||
foreachSubarg(arg0, func(arg, _ Arg, _ *[]Arg) {
|
||||
// removeArg removes all references to/from arg0 from a program.
|
||||
func removeArg(arg0 Arg) {
|
||||
ForeachSubarg(arg0, func(arg, _ Arg, _ *[]Arg) {
|
||||
if a, ok := arg.(*ResultArg); ok && a.Res != nil {
|
||||
if !(*a.Res.(ArgUsed).Used())[arg] {
|
||||
panic("broken tree")
|
||||
@ -451,9 +443,9 @@ func (p *Prog) removeArg(c *Call, arg0 Arg) {
|
||||
func (p *Prog) removeCall(idx int) {
|
||||
c := p.Calls[idx]
|
||||
for _, arg := range c.Args {
|
||||
p.removeArg(c, arg)
|
||||
removeArg(arg)
|
||||
}
|
||||
p.removeArg(c, c.Ret)
|
||||
removeArg(c.Ret)
|
||||
copy(p.Calls[idx:], p.Calls[idx+1:])
|
||||
p.Calls = p.Calls[:len(p.Calls)-1]
|
||||
}
|
||||
|
@ -175,3 +175,31 @@ func testCrossArchProg(t *testing.T, p *Prog, crossTargets []*Target) {
|
||||
crossTarget.OS, crossTarget.Arch, err, serialized)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSpecialStructs(t *testing.T) {
|
||||
testEachTargetRandom(t, func(t *testing.T, target *Target, rs rand.Source, iters int) {
|
||||
for special, gen := range target.SpecialTypes {
|
||||
t.Run(special, func(t *testing.T) {
|
||||
var typ Type
|
||||
for i := 0; i < len(target.Syscalls) && typ == nil; i++ {
|
||||
ForeachType(target.Syscalls[i], func(t Type) {
|
||||
if s, ok := t.(*StructType); ok && s.Name() == special {
|
||||
typ = s
|
||||
}
|
||||
if s, ok := t.(*UnionType); ok && s.Name() == special {
|
||||
typ = s
|
||||
}
|
||||
})
|
||||
}
|
||||
if typ == nil {
|
||||
t.Fatal("can't find struct description")
|
||||
}
|
||||
g := &Gen{newRand(target, rs), newState(target, nil)}
|
||||
for i := 0; i < iters/len(target.SpecialTypes); i++ {
|
||||
arg, _ := gen(g, typ, nil)
|
||||
gen(g, typ, arg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
19
prog/rand.go
19
prog/rand.go
@ -517,6 +517,10 @@ func (r *randGen) generateArgs(s *state, types []Type) ([]Arg, []*Call) {
|
||||
}
|
||||
|
||||
func (r *randGen) generateArg(s *state, typ Type) (arg Arg, calls []*Call) {
|
||||
return r.generateArgImpl(s, typ, false)
|
||||
}
|
||||
|
||||
func (r *randGen) generateArgImpl(s *state, typ Type, ignoreSpecial bool) (arg Arg, calls []*Call) {
|
||||
if typ.Dir() == DirOut {
|
||||
// No need to generate something interesting for output scalar arguments.
|
||||
// But we still need to generate the argument itself so that it can be referenced
|
||||
@ -666,19 +670,28 @@ func (r *randGen) generateArg(s *state, typ Type) (arg Arg, calls []*Call) {
|
||||
}
|
||||
return MakeGroupArg(a, inner), calls
|
||||
case *StructType:
|
||||
if gen := r.target.SpecialStructs[a.Name()]; gen != nil && a.Dir() != DirOut {
|
||||
arg, calls = gen(&Gen{r, s}, a, nil)
|
||||
return
|
||||
if !ignoreSpecial {
|
||||
if gen := r.target.SpecialTypes[a.Name()]; gen != nil && a.Dir() != DirOut {
|
||||
arg, calls = gen(&Gen{r, s}, a, nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
args, calls := r.generateArgs(s, a.Fields)
|
||||
group := MakeGroupArg(a, args)
|
||||
return group, calls
|
||||
case *UnionType:
|
||||
if !ignoreSpecial {
|
||||
if gen := r.target.SpecialTypes[a.Name()]; gen != nil && a.Dir() != DirOut {
|
||||
arg, calls = gen(&Gen{r, s}, a, nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
optType := a.Fields[r.Intn(len(a.Fields))]
|
||||
opt, calls := r.generateArg(s, optType)
|
||||
return MakeUnionArg(a, opt), calls
|
||||
case *PtrType:
|
||||
inner, calls := r.generateArg(s, a.Type)
|
||||
// TODO(dvyukov): remove knowledge about iocb from prog.
|
||||
if a.Type.Name() == "iocb" && len(s.resources["iocbptr"]) != 0 {
|
||||
// It is weird, but these are actually identified by kernel by address.
|
||||
// So try to reuse a previously used address.
|
||||
|
@ -39,14 +39,14 @@ type Target struct {
|
||||
// SanitizeCall neutralizes harmful calls.
|
||||
SanitizeCall func(c *Call)
|
||||
|
||||
// SpecialStructs allows target to do custom generation/mutation for some struct types.
|
||||
// Map key is struct name for which custom generation/mutation is required.
|
||||
// SpecialTypes allows target to do custom generation/mutation for some struct's and union's.
|
||||
// Map key is struct/union name for which custom generation/mutation is required.
|
||||
// Map value is custom generation/mutation function that will be called
|
||||
// for the corresponding structs. g is helper object that allows generate random numbers,
|
||||
// allocate memory, etc. typ is the struct type. old is the old value of the struct
|
||||
// for mutation, or nil for generation. The function returns a new value of the struct,
|
||||
// for the corresponding type. g is helper object that allows generate random numbers,
|
||||
// allocate memory, etc. typ is the struct/union type. old is the old value of the struct/union
|
||||
// for mutation, or nil for generation. The function returns a new value of the struct/union,
|
||||
// and optionally any calls that need to be inserted before the arg reference.
|
||||
SpecialStructs map[string]func(g *Gen, typ *StructType, old *GroupArg) (Arg, []*Call)
|
||||
SpecialTypes map[string]func(g *Gen, typ Type, old Arg) (Arg, []*Call)
|
||||
|
||||
// Special strings that can matter for the target.
|
||||
// Used as fallback when string type does not have own dictionary.
|
||||
@ -175,7 +175,36 @@ func (g *Gen) Alloc(ptrType Type, data Arg) (Arg, []*Call) {
|
||||
}
|
||||
|
||||
func (g *Gen) GenerateArg(typ Type, pcalls *[]*Call) Arg {
|
||||
arg, calls := g.r.generateArg(g.s, typ)
|
||||
return g.generateArg(typ, pcalls, false)
|
||||
}
|
||||
|
||||
func (g *Gen) GenerateSpecialArg(typ Type, pcalls *[]*Call) Arg {
|
||||
return g.generateArg(typ, pcalls, true)
|
||||
}
|
||||
|
||||
func (g *Gen) generateArg(typ Type, pcalls *[]*Call, ignoreSpecial bool) Arg {
|
||||
arg, calls := g.r.generateArgImpl(g.s, typ, ignoreSpecial)
|
||||
*pcalls = append(*pcalls, calls...)
|
||||
g.r.target.assignSizesArray([]Arg{arg})
|
||||
return arg
|
||||
}
|
||||
|
||||
func (g *Gen) MutateArg(arg0 Arg) (calls []*Call) {
|
||||
updateSizes := true
|
||||
for stop := false; !stop; stop = g.r.oneOf(3) {
|
||||
args, bases, parents := g.r.target.mutationSubargs(arg0)
|
||||
if len(args) == 0 {
|
||||
// TODO(dvyukov): probably need to return this condition
|
||||
// and updateSizes to caller so that Mutate can act accordingly.
|
||||
return
|
||||
}
|
||||
idx := g.r.Intn(len(args))
|
||||
arg, base, parent := args[idx], bases[idx], parents[idx]
|
||||
newCalls, ok := g.r.target.mutateArg(g.r, g.s, arg, base, parent, &updateSizes)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
calls = append(newCalls, newCalls...)
|
||||
}
|
||||
return calls
|
||||
}
|
||||
|
3412
sys/linux/386.go
3412
sys/linux/386.go
File diff suppressed because one or more lines are too long
3481
sys/linux/amd64.go
3481
sys/linux/amd64.go
File diff suppressed because one or more lines are too long
3430
sys/linux/arm.go
3430
sys/linux/arm.go
File diff suppressed because one or more lines are too long
3457
sys/linux/arm64.go
3457
sys/linux/arm64.go
File diff suppressed because one or more lines are too long
@ -40,7 +40,7 @@ func initTarget(target *prog.Target) {
|
||||
target.MakeMmap = arch.makeMmap
|
||||
target.AnalyzeMmap = arch.analyzeMmap
|
||||
target.SanitizeCall = arch.sanitizeCall
|
||||
target.SpecialStructs = map[string]func(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
target.SpecialTypes = map[string]func(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
prog.Arg, []*prog.Call){
|
||||
"timespec": arch.generateTimespec,
|
||||
"timeval": arch.generateTimespec,
|
||||
@ -49,6 +49,8 @@ func initTarget(target *prog.Target) {
|
||||
"alg_aead_name": arch.generateAlgAeadName,
|
||||
"alg_hash_name": arch.generateAlgHashName,
|
||||
"alg_blkcipher_name": arch.generateAlgBlkcipherhName,
|
||||
"ipt_replace": arch.generateIptables,
|
||||
"ip6t_replace": arch.generateIptables,
|
||||
}
|
||||
target.StringDictionary = stringDictionary
|
||||
|
||||
@ -71,6 +73,7 @@ var (
|
||||
KCOV_ENABLE uintptr
|
||||
KCOV_TRACE_CMP uintptr
|
||||
|
||||
// TODO(dvyukov): get rid of this, this must be in descriptions.
|
||||
stringDictionary = []string{"user", "keyring", "trusted", "system", "security", "selinux",
|
||||
"posix_acl_access", "mime_type", "md5sum", "nodev", "self",
|
||||
"bdev", "proc", "cgroup", "cpuset",
|
||||
@ -218,7 +221,8 @@ func (arch *arch) sanitizeCall(c *prog.Call) {
|
||||
}
|
||||
}
|
||||
|
||||
func (arch *arch) generateTimespec(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (arg prog.Arg, calls []*prog.Call) {
|
||||
func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, old prog.Arg) (arg prog.Arg, calls []*prog.Call) {
|
||||
typ := typ0.(*prog.StructType)
|
||||
// We need to generate timespec/timeval that are either
|
||||
// (1) definitely in the past, or
|
||||
// (2) definitely in unreachable fututre, or
|
||||
|
@ -9,8 +9,9 @@ import (
|
||||
"github.com/google/syzkaller/prog"
|
||||
)
|
||||
|
||||
func (arch *arch) generateSockaddrAlg(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
func (arch *arch) generateSockaddrAlg(g *prog.Gen, typ0 prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
typ := typ0.(*prog.StructType)
|
||||
family := g.GenerateArg(typ.Fields[0], &calls)
|
||||
// There is very little point in generating feat/mask,
|
||||
// because that can only fail otherwise correct bind.
|
||||
@ -34,28 +35,28 @@ func (arch *arch) generateSockaddrAlg(g *prog.Gen, typ *prog.StructType, old *pr
|
||||
return
|
||||
}
|
||||
|
||||
func (arch *arch) generateAlgName(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
func (arch *arch) generateAlgName(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
return generateAlgNameStruct(g, typ, allTypes[g.Rand().Intn(len(allTypes))].typ)
|
||||
}
|
||||
|
||||
func (arch *arch) generateAlgAeadName(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
func (arch *arch) generateAlgAeadName(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
return generateAlgNameStruct(g, typ, ALG_AEAD)
|
||||
}
|
||||
|
||||
func (arch *arch) generateAlgHashName(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
func (arch *arch) generateAlgHashName(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
return generateAlgNameStruct(g, typ, ALG_HASH)
|
||||
}
|
||||
|
||||
func (arch *arch) generateAlgBlkcipherhName(g *prog.Gen, typ *prog.StructType, old *prog.GroupArg) (
|
||||
func (arch *arch) generateAlgBlkcipherhName(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
return generateAlgNameStruct(g, typ, ALG_BLKCIPHER)
|
||||
}
|
||||
|
||||
func generateAlgNameStruct(g *prog.Gen, typ *prog.StructType, algTyp int) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
func generateAlgNameStruct(g *prog.Gen, typ0 prog.Type, algTyp int) (arg prog.Arg, calls []*prog.Call) {
|
||||
typ := typ0.(*prog.StructType)
|
||||
algName := generateAlg(g.Rand(), algTyp)
|
||||
algNameData := fixedSizeData(algName, typ.Fields[0].Size())
|
||||
arg = prog.MakeGroupArg(typ, []prog.Arg{
|
||||
|
71
sys/linux/init_iptables.go
Normal file
71
sys/linux/init_iptables.go
Normal file
@ -0,0 +1,71 @@
|
||||
// Copyright 2018 syzkaller project authors. All rights reserved.
|
||||
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
package linux
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/google/syzkaller/prog"
|
||||
)
|
||||
|
||||
func (arch *arch) generateIptables(g *prog.Gen, typ prog.Type, old prog.Arg) (
|
||||
arg prog.Arg, calls []*prog.Call) {
|
||||
if old == nil {
|
||||
arg = g.GenerateSpecialArg(typ, &calls)
|
||||
} else {
|
||||
arg = old
|
||||
calls = g.MutateArg(arg)
|
||||
}
|
||||
tableArg := arg.(*prog.UnionArg).Option.(*prog.GroupArg)
|
||||
if len(tableArg.Inner) != 17 {
|
||||
panic("iptable is expected to have 17 fields")
|
||||
}
|
||||
entriesArg := tableArg.Inner[16].(*prog.GroupArg)
|
||||
if len(entriesArg.Inner) != 2 {
|
||||
panic("iptable entries is expected to have 2 fields")
|
||||
}
|
||||
underflowArg := entriesArg.Inner[0].(*prog.GroupArg)
|
||||
entriesArray := entriesArg.Inner[1].(*prog.GroupArg)
|
||||
// Collect offsets of entries.
|
||||
offsets := make([]uint64, len(entriesArray.Inner))
|
||||
pos := underflowArg.Size()
|
||||
for i, entryArg := range entriesArray.Inner {
|
||||
offsets[i] = pos
|
||||
pos += entryArg.Size()
|
||||
}
|
||||
genOffset := func() uint64 {
|
||||
if g.Rand().Intn(100) == 0 {
|
||||
// Assign the underflow entry once in a while.
|
||||
// We have it in underflow hooks, so no point in using it frequently.
|
||||
return 0
|
||||
} else {
|
||||
return offsets[g.Rand().Intn(len(offsets))]
|
||||
}
|
||||
}
|
||||
// Assign offsets to used hooks.
|
||||
for hook := 4; hook < 9; hook++ {
|
||||
hookArg := tableArg.Inner[hook].(*prog.ConstArg)
|
||||
if hookArg.Type().(*prog.ConstType).Val == uint64(^uint32(0)) {
|
||||
continue // unused hook
|
||||
}
|
||||
hookArg.Val = genOffset()
|
||||
}
|
||||
// Now update standard target jump offsets.
|
||||
prog.ForeachSubarg(arg, func(arg, _ prog.Arg, _ *[]prog.Arg) {
|
||||
if !strings.HasPrefix(arg.Type().Name(), `xt_target_t["", `) {
|
||||
return
|
||||
}
|
||||
targetArg := arg.(*prog.GroupArg)
|
||||
valArg := targetArg.Inner[3].(*prog.ConstArg)
|
||||
if flagsType, ok := valArg.Type().(*prog.FlagsType); ok && int64(valArg.Val) < 0 {
|
||||
for _, val := range flagsType.Vals {
|
||||
if val == valArg.Val {
|
||||
return // verdict
|
||||
}
|
||||
}
|
||||
}
|
||||
valArg.Val = genOffset()
|
||||
})
|
||||
return
|
||||
}
|
@ -2,84 +2,63 @@
|
||||
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
include <linux/socket.h>
|
||||
include <uapi/linux/netfilter_ipv4/ip_tables.h>
|
||||
include <uapi/linux/limits.h>
|
||||
include <uapi/linux/ip_vs.h>
|
||||
include <uapi/linux/netfilter/x_tables.h>
|
||||
include <uapi/linux/netfilter/xt_rpfilter.h>
|
||||
include <uapi/linux/netfilter/xt_cgroup.h>
|
||||
include <uapi/linux/netfilter/xt_rateest.h>
|
||||
include <uapi/linux/netfilter/xt_l2tp.h>
|
||||
include <uapi/linux/netfilter/xt_time.h>
|
||||
include <uapi/linux/netfilter/xt_bpf.h>
|
||||
include <uapi/linux/netfilter/xt_socket.h>
|
||||
include <uapi/linux/netfilter/xt_connlimit.h>
|
||||
include <uapi/linux/netfilter/xt_conntrack.h>
|
||||
include <uapi/linux/netfilter/xt_tcpudp.h>
|
||||
include <uapi/linux/netfilter/xt_set.h>
|
||||
include <uapi/linux/netfilter/xt_mark.h>
|
||||
include <uapi/linux/netfilter/xt_connmark.h>
|
||||
include <uapi/linux/netfilter/xt_realm.h>
|
||||
include <uapi/linux/netfilter/xt_connbytes.h>
|
||||
include <uapi/linux/netfilter/xt_quota.h>
|
||||
include <uapi/linux/netfilter/xt_sctp.h>
|
||||
include <uapi/linux/netfilter/xt_limit.h>
|
||||
include <uapi/linux/netfilter/xt_addrtype.h>
|
||||
include <uapi/linux/netfilter/xt_ipvs.h>
|
||||
include <uapi/linux/netfilter/xt_dccp.h>
|
||||
include <uapi/linux/netfilter/xt_hashlimit.h>
|
||||
include <uapi/linux/netfilter/xt_nfacct.h>
|
||||
include <uapi/linux/netfilter/xt_length.h>
|
||||
include <uapi/linux/netfilter/xt_mac.h>
|
||||
include <uapi/linux/netfilter/xt_comment.h>
|
||||
include <uapi/linux/netfilter/xt_ipcomp.h>
|
||||
include <uapi/linux/netfilter/xt_statistic.h>
|
||||
include <uapi/linux/netfilter/xt_recent.h>
|
||||
include <uapi/linux/netfilter/xt_dscp.h>
|
||||
include <uapi/linux/netfilter/xt_policy.h>
|
||||
include <uapi/linux/netfilter/xt_tcpmss.h>
|
||||
include <uapi/linux/netfilter/xt_string.h>
|
||||
include <uapi/linux/netfilter/xt_physdev.h>
|
||||
include <uapi/linux/netfilter/xt_connlabel.h>
|
||||
include <uapi/linux/netfilter/xt_devgroup.h>
|
||||
include <uapi/linux/netfilter/xt_multiport.h>
|
||||
include <uapi/linux/netfilter/xt_cluster.h>
|
||||
include <uapi/linux/netfilter/xt_ecn.h>
|
||||
include <uapi/linux/netfilter/xt_owner.h>
|
||||
include <uapi/linux/netfilter/xt_pkttype.h>
|
||||
include <uapi/linux/netfilter/xt_u32.h>
|
||||
include <uapi/linux/netfilter/xt_iprange.h>
|
||||
include <uapi/linux/netfilter/xt_esp.h>
|
||||
include <uapi/linux/netfilter/xt_cpu.h>
|
||||
include <uapi/linux/netfilter/xt_state.h>
|
||||
|
||||
setsockopt$IPT_SO_SET_REPLACE(fd sock_in, level const[SOL_IP], opt const[IPT_SO_SET_REPLACE], val ptr[in, ipt_replace], len len[val])
|
||||
# Netfilter matches shared between ipv6/ipv6.
|
||||
|
||||
ipt_replace {
|
||||
name string[ipt_tables, XT_TABLE_MAXNAMELEN]
|
||||
# TODO: what should be here?
|
||||
valid_hooks int32
|
||||
# TODO: this should be len[entries, int32],
|
||||
# so far the only precedent of length of an array with variable-size elements.
|
||||
num_entries int32[0:5]
|
||||
size bytesize[entries, int32]
|
||||
# There are are byte offsets of elements in the entries array, quite hard to fill in properly...
|
||||
hook_entry array[int32, NF_INET_NUMHOOKS]
|
||||
underflow array[int32, NF_INET_NUMHOOKS]
|
||||
num_counters len[counters, int32]
|
||||
counters ptr[out, xt_counters]
|
||||
entries array[ipt_entry]
|
||||
}
|
||||
|
||||
ipt_entry {
|
||||
# This is split so that we can correctly fill in target_offset/next_offset.
|
||||
matches ipt_entry_matches
|
||||
target xt_entry_target
|
||||
} [packed]
|
||||
|
||||
ipt_entry_matches {
|
||||
ip ipt_ip
|
||||
# TODO: is it even used? how?
|
||||
nfcache int32
|
||||
target_offset len[parent, int16]
|
||||
next_offset len[ipt_entry, int16]
|
||||
comefrom flags[nf_inet_hooks_bits, int32]
|
||||
counters xt_counters
|
||||
matches array[xt_entry_match]
|
||||
} [packed]
|
||||
|
||||
ipt_ip {
|
||||
src ipv4_addr
|
||||
dst ipv4_addr
|
||||
smsk ipv4_addr_mask
|
||||
dmsk ipv4_addr_mask
|
||||
iniface devname
|
||||
outiface devname
|
||||
iniface_mask devname_mask
|
||||
outiface_mask devname_mask
|
||||
proto flags[ipv4_types, int16]
|
||||
flags flags[ipt_ip_flags, int8]
|
||||
invflags flags[ipt_ip_invflags, int8]
|
||||
}
|
||||
|
||||
xt_entry_match {
|
||||
match_size len[parent, int16]
|
||||
# TODO: this must be a random fixed-size string.
|
||||
name array[int8, XT_EXTENSION_MAXNAMELEN]
|
||||
revision int8
|
||||
# TODO: what's here
|
||||
data array[int8]
|
||||
}
|
||||
|
||||
xt_entry_target {
|
||||
target_size len[parent, int16]
|
||||
# TODO: this must be a random fixed-size string.
|
||||
name array[int8, XT_EXTENSION_MAXNAMELEN]
|
||||
revision int8
|
||||
# TODO: what's here
|
||||
data array[int8]
|
||||
}
|
||||
|
||||
xt_counters {
|
||||
pcnt int64
|
||||
bcnt int64
|
||||
}
|
||||
|
||||
ipt_tables = "filter", "mangle", "nat", "raw", "security"
|
||||
ipt_ip_flags = IPT_F_FRAG, IPT_F_GOTO
|
||||
ipt_ip_invflags = IPT_INV_VIA_IN, IPT_INV_VIA_OUT, IPT_INV_TOS, IPT_INV_SRCIP, IPT_INV_DSTIP, IPT_INV_FRAG, IPT_INV_PROTO
|
||||
nf_inet_hooks_bits = NF_INET_PRE_ROUTING_BIT, NF_INET_LOCAL_IN_BIT, NF_INET_FORWARD_BIT, NF_INET_LOCAL_OUT_BIT, NF_INET_POST_ROUTING_BIT, NF_INET_NUMHOOKS_BIT
|
||||
define IPT_FILTER_VALID_HOOKS NF_INET_LOCAL_IN_BIT | NF_INET_FORWARD_BIT | NF_INET_LOCAL_OUT_BIT
|
||||
define IPT_NAT_VALID_HOOKS NF_INET_PRE_ROUTING_BIT | NF_INET_POST_ROUTING_BIT | NF_INET_LOCAL_OUT_BIT | NF_INET_LOCAL_IN_BIT
|
||||
define IPT_MANGLE_VALID_HOOKS NF_INET_PRE_ROUTING_BIT | NF_INET_POST_ROUTING_BIT | NF_INET_FORWARD_BIT |NF_INET_LOCAL_OUT_BIT | NF_INET_LOCAL_IN_BIT
|
||||
define IPT_RAW_VALID_HOOKS NF_INET_PRE_ROUTING_BIT | NF_INET_LOCAL_OUT_BIT
|
||||
define IPT_SECURITY_VALID_HOOKS NF_INET_LOCAL_IN_BIT | NF_INET_FORWARD_BIT | NF_INET_LOCAL_OUT_BIT
|
||||
|
||||
define NF_INET_PRE_ROUTING_BIT 1 << NF_INET_PRE_ROUTING
|
||||
define NF_INET_LOCAL_IN_BIT 1 << NF_INET_LOCAL_IN
|
||||
@ -87,3 +66,715 @@ define NF_INET_FORWARD_BIT 1 << NF_INET_FORWARD
|
||||
define NF_INET_LOCAL_OUT_BIT 1 << NF_INET_LOCAL_OUT
|
||||
define NF_INET_POST_ROUTING_BIT 1 << NF_INET_POST_ROUTING
|
||||
define NF_INET_NUMHOOKS_BIT 1 << NF_INET_NUMHOOKS
|
||||
|
||||
xt_counters {
|
||||
pcnt const[0, int64]
|
||||
bcnt const[0, int64]
|
||||
}
|
||||
|
||||
nf_inet_addr [
|
||||
ipv4 ipv4_addr
|
||||
ipv6 ipv6_addr
|
||||
]
|
||||
|
||||
nf_conntrack_man_proto [
|
||||
port sock_port
|
||||
icmp_id icmp_id
|
||||
# TODO: what is gre key? do we have it already in gre descriptions in vnet.txt?
|
||||
gre_key int16
|
||||
]
|
||||
|
||||
type xt_entry_match[NAME, DATA, REV] {
|
||||
match_size len[parent, int16]
|
||||
name string[NAME, XT_EXTENSION_MAXNAMELEN]
|
||||
revision const[REV, int8]
|
||||
data DATA
|
||||
} [align_ptr]
|
||||
|
||||
xt_unspec_matches [
|
||||
cgroup0 xt_entry_match["cgroup", xt_cgroup_info_v0, 0]
|
||||
cgroup1 xt_entry_match["cgroup", xt_cgroup_info_v1, 1]
|
||||
helper xt_entry_match["helper", xt_helper_info, 0]
|
||||
rateest xt_entry_match["rateest", xt_rateest_match_info, 0]
|
||||
l2tp xt_entry_match["l2tp", xt_l2tp_info, 0]
|
||||
time xt_entry_match["time", xt_time_info, 0]
|
||||
bpf0 xt_entry_match["bpf", xt_bpf_info, 0]
|
||||
bpf1 xt_entry_match["bpf", xt_bpf_info_v1, 1]
|
||||
socket1 xt_entry_match["socket", flags[xt_socket_flags_v1, int8], 1]
|
||||
socket2 xt_entry_match["socket", flags[xt_socket_flags_v2, int8], 2]
|
||||
socket3 xt_entry_match["socket", flags[xt_socket_flags_v3, int8], 3]
|
||||
connlimit xt_entry_match["connlimit", xt_connlimit_info, 0]
|
||||
conntrack1 xt_entry_match["conntrack", xt_conntrack_mtinfo1, 1]
|
||||
conntrack2 xt_entry_match["conntrack", xt_conntrack_mtinfo2, 2]
|
||||
conntrack3 xt_entry_match["conntrack", xt_conntrack_mtinfo3, 3]
|
||||
tcp xt_entry_match["tcp", xt_tcp, 0]
|
||||
udp xt_entry_match["udp", xt_udp, 0]
|
||||
udplite xt_entry_match["udplite", xt_udp, 0]
|
||||
set1 xt_entry_match["set", xt_set_info_match_v1, 1]
|
||||
set2 xt_entry_match["set", xt_set_info_match_v1, 2]
|
||||
set3 xt_entry_match["set", xt_set_info_match_v3, 3]
|
||||
set4 xt_entry_match["set", xt_set_info_match_v4, 4]
|
||||
mark xt_entry_match["mark", xt_mark_mtinfo1, 1]
|
||||
connmark xt_entry_match["connmark", xt_connmark_mtinfo1, 1]
|
||||
realm xt_entry_match["realm", xt_realm_info, 0]
|
||||
connbytes xt_entry_match["connbytes", xt_connbytes_info, 0]
|
||||
quota xt_entry_match["quota", xt_quota_info, 0]
|
||||
sctp xt_entry_match["sctp", xt_sctp_info, 0]
|
||||
limit xt_entry_match["limit", xt_rateinfo, 0]
|
||||
addrtype1 xt_entry_match["addrtype", xt_addrtype_info_v1, 1]
|
||||
ipvs xt_entry_match["ipvs", xt_ipvs_mtinfo, 0]
|
||||
dccp xt_entry_match["dccp", xt_dccp_info, 0]
|
||||
hashlimit1 xt_entry_match["hashlimit", xt_hashlimit_mtinfo1, 1]
|
||||
hashlimit2 xt_entry_match["hashlimit", xt_hashlimit_mtinfo2, 2]
|
||||
hashlimit3 xt_entry_match["hashlimit", xt_hashlimit_mtinfo3, 3]
|
||||
nfacct xt_entry_match["nfacct", xt_nfacct_match_info, 0]
|
||||
length xt_entry_match["length", xt_length_info, 0]
|
||||
mac xt_entry_match["mac", xt_mac_info, 0]
|
||||
comment xt_entry_match["comment", xt_comment_info, 0]
|
||||
ipcomp xt_entry_match["ipcomp", xt_ipcomp, 0]
|
||||
statistic xt_entry_match["statistic", xt_statistic_info, 0]
|
||||
recent0 xt_entry_match["recent", xt_recent_mtinfo, 0]
|
||||
recent1 xt_entry_match["recent", xt_recent_mtinfo_v1, 0]
|
||||
dscp xt_entry_match["dscp", xt_dscp_info, 0]
|
||||
tos xt_entry_match["tos", xt_tos_match_info, 0]
|
||||
policy xt_entry_match["policy", xt_policy_info, 0]
|
||||
tcpmss xt_entry_match["tcpmss", xt_tcpmss_match_info, 0]
|
||||
string xt_entry_match["string", xt_string_info, 1]
|
||||
physdev xt_entry_match["physdev", xt_physdev_info, 0]
|
||||
connlabel xt_entry_match["connlabel", xt_connlabel_mtinfo, 0]
|
||||
devgroup xt_entry_match["devgroup", xt_devgroup_info, 0]
|
||||
multiport xt_entry_match["multiport", xt_multiport_v1, 1]
|
||||
cluster xt_entry_match["cluster", xt_cluster_match_info, 0]
|
||||
ecn xt_entry_match["ecn", xt_ecn_info, 0]
|
||||
owner xt_entry_match["owner", xt_owner_match_info, 0]
|
||||
pkttype xt_entry_match["pkttype", xt_pkttype_info, 0]
|
||||
u32 xt_entry_match["u32", xt_u32, 0]
|
||||
iprange xt_entry_match["iprange", xt_iprange_mtinfo, 1]
|
||||
esp xt_entry_match["esp", xt_esp, 0]
|
||||
cpu xt_entry_match["cpu", xt_cpu_info, 0]
|
||||
state xt_entry_match["state", xt_state_info, 0]
|
||||
] [varlen]
|
||||
|
||||
xt_unspec_mangle_matches [
|
||||
rpfilter xt_entry_match["rpfilter", xt_rpfilter_info, 0]
|
||||
# TODO: just so that we have second union option.
|
||||
void void
|
||||
] [varlen]
|
||||
|
||||
xt_unspec_raw_matches [
|
||||
rpfilter xt_entry_match["rpfilter", xt_rpfilter_info, 0]
|
||||
# TODO: just so that we have second union option.
|
||||
void void
|
||||
] [varlen]
|
||||
|
||||
xt_socket_flags_v1 = XT_SOCKET_TRANSPARENT
|
||||
xt_socket_flags_v2 = XT_SOCKET_TRANSPARENT, XT_SOCKET_NOWILDCARD
|
||||
xt_socket_flags_v3 = XT_SOCKET_TRANSPARENT, XT_SOCKET_NOWILDCARD, XT_SOCKET_RESTORESKMARK
|
||||
|
||||
xt_rpfilter_info {
|
||||
flags flags[xt_rpfilter_flags, int8]
|
||||
}
|
||||
|
||||
xt_rpfilter_flags = XT_RPFILTER_LOOSE, XT_RPFILTER_VALID_MARK, XT_RPFILTER_ACCEPT_LOCAL, XT_RPFILTER_INVERT
|
||||
|
||||
xt_cgroup_info_v0 {
|
||||
# TODO: this is some "cgroup classid", what's this?
|
||||
id int32
|
||||
invert bool32
|
||||
}
|
||||
|
||||
xt_cgroup_info_v1 {
|
||||
has_path bool8
|
||||
has_classid bool8
|
||||
invert_path bool8
|
||||
invert_classid bool8
|
||||
# TODO: this is some "cgroup path"
|
||||
path array[int8, PATH_MAX]
|
||||
# TODO: again "cgroup classid"
|
||||
classid int32
|
||||
priv intptr
|
||||
}
|
||||
|
||||
xt_helper_info {
|
||||
invert bool32
|
||||
name string[xt_helper_names, 30]
|
||||
}
|
||||
|
||||
xt_helper_names = "ftp-20000", "tftp-20000", "sip-20000", "irc-20000", "sane-20000", "amanda", "RAS", "Q.931", "H.245"
|
||||
|
||||
xt_rateest_match_info {
|
||||
name1 devname
|
||||
name2 devname
|
||||
flags flags[xt_rateest_match_flags, int16]
|
||||
mode flags[xt_rateest_match_mode, int16]
|
||||
bps1 int32
|
||||
pps1 int32
|
||||
bps2 int32
|
||||
pps2 int32
|
||||
est1 intptr
|
||||
est2 intptr
|
||||
}
|
||||
|
||||
xt_rateest_match_flags = XT_RATEEST_MATCH_INVERT, XT_RATEEST_MATCH_ABS, XT_RATEEST_MATCH_REL, XT_RATEEST_MATCH_DELTA, XT_RATEEST_MATCH_BPS, XT_RATEEST_MATCH_PPS
|
||||
xt_rateest_match_mode = XT_RATEEST_MATCH_NONE, XT_RATEEST_MATCH_EQ, XT_RATEEST_MATCH_LT, XT_RATEEST_MATCH_GT
|
||||
|
||||
xt_l2tp_info {
|
||||
tid l2tp_tunnel32
|
||||
sid l2tp_session32
|
||||
version int8[2:3]
|
||||
type flags[xt_l2tp_type, int8]
|
||||
flags flags[xt_l2tp_flags, int8]
|
||||
}
|
||||
|
||||
xt_l2tp_type = XT_L2TP_TYPE_CONTROL, XT_L2TP_TYPE_DATA
|
||||
xt_l2tp_flags = XT_L2TP_TID, XT_L2TP_SID, XT_L2TP_VERSION, XT_L2TP_TYPE
|
||||
|
||||
xt_time_info {
|
||||
date_start int32[0:XT_TIME_MAX_DAYTIME]
|
||||
date_stop int32[0:XT_TIME_MAX_DAYTIME]
|
||||
monthdays_match int32
|
||||
weekdays_match int8
|
||||
flags flags[xt_time_flags, int8]
|
||||
}
|
||||
|
||||
xt_time_flags = XT_TIME_LOCAL_TZ, XT_TIME_CONTIGUOUS
|
||||
|
||||
xt_bpf_info {
|
||||
bpf_program_num_elem int16[0:XT_BPF_MAX_NUM_INSTR]
|
||||
bpf_program array[sock_filter, XT_BPF_MAX_NUM_INSTR]
|
||||
filter ptr64[in, array[int8]]
|
||||
}
|
||||
|
||||
xt_bpf_info_v1 [
|
||||
bytecode xt_bpf_info_bytecode
|
||||
pinned xt_bpf_info_pinned
|
||||
fd xt_bpf_info_fd
|
||||
]
|
||||
|
||||
xt_bpf_info_bytecode {
|
||||
mode const[XT_BPF_MODE_BYTECODE, int16]
|
||||
bpf_program_num_elem int16[0:XT_BPF_MAX_NUM_INSTR]
|
||||
fd const[0, int32]
|
||||
bpf_program array[sock_filter, XT_BPF_MAX_NUM_INSTR]
|
||||
filter ptr64[in, array[int8]]
|
||||
}
|
||||
|
||||
xt_bpf_info_pinned {
|
||||
mode const[XT_BPF_MODE_FD_PINNED, int16]
|
||||
bpf_program_num_elem const[0, int16]
|
||||
fd const[0, int32]
|
||||
# TODO: we need fixed-size filename here.
|
||||
path array[int8, XT_BPF_PATH_MAX]
|
||||
filter ptr64[in, array[int8]]
|
||||
}
|
||||
|
||||
xt_bpf_info_fd {
|
||||
mode const[XT_BPF_MODE_FD_ELF, int16]
|
||||
bpf_program_num_elem const[0, int16]
|
||||
fd fd_bpf_prog
|
||||
}
|
||||
|
||||
xt_connlimit_info {
|
||||
mask ipv6_addr_mask
|
||||
limit int32
|
||||
flags flags[xt_connlimit_flags, int32]
|
||||
data intptr
|
||||
}
|
||||
|
||||
xt_connlimit_flags = XT_CONNLIMIT_INVERT, XT_CONNLIMIT_DADDR
|
||||
|
||||
xt_conntrack_mtinfo_common {
|
||||
origsrc_addr nf_inet_addr
|
||||
origsrc_mask ipv6_addr_mask
|
||||
origdst_addr nf_inet_addr
|
||||
origdst_mask ipv6_addr_mask
|
||||
replsrc_addr nf_inet_addr
|
||||
replsrc_mask ipv6_addr_mask
|
||||
repldst_addr nf_inet_addr
|
||||
repldst_mask ipv6_addr_mask
|
||||
expires_min int32
|
||||
expires_max int32
|
||||
l4proto flags[ipv6_types, int16]
|
||||
origsrc_port sock_port
|
||||
origdst_port sock_port
|
||||
replsrc_port sock_port
|
||||
repldst_port sock_port
|
||||
match_flags flags[xt_conntrack_flags, int16]
|
||||
invert_flags flags[xt_conntrack_flags, int16]
|
||||
}
|
||||
|
||||
xt_conntrack_mtinfo1 {
|
||||
common xt_conntrack_mtinfo_common
|
||||
state_mask flags[xt_conntrack_state, int8]
|
||||
status_mask flags[xt_conntrack_status, int8]
|
||||
}
|
||||
|
||||
xt_conntrack_mtinfo2 {
|
||||
common xt_conntrack_mtinfo_common
|
||||
state_mask flags[xt_conntrack_state, int16]
|
||||
status_mask flags[xt_conntrack_status, int16]
|
||||
}
|
||||
|
||||
xt_conntrack_mtinfo3 {
|
||||
common xt_conntrack_mtinfo_common
|
||||
state_mask flags[xt_conntrack_state, int16]
|
||||
status_mask flags[xt_conntrack_status, int16]
|
||||
origsrc_port_high sock_port
|
||||
origdst_port_high sock_port
|
||||
replsrc_port_high sock_port
|
||||
repldst_port_high sock_port
|
||||
}
|
||||
|
||||
xt_conntrack_flags = XT_CONNTRACK_STATE, XT_CONNTRACK_PROTO, XT_CONNTRACK_ORIGSRC, XT_CONNTRACK_ORIGDST, XT_CONNTRACK_REPLSRC, XT_CONNTRACK_REPLDST, XT_CONNTRACK_STATUS, XT_CONNTRACK_EXPIRES, XT_CONNTRACK_ORIGSRC_PORT, XT_CONNTRACK_ORIGDST_PORT, XT_CONNTRACK_REPLSRC_PORT, XT_CONNTRACK_REPLDST_PORT, XT_CONNTRACK_DIRECTION, XT_CONNTRACK_STATE_ALIAS
|
||||
xt_conntrack_state = XT_CONNTRACK_STATE_INVALID, XT_CONNTRACK_STATE_SNAT, XT_CONNTRACK_STATE_DNAT, XT_CONNTRACK_STATE_UNTRACKED
|
||||
xt_conntrack_status = IPS_EXPECTED, IPS_SEEN_REPLY, IPS_ASSURED, IPS_CONFIRMED, IPS_SRC_NAT, IPS_DST_NAT, IPS_SEQ_ADJUST, IPS_SRC_NAT_DONE, IPS_DST_NAT_DONE, IPS_DYING, IPS_FIXED_TIMEOUT, IPS_TEMPLATE, IPS_UNTRACKED, IPS_HELPER
|
||||
|
||||
xt_tcp {
|
||||
spts_min sock_port
|
||||
spts_max sock_port
|
||||
dpts_min sock_port
|
||||
dpts_max sock_port
|
||||
option flags[tcp_option_types, int8]
|
||||
flg_mask flags[tcp_flags, int8]
|
||||
flg_cmp flags[tcp_flags, int8]
|
||||
invflags flags[xt_tcp_inv_flags, int8]
|
||||
}
|
||||
|
||||
xt_tcp_inv_flags = XT_TCP_INV_SRCPT, XT_TCP_INV_DSTPT, XT_TCP_INV_FLAGS, XT_TCP_INV_OPTION
|
||||
|
||||
xt_udp {
|
||||
spts_min sock_port
|
||||
spts_max sock_port
|
||||
dpts_min sock_port
|
||||
dpts_max sock_port
|
||||
invflags flags[xt_udp_inv_flags, int8]
|
||||
}
|
||||
|
||||
xt_udp_inv_flags = XT_UDP_INV_SRCPT, XT_UDP_INV_DSTPT
|
||||
|
||||
xt_set_info_match_v0 {
|
||||
match_set xt_set_info_v0
|
||||
}
|
||||
|
||||
xt_set_info_match_v1 {
|
||||
match_set xt_set_info
|
||||
}
|
||||
|
||||
xt_set_info_match_v3 {
|
||||
match_set xt_set_info
|
||||
packets ip_set_counter_match0
|
||||
bytes ip_set_counter_match0
|
||||
flags int32
|
||||
}
|
||||
|
||||
xt_set_info_match_v4 {
|
||||
match_set xt_set_info
|
||||
packets ip_set_counter_match
|
||||
bytes ip_set_counter_match
|
||||
flags int32
|
||||
}
|
||||
|
||||
xt_mark_mtinfo1 {
|
||||
mark int32
|
||||
mask int32
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_connmark_mtinfo1 {
|
||||
mark int32
|
||||
mask int32
|
||||
invert bool32
|
||||
}
|
||||
|
||||
xt_realm_info {
|
||||
id int32
|
||||
mask int32
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_connbytes_info {
|
||||
count_from int64
|
||||
count_to int64
|
||||
what flags[xt_connbytes_what, int8]
|
||||
direction flags[xt_connbytes_direction, int8]
|
||||
}
|
||||
|
||||
xt_connbytes_what = XT_CONNBYTES_PKTS, XT_CONNBYTES_BYTES, XT_CONNBYTES_AVGPKT
|
||||
xt_connbytes_direction = XT_CONNBYTES_DIR_ORIGINAL, XT_CONNBYTES_DIR_REPLY, XT_CONNBYTES_DIR_BOTH
|
||||
|
||||
xt_quota_info {
|
||||
flags bool32
|
||||
pad const[0, int32]
|
||||
quota int64
|
||||
master intptr
|
||||
}
|
||||
|
||||
xt_sctp_info {
|
||||
dpts_min sock_port
|
||||
dpts_max sock_port
|
||||
spts_min sock_port
|
||||
spts_max sock_port
|
||||
chunkmap array[int32, 64]
|
||||
chunk_match_type flags[xt_sctp_match_type, int32]
|
||||
flag_info array[xt_sctp_flag_info, XT_NUM_SCTP_FLAGS]
|
||||
flag_count int32[0:XT_NUM_SCTP_FLAGS]
|
||||
flags flags[xt_sctp_flags, int32]
|
||||
invflags flags[xt_sctp_flags, int32]
|
||||
}
|
||||
|
||||
xt_sctp_match_type = SCTP_CHUNK_MATCH_ANY, SCTP_CHUNK_MATCH_ALL, SCTP_CHUNK_MATCH_ONLY
|
||||
xt_sctp_flags = XT_SCTP_SRC_PORTS, XT_SCTP_DEST_PORTS, XT_SCTP_CHUNK_TYPES
|
||||
|
||||
xt_sctp_flag_info {
|
||||
chunktype int8
|
||||
flag int8
|
||||
flag_mask int8
|
||||
}
|
||||
|
||||
xt_rateinfo {
|
||||
avg int32
|
||||
burst int32
|
||||
prev intptr
|
||||
credit int32
|
||||
credit_cap int32
|
||||
cost int32
|
||||
master intptr
|
||||
}
|
||||
|
||||
xt_addrtype_info {
|
||||
source flags[xt_addrtype_type, int16]
|
||||
dest flags[xt_addrtype_type, int16]
|
||||
invert_source bool32
|
||||
invert_dest bool32
|
||||
}
|
||||
|
||||
xt_addrtype_info_v1 {
|
||||
source flags[xt_addrtype_type, int16]
|
||||
dest flags[xt_addrtype_type, int16]
|
||||
flags flags[xt_addrtype_flags, int32]
|
||||
}
|
||||
|
||||
xt_addrtype_type = XT_ADDRTYPE_UNSPEC, XT_ADDRTYPE_UNICAST, XT_ADDRTYPE_LOCAL, XT_ADDRTYPE_BROADCAST, XT_ADDRTYPE_ANYCAST, XT_ADDRTYPE_MULTICAST, XT_ADDRTYPE_BLACKHOLE, XT_ADDRTYPE_UNREACHABLE, XT_ADDRTYPE_PROHIBIT, XT_ADDRTYPE_THROW, XT_ADDRTYPE_NAT, XT_ADDRTYPE_XRESOLVE
|
||||
xt_addrtype_flags = XT_ADDRTYPE_INVERT_SOURCE, XT_ADDRTYPE_INVERT_DEST, XT_ADDRTYPE_LIMIT_IFACE_IN, XT_ADDRTYPE_LIMIT_IFACE_OUT
|
||||
|
||||
xt_ipvs_mtinfo {
|
||||
vaddr nf_inet_addr
|
||||
vmask ipv6_addr_mask
|
||||
vport sock_port
|
||||
l4proto flags[ipv6_types, int8]
|
||||
fwd_method int8[0:IP_VS_CONN_F_FWD_MASK]
|
||||
vportctl sock_port
|
||||
invert flags[xt_ipvs_flags, int8]
|
||||
bitmask flags[xt_ipvs_flags, int8]
|
||||
}
|
||||
|
||||
xt_ipvs_flags = XT_IPVS_IPVS_PROPERTY, XT_IPVS_PROTO, XT_IPVS_VADDR, XT_IPVS_VPORT, XT_IPVS_DIR, XT_IPVS_METHOD, XT_IPVS_VPORT
|
||||
|
||||
xt_dccp_info {
|
||||
dpts_min sock_port
|
||||
dpts_max sock_port
|
||||
spts_min sock_port
|
||||
spts_max sock_port
|
||||
flags flags[xt_dccp_flags, int16]
|
||||
invflags flags[xt_dccp_flags, int16]
|
||||
typemask int16
|
||||
option int8
|
||||
}
|
||||
|
||||
xt_dccp_flags = XT_DCCP_SRC_PORTS, XT_DCCP_DEST_PORTS, XT_DCCP_TYPE, XT_DCCP_OPTION
|
||||
|
||||
xt_hashlimit_mtinfo1 {
|
||||
name devname
|
||||
cfg hashlimit_cfg1
|
||||
hinfo intptr
|
||||
}
|
||||
|
||||
xt_hashlimit_mtinfo2 {
|
||||
name string[devnames, NAME_MAX]
|
||||
cfg hashlimit_cfg2
|
||||
hinfo intptr
|
||||
}
|
||||
|
||||
xt_hashlimit_mtinfo3 {
|
||||
name string[devnames, NAME_MAX]
|
||||
cfg hashlimit_cfg3
|
||||
hinfo intptr
|
||||
}
|
||||
|
||||
hashlimit_cfg1 {
|
||||
mode flags[xt_hashlimit_modes, int32]
|
||||
avg int32
|
||||
burst int32
|
||||
size int32
|
||||
max int32
|
||||
gc_interval int32
|
||||
expire int32
|
||||
srcmask flags[xt_hashlimit_mask, int8]
|
||||
dstmask flags[xt_hashlimit_mask, int8]
|
||||
}
|
||||
|
||||
hashlimit_cfg2 {
|
||||
avg int64
|
||||
burst int64
|
||||
mode flags[xt_hashlimit_modes, int32]
|
||||
size int32
|
||||
max int32
|
||||
gc_interval int32
|
||||
expire int32
|
||||
srcmask flags[xt_hashlimit_mask, int8]
|
||||
dstmask flags[xt_hashlimit_mask, int8]
|
||||
}
|
||||
|
||||
hashlimit_cfg3 {
|
||||
avg int64
|
||||
burst int64
|
||||
mode flags[xt_hashlimit_modes, int32]
|
||||
size int32
|
||||
max int32
|
||||
gc_interval int32
|
||||
expire int32
|
||||
interval int32
|
||||
srcmask flags[xt_hashlimit_mask, int8]
|
||||
dstmask flags[xt_hashlimit_mask, int8]
|
||||
}
|
||||
|
||||
xt_hashlimit_modes = XT_HASHLIMIT_HASH_DIP, XT_HASHLIMIT_HASH_DPT, XT_HASHLIMIT_HASH_SIP, XT_HASHLIMIT_HASH_SPT, XT_HASHLIMIT_INVERT, XT_HASHLIMIT_BYTES, XT_HASHLIMIT_RATE_MATCH
|
||||
xt_hashlimit_mask = 0, 8, 24, 32, 64, 120, 128
|
||||
|
||||
xt_nfacct_match_info {
|
||||
name string[xt_nfacct_match_names, NFACCT_NAME_MAX]
|
||||
# TODO: this seems to leak from kernel (there were another similar place, but can't find it now):
|
||||
nfacct intptr
|
||||
}
|
||||
|
||||
xt_nfacct_match_names = "syz0", "syz1"
|
||||
|
||||
xt_length_info {
|
||||
min int16
|
||||
max int16
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_mac_info {
|
||||
srcaddr mac_addr
|
||||
invert bool32
|
||||
}
|
||||
|
||||
xt_comment_info {
|
||||
comment array[const[0, int8], XT_MAX_COMMENT_LEN]
|
||||
}
|
||||
|
||||
xt_ipcomp {
|
||||
spis_min xfrm_spi
|
||||
spis_max xfrm_spi
|
||||
invflags flags[xt_ipcomp_flags, int8]
|
||||
hdrres const[0, int8]
|
||||
}
|
||||
|
||||
xt_ipcomp_flags = XT_IPCOMP_INV_SPI, XT_IPCOMP_INV_MASK
|
||||
|
||||
xt_statistic_info {
|
||||
mode bool16
|
||||
flags bool16
|
||||
every int32
|
||||
packet int32
|
||||
count int32
|
||||
# TODO: this seem to leak to userspace:
|
||||
master intptr
|
||||
}
|
||||
|
||||
xt_recent_mtinfo {
|
||||
seconds int32
|
||||
hit_count int32
|
||||
check_set flags[xt_recent_check_set, int8]
|
||||
invert bool8
|
||||
name string[xt_recent_names, XT_RECENT_NAME_LEN]
|
||||
side int8
|
||||
}
|
||||
|
||||
xt_recent_mtinfo_v1 {
|
||||
seconds int32
|
||||
hit_count int32
|
||||
check_set flags[xt_recent_check_set, int8]
|
||||
invert bool8
|
||||
name string[xt_recent_names, XT_RECENT_NAME_LEN]
|
||||
side int8
|
||||
mask ipv6_addr_mask
|
||||
}
|
||||
|
||||
xt_recent_names = "syz0", "syz1"
|
||||
xt_recent_check_set = XT_RECENT_CHECK, XT_RECENT_SET, XT_RECENT_UPDATE, XT_RECENT_REMOVE, XT_RECENT_TTL, XT_RECENT_REAP, XT_RECENT_SOURCE, XT_RECENT_DEST
|
||||
|
||||
xt_dscp_info {
|
||||
dscp int8
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_tos_match_info {
|
||||
tos_mask int8
|
||||
tos_value int8
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_policy_info {
|
||||
pol array[xt_policy_elem, XT_POLICY_MAX_ELEM]
|
||||
flags flags[xt_policy_flags, int16]
|
||||
len int16[0:XT_POLICY_MAX_ELEM]
|
||||
}
|
||||
|
||||
xt_policy_elem {
|
||||
saddr nf_inet_addr
|
||||
smask ipv6_addr_mask
|
||||
daddr nf_inet_addr
|
||||
dmask ipv6_addr_mask
|
||||
spi xfrm_spi
|
||||
reqid xfrm_req_id
|
||||
proto flags[ipv6_types, int8]
|
||||
mode flags[xt_policy_mode, int8]
|
||||
match flags[xt_policy_spec, int8]
|
||||
invert flags[xt_policy_spec, int8]
|
||||
}
|
||||
|
||||
xt_policy_flags = XT_POLICY_MATCH_IN, XT_POLICY_MATCH_OUT, XT_POLICY_MATCH_NONE, XT_POLICY_MATCH_STRICT
|
||||
xt_policy_mode = XT_POLICY_MODE_TRANSPORT, XT_POLICY_MODE_TUNNEL
|
||||
xt_policy_spec = 1, 2, 4, 8, 16
|
||||
|
||||
xt_tcpmss_match_info {
|
||||
mss_min int16
|
||||
mss_max int16
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_string_info {
|
||||
from_offset int16
|
||||
to_offset int16
|
||||
algo string[textsearch_algos, XT_STRING_MAX_ALGO_NAME_SIZE]
|
||||
pattern array[int8, XT_STRING_MAX_PATTERN_SIZE]
|
||||
patlen int8[0:XT_STRING_MAX_PATTERN_SIZE]
|
||||
flags flags[xt_string_flags, int8]
|
||||
config intptr
|
||||
}
|
||||
|
||||
textsearch_algos = "bm", "fsm", "kmp"
|
||||
xt_string_flags = XT_STRING_FLAG_INVERT, XT_STRING_FLAG_IGNORECASE
|
||||
|
||||
xt_physdev_info {
|
||||
physindev devname
|
||||
in_mask devname_mask
|
||||
physoutdev devname
|
||||
out_mask devname_mask
|
||||
invert flags[xt_physdev_flags, int8]
|
||||
bitmask flags[xt_physdev_flags, int8]
|
||||
}
|
||||
|
||||
xt_physdev_flags = XT_PHYSDEV_OP_IN, XT_PHYSDEV_OP_OUT, XT_PHYSDEV_OP_BRIDGED, XT_PHYSDEV_OP_ISIN, XT_PHYSDEV_OP_ISOUT
|
||||
|
||||
xt_connlabel_mtinfo {
|
||||
bit int16
|
||||
options flags[xt_connlabel_mtopts, int16]
|
||||
}
|
||||
|
||||
xt_connlabel_mtopts = XT_CONNLABEL_OP_INVERT, XT_CONNLABEL_OP_SET
|
||||
|
||||
xt_devgroup_info {
|
||||
flags flags[xt_devgroup_flags, int32]
|
||||
src_group int32
|
||||
src_mask int32
|
||||
dst_group int32
|
||||
dst_mask int32
|
||||
}
|
||||
|
||||
xt_devgroup_flags = XT_DEVGROUP_MATCH_SRC, XT_DEVGROUP_INVERT_SRC, XT_DEVGROUP_MATCH_DST, XT_DEVGROUP_INVERT_DST
|
||||
|
||||
xt_multiport_v1 {
|
||||
flags int8[0:2]
|
||||
count int8[0:XT_MULTI_PORTS]
|
||||
ports array[sock_port, XT_MULTI_PORTS]
|
||||
pflags array[bool8, XT_MULTI_PORTS]
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_cluster_match_info {
|
||||
total_nodes int32
|
||||
node_mask int32
|
||||
hash_seed int32
|
||||
flags bool32
|
||||
}
|
||||
|
||||
xt_ecn_info {
|
||||
operation flags[xt_ecn_operation, int8]
|
||||
invert flags[xt_ecn_operation, int8]
|
||||
ip_ect int8
|
||||
ect int8
|
||||
}
|
||||
|
||||
xt_ecn_operation = XT_ECN_OP_MATCH_IP, XT_ECN_OP_MATCH_ECE, XT_ECN_OP_MATCH_CWR
|
||||
|
||||
xt_owner_match_info {
|
||||
uid_min uid
|
||||
uid_max uid
|
||||
gid_min gid
|
||||
gid_max gid
|
||||
match flags[xt_owner_match_flags, int8]
|
||||
invert flags[xt_owner_match_flags, int8]
|
||||
}
|
||||
|
||||
xt_owner_match_flags = XT_OWNER_UID, XT_OWNER_GID, XT_OWNER_SOCKET
|
||||
|
||||
xt_pkttype_info {
|
||||
pkttype int32
|
||||
invert int32
|
||||
}
|
||||
|
||||
xt_u32 {
|
||||
tests array[xt_u32_test, XT_U32_REAL_MAXSIZE]
|
||||
ntests int8[0:XT_U32_REAL_MAXSIZE]
|
||||
invert bool8
|
||||
}
|
||||
|
||||
xt_u32_test {
|
||||
location array[xt_u32_location_element, XT_U32_REAL_MAXSIZE]
|
||||
value array[xt_u32_value_element, XT_U32_REAL_MAXSIZE]
|
||||
nnums int8[0:XT_U32_REAL_MAXSIZE]
|
||||
nvalues int8[0:XT_U32_REAL_MAXSIZE]
|
||||
}
|
||||
|
||||
xt_u32_location_element {
|
||||
number int32
|
||||
nextop flags[xt_u32_ops, int8]
|
||||
}
|
||||
|
||||
xt_u32_value_element {
|
||||
min int32
|
||||
max int32
|
||||
}
|
||||
|
||||
xt_u32_ops = XT_U32_AND, XT_U32_LEFTSH, XT_U32_RIGHTSH, XT_U32_AT
|
||||
define XT_U32_REAL_MAXSIZE XT_U32_MAXSIZE + 1
|
||||
|
||||
xt_iprange_mtinfo {
|
||||
src_min nf_inet_addr
|
||||
src_max nf_inet_addr
|
||||
dst_min nf_inet_addr
|
||||
dst_max nf_inet_addr
|
||||
flags flags[xt_iprange_flags, int8]
|
||||
}
|
||||
|
||||
xt_iprange_flags = IPRANGE_SRC, IPRANGE_DST, IPRANGE_SRC_INV, IPRANGE_DST_INV
|
||||
|
||||
xt_esp {
|
||||
spis_min xfrm_spi
|
||||
spis_max xfrm_spi
|
||||
invflags flags[xt_esp_flags, int8]
|
||||
}
|
||||
|
||||
xt_esp_flags = XT_ESP_INV_SPI, XT_ESP_INV_MASK
|
||||
|
||||
xt_cpu_info {
|
||||
cpu int32
|
||||
invert bool32
|
||||
}
|
||||
|
||||
xt_state_info {
|
||||
statemask int32
|
||||
}
|
||||
|
@ -1,22 +1,186 @@
|
||||
# AUTOGENERATED FILE
|
||||
IPPROTO_IP = 0
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPRANGE_DST = 2
|
||||
IPRANGE_DST_INV = 32
|
||||
IPRANGE_SRC = 1
|
||||
IPRANGE_SRC_INV = 16
|
||||
IPS_ASSURED = 4
|
||||
IPS_CONFIRMED = 8
|
||||
IPS_DST_NAT = 32
|
||||
IPS_DST_NAT_DONE = 256
|
||||
IPS_DYING = 512
|
||||
IPS_EXPECTED = 1
|
||||
IPS_FIXED_TIMEOUT = 1024
|
||||
IPS_HELPER = 8192
|
||||
IPS_SEEN_REPLY = 2
|
||||
IPS_SEQ_ADJUST = 64
|
||||
IPS_SRC_NAT = 16
|
||||
IPS_SRC_NAT_DONE = 128
|
||||
IPS_TEMPLATE = 2048
|
||||
IPS_UNTRACKED = 4096
|
||||
IPT_FILTER_VALID_HOOKS = 14
|
||||
IPT_MANGLE_VALID_HOOKS = 31
|
||||
IPT_NAT_VALID_HOOKS = 27
|
||||
IPT_RAW_VALID_HOOKS = 9
|
||||
IPT_SECURITY_VALID_HOOKS = 14
|
||||
IP_VS_CONN_F_FWD_MASK = 7
|
||||
NAME_MAX = 255
|
||||
NFACCT_NAME_MAX = 32
|
||||
NF_INET_FORWARD_BIT = 4
|
||||
NF_INET_LOCAL_IN_BIT = 2
|
||||
NF_INET_LOCAL_OUT_BIT = 8
|
||||
NF_INET_NUMHOOKS = 5
|
||||
NF_INET_NUMHOOKS_BIT = 32
|
||||
NF_INET_POST_ROUTING_BIT = 16
|
||||
NF_INET_PRE_ROUTING_BIT = 1
|
||||
PATH_MAX = 4096
|
||||
SCTP_CHUNK_MATCH_ALL = 2
|
||||
SCTP_CHUNK_MATCH_ANY = 1
|
||||
SCTP_CHUNK_MATCH_ONLY = 4
|
||||
XT_ADDRTYPE_ANYCAST = 16
|
||||
XT_ADDRTYPE_BLACKHOLE = 64
|
||||
XT_ADDRTYPE_BROADCAST = 8
|
||||
XT_ADDRTYPE_INVERT_DEST = 2
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 1
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 4
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 8
|
||||
XT_ADDRTYPE_LOCAL = 4
|
||||
XT_ADDRTYPE_MULTICAST = 32
|
||||
XT_ADDRTYPE_NAT = 1024
|
||||
XT_ADDRTYPE_PROHIBIT = 256
|
||||
XT_ADDRTYPE_THROW = 512
|
||||
XT_ADDRTYPE_UNICAST = 2
|
||||
XT_ADDRTYPE_UNREACHABLE = 128
|
||||
XT_ADDRTYPE_UNSPEC = 1
|
||||
XT_ADDRTYPE_XRESOLVE = 2048
|
||||
XT_BPF_MAX_NUM_INSTR = 64
|
||||
XT_BPF_MODE_BYTECODE = 0
|
||||
XT_BPF_MODE_FD_ELF = 2
|
||||
XT_BPF_MODE_FD_PINNED = 1
|
||||
XT_BPF_PATH_MAX = 512
|
||||
XT_CONNBYTES_AVGPKT = 2
|
||||
XT_CONNBYTES_BYTES = 1
|
||||
XT_CONNBYTES_DIR_BOTH = 2
|
||||
XT_CONNBYTES_DIR_ORIGINAL = 0
|
||||
XT_CONNBYTES_DIR_REPLY = 1
|
||||
XT_CONNBYTES_PKTS = 0
|
||||
XT_CONNLABEL_OP_INVERT = 1
|
||||
XT_CONNLABEL_OP_SET = 2
|
||||
XT_CONNLIMIT_DADDR = 2
|
||||
XT_CONNLIMIT_INVERT = 1
|
||||
XT_CONNTRACK_DIRECTION = 4096
|
||||
XT_CONNTRACK_EXPIRES = 128
|
||||
XT_CONNTRACK_ORIGDST = 8
|
||||
XT_CONNTRACK_ORIGDST_PORT = 512
|
||||
XT_CONNTRACK_ORIGSRC = 4
|
||||
XT_CONNTRACK_ORIGSRC_PORT = 256
|
||||
XT_CONNTRACK_PROTO = 2
|
||||
XT_CONNTRACK_REPLDST = 32
|
||||
XT_CONNTRACK_REPLDST_PORT = 2048
|
||||
XT_CONNTRACK_REPLSRC = 16
|
||||
XT_CONNTRACK_REPLSRC_PORT = 1024
|
||||
XT_CONNTRACK_STATE = 1
|
||||
XT_CONNTRACK_STATE_ALIAS = 8192
|
||||
XT_CONNTRACK_STATE_DNAT = 128
|
||||
XT_CONNTRACK_STATE_INVALID = 1
|
||||
XT_CONNTRACK_STATE_SNAT = 64
|
||||
XT_CONNTRACK_STATE_UNTRACKED = 256
|
||||
XT_CONNTRACK_STATUS = 64
|
||||
XT_DCCP_DEST_PORTS = 2
|
||||
XT_DCCP_OPTION = 8
|
||||
XT_DCCP_SRC_PORTS = 1
|
||||
XT_DCCP_TYPE = 4
|
||||
XT_DEVGROUP_INVERT_DST = 8
|
||||
XT_DEVGROUP_INVERT_SRC = 2
|
||||
XT_DEVGROUP_MATCH_DST = 4
|
||||
XT_DEVGROUP_MATCH_SRC = 1
|
||||
XT_ECN_OP_MATCH_CWR = 32
|
||||
XT_ECN_OP_MATCH_ECE = 16
|
||||
XT_ECN_OP_MATCH_IP = 1
|
||||
XT_ESP_INV_MASK = 1
|
||||
XT_ESP_INV_SPI = 1
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 366
|
||||
XT_HASHLIMIT_BYTES = 32
|
||||
XT_HASHLIMIT_HASH_DIP = 1
|
||||
XT_HASHLIMIT_HASH_DPT = 2
|
||||
XT_HASHLIMIT_HASH_SIP = 4
|
||||
XT_HASHLIMIT_HASH_SPT = 8
|
||||
XT_HASHLIMIT_INVERT = 16
|
||||
XT_HASHLIMIT_RATE_MATCH = 64
|
||||
XT_IPCOMP_INV_MASK = 1
|
||||
XT_IPCOMP_INV_SPI = 1
|
||||
XT_IPVS_DIR = 16
|
||||
XT_IPVS_IPVS_PROPERTY = 1
|
||||
XT_IPVS_METHOD = 32
|
||||
XT_IPVS_PROTO = 2
|
||||
XT_IPVS_VADDR = 4
|
||||
XT_IPVS_VPORT = 8
|
||||
XT_L2TP_SID = 2
|
||||
XT_L2TP_TID = 1
|
||||
XT_L2TP_TYPE = 8
|
||||
XT_L2TP_TYPE_CONTROL = 0
|
||||
XT_L2TP_TYPE_DATA = 1
|
||||
XT_L2TP_VERSION = 4
|
||||
XT_MAX_COMMENT_LEN = 256
|
||||
XT_MULTI_PORTS = 15
|
||||
XT_NUM_SCTP_FLAGS = 4
|
||||
XT_OWNER_GID = 2
|
||||
XT_OWNER_SOCKET = 4
|
||||
XT_OWNER_UID = 1
|
||||
XT_PHYSDEV_OP_BRIDGED = 4
|
||||
XT_PHYSDEV_OP_IN = 1
|
||||
XT_PHYSDEV_OP_ISIN = 8
|
||||
XT_PHYSDEV_OP_ISOUT = 16
|
||||
XT_PHYSDEV_OP_OUT = 2
|
||||
XT_POLICY_MATCH_IN = 1
|
||||
XT_POLICY_MATCH_NONE = 4
|
||||
XT_POLICY_MATCH_OUT = 2
|
||||
XT_POLICY_MATCH_STRICT = 8
|
||||
XT_POLICY_MAX_ELEM = 4
|
||||
XT_POLICY_MODE_TRANSPORT = 0
|
||||
XT_POLICY_MODE_TUNNEL = 1
|
||||
XT_RATEEST_MATCH_ABS = 2
|
||||
XT_RATEEST_MATCH_BPS = 16
|
||||
XT_RATEEST_MATCH_DELTA = 8
|
||||
XT_RATEEST_MATCH_EQ = 1
|
||||
XT_RATEEST_MATCH_GT = 3
|
||||
XT_RATEEST_MATCH_INVERT = 1
|
||||
XT_RATEEST_MATCH_LT = 2
|
||||
XT_RATEEST_MATCH_NONE = 0
|
||||
XT_RATEEST_MATCH_PPS = 32
|
||||
XT_RATEEST_MATCH_REL = 4
|
||||
XT_RECENT_CHECK = 1
|
||||
XT_RECENT_DEST = 1
|
||||
XT_RECENT_NAME_LEN = 200
|
||||
XT_RECENT_REAP = 32
|
||||
XT_RECENT_REMOVE = 8
|
||||
XT_RECENT_SET = 2
|
||||
XT_RECENT_SOURCE = 0
|
||||
XT_RECENT_TTL = 16
|
||||
XT_RECENT_UPDATE = 4
|
||||
XT_RPFILTER_ACCEPT_LOCAL = 4
|
||||
XT_RPFILTER_INVERT = 8
|
||||
XT_RPFILTER_LOOSE = 1
|
||||
XT_RPFILTER_VALID_MARK = 2
|
||||
XT_SCTP_CHUNK_TYPES = 4
|
||||
XT_SCTP_DEST_PORTS = 2
|
||||
XT_SCTP_SRC_PORTS = 1
|
||||
XT_SOCKET_NOWILDCARD = 2
|
||||
XT_SOCKET_RESTORESKMARK = 4
|
||||
XT_SOCKET_TRANSPARENT = 1
|
||||
XT_STRING_FLAG_IGNORECASE = 2
|
||||
XT_STRING_FLAG_INVERT = 1
|
||||
XT_STRING_MAX_ALGO_NAME_SIZE = 16
|
||||
XT_STRING_MAX_PATTERN_SIZE = 128
|
||||
XT_TCP_INV_DSTPT = 2
|
||||
XT_TCP_INV_FLAGS = 4
|
||||
XT_TCP_INV_OPTION = 8
|
||||
XT_TCP_INV_SRCPT = 1
|
||||
XT_TIME_CONTIGUOUS = 2
|
||||
XT_TIME_LOCAL_TZ = 1
|
||||
XT_TIME_MAX_DAYTIME = 86399
|
||||
XT_U32_AND = 0
|
||||
XT_U32_AT = 3
|
||||
XT_U32_LEFTSH = 1
|
||||
XT_U32_REAL_MAXSIZE = 11
|
||||
XT_U32_RIGHTSH = 2
|
||||
XT_UDP_INV_DSTPT = 2
|
||||
XT_UDP_INV_SRCPT = 1
|
||||
|
@ -1,22 +1,186 @@
|
||||
# AUTOGENERATED FILE
|
||||
IPPROTO_IP = 0
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPRANGE_DST = 2
|
||||
IPRANGE_DST_INV = 32
|
||||
IPRANGE_SRC = 1
|
||||
IPRANGE_SRC_INV = 16
|
||||
IPS_ASSURED = 4
|
||||
IPS_CONFIRMED = 8
|
||||
IPS_DST_NAT = 32
|
||||
IPS_DST_NAT_DONE = 256
|
||||
IPS_DYING = 512
|
||||
IPS_EXPECTED = 1
|
||||
IPS_FIXED_TIMEOUT = 1024
|
||||
IPS_HELPER = 8192
|
||||
IPS_SEEN_REPLY = 2
|
||||
IPS_SEQ_ADJUST = 64
|
||||
IPS_SRC_NAT = 16
|
||||
IPS_SRC_NAT_DONE = 128
|
||||
IPS_TEMPLATE = 2048
|
||||
IPS_UNTRACKED = 4096
|
||||
IPT_FILTER_VALID_HOOKS = 14
|
||||
IPT_MANGLE_VALID_HOOKS = 31
|
||||
IPT_NAT_VALID_HOOKS = 27
|
||||
IPT_RAW_VALID_HOOKS = 9
|
||||
IPT_SECURITY_VALID_HOOKS = 14
|
||||
IP_VS_CONN_F_FWD_MASK = 7
|
||||
NAME_MAX = 255
|
||||
NFACCT_NAME_MAX = 32
|
||||
NF_INET_FORWARD_BIT = 4
|
||||
NF_INET_LOCAL_IN_BIT = 2
|
||||
NF_INET_LOCAL_OUT_BIT = 8
|
||||
NF_INET_NUMHOOKS = 5
|
||||
NF_INET_NUMHOOKS_BIT = 32
|
||||
NF_INET_POST_ROUTING_BIT = 16
|
||||
NF_INET_PRE_ROUTING_BIT = 1
|
||||
PATH_MAX = 4096
|
||||
SCTP_CHUNK_MATCH_ALL = 2
|
||||
SCTP_CHUNK_MATCH_ANY = 1
|
||||
SCTP_CHUNK_MATCH_ONLY = 4
|
||||
XT_ADDRTYPE_ANYCAST = 16
|
||||
XT_ADDRTYPE_BLACKHOLE = 64
|
||||
XT_ADDRTYPE_BROADCAST = 8
|
||||
XT_ADDRTYPE_INVERT_DEST = 2
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 1
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 4
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 8
|
||||
XT_ADDRTYPE_LOCAL = 4
|
||||
XT_ADDRTYPE_MULTICAST = 32
|
||||
XT_ADDRTYPE_NAT = 1024
|
||||
XT_ADDRTYPE_PROHIBIT = 256
|
||||
XT_ADDRTYPE_THROW = 512
|
||||
XT_ADDRTYPE_UNICAST = 2
|
||||
XT_ADDRTYPE_UNREACHABLE = 128
|
||||
XT_ADDRTYPE_UNSPEC = 1
|
||||
XT_ADDRTYPE_XRESOLVE = 2048
|
||||
XT_BPF_MAX_NUM_INSTR = 64
|
||||
XT_BPF_MODE_BYTECODE = 0
|
||||
XT_BPF_MODE_FD_ELF = 2
|
||||
XT_BPF_MODE_FD_PINNED = 1
|
||||
XT_BPF_PATH_MAX = 512
|
||||
XT_CONNBYTES_AVGPKT = 2
|
||||
XT_CONNBYTES_BYTES = 1
|
||||
XT_CONNBYTES_DIR_BOTH = 2
|
||||
XT_CONNBYTES_DIR_ORIGINAL = 0
|
||||
XT_CONNBYTES_DIR_REPLY = 1
|
||||
XT_CONNBYTES_PKTS = 0
|
||||
XT_CONNLABEL_OP_INVERT = 1
|
||||
XT_CONNLABEL_OP_SET = 2
|
||||
XT_CONNLIMIT_DADDR = 2
|
||||
XT_CONNLIMIT_INVERT = 1
|
||||
XT_CONNTRACK_DIRECTION = 4096
|
||||
XT_CONNTRACK_EXPIRES = 128
|
||||
XT_CONNTRACK_ORIGDST = 8
|
||||
XT_CONNTRACK_ORIGDST_PORT = 512
|
||||
XT_CONNTRACK_ORIGSRC = 4
|
||||
XT_CONNTRACK_ORIGSRC_PORT = 256
|
||||
XT_CONNTRACK_PROTO = 2
|
||||
XT_CONNTRACK_REPLDST = 32
|
||||
XT_CONNTRACK_REPLDST_PORT = 2048
|
||||
XT_CONNTRACK_REPLSRC = 16
|
||||
XT_CONNTRACK_REPLSRC_PORT = 1024
|
||||
XT_CONNTRACK_STATE = 1
|
||||
XT_CONNTRACK_STATE_ALIAS = 8192
|
||||
XT_CONNTRACK_STATE_DNAT = 128
|
||||
XT_CONNTRACK_STATE_INVALID = 1
|
||||
XT_CONNTRACK_STATE_SNAT = 64
|
||||
XT_CONNTRACK_STATE_UNTRACKED = 256
|
||||
XT_CONNTRACK_STATUS = 64
|
||||
XT_DCCP_DEST_PORTS = 2
|
||||
XT_DCCP_OPTION = 8
|
||||
XT_DCCP_SRC_PORTS = 1
|
||||
XT_DCCP_TYPE = 4
|
||||
XT_DEVGROUP_INVERT_DST = 8
|
||||
XT_DEVGROUP_INVERT_SRC = 2
|
||||
XT_DEVGROUP_MATCH_DST = 4
|
||||
XT_DEVGROUP_MATCH_SRC = 1
|
||||
XT_ECN_OP_MATCH_CWR = 32
|
||||
XT_ECN_OP_MATCH_ECE = 16
|
||||
XT_ECN_OP_MATCH_IP = 1
|
||||
XT_ESP_INV_MASK = 1
|
||||
XT_ESP_INV_SPI = 1
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 54
|
||||
XT_HASHLIMIT_BYTES = 32
|
||||
XT_HASHLIMIT_HASH_DIP = 1
|
||||
XT_HASHLIMIT_HASH_DPT = 2
|
||||
XT_HASHLIMIT_HASH_SIP = 4
|
||||
XT_HASHLIMIT_HASH_SPT = 8
|
||||
XT_HASHLIMIT_INVERT = 16
|
||||
XT_HASHLIMIT_RATE_MATCH = 64
|
||||
XT_IPCOMP_INV_MASK = 1
|
||||
XT_IPCOMP_INV_SPI = 1
|
||||
XT_IPVS_DIR = 16
|
||||
XT_IPVS_IPVS_PROPERTY = 1
|
||||
XT_IPVS_METHOD = 32
|
||||
XT_IPVS_PROTO = 2
|
||||
XT_IPVS_VADDR = 4
|
||||
XT_IPVS_VPORT = 8
|
||||
XT_L2TP_SID = 2
|
||||
XT_L2TP_TID = 1
|
||||
XT_L2TP_TYPE = 8
|
||||
XT_L2TP_TYPE_CONTROL = 0
|
||||
XT_L2TP_TYPE_DATA = 1
|
||||
XT_L2TP_VERSION = 4
|
||||
XT_MAX_COMMENT_LEN = 256
|
||||
XT_MULTI_PORTS = 15
|
||||
XT_NUM_SCTP_FLAGS = 4
|
||||
XT_OWNER_GID = 2
|
||||
XT_OWNER_SOCKET = 4
|
||||
XT_OWNER_UID = 1
|
||||
XT_PHYSDEV_OP_BRIDGED = 4
|
||||
XT_PHYSDEV_OP_IN = 1
|
||||
XT_PHYSDEV_OP_ISIN = 8
|
||||
XT_PHYSDEV_OP_ISOUT = 16
|
||||
XT_PHYSDEV_OP_OUT = 2
|
||||
XT_POLICY_MATCH_IN = 1
|
||||
XT_POLICY_MATCH_NONE = 4
|
||||
XT_POLICY_MATCH_OUT = 2
|
||||
XT_POLICY_MATCH_STRICT = 8
|
||||
XT_POLICY_MAX_ELEM = 4
|
||||
XT_POLICY_MODE_TRANSPORT = 0
|
||||
XT_POLICY_MODE_TUNNEL = 1
|
||||
XT_RATEEST_MATCH_ABS = 2
|
||||
XT_RATEEST_MATCH_BPS = 16
|
||||
XT_RATEEST_MATCH_DELTA = 8
|
||||
XT_RATEEST_MATCH_EQ = 1
|
||||
XT_RATEEST_MATCH_GT = 3
|
||||
XT_RATEEST_MATCH_INVERT = 1
|
||||
XT_RATEEST_MATCH_LT = 2
|
||||
XT_RATEEST_MATCH_NONE = 0
|
||||
XT_RATEEST_MATCH_PPS = 32
|
||||
XT_RATEEST_MATCH_REL = 4
|
||||
XT_RECENT_CHECK = 1
|
||||
XT_RECENT_DEST = 1
|
||||
XT_RECENT_NAME_LEN = 200
|
||||
XT_RECENT_REAP = 32
|
||||
XT_RECENT_REMOVE = 8
|
||||
XT_RECENT_SET = 2
|
||||
XT_RECENT_SOURCE = 0
|
||||
XT_RECENT_TTL = 16
|
||||
XT_RECENT_UPDATE = 4
|
||||
XT_RPFILTER_ACCEPT_LOCAL = 4
|
||||
XT_RPFILTER_INVERT = 8
|
||||
XT_RPFILTER_LOOSE = 1
|
||||
XT_RPFILTER_VALID_MARK = 2
|
||||
XT_SCTP_CHUNK_TYPES = 4
|
||||
XT_SCTP_DEST_PORTS = 2
|
||||
XT_SCTP_SRC_PORTS = 1
|
||||
XT_SOCKET_NOWILDCARD = 2
|
||||
XT_SOCKET_RESTORESKMARK = 4
|
||||
XT_SOCKET_TRANSPARENT = 1
|
||||
XT_STRING_FLAG_IGNORECASE = 2
|
||||
XT_STRING_FLAG_INVERT = 1
|
||||
XT_STRING_MAX_ALGO_NAME_SIZE = 16
|
||||
XT_STRING_MAX_PATTERN_SIZE = 128
|
||||
XT_TCP_INV_DSTPT = 2
|
||||
XT_TCP_INV_FLAGS = 4
|
||||
XT_TCP_INV_OPTION = 8
|
||||
XT_TCP_INV_SRCPT = 1
|
||||
XT_TIME_CONTIGUOUS = 2
|
||||
XT_TIME_LOCAL_TZ = 1
|
||||
XT_TIME_MAX_DAYTIME = 86399
|
||||
XT_U32_AND = 0
|
||||
XT_U32_AT = 3
|
||||
XT_U32_LEFTSH = 1
|
||||
XT_U32_REAL_MAXSIZE = 11
|
||||
XT_U32_RIGHTSH = 2
|
||||
XT_UDP_INV_DSTPT = 2
|
||||
XT_UDP_INV_SRCPT = 1
|
||||
|
@ -1,22 +1,186 @@
|
||||
# AUTOGENERATED FILE
|
||||
IPPROTO_IP = 0
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPRANGE_DST = 2
|
||||
IPRANGE_DST_INV = 32
|
||||
IPRANGE_SRC = 1
|
||||
IPRANGE_SRC_INV = 16
|
||||
IPS_ASSURED = 4
|
||||
IPS_CONFIRMED = 8
|
||||
IPS_DST_NAT = 32
|
||||
IPS_DST_NAT_DONE = 256
|
||||
IPS_DYING = 512
|
||||
IPS_EXPECTED = 1
|
||||
IPS_FIXED_TIMEOUT = 1024
|
||||
IPS_HELPER = 8192
|
||||
IPS_SEEN_REPLY = 2
|
||||
IPS_SEQ_ADJUST = 64
|
||||
IPS_SRC_NAT = 16
|
||||
IPS_SRC_NAT_DONE = 128
|
||||
IPS_TEMPLATE = 2048
|
||||
IPS_UNTRACKED = 4096
|
||||
IPT_FILTER_VALID_HOOKS = 14
|
||||
IPT_MANGLE_VALID_HOOKS = 31
|
||||
IPT_NAT_VALID_HOOKS = 27
|
||||
IPT_RAW_VALID_HOOKS = 9
|
||||
IPT_SECURITY_VALID_HOOKS = 14
|
||||
IP_VS_CONN_F_FWD_MASK = 7
|
||||
NAME_MAX = 255
|
||||
NFACCT_NAME_MAX = 32
|
||||
NF_INET_FORWARD_BIT = 4
|
||||
NF_INET_LOCAL_IN_BIT = 2
|
||||
NF_INET_LOCAL_OUT_BIT = 8
|
||||
NF_INET_NUMHOOKS = 5
|
||||
NF_INET_NUMHOOKS_BIT = 32
|
||||
NF_INET_POST_ROUTING_BIT = 16
|
||||
NF_INET_PRE_ROUTING_BIT = 1
|
||||
PATH_MAX = 4096
|
||||
SCTP_CHUNK_MATCH_ALL = 2
|
||||
SCTP_CHUNK_MATCH_ANY = 1
|
||||
SCTP_CHUNK_MATCH_ONLY = 4
|
||||
XT_ADDRTYPE_ANYCAST = 16
|
||||
XT_ADDRTYPE_BLACKHOLE = 64
|
||||
XT_ADDRTYPE_BROADCAST = 8
|
||||
XT_ADDRTYPE_INVERT_DEST = 2
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 1
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 4
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 8
|
||||
XT_ADDRTYPE_LOCAL = 4
|
||||
XT_ADDRTYPE_MULTICAST = 32
|
||||
XT_ADDRTYPE_NAT = 1024
|
||||
XT_ADDRTYPE_PROHIBIT = 256
|
||||
XT_ADDRTYPE_THROW = 512
|
||||
XT_ADDRTYPE_UNICAST = 2
|
||||
XT_ADDRTYPE_UNREACHABLE = 128
|
||||
XT_ADDRTYPE_UNSPEC = 1
|
||||
XT_ADDRTYPE_XRESOLVE = 2048
|
||||
XT_BPF_MAX_NUM_INSTR = 64
|
||||
XT_BPF_MODE_BYTECODE = 0
|
||||
XT_BPF_MODE_FD_ELF = 2
|
||||
XT_BPF_MODE_FD_PINNED = 1
|
||||
XT_BPF_PATH_MAX = 512
|
||||
XT_CONNBYTES_AVGPKT = 2
|
||||
XT_CONNBYTES_BYTES = 1
|
||||
XT_CONNBYTES_DIR_BOTH = 2
|
||||
XT_CONNBYTES_DIR_ORIGINAL = 0
|
||||
XT_CONNBYTES_DIR_REPLY = 1
|
||||
XT_CONNBYTES_PKTS = 0
|
||||
XT_CONNLABEL_OP_INVERT = 1
|
||||
XT_CONNLABEL_OP_SET = 2
|
||||
XT_CONNLIMIT_DADDR = 2
|
||||
XT_CONNLIMIT_INVERT = 1
|
||||
XT_CONNTRACK_DIRECTION = 4096
|
||||
XT_CONNTRACK_EXPIRES = 128
|
||||
XT_CONNTRACK_ORIGDST = 8
|
||||
XT_CONNTRACK_ORIGDST_PORT = 512
|
||||
XT_CONNTRACK_ORIGSRC = 4
|
||||
XT_CONNTRACK_ORIGSRC_PORT = 256
|
||||
XT_CONNTRACK_PROTO = 2
|
||||
XT_CONNTRACK_REPLDST = 32
|
||||
XT_CONNTRACK_REPLDST_PORT = 2048
|
||||
XT_CONNTRACK_REPLSRC = 16
|
||||
XT_CONNTRACK_REPLSRC_PORT = 1024
|
||||
XT_CONNTRACK_STATE = 1
|
||||
XT_CONNTRACK_STATE_ALIAS = 8192
|
||||
XT_CONNTRACK_STATE_DNAT = 128
|
||||
XT_CONNTRACK_STATE_INVALID = 1
|
||||
XT_CONNTRACK_STATE_SNAT = 64
|
||||
XT_CONNTRACK_STATE_UNTRACKED = 256
|
||||
XT_CONNTRACK_STATUS = 64
|
||||
XT_DCCP_DEST_PORTS = 2
|
||||
XT_DCCP_OPTION = 8
|
||||
XT_DCCP_SRC_PORTS = 1
|
||||
XT_DCCP_TYPE = 4
|
||||
XT_DEVGROUP_INVERT_DST = 8
|
||||
XT_DEVGROUP_INVERT_SRC = 2
|
||||
XT_DEVGROUP_MATCH_DST = 4
|
||||
XT_DEVGROUP_MATCH_SRC = 1
|
||||
XT_ECN_OP_MATCH_CWR = 32
|
||||
XT_ECN_OP_MATCH_ECE = 16
|
||||
XT_ECN_OP_MATCH_IP = 1
|
||||
XT_ESP_INV_MASK = 1
|
||||
XT_ESP_INV_SPI = 1
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 294
|
||||
XT_HASHLIMIT_BYTES = 32
|
||||
XT_HASHLIMIT_HASH_DIP = 1
|
||||
XT_HASHLIMIT_HASH_DPT = 2
|
||||
XT_HASHLIMIT_HASH_SIP = 4
|
||||
XT_HASHLIMIT_HASH_SPT = 8
|
||||
XT_HASHLIMIT_INVERT = 16
|
||||
XT_HASHLIMIT_RATE_MATCH = 64
|
||||
XT_IPCOMP_INV_MASK = 1
|
||||
XT_IPCOMP_INV_SPI = 1
|
||||
XT_IPVS_DIR = 16
|
||||
XT_IPVS_IPVS_PROPERTY = 1
|
||||
XT_IPVS_METHOD = 32
|
||||
XT_IPVS_PROTO = 2
|
||||
XT_IPVS_VADDR = 4
|
||||
XT_IPVS_VPORT = 8
|
||||
XT_L2TP_SID = 2
|
||||
XT_L2TP_TID = 1
|
||||
XT_L2TP_TYPE = 8
|
||||
XT_L2TP_TYPE_CONTROL = 0
|
||||
XT_L2TP_TYPE_DATA = 1
|
||||
XT_L2TP_VERSION = 4
|
||||
XT_MAX_COMMENT_LEN = 256
|
||||
XT_MULTI_PORTS = 15
|
||||
XT_NUM_SCTP_FLAGS = 4
|
||||
XT_OWNER_GID = 2
|
||||
XT_OWNER_SOCKET = 4
|
||||
XT_OWNER_UID = 1
|
||||
XT_PHYSDEV_OP_BRIDGED = 4
|
||||
XT_PHYSDEV_OP_IN = 1
|
||||
XT_PHYSDEV_OP_ISIN = 8
|
||||
XT_PHYSDEV_OP_ISOUT = 16
|
||||
XT_PHYSDEV_OP_OUT = 2
|
||||
XT_POLICY_MATCH_IN = 1
|
||||
XT_POLICY_MATCH_NONE = 4
|
||||
XT_POLICY_MATCH_OUT = 2
|
||||
XT_POLICY_MATCH_STRICT = 8
|
||||
XT_POLICY_MAX_ELEM = 4
|
||||
XT_POLICY_MODE_TRANSPORT = 0
|
||||
XT_POLICY_MODE_TUNNEL = 1
|
||||
XT_RATEEST_MATCH_ABS = 2
|
||||
XT_RATEEST_MATCH_BPS = 16
|
||||
XT_RATEEST_MATCH_DELTA = 8
|
||||
XT_RATEEST_MATCH_EQ = 1
|
||||
XT_RATEEST_MATCH_GT = 3
|
||||
XT_RATEEST_MATCH_INVERT = 1
|
||||
XT_RATEEST_MATCH_LT = 2
|
||||
XT_RATEEST_MATCH_NONE = 0
|
||||
XT_RATEEST_MATCH_PPS = 32
|
||||
XT_RATEEST_MATCH_REL = 4
|
||||
XT_RECENT_CHECK = 1
|
||||
XT_RECENT_DEST = 1
|
||||
XT_RECENT_NAME_LEN = 200
|
||||
XT_RECENT_REAP = 32
|
||||
XT_RECENT_REMOVE = 8
|
||||
XT_RECENT_SET = 2
|
||||
XT_RECENT_SOURCE = 0
|
||||
XT_RECENT_TTL = 16
|
||||
XT_RECENT_UPDATE = 4
|
||||
XT_RPFILTER_ACCEPT_LOCAL = 4
|
||||
XT_RPFILTER_INVERT = 8
|
||||
XT_RPFILTER_LOOSE = 1
|
||||
XT_RPFILTER_VALID_MARK = 2
|
||||
XT_SCTP_CHUNK_TYPES = 4
|
||||
XT_SCTP_DEST_PORTS = 2
|
||||
XT_SCTP_SRC_PORTS = 1
|
||||
XT_SOCKET_NOWILDCARD = 2
|
||||
XT_SOCKET_RESTORESKMARK = 4
|
||||
XT_SOCKET_TRANSPARENT = 1
|
||||
XT_STRING_FLAG_IGNORECASE = 2
|
||||
XT_STRING_FLAG_INVERT = 1
|
||||
XT_STRING_MAX_ALGO_NAME_SIZE = 16
|
||||
XT_STRING_MAX_PATTERN_SIZE = 128
|
||||
XT_TCP_INV_DSTPT = 2
|
||||
XT_TCP_INV_FLAGS = 4
|
||||
XT_TCP_INV_OPTION = 8
|
||||
XT_TCP_INV_SRCPT = 1
|
||||
XT_TIME_CONTIGUOUS = 2
|
||||
XT_TIME_LOCAL_TZ = 1
|
||||
XT_TIME_MAX_DAYTIME = 86399
|
||||
XT_U32_AND = 0
|
||||
XT_U32_AT = 3
|
||||
XT_U32_LEFTSH = 1
|
||||
XT_U32_REAL_MAXSIZE = 11
|
||||
XT_U32_RIGHTSH = 2
|
||||
XT_UDP_INV_DSTPT = 2
|
||||
XT_UDP_INV_SRCPT = 1
|
||||
|
@ -1,22 +1,186 @@
|
||||
# AUTOGENERATED FILE
|
||||
IPPROTO_IP = 0
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPRANGE_DST = 2
|
||||
IPRANGE_DST_INV = 32
|
||||
IPRANGE_SRC = 1
|
||||
IPRANGE_SRC_INV = 16
|
||||
IPS_ASSURED = 4
|
||||
IPS_CONFIRMED = 8
|
||||
IPS_DST_NAT = 32
|
||||
IPS_DST_NAT_DONE = 256
|
||||
IPS_DYING = 512
|
||||
IPS_EXPECTED = 1
|
||||
IPS_FIXED_TIMEOUT = 1024
|
||||
IPS_HELPER = 8192
|
||||
IPS_SEEN_REPLY = 2
|
||||
IPS_SEQ_ADJUST = 64
|
||||
IPS_SRC_NAT = 16
|
||||
IPS_SRC_NAT_DONE = 128
|
||||
IPS_TEMPLATE = 2048
|
||||
IPS_UNTRACKED = 4096
|
||||
IPT_FILTER_VALID_HOOKS = 14
|
||||
IPT_MANGLE_VALID_HOOKS = 31
|
||||
IPT_NAT_VALID_HOOKS = 27
|
||||
IPT_RAW_VALID_HOOKS = 9
|
||||
IPT_SECURITY_VALID_HOOKS = 14
|
||||
IP_VS_CONN_F_FWD_MASK = 7
|
||||
NAME_MAX = 255
|
||||
NFACCT_NAME_MAX = 32
|
||||
NF_INET_FORWARD_BIT = 4
|
||||
NF_INET_LOCAL_IN_BIT = 2
|
||||
NF_INET_LOCAL_OUT_BIT = 8
|
||||
NF_INET_NUMHOOKS = 5
|
||||
NF_INET_NUMHOOKS_BIT = 32
|
||||
NF_INET_POST_ROUTING_BIT = 16
|
||||
NF_INET_PRE_ROUTING_BIT = 1
|
||||
PATH_MAX = 4096
|
||||
SCTP_CHUNK_MATCH_ALL = 2
|
||||
SCTP_CHUNK_MATCH_ANY = 1
|
||||
SCTP_CHUNK_MATCH_ONLY = 4
|
||||
XT_ADDRTYPE_ANYCAST = 16
|
||||
XT_ADDRTYPE_BLACKHOLE = 64
|
||||
XT_ADDRTYPE_BROADCAST = 8
|
||||
XT_ADDRTYPE_INVERT_DEST = 2
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 1
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 4
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 8
|
||||
XT_ADDRTYPE_LOCAL = 4
|
||||
XT_ADDRTYPE_MULTICAST = 32
|
||||
XT_ADDRTYPE_NAT = 1024
|
||||
XT_ADDRTYPE_PROHIBIT = 256
|
||||
XT_ADDRTYPE_THROW = 512
|
||||
XT_ADDRTYPE_UNICAST = 2
|
||||
XT_ADDRTYPE_UNREACHABLE = 128
|
||||
XT_ADDRTYPE_UNSPEC = 1
|
||||
XT_ADDRTYPE_XRESOLVE = 2048
|
||||
XT_BPF_MAX_NUM_INSTR = 64
|
||||
XT_BPF_MODE_BYTECODE = 0
|
||||
XT_BPF_MODE_FD_ELF = 2
|
||||
XT_BPF_MODE_FD_PINNED = 1
|
||||
XT_BPF_PATH_MAX = 512
|
||||
XT_CONNBYTES_AVGPKT = 2
|
||||
XT_CONNBYTES_BYTES = 1
|
||||
XT_CONNBYTES_DIR_BOTH = 2
|
||||
XT_CONNBYTES_DIR_ORIGINAL = 0
|
||||
XT_CONNBYTES_DIR_REPLY = 1
|
||||
XT_CONNBYTES_PKTS = 0
|
||||
XT_CONNLABEL_OP_INVERT = 1
|
||||
XT_CONNLABEL_OP_SET = 2
|
||||
XT_CONNLIMIT_DADDR = 2
|
||||
XT_CONNLIMIT_INVERT = 1
|
||||
XT_CONNTRACK_DIRECTION = 4096
|
||||
XT_CONNTRACK_EXPIRES = 128
|
||||
XT_CONNTRACK_ORIGDST = 8
|
||||
XT_CONNTRACK_ORIGDST_PORT = 512
|
||||
XT_CONNTRACK_ORIGSRC = 4
|
||||
XT_CONNTRACK_ORIGSRC_PORT = 256
|
||||
XT_CONNTRACK_PROTO = 2
|
||||
XT_CONNTRACK_REPLDST = 32
|
||||
XT_CONNTRACK_REPLDST_PORT = 2048
|
||||
XT_CONNTRACK_REPLSRC = 16
|
||||
XT_CONNTRACK_REPLSRC_PORT = 1024
|
||||
XT_CONNTRACK_STATE = 1
|
||||
XT_CONNTRACK_STATE_ALIAS = 8192
|
||||
XT_CONNTRACK_STATE_DNAT = 128
|
||||
XT_CONNTRACK_STATE_INVALID = 1
|
||||
XT_CONNTRACK_STATE_SNAT = 64
|
||||
XT_CONNTRACK_STATE_UNTRACKED = 256
|
||||
XT_CONNTRACK_STATUS = 64
|
||||
XT_DCCP_DEST_PORTS = 2
|
||||
XT_DCCP_OPTION = 8
|
||||
XT_DCCP_SRC_PORTS = 1
|
||||
XT_DCCP_TYPE = 4
|
||||
XT_DEVGROUP_INVERT_DST = 8
|
||||
XT_DEVGROUP_INVERT_SRC = 2
|
||||
XT_DEVGROUP_MATCH_DST = 4
|
||||
XT_DEVGROUP_MATCH_SRC = 1
|
||||
XT_ECN_OP_MATCH_CWR = 32
|
||||
XT_ECN_OP_MATCH_ECE = 16
|
||||
XT_ECN_OP_MATCH_IP = 1
|
||||
XT_ESP_INV_MASK = 1
|
||||
XT_ESP_INV_SPI = 1
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 208
|
||||
XT_HASHLIMIT_BYTES = 32
|
||||
XT_HASHLIMIT_HASH_DIP = 1
|
||||
XT_HASHLIMIT_HASH_DPT = 2
|
||||
XT_HASHLIMIT_HASH_SIP = 4
|
||||
XT_HASHLIMIT_HASH_SPT = 8
|
||||
XT_HASHLIMIT_INVERT = 16
|
||||
XT_HASHLIMIT_RATE_MATCH = 64
|
||||
XT_IPCOMP_INV_MASK = 1
|
||||
XT_IPCOMP_INV_SPI = 1
|
||||
XT_IPVS_DIR = 16
|
||||
XT_IPVS_IPVS_PROPERTY = 1
|
||||
XT_IPVS_METHOD = 32
|
||||
XT_IPVS_PROTO = 2
|
||||
XT_IPVS_VADDR = 4
|
||||
XT_IPVS_VPORT = 8
|
||||
XT_L2TP_SID = 2
|
||||
XT_L2TP_TID = 1
|
||||
XT_L2TP_TYPE = 8
|
||||
XT_L2TP_TYPE_CONTROL = 0
|
||||
XT_L2TP_TYPE_DATA = 1
|
||||
XT_L2TP_VERSION = 4
|
||||
XT_MAX_COMMENT_LEN = 256
|
||||
XT_MULTI_PORTS = 15
|
||||
XT_NUM_SCTP_FLAGS = 4
|
||||
XT_OWNER_GID = 2
|
||||
XT_OWNER_SOCKET = 4
|
||||
XT_OWNER_UID = 1
|
||||
XT_PHYSDEV_OP_BRIDGED = 4
|
||||
XT_PHYSDEV_OP_IN = 1
|
||||
XT_PHYSDEV_OP_ISIN = 8
|
||||
XT_PHYSDEV_OP_ISOUT = 16
|
||||
XT_PHYSDEV_OP_OUT = 2
|
||||
XT_POLICY_MATCH_IN = 1
|
||||
XT_POLICY_MATCH_NONE = 4
|
||||
XT_POLICY_MATCH_OUT = 2
|
||||
XT_POLICY_MATCH_STRICT = 8
|
||||
XT_POLICY_MAX_ELEM = 4
|
||||
XT_POLICY_MODE_TRANSPORT = 0
|
||||
XT_POLICY_MODE_TUNNEL = 1
|
||||
XT_RATEEST_MATCH_ABS = 2
|
||||
XT_RATEEST_MATCH_BPS = 16
|
||||
XT_RATEEST_MATCH_DELTA = 8
|
||||
XT_RATEEST_MATCH_EQ = 1
|
||||
XT_RATEEST_MATCH_GT = 3
|
||||
XT_RATEEST_MATCH_INVERT = 1
|
||||
XT_RATEEST_MATCH_LT = 2
|
||||
XT_RATEEST_MATCH_NONE = 0
|
||||
XT_RATEEST_MATCH_PPS = 32
|
||||
XT_RATEEST_MATCH_REL = 4
|
||||
XT_RECENT_CHECK = 1
|
||||
XT_RECENT_DEST = 1
|
||||
XT_RECENT_NAME_LEN = 200
|
||||
XT_RECENT_REAP = 32
|
||||
XT_RECENT_REMOVE = 8
|
||||
XT_RECENT_SET = 2
|
||||
XT_RECENT_SOURCE = 0
|
||||
XT_RECENT_TTL = 16
|
||||
XT_RECENT_UPDATE = 4
|
||||
XT_RPFILTER_ACCEPT_LOCAL = 4
|
||||
XT_RPFILTER_INVERT = 8
|
||||
XT_RPFILTER_LOOSE = 1
|
||||
XT_RPFILTER_VALID_MARK = 2
|
||||
XT_SCTP_CHUNK_TYPES = 4
|
||||
XT_SCTP_DEST_PORTS = 2
|
||||
XT_SCTP_SRC_PORTS = 1
|
||||
XT_SOCKET_NOWILDCARD = 2
|
||||
XT_SOCKET_RESTORESKMARK = 4
|
||||
XT_SOCKET_TRANSPARENT = 1
|
||||
XT_STRING_FLAG_IGNORECASE = 2
|
||||
XT_STRING_FLAG_INVERT = 1
|
||||
XT_STRING_MAX_ALGO_NAME_SIZE = 16
|
||||
XT_STRING_MAX_PATTERN_SIZE = 128
|
||||
XT_TCP_INV_DSTPT = 2
|
||||
XT_TCP_INV_FLAGS = 4
|
||||
XT_TCP_INV_OPTION = 8
|
||||
XT_TCP_INV_SRCPT = 1
|
||||
XT_TIME_CONTIGUOUS = 2
|
||||
XT_TIME_LOCAL_TZ = 1
|
||||
XT_TIME_MAX_DAYTIME = 86399
|
||||
XT_U32_AND = 0
|
||||
XT_U32_AT = 3
|
||||
XT_U32_LEFTSH = 1
|
||||
XT_U32_REAL_MAXSIZE = 11
|
||||
XT_U32_RIGHTSH = 2
|
||||
XT_UDP_INV_DSTPT = 2
|
||||
XT_UDP_INV_SRCPT = 1
|
||||
|
244
sys/linux/netfilter_ipv4.txt
Normal file
244
sys/linux/netfilter_ipv4.txt
Normal file
@ -0,0 +1,244 @@
|
||||
# Copyright 2018 syzkaller project authors. All rights reserved.
|
||||
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
include <linux/socket.h>
|
||||
include <uapi/linux/netfilter/xt_osf.h>
|
||||
include <uapi/linux/netfilter_ipv4/ip_tables.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_ah.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_ttl.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_REJECT.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_ECN.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_TTL.h>
|
||||
include <uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h>
|
||||
|
||||
setsockopt$IPT_SO_SET_REPLACE(fd sock_in, level const[SOL_IP], opt const[IPT_SO_SET_REPLACE], val ptr[in, ipt_replace], len len[val])
|
||||
|
||||
ipt_replace [
|
||||
filter ipt_replace_t["filter", IPT_FILTER_VALID_HOOKS, ipt_filter_matches, ipt_filter_targets, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused]
|
||||
nat ipt_replace_t["nat", IPT_NAT_VALID_HOOKS, ipt_nat_matches, ipt_nat_targets, ipt_hook, ipt_hook, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_hook, ipt_hook]
|
||||
mangle ipt_replace_t["mangle", IPT_MANGLE_VALID_HOOKS, ipt_mangle_matches, ipt_mangle_targets, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook]
|
||||
raw ipt_replace_t["raw", IPT_RAW_VALID_HOOKS, ipt_raw_matches, ipt_raw_targets, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_unused, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_unused]
|
||||
security ipt_replace_t["security", IPT_SECURITY_VALID_HOOKS, ipt_security_matches, ipt_security_targets, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused]
|
||||
] [varlen]
|
||||
|
||||
type ipt_replace_t[NAME, HOOKS, MATCHES, TARGETS, H0, H1, H2, H3, H4, U0, U1, U2, U3, U4] {
|
||||
name string[NAME, XT_TABLE_MAXNAMELEN]
|
||||
valid_hooks const[HOOKS, int32]
|
||||
num_entries const[4, int32]
|
||||
size bytesize[entries, int32]
|
||||
hook_pre_routing H0
|
||||
hook_pre_local_in H1
|
||||
hook_pre_forward H2
|
||||
hook_pre_local_out H3
|
||||
hook_pre_post_routing H4
|
||||
underflow_pre_routing U0
|
||||
underflow_pre_local_in U1
|
||||
underflow_pre_forward U2
|
||||
underflow_pre_local_out U3
|
||||
underflow_pre_post_routing U4
|
||||
num_counters const[4, int32]
|
||||
counters ptr[in, array[xt_counters, 4]]
|
||||
entries ipt_replace_entries[MATCHES, TARGETS]
|
||||
}
|
||||
|
||||
type ipt_replace_entries[MATCHES, TARGETS] {
|
||||
underflow ipt_entry_underflow
|
||||
entries array[ipt_entry[MATCHES, TARGETS], 3]
|
||||
} [packed, align_ptr]
|
||||
|
||||
type ipt_hook const[0, int32]
|
||||
type ipt_unused const[0xffffffff, int32]
|
||||
|
||||
type ipt_entry[MATCHES, TARGETS] {
|
||||
matches ipt_entry_matches[MATCHES]
|
||||
target TARGETS
|
||||
} [packed, align_8]
|
||||
|
||||
type ipt_entry_matches[MATCHES] {
|
||||
ip ipt_ip_or_uncond
|
||||
nfcache const[0, int32]
|
||||
target_offset len[parent, int16]
|
||||
next_offset len[ipt_entry, int16]
|
||||
comefrom const[0, int32]
|
||||
counters xt_counters
|
||||
matches array[MATCHES, 0:2]
|
||||
} [packed, align_ptr]
|
||||
|
||||
ipt_entry_underflow {
|
||||
matches ipt_entry_underflow_matches
|
||||
target xt_target_t["", const[NF_ACCEPT_VERDICT, int32], 0]
|
||||
} [align_ptr]
|
||||
|
||||
ipt_entry_underflow_matches {
|
||||
ip ipt_ip_uncond
|
||||
nfcache const[0, int32]
|
||||
target_offset len[parent, int16]
|
||||
next_offset len[ipt_entry_underflow, int16]
|
||||
comefrom const[0, int32]
|
||||
counters xt_counters
|
||||
}
|
||||
|
||||
ipt_ip_or_uncond [
|
||||
ip ipt_ip
|
||||
uncond ipt_ip_uncond
|
||||
]
|
||||
|
||||
type ipt_ip_uncond array[const[0, int8], IPT_IP_SIZE]
|
||||
define IPT_IP_SIZE sizeof(struct ipt_ip)
|
||||
|
||||
ipt_ip {
|
||||
src ipv4_addr
|
||||
dst ipv4_addr
|
||||
smsk ipv4_addr_mask
|
||||
dmsk ipv4_addr_mask
|
||||
iniface devname
|
||||
outiface devname
|
||||
iniface_mask devname_mask
|
||||
outiface_mask devname_mask
|
||||
proto flags[ipv4_types, int16]
|
||||
flags flags[ipt_ip_flags, int8]
|
||||
invflags flags[ipt_ip_invflags, int8]
|
||||
}
|
||||
|
||||
ipt_ip_flags = IPT_F_FRAG, IPT_F_GOTO
|
||||
ipt_ip_invflags = IPT_INV_VIA_IN, IPT_INV_VIA_OUT, IPT_INV_TOS, IPT_INV_SRCIP, IPT_INV_DSTIP, IPT_INV_FRAG, IPT_INV_PROTO
|
||||
|
||||
# MATCHES:
|
||||
|
||||
ipt_matches [
|
||||
unspec xt_unspec_matches
|
||||
icmp xt_entry_match["icmp", ipt_icmp, 0]
|
||||
ah xt_entry_match["ah", ipt_ah, 0]
|
||||
socket0 xt_entry_match["socket", void, 0]
|
||||
set xt_entry_match["set", xt_set_info_match_v0, 0]
|
||||
addrtype xt_entry_match["addrtype", xt_addrtype_info, 0]
|
||||
osf xt_entry_match["osf", xt_osf_info, 0]
|
||||
ttl xt_entry_match["ttl", ipt_ttl_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ipt_filter_matches [
|
||||
common ipt_matches
|
||||
] [varlen]
|
||||
|
||||
ipt_nat_matches [
|
||||
common ipt_matches
|
||||
] [varlen]
|
||||
|
||||
ipt_mangle_matches [
|
||||
common ipt_matches
|
||||
unspec xt_unspec_mangle_matches
|
||||
] [varlen]
|
||||
|
||||
ipt_raw_matches [
|
||||
common ipt_matches
|
||||
unspec xt_unspec_raw_matches
|
||||
] [varlen]
|
||||
|
||||
ipt_security_matches [
|
||||
common ipt_matches
|
||||
] [varlen]
|
||||
|
||||
ipt_icmp {
|
||||
type flags[icmp_types, int8]
|
||||
code_min int8
|
||||
code_max int8
|
||||
invflags bool8
|
||||
}
|
||||
|
||||
ipt_ah {
|
||||
spi_min int8
|
||||
spi_max int8
|
||||
invflags bool8
|
||||
}
|
||||
|
||||
xt_osf_info {
|
||||
genre string[xt_osf_genre, MAXGENRELEN]
|
||||
len int32
|
||||
flags flags[xt_osf_flags, int32]
|
||||
loglevel int32[0:2]
|
||||
ttl int32[0:2]
|
||||
}
|
||||
|
||||
# TODO: genres are somehow setup via netlink.
|
||||
xt_osf_genre = "syz0", "syz1"
|
||||
xt_osf_flags = XT_OSF_GENRE, XT_OSF_TTL, XT_OSF_LOG, XT_OSF_INVERT
|
||||
|
||||
ipt_ttl_info {
|
||||
mode flags[ipt_ttl_mode, int8]
|
||||
ttl int8
|
||||
}
|
||||
|
||||
ipt_ttl_mode = IPT_TTL_EQ, IPT_TTL_NE, IPT_TTL_LT, IPT_TTL_GT
|
||||
|
||||
# TARGETS:
|
||||
|
||||
ipt_targets [
|
||||
unspec xt_unspec_targets
|
||||
SET xt_target_t["SET", xt_set_info_target_v0, 0]
|
||||
CLUSTERIP xt_target_t["CLUSTERIP", ipt_clusterip_tgt_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ipt_filter_targets [
|
||||
common ipt_targets
|
||||
REJECT xt_target_t["REJECT", ipt_reject_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ipt_nat_targets [
|
||||
common ipt_targets
|
||||
NETMAP xt_target_t["NETMAP", nf_nat_ipv4_multi_range_compat, 0]
|
||||
SNAT0 xt_target_t["SNAT", nf_nat_ipv4_multi_range_compat, 0]
|
||||
DNAT0 xt_target_t["DNAT", nf_nat_ipv4_multi_range_compat, 0]
|
||||
SNAT1 xt_target_t["SNAT", nf_nat_range, 1]
|
||||
DNAT1 xt_target_t["DNAT", nf_nat_range, 1]
|
||||
REDIRECT xt_target_t["REDIRECT", nf_nat_ipv4_multi_range_compat, 0]
|
||||
MASQUERADE xt_target_t["MASQUERADE", nf_nat_ipv4_multi_range_compat, 0]
|
||||
] [varlen]
|
||||
|
||||
ipt_mangle_targets [
|
||||
common ipt_targets
|
||||
unspec xt_unspec_mangle_targets
|
||||
ECN xt_target_t["ECN", ipt_ECN_info, 0]
|
||||
TPROXY xt_target_t["TPROXY", xt_tproxy_target_info, 0]
|
||||
TTL xt_target_t["TTL", ipt_TTL_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ipt_raw_targets [
|
||||
common ipt_targets
|
||||
unspec xt_unspec_raw_targets
|
||||
] [varlen]
|
||||
|
||||
ipt_security_targets [
|
||||
common ipt_targets
|
||||
] [varlen]
|
||||
|
||||
ipt_reject_info {
|
||||
with flags[ipt_reject_with, int32]
|
||||
}
|
||||
|
||||
ipt_reject_with = IPT_ICMP_NET_UNREACHABLE, IPT_ICMP_HOST_UNREACHABLE, IPT_ICMP_PROT_UNREACHABLE, IPT_ICMP_PORT_UNREACHABLE, IPT_ICMP_NET_PROHIBITED, IPT_ICMP_HOST_PROHIBITED, IPT_TCP_RESET, IPT_ICMP_ADMIN_PROHIBITED
|
||||
|
||||
ipt_ECN_info {
|
||||
operation flags[ipt_ECN_op, int8]
|
||||
ip_ect int8
|
||||
tcp int8[0:3]
|
||||
}
|
||||
|
||||
ipt_ECN_op = IPT_ECN_OP_SET_IP, IPT_ECN_OP_SET_ECE, IPT_ECN_OP_SET_CWR
|
||||
|
||||
ipt_TTL_info {
|
||||
mode int8[0:3]
|
||||
ttl int8
|
||||
}
|
||||
|
||||
ipt_clusterip_tgt_info {
|
||||
flags bool32
|
||||
clustermac mac_addr
|
||||
num_total_nodes int16
|
||||
num_local_nodes int16
|
||||
local_nodes array[int16, CLUSTERIP_MAX_NODES]
|
||||
hash_mode flags[ipt_clusterip_hash_mode, int32]
|
||||
hash_initval int32
|
||||
config intptr
|
||||
}
|
||||
|
||||
ipt_clusterip_hash_mode = CLUSTERIP_HASHMODE_SIP, CLUSTERIP_HASHMODE_SIP_SPT, CLUSTERIP_HASHMODE_SIP_SPT_DPT
|
39
sys/linux/netfilter_ipv4_386.const
Normal file
39
sys/linux/netfilter_ipv4_386.const
Normal file
@ -0,0 +1,39 @@
|
||||
# AUTOGENERATED FILE
|
||||
CLUSTERIP_HASHMODE_SIP = 0
|
||||
CLUSTERIP_HASHMODE_SIP_SPT = 1
|
||||
CLUSTERIP_HASHMODE_SIP_SPT_DPT = 2
|
||||
CLUSTERIP_MAX_NODES = 16
|
||||
IPT_ECN_OP_SET_CWR = 32
|
||||
IPT_ECN_OP_SET_ECE = 16
|
||||
IPT_ECN_OP_SET_IP = 1
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_ICMP_ADMIN_PROHIBITED = 8
|
||||
IPT_ICMP_HOST_PROHIBITED = 6
|
||||
IPT_ICMP_HOST_UNREACHABLE = 1
|
||||
IPT_ICMP_NET_PROHIBITED = 5
|
||||
IPT_ICMP_NET_UNREACHABLE = 0
|
||||
IPT_ICMP_PORT_UNREACHABLE = 3
|
||||
IPT_ICMP_PROT_UNREACHABLE = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_IP_SIZE = 84
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPT_TCP_RESET = 7
|
||||
IPT_TTL_EQ = 0
|
||||
IPT_TTL_GT = 3
|
||||
IPT_TTL_LT = 2
|
||||
IPT_TTL_NE = 1
|
||||
MAXGENRELEN = 32
|
||||
SOL_IP = 0
|
||||
XT_OSF_GENRE = 1
|
||||
XT_OSF_INVERT = 8
|
||||
XT_OSF_LOG = 4
|
||||
XT_OSF_TTL = 2
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 366
|
39
sys/linux/netfilter_ipv4_amd64.const
Normal file
39
sys/linux/netfilter_ipv4_amd64.const
Normal file
@ -0,0 +1,39 @@
|
||||
# AUTOGENERATED FILE
|
||||
CLUSTERIP_HASHMODE_SIP = 0
|
||||
CLUSTERIP_HASHMODE_SIP_SPT = 1
|
||||
CLUSTERIP_HASHMODE_SIP_SPT_DPT = 2
|
||||
CLUSTERIP_MAX_NODES = 16
|
||||
IPT_ECN_OP_SET_CWR = 32
|
||||
IPT_ECN_OP_SET_ECE = 16
|
||||
IPT_ECN_OP_SET_IP = 1
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_ICMP_ADMIN_PROHIBITED = 8
|
||||
IPT_ICMP_HOST_PROHIBITED = 6
|
||||
IPT_ICMP_HOST_UNREACHABLE = 1
|
||||
IPT_ICMP_NET_PROHIBITED = 5
|
||||
IPT_ICMP_NET_UNREACHABLE = 0
|
||||
IPT_ICMP_PORT_UNREACHABLE = 3
|
||||
IPT_ICMP_PROT_UNREACHABLE = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_IP_SIZE = 84
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPT_TCP_RESET = 7
|
||||
IPT_TTL_EQ = 0
|
||||
IPT_TTL_GT = 3
|
||||
IPT_TTL_LT = 2
|
||||
IPT_TTL_NE = 1
|
||||
MAXGENRELEN = 32
|
||||
SOL_IP = 0
|
||||
XT_OSF_GENRE = 1
|
||||
XT_OSF_INVERT = 8
|
||||
XT_OSF_LOG = 4
|
||||
XT_OSF_TTL = 2
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 54
|
39
sys/linux/netfilter_ipv4_arm.const
Normal file
39
sys/linux/netfilter_ipv4_arm.const
Normal file
@ -0,0 +1,39 @@
|
||||
# AUTOGENERATED FILE
|
||||
CLUSTERIP_HASHMODE_SIP = 0
|
||||
CLUSTERIP_HASHMODE_SIP_SPT = 1
|
||||
CLUSTERIP_HASHMODE_SIP_SPT_DPT = 2
|
||||
CLUSTERIP_MAX_NODES = 16
|
||||
IPT_ECN_OP_SET_CWR = 32
|
||||
IPT_ECN_OP_SET_ECE = 16
|
||||
IPT_ECN_OP_SET_IP = 1
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_ICMP_ADMIN_PROHIBITED = 8
|
||||
IPT_ICMP_HOST_PROHIBITED = 6
|
||||
IPT_ICMP_HOST_UNREACHABLE = 1
|
||||
IPT_ICMP_NET_PROHIBITED = 5
|
||||
IPT_ICMP_NET_UNREACHABLE = 0
|
||||
IPT_ICMP_PORT_UNREACHABLE = 3
|
||||
IPT_ICMP_PROT_UNREACHABLE = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_IP_SIZE = 84
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPT_TCP_RESET = 7
|
||||
IPT_TTL_EQ = 0
|
||||
IPT_TTL_GT = 3
|
||||
IPT_TTL_LT = 2
|
||||
IPT_TTL_NE = 1
|
||||
MAXGENRELEN = 32
|
||||
SOL_IP = 0
|
||||
XT_OSF_GENRE = 1
|
||||
XT_OSF_INVERT = 8
|
||||
XT_OSF_LOG = 4
|
||||
XT_OSF_TTL = 2
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 294
|
39
sys/linux/netfilter_ipv4_arm64.const
Normal file
39
sys/linux/netfilter_ipv4_arm64.const
Normal file
@ -0,0 +1,39 @@
|
||||
# AUTOGENERATED FILE
|
||||
CLUSTERIP_HASHMODE_SIP = 0
|
||||
CLUSTERIP_HASHMODE_SIP_SPT = 1
|
||||
CLUSTERIP_HASHMODE_SIP_SPT_DPT = 2
|
||||
CLUSTERIP_MAX_NODES = 16
|
||||
IPT_ECN_OP_SET_CWR = 32
|
||||
IPT_ECN_OP_SET_ECE = 16
|
||||
IPT_ECN_OP_SET_IP = 1
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_ICMP_ADMIN_PROHIBITED = 8
|
||||
IPT_ICMP_HOST_PROHIBITED = 6
|
||||
IPT_ICMP_HOST_UNREACHABLE = 1
|
||||
IPT_ICMP_NET_PROHIBITED = 5
|
||||
IPT_ICMP_NET_UNREACHABLE = 0
|
||||
IPT_ICMP_PORT_UNREACHABLE = 3
|
||||
IPT_ICMP_PROT_UNREACHABLE = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_IP_SIZE = 84
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPT_TCP_RESET = 7
|
||||
IPT_TTL_EQ = 0
|
||||
IPT_TTL_GT = 3
|
||||
IPT_TTL_LT = 2
|
||||
IPT_TTL_NE = 1
|
||||
MAXGENRELEN = 32
|
||||
SOL_IP = 0
|
||||
XT_OSF_GENRE = 1
|
||||
XT_OSF_INVERT = 8
|
||||
XT_OSF_LOG = 4
|
||||
XT_OSF_TTL = 2
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 208
|
39
sys/linux/netfilter_ipv4_ppc64le.const
Normal file
39
sys/linux/netfilter_ipv4_ppc64le.const
Normal file
@ -0,0 +1,39 @@
|
||||
# AUTOGENERATED FILE
|
||||
CLUSTERIP_HASHMODE_SIP = 0
|
||||
CLUSTERIP_HASHMODE_SIP_SPT = 1
|
||||
CLUSTERIP_HASHMODE_SIP_SPT_DPT = 2
|
||||
CLUSTERIP_MAX_NODES = 16
|
||||
IPT_ECN_OP_SET_CWR = 32
|
||||
IPT_ECN_OP_SET_ECE = 16
|
||||
IPT_ECN_OP_SET_IP = 1
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_ICMP_ADMIN_PROHIBITED = 8
|
||||
IPT_ICMP_HOST_PROHIBITED = 6
|
||||
IPT_ICMP_HOST_UNREACHABLE = 1
|
||||
IPT_ICMP_NET_PROHIBITED = 5
|
||||
IPT_ICMP_NET_UNREACHABLE = 0
|
||||
IPT_ICMP_PORT_UNREACHABLE = 3
|
||||
IPT_ICMP_PROT_UNREACHABLE = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_IP_SIZE = 84
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPT_TCP_RESET = 7
|
||||
IPT_TTL_EQ = 0
|
||||
IPT_TTL_GT = 3
|
||||
IPT_TTL_LT = 2
|
||||
IPT_TTL_NE = 1
|
||||
MAXGENRELEN = 32
|
||||
SOL_IP = 0
|
||||
XT_OSF_GENRE = 1
|
||||
XT_OSF_INVERT = 8
|
||||
XT_OSF_LOG = 4
|
||||
XT_OSF_TTL = 2
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 339
|
258
sys/linux/netfilter_ipv6.txt
Normal file
258
sys/linux/netfilter_ipv6.txt
Normal file
@ -0,0 +1,258 @@
|
||||
# Copyright 2018 syzkaller project authors. All rights reserved.
|
||||
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
include <linux/socket.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6_tables.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_rt.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_mh.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_opts.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_frag.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_ipv6header.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_ah.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_REJECT.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_NPT.h>
|
||||
include <uapi/linux/netfilter_ipv6/ip6t_HL.h>
|
||||
|
||||
setsockopt$IP6T_SO_SET_REPLACE(fd sock_in6, level const[SOL_IPV6], opt const[IP6T_SO_SET_REPLACE], val ptr[in, ip6t_replace], len len[val])
|
||||
|
||||
ip6t_replace [
|
||||
filter ip6t_replace_t["filter", IPT_FILTER_VALID_HOOKS, ip6t_filter_matches, ip6t_filter_targets, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused]
|
||||
nat ip6t_replace_t["nat", IPT_NAT_VALID_HOOKS, ip6t_nat_matches, ip6t_nat_targets, ipt_hook, ipt_hook, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_hook, ipt_hook]
|
||||
mangle ip6t_replace_t["mangle", IPT_MANGLE_VALID_HOOKS, ip6t_mangle_matches, ip6t_mangle_targets, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook, ipt_hook]
|
||||
raw ip6t_replace_t["raw", IPT_RAW_VALID_HOOKS, ip6t_raw_matches, ip6t_raw_targets, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_unused, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_unused]
|
||||
security ip6t_replace_t["security", IPT_SECURITY_VALID_HOOKS, ip6t_security_matches, ip6t_security_targets, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_hook, ipt_hook, ipt_unused]
|
||||
] [varlen]
|
||||
|
||||
type ip6t_replace_t[NAME, HOOKS, MATCHES, TARGETS, H0, H1, H2, H3, H4, U0, U1, U2, U3, U4] {
|
||||
name string[NAME, XT_TABLE_MAXNAMELEN]
|
||||
valid_hooks const[HOOKS, int32]
|
||||
num_entries const[4, int32]
|
||||
size bytesize[entries, int32]
|
||||
hook_pre_routing H0
|
||||
hook_pre_local_in H1
|
||||
hook_pre_forward H2
|
||||
hook_pre_local_out H3
|
||||
hook_pre_post_routing H4
|
||||
underflow_pre_routing U0
|
||||
underflow_pre_local_in U1
|
||||
underflow_pre_forward U2
|
||||
underflow_pre_local_out U3
|
||||
underflow_pre_post_routing U4
|
||||
num_counters const[4, int32]
|
||||
counters ptr[in, array[xt_counters, 4]]
|
||||
entries ip6t_replace_entries[MATCHES, TARGETS]
|
||||
}
|
||||
|
||||
type ip6t_replace_entries[MATCHES, TARGETS] {
|
||||
underflow ip6t_entry_underflow
|
||||
entries array[ip6t_entry[MATCHES, TARGETS], 3]
|
||||
} [packed, align_ptr]
|
||||
|
||||
type ip6t_entry[MATCHES, TARGETS] {
|
||||
matches ip6t_entry_matches[MATCHES]
|
||||
target TARGETS
|
||||
} [packed, align_8]
|
||||
|
||||
type ip6t_entry_matches[MATCHES] {
|
||||
ipv6 ip6t_ip6_or_uncond
|
||||
nfcache const[0, int32]
|
||||
target_offset len[parent, int16]
|
||||
next_offset len[ip6t_entry, int16]
|
||||
comefrom const[0, int32]
|
||||
counters xt_counters
|
||||
matches array[MATCHES, 0:2]
|
||||
} [packed, align_ptr]
|
||||
|
||||
ip6t_entry_underflow {
|
||||
matches ip6t_entry_underflow_matches
|
||||
target xt_target_t["", const[NF_ACCEPT_VERDICT, int32], 0]
|
||||
} [align_ptr]
|
||||
|
||||
ip6t_entry_underflow_matches {
|
||||
ipv6 ip6t_ip6_uncond
|
||||
nfcache const[0, int32]
|
||||
target_offset len[parent, int16]
|
||||
next_offset len[ip6t_entry_underflow, int16]
|
||||
comefrom const[0, int32]
|
||||
counters xt_counters
|
||||
}
|
||||
|
||||
ip6t_ip6_or_uncond [
|
||||
ipv6 ip6t_ip6
|
||||
uncond ip6t_ip6_uncond
|
||||
]
|
||||
|
||||
type ip6t_ip6_uncond array[const[0, int8], IP6T_IP6_SIZE]
|
||||
define IP6T_IP6_SIZE sizeof(struct ip6t_ip6)
|
||||
|
||||
ip6t_ip6 {
|
||||
src ipv6_addr
|
||||
dst ipv6_addr
|
||||
smsk ipv6_addr_mask
|
||||
dmsk ipv6_addr_mask
|
||||
iniface devname
|
||||
outiface devname
|
||||
iniface_mask devname_mask
|
||||
outiface_mask devname_mask
|
||||
proto flags[ipv6_types, int16]
|
||||
tos int8
|
||||
flags flags[ip6t_ip6_flags, int8]
|
||||
invflags flags[ip6t_ip6_invflags, int8]
|
||||
}
|
||||
|
||||
ip6t_ip6_flags = IP6T_F_PROTO, IP6T_F_TOS, IP6T_F_GOTO
|
||||
ip6t_ip6_invflags = IP6T_INV_VIA_IN, IP6T_INV_VIA_OUT, IP6T_INV_TOS, IP6T_INV_SRCIP, IP6T_INV_DSTIP, IP6T_INV_FRAG, IP6T_INV_PROTO
|
||||
|
||||
# MATCHES:
|
||||
|
||||
ipt6_matches [
|
||||
unspec xt_unspec_matches
|
||||
icmp6 xt_entry_match["icmp6", ip6t_icmp, 0]
|
||||
rt xt_entry_match["rt", ip6t_rt, 0]
|
||||
mh xt_entry_match["mh", ip6t_mh, 0]
|
||||
hbh xt_entry_match["hbh", ip6t_opts, 0]
|
||||
dst xt_entry_match["dst", ip6t_opts, 0]
|
||||
frag xt_entry_match["frag", ip6t_frag, 0]
|
||||
eui64 xt_entry_match["eui64", const[0, int32], 0]
|
||||
ah xt_entry_match["ah", ip6t_ah, 0]
|
||||
ipv6header xt_entry_match["ipv6header", ip6t_ipv6header_info, 0]
|
||||
hl xt_entry_match["hl", ipt_ttl_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ip6t_filter_matches [
|
||||
common ipt6_matches
|
||||
] [varlen]
|
||||
|
||||
ip6t_nat_matches [
|
||||
common ipt6_matches
|
||||
] [varlen]
|
||||
|
||||
ip6t_mangle_matches [
|
||||
common ipt6_matches
|
||||
unspec xt_unspec_mangle_matches
|
||||
] [varlen]
|
||||
|
||||
ip6t_raw_matches [
|
||||
common ipt6_matches
|
||||
unspec xt_unspec_raw_matches
|
||||
] [varlen]
|
||||
|
||||
ip6t_security_matches [
|
||||
common ipt6_matches
|
||||
] [varlen]
|
||||
|
||||
ip6t_icmp {
|
||||
type flags[icmp_types, int8]
|
||||
code_min int8
|
||||
code_max int8
|
||||
invflags bool8
|
||||
}
|
||||
|
||||
ip6t_rt {
|
||||
rt_type int32
|
||||
segsleft_min int32
|
||||
segsleft_max int32
|
||||
hdrlen int32
|
||||
flags flags[ip6t_rt_flags, int8]
|
||||
invflags flags[ip6t_rt_invflags, int8]
|
||||
addrs array[ipv6_addr, IP6T_RT_HOPS]
|
||||
addrnr int8[0:IP6T_RT_HOPS]
|
||||
}
|
||||
|
||||
ip6t_rt_flags = IP6T_RT_TYP, IP6T_RT_SGS, IP6T_RT_LEN, IP6T_RT_RES, IP6T_RT_FST_MASK, IP6T_RT_FST, IP6T_RT_FST_NSTRICT
|
||||
ip6t_rt_invflags = IP6T_RT_INV_TYP, IP6T_RT_INV_SGS, IP6T_RT_INV_LEN
|
||||
|
||||
ip6t_mh {
|
||||
types_min int8
|
||||
types_max int8
|
||||
invflags bool8
|
||||
}
|
||||
|
||||
ip6t_opts {
|
||||
hdrlen int32
|
||||
flags flags[ip6t_opts_flags, int8]
|
||||
invflags flags[ip6t_opts_invflags, int8]
|
||||
opts array[int16, IP6T_OPTS_OPTSNR]
|
||||
optsnr int8[0:IP6T_OPTS_OPTSNR]
|
||||
}
|
||||
|
||||
ip6t_opts_flags = IP6T_OPTS_LEN, IP6T_OPTS_OPTS, IP6T_OPTS_NSTRICT
|
||||
ip6t_opts_invflags = IP6T_OPTS_INV_LEN
|
||||
|
||||
ip6t_frag {
|
||||
ids_min int32
|
||||
ids_max int32
|
||||
hdrlen int32
|
||||
flags flags[ip6t_frag_flags, int8]
|
||||
invflags flags[ip6t_frag_invflags, int8]
|
||||
}
|
||||
|
||||
ip6t_frag_flags = IP6T_FRAG_IDS, IP6T_FRAG_LEN, IP6T_FRAG_RES, IP6T_FRAG_FST, IP6T_FRAG_MF, IP6T_FRAG_NMF
|
||||
ip6t_frag_invflags = IP6T_FRAG_INV_IDS, IP6T_FRAG_INV_LEN
|
||||
|
||||
ip6t_ipv6header_info {
|
||||
matchflags flags[ip6t_ipv6header_flags, int8]
|
||||
invflags flags[ip6t_ipv6header_flags, int8]
|
||||
modeflag bool8
|
||||
}
|
||||
|
||||
ip6t_ipv6header_flags = MASK_HOPOPTS, MASK_DSTOPTS, MASK_ROUTING, MASK_FRAGMENT, MASK_AH, MASK_ESP, MASK_NONE, MASK_PROTO
|
||||
|
||||
ip6t_ah {
|
||||
spis_min xfrm_spi
|
||||
spis_max xfrm_spi
|
||||
hdrlen int32
|
||||
hdrres int8
|
||||
invflags flags[ip6t_ah_flags, int8]
|
||||
}
|
||||
|
||||
ip6t_ah_flags = IP6T_AH_INV_SPI, IP6T_AH_INV_LEN
|
||||
|
||||
# TARGETS:
|
||||
|
||||
ip6t_targets [
|
||||
unspec xt_unspec_targets
|
||||
] [varlen]
|
||||
|
||||
ip6t_filter_targets [
|
||||
common ip6t_targets
|
||||
REJECT xt_target_t["REJECT", ip6t_reject_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ip6t_nat_targets [
|
||||
common ip6t_targets
|
||||
NETMAP xt_target_t["NETMAP", nf_nat_range, 0]
|
||||
REDIRECT xt_target_t["REDIRECT", nf_nat_range, 0]
|
||||
MASQUERADE xt_target_t["MASQUERADE", nf_nat_range, 0]
|
||||
] [varlen]
|
||||
|
||||
ip6t_mangle_targets [
|
||||
common ip6t_targets
|
||||
unspec xt_unspec_mangle_targets
|
||||
SNPT xt_target_t["SNPT", ip6t_npt_tginfo, 0]
|
||||
DNPT xt_target_t["DNPT", ip6t_npt_tginfo, 0]
|
||||
HL xt_target_t["HL", ipt_TTL_info, 0]
|
||||
] [varlen]
|
||||
|
||||
ip6t_raw_targets [
|
||||
common ip6t_targets
|
||||
unspec xt_unspec_raw_targets
|
||||
] [varlen]
|
||||
|
||||
ip6t_security_targets [
|
||||
common ip6t_targets
|
||||
] [varlen]
|
||||
|
||||
ip6t_reject_info {
|
||||
with flags[ip6t_reject_with, int32]
|
||||
}
|
||||
|
||||
ip6t_reject_with = IP6T_ICMP6_NO_ROUTE, IP6T_ICMP6_ADM_PROHIBITED, IP6T_ICMP6_NOT_NEIGHBOUR, IP6T_ICMP6_ADDR_UNREACH, IP6T_ICMP6_PORT_UNREACH, IP6T_ICMP6_ECHOREPLY, IP6T_TCP_RESET, IP6T_ICMP6_POLICY_FAIL, IP6T_ICMP6_REJECT_ROUTE
|
||||
|
||||
ip6t_npt_tginfo {
|
||||
src_pfx nf_inet_addr
|
||||
dst_pfx nf_inet_addr
|
||||
src_pfx_len int8[0:64]
|
||||
dst_pfx_len int8[0:64]
|
||||
adjustment int16
|
||||
}
|
59
sys/linux/netfilter_ipv6_386.const
Normal file
59
sys/linux/netfilter_ipv6_386.const
Normal file
@ -0,0 +1,59 @@
|
||||
# AUTOGENERATED FILE
|
||||
IP6T_AH_INV_LEN = 2
|
||||
IP6T_AH_INV_SPI = 1
|
||||
IP6T_FRAG_FST = 8
|
||||
IP6T_FRAG_IDS = 1
|
||||
IP6T_FRAG_INV_IDS = 1
|
||||
IP6T_FRAG_INV_LEN = 2
|
||||
IP6T_FRAG_LEN = 2
|
||||
IP6T_FRAG_MF = 16
|
||||
IP6T_FRAG_NMF = 32
|
||||
IP6T_FRAG_RES = 4
|
||||
IP6T_F_GOTO = 4
|
||||
IP6T_F_PROTO = 1
|
||||
IP6T_F_TOS = 2
|
||||
IP6T_ICMP6_ADDR_UNREACH = 3
|
||||
IP6T_ICMP6_ADM_PROHIBITED = 1
|
||||
IP6T_ICMP6_ECHOREPLY = 5
|
||||
IP6T_ICMP6_NOT_NEIGHBOUR = 2
|
||||
IP6T_ICMP6_NO_ROUTE = 0
|
||||
IP6T_ICMP6_POLICY_FAIL = 7
|
||||
IP6T_ICMP6_PORT_UNREACH = 4
|
||||
IP6T_ICMP6_REJECT_ROUTE = 8
|
||||
IP6T_INV_DSTIP = 16
|
||||
IP6T_INV_FRAG = 32
|
||||
IP6T_INV_PROTO = 64
|
||||
IP6T_INV_SRCIP = 8
|
||||
IP6T_INV_TOS = 4
|
||||
IP6T_INV_VIA_IN = 1
|
||||
IP6T_INV_VIA_OUT = 2
|
||||
IP6T_IP6_SIZE = 136
|
||||
IP6T_OPTS_INV_LEN = 1
|
||||
IP6T_OPTS_LEN = 1
|
||||
IP6T_OPTS_NSTRICT = 4
|
||||
IP6T_OPTS_OPTS = 2
|
||||
IP6T_OPTS_OPTSNR = 16
|
||||
IP6T_RT_FST = 16
|
||||
IP6T_RT_FST_MASK = 48
|
||||
IP6T_RT_FST_NSTRICT = 32
|
||||
IP6T_RT_HOPS = 16
|
||||
IP6T_RT_INV_LEN = 4
|
||||
IP6T_RT_INV_SGS = 2
|
||||
IP6T_RT_INV_TYP = 1
|
||||
IP6T_RT_LEN = 4
|
||||
IP6T_RT_RES = 8
|
||||
IP6T_RT_SGS = 2
|
||||
IP6T_RT_TYP = 1
|
||||
IP6T_SO_SET_REPLACE = 64
|
||||
IP6T_TCP_RESET = 6
|
||||
MASK_AH = 8
|
||||
MASK_DSTOPTS = 64
|
||||
MASK_ESP = 4
|
||||
MASK_FRAGMENT = 16
|
||||
MASK_HOPOPTS = 128
|
||||
MASK_NONE = 2
|
||||
MASK_PROTO = 1
|
||||
MASK_ROUTING = 32
|
||||
SOL_IPV6 = 41
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 366
|
59
sys/linux/netfilter_ipv6_amd64.const
Normal file
59
sys/linux/netfilter_ipv6_amd64.const
Normal file
@ -0,0 +1,59 @@
|
||||
# AUTOGENERATED FILE
|
||||
IP6T_AH_INV_LEN = 2
|
||||
IP6T_AH_INV_SPI = 1
|
||||
IP6T_FRAG_FST = 8
|
||||
IP6T_FRAG_IDS = 1
|
||||
IP6T_FRAG_INV_IDS = 1
|
||||
IP6T_FRAG_INV_LEN = 2
|
||||
IP6T_FRAG_LEN = 2
|
||||
IP6T_FRAG_MF = 16
|
||||
IP6T_FRAG_NMF = 32
|
||||
IP6T_FRAG_RES = 4
|
||||
IP6T_F_GOTO = 4
|
||||
IP6T_F_PROTO = 1
|
||||
IP6T_F_TOS = 2
|
||||
IP6T_ICMP6_ADDR_UNREACH = 3
|
||||
IP6T_ICMP6_ADM_PROHIBITED = 1
|
||||
IP6T_ICMP6_ECHOREPLY = 5
|
||||
IP6T_ICMP6_NOT_NEIGHBOUR = 2
|
||||
IP6T_ICMP6_NO_ROUTE = 0
|
||||
IP6T_ICMP6_POLICY_FAIL = 7
|
||||
IP6T_ICMP6_PORT_UNREACH = 4
|
||||
IP6T_ICMP6_REJECT_ROUTE = 8
|
||||
IP6T_INV_DSTIP = 16
|
||||
IP6T_INV_FRAG = 32
|
||||
IP6T_INV_PROTO = 64
|
||||
IP6T_INV_SRCIP = 8
|
||||
IP6T_INV_TOS = 4
|
||||
IP6T_INV_VIA_IN = 1
|
||||
IP6T_INV_VIA_OUT = 2
|
||||
IP6T_IP6_SIZE = 136
|
||||
IP6T_OPTS_INV_LEN = 1
|
||||
IP6T_OPTS_LEN = 1
|
||||
IP6T_OPTS_NSTRICT = 4
|
||||
IP6T_OPTS_OPTS = 2
|
||||
IP6T_OPTS_OPTSNR = 16
|
||||
IP6T_RT_FST = 16
|
||||
IP6T_RT_FST_MASK = 48
|
||||
IP6T_RT_FST_NSTRICT = 32
|
||||
IP6T_RT_HOPS = 16
|
||||
IP6T_RT_INV_LEN = 4
|
||||
IP6T_RT_INV_SGS = 2
|
||||
IP6T_RT_INV_TYP = 1
|
||||
IP6T_RT_LEN = 4
|
||||
IP6T_RT_RES = 8
|
||||
IP6T_RT_SGS = 2
|
||||
IP6T_RT_TYP = 1
|
||||
IP6T_SO_SET_REPLACE = 64
|
||||
IP6T_TCP_RESET = 6
|
||||
MASK_AH = 8
|
||||
MASK_DSTOPTS = 64
|
||||
MASK_ESP = 4
|
||||
MASK_FRAGMENT = 16
|
||||
MASK_HOPOPTS = 128
|
||||
MASK_NONE = 2
|
||||
MASK_PROTO = 1
|
||||
MASK_ROUTING = 32
|
||||
SOL_IPV6 = 41
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 54
|
59
sys/linux/netfilter_ipv6_arm.const
Normal file
59
sys/linux/netfilter_ipv6_arm.const
Normal file
@ -0,0 +1,59 @@
|
||||
# AUTOGENERATED FILE
|
||||
IP6T_AH_INV_LEN = 2
|
||||
IP6T_AH_INV_SPI = 1
|
||||
IP6T_FRAG_FST = 8
|
||||
IP6T_FRAG_IDS = 1
|
||||
IP6T_FRAG_INV_IDS = 1
|
||||
IP6T_FRAG_INV_LEN = 2
|
||||
IP6T_FRAG_LEN = 2
|
||||
IP6T_FRAG_MF = 16
|
||||
IP6T_FRAG_NMF = 32
|
||||
IP6T_FRAG_RES = 4
|
||||
IP6T_F_GOTO = 4
|
||||
IP6T_F_PROTO = 1
|
||||
IP6T_F_TOS = 2
|
||||
IP6T_ICMP6_ADDR_UNREACH = 3
|
||||
IP6T_ICMP6_ADM_PROHIBITED = 1
|
||||
IP6T_ICMP6_ECHOREPLY = 5
|
||||
IP6T_ICMP6_NOT_NEIGHBOUR = 2
|
||||
IP6T_ICMP6_NO_ROUTE = 0
|
||||
IP6T_ICMP6_POLICY_FAIL = 7
|
||||
IP6T_ICMP6_PORT_UNREACH = 4
|
||||
IP6T_ICMP6_REJECT_ROUTE = 8
|
||||
IP6T_INV_DSTIP = 16
|
||||
IP6T_INV_FRAG = 32
|
||||
IP6T_INV_PROTO = 64
|
||||
IP6T_INV_SRCIP = 8
|
||||
IP6T_INV_TOS = 4
|
||||
IP6T_INV_VIA_IN = 1
|
||||
IP6T_INV_VIA_OUT = 2
|
||||
IP6T_IP6_SIZE = 136
|
||||
IP6T_OPTS_INV_LEN = 1
|
||||
IP6T_OPTS_LEN = 1
|
||||
IP6T_OPTS_NSTRICT = 4
|
||||
IP6T_OPTS_OPTS = 2
|
||||
IP6T_OPTS_OPTSNR = 16
|
||||
IP6T_RT_FST = 16
|
||||
IP6T_RT_FST_MASK = 48
|
||||
IP6T_RT_FST_NSTRICT = 32
|
||||
IP6T_RT_HOPS = 16
|
||||
IP6T_RT_INV_LEN = 4
|
||||
IP6T_RT_INV_SGS = 2
|
||||
IP6T_RT_INV_TYP = 1
|
||||
IP6T_RT_LEN = 4
|
||||
IP6T_RT_RES = 8
|
||||
IP6T_RT_SGS = 2
|
||||
IP6T_RT_TYP = 1
|
||||
IP6T_SO_SET_REPLACE = 64
|
||||
IP6T_TCP_RESET = 6
|
||||
MASK_AH = 8
|
||||
MASK_DSTOPTS = 64
|
||||
MASK_ESP = 4
|
||||
MASK_FRAGMENT = 16
|
||||
MASK_HOPOPTS = 128
|
||||
MASK_NONE = 2
|
||||
MASK_PROTO = 1
|
||||
MASK_ROUTING = 32
|
||||
SOL_IPV6 = 41
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 294
|
59
sys/linux/netfilter_ipv6_arm64.const
Normal file
59
sys/linux/netfilter_ipv6_arm64.const
Normal file
@ -0,0 +1,59 @@
|
||||
# AUTOGENERATED FILE
|
||||
IP6T_AH_INV_LEN = 2
|
||||
IP6T_AH_INV_SPI = 1
|
||||
IP6T_FRAG_FST = 8
|
||||
IP6T_FRAG_IDS = 1
|
||||
IP6T_FRAG_INV_IDS = 1
|
||||
IP6T_FRAG_INV_LEN = 2
|
||||
IP6T_FRAG_LEN = 2
|
||||
IP6T_FRAG_MF = 16
|
||||
IP6T_FRAG_NMF = 32
|
||||
IP6T_FRAG_RES = 4
|
||||
IP6T_F_GOTO = 4
|
||||
IP6T_F_PROTO = 1
|
||||
IP6T_F_TOS = 2
|
||||
IP6T_ICMP6_ADDR_UNREACH = 3
|
||||
IP6T_ICMP6_ADM_PROHIBITED = 1
|
||||
IP6T_ICMP6_ECHOREPLY = 5
|
||||
IP6T_ICMP6_NOT_NEIGHBOUR = 2
|
||||
IP6T_ICMP6_NO_ROUTE = 0
|
||||
IP6T_ICMP6_POLICY_FAIL = 7
|
||||
IP6T_ICMP6_PORT_UNREACH = 4
|
||||
IP6T_ICMP6_REJECT_ROUTE = 8
|
||||
IP6T_INV_DSTIP = 16
|
||||
IP6T_INV_FRAG = 32
|
||||
IP6T_INV_PROTO = 64
|
||||
IP6T_INV_SRCIP = 8
|
||||
IP6T_INV_TOS = 4
|
||||
IP6T_INV_VIA_IN = 1
|
||||
IP6T_INV_VIA_OUT = 2
|
||||
IP6T_IP6_SIZE = 136
|
||||
IP6T_OPTS_INV_LEN = 1
|
||||
IP6T_OPTS_LEN = 1
|
||||
IP6T_OPTS_NSTRICT = 4
|
||||
IP6T_OPTS_OPTS = 2
|
||||
IP6T_OPTS_OPTSNR = 16
|
||||
IP6T_RT_FST = 16
|
||||
IP6T_RT_FST_MASK = 48
|
||||
IP6T_RT_FST_NSTRICT = 32
|
||||
IP6T_RT_HOPS = 16
|
||||
IP6T_RT_INV_LEN = 4
|
||||
IP6T_RT_INV_SGS = 2
|
||||
IP6T_RT_INV_TYP = 1
|
||||
IP6T_RT_LEN = 4
|
||||
IP6T_RT_RES = 8
|
||||
IP6T_RT_SGS = 2
|
||||
IP6T_RT_TYP = 1
|
||||
IP6T_SO_SET_REPLACE = 64
|
||||
IP6T_TCP_RESET = 6
|
||||
MASK_AH = 8
|
||||
MASK_DSTOPTS = 64
|
||||
MASK_ESP = 4
|
||||
MASK_FRAGMENT = 16
|
||||
MASK_HOPOPTS = 128
|
||||
MASK_NONE = 2
|
||||
MASK_PROTO = 1
|
||||
MASK_ROUTING = 32
|
||||
SOL_IPV6 = 41
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 208
|
59
sys/linux/netfilter_ipv6_ppc64le.const
Normal file
59
sys/linux/netfilter_ipv6_ppc64le.const
Normal file
@ -0,0 +1,59 @@
|
||||
# AUTOGENERATED FILE
|
||||
IP6T_AH_INV_LEN = 2
|
||||
IP6T_AH_INV_SPI = 1
|
||||
IP6T_FRAG_FST = 8
|
||||
IP6T_FRAG_IDS = 1
|
||||
IP6T_FRAG_INV_IDS = 1
|
||||
IP6T_FRAG_INV_LEN = 2
|
||||
IP6T_FRAG_LEN = 2
|
||||
IP6T_FRAG_MF = 16
|
||||
IP6T_FRAG_NMF = 32
|
||||
IP6T_FRAG_RES = 4
|
||||
IP6T_F_GOTO = 4
|
||||
IP6T_F_PROTO = 1
|
||||
IP6T_F_TOS = 2
|
||||
IP6T_ICMP6_ADDR_UNREACH = 3
|
||||
IP6T_ICMP6_ADM_PROHIBITED = 1
|
||||
IP6T_ICMP6_ECHOREPLY = 5
|
||||
IP6T_ICMP6_NOT_NEIGHBOUR = 2
|
||||
IP6T_ICMP6_NO_ROUTE = 0
|
||||
IP6T_ICMP6_POLICY_FAIL = 7
|
||||
IP6T_ICMP6_PORT_UNREACH = 4
|
||||
IP6T_ICMP6_REJECT_ROUTE = 8
|
||||
IP6T_INV_DSTIP = 16
|
||||
IP6T_INV_FRAG = 32
|
||||
IP6T_INV_PROTO = 64
|
||||
IP6T_INV_SRCIP = 8
|
||||
IP6T_INV_TOS = 4
|
||||
IP6T_INV_VIA_IN = 1
|
||||
IP6T_INV_VIA_OUT = 2
|
||||
IP6T_IP6_SIZE = 136
|
||||
IP6T_OPTS_INV_LEN = 1
|
||||
IP6T_OPTS_LEN = 1
|
||||
IP6T_OPTS_NSTRICT = 4
|
||||
IP6T_OPTS_OPTS = 2
|
||||
IP6T_OPTS_OPTSNR = 16
|
||||
IP6T_RT_FST = 16
|
||||
IP6T_RT_FST_MASK = 48
|
||||
IP6T_RT_FST_NSTRICT = 32
|
||||
IP6T_RT_HOPS = 16
|
||||
IP6T_RT_INV_LEN = 4
|
||||
IP6T_RT_INV_SGS = 2
|
||||
IP6T_RT_INV_TYP = 1
|
||||
IP6T_RT_LEN = 4
|
||||
IP6T_RT_RES = 8
|
||||
IP6T_RT_SGS = 2
|
||||
IP6T_RT_TYP = 1
|
||||
IP6T_SO_SET_REPLACE = 64
|
||||
IP6T_TCP_RESET = 6
|
||||
MASK_AH = 8
|
||||
MASK_DSTOPTS = 64
|
||||
MASK_ESP = 4
|
||||
MASK_FRAGMENT = 16
|
||||
MASK_HOPOPTS = 128
|
||||
MASK_NONE = 2
|
||||
MASK_PROTO = 1
|
||||
MASK_ROUTING = 32
|
||||
SOL_IPV6 = 41
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 339
|
@ -1,22 +1,186 @@
|
||||
# AUTOGENERATED FILE
|
||||
IPPROTO_IP = 0
|
||||
IPT_F_FRAG = 1
|
||||
IPT_F_GOTO = 2
|
||||
IPT_INV_DSTIP = 16
|
||||
IPT_INV_FRAG = 32
|
||||
IPT_INV_PROTO = 64
|
||||
IPT_INV_SRCIP = 8
|
||||
IPT_INV_TOS = 4
|
||||
IPT_INV_VIA_IN = 1
|
||||
IPT_INV_VIA_OUT = 2
|
||||
IPT_SO_SET_REPLACE = 64
|
||||
IPRANGE_DST = 2
|
||||
IPRANGE_DST_INV = 32
|
||||
IPRANGE_SRC = 1
|
||||
IPRANGE_SRC_INV = 16
|
||||
IPS_ASSURED = 4
|
||||
IPS_CONFIRMED = 8
|
||||
IPS_DST_NAT = 32
|
||||
IPS_DST_NAT_DONE = 256
|
||||
IPS_DYING = 512
|
||||
IPS_EXPECTED = 1
|
||||
IPS_FIXED_TIMEOUT = 1024
|
||||
IPS_HELPER = 8192
|
||||
IPS_SEEN_REPLY = 2
|
||||
IPS_SEQ_ADJUST = 64
|
||||
IPS_SRC_NAT = 16
|
||||
IPS_SRC_NAT_DONE = 128
|
||||
IPS_TEMPLATE = 2048
|
||||
IPS_UNTRACKED = 4096
|
||||
IPT_FILTER_VALID_HOOKS = 14
|
||||
IPT_MANGLE_VALID_HOOKS = 31
|
||||
IPT_NAT_VALID_HOOKS = 27
|
||||
IPT_RAW_VALID_HOOKS = 9
|
||||
IPT_SECURITY_VALID_HOOKS = 14
|
||||
IP_VS_CONN_F_FWD_MASK = 7
|
||||
NAME_MAX = 255
|
||||
NFACCT_NAME_MAX = 32
|
||||
NF_INET_FORWARD_BIT = 4
|
||||
NF_INET_LOCAL_IN_BIT = 2
|
||||
NF_INET_LOCAL_OUT_BIT = 8
|
||||
NF_INET_NUMHOOKS = 5
|
||||
NF_INET_NUMHOOKS_BIT = 32
|
||||
NF_INET_POST_ROUTING_BIT = 16
|
||||
NF_INET_PRE_ROUTING_BIT = 1
|
||||
PATH_MAX = 4096
|
||||
SCTP_CHUNK_MATCH_ALL = 2
|
||||
SCTP_CHUNK_MATCH_ANY = 1
|
||||
SCTP_CHUNK_MATCH_ONLY = 4
|
||||
XT_ADDRTYPE_ANYCAST = 16
|
||||
XT_ADDRTYPE_BLACKHOLE = 64
|
||||
XT_ADDRTYPE_BROADCAST = 8
|
||||
XT_ADDRTYPE_INVERT_DEST = 2
|
||||
XT_ADDRTYPE_INVERT_SOURCE = 1
|
||||
XT_ADDRTYPE_LIMIT_IFACE_IN = 4
|
||||
XT_ADDRTYPE_LIMIT_IFACE_OUT = 8
|
||||
XT_ADDRTYPE_LOCAL = 4
|
||||
XT_ADDRTYPE_MULTICAST = 32
|
||||
XT_ADDRTYPE_NAT = 1024
|
||||
XT_ADDRTYPE_PROHIBIT = 256
|
||||
XT_ADDRTYPE_THROW = 512
|
||||
XT_ADDRTYPE_UNICAST = 2
|
||||
XT_ADDRTYPE_UNREACHABLE = 128
|
||||
XT_ADDRTYPE_UNSPEC = 1
|
||||
XT_ADDRTYPE_XRESOLVE = 2048
|
||||
XT_BPF_MAX_NUM_INSTR = 64
|
||||
XT_BPF_MODE_BYTECODE = 0
|
||||
XT_BPF_MODE_FD_ELF = 2
|
||||
XT_BPF_MODE_FD_PINNED = 1
|
||||
XT_BPF_PATH_MAX = 512
|
||||
XT_CONNBYTES_AVGPKT = 2
|
||||
XT_CONNBYTES_BYTES = 1
|
||||
XT_CONNBYTES_DIR_BOTH = 2
|
||||
XT_CONNBYTES_DIR_ORIGINAL = 0
|
||||
XT_CONNBYTES_DIR_REPLY = 1
|
||||
XT_CONNBYTES_PKTS = 0
|
||||
XT_CONNLABEL_OP_INVERT = 1
|
||||
XT_CONNLABEL_OP_SET = 2
|
||||
XT_CONNLIMIT_DADDR = 2
|
||||
XT_CONNLIMIT_INVERT = 1
|
||||
XT_CONNTRACK_DIRECTION = 4096
|
||||
XT_CONNTRACK_EXPIRES = 128
|
||||
XT_CONNTRACK_ORIGDST = 8
|
||||
XT_CONNTRACK_ORIGDST_PORT = 512
|
||||
XT_CONNTRACK_ORIGSRC = 4
|
||||
XT_CONNTRACK_ORIGSRC_PORT = 256
|
||||
XT_CONNTRACK_PROTO = 2
|
||||
XT_CONNTRACK_REPLDST = 32
|
||||
XT_CONNTRACK_REPLDST_PORT = 2048
|
||||
XT_CONNTRACK_REPLSRC = 16
|
||||
XT_CONNTRACK_REPLSRC_PORT = 1024
|
||||
XT_CONNTRACK_STATE = 1
|
||||
XT_CONNTRACK_STATE_ALIAS = 8192
|
||||
XT_CONNTRACK_STATE_DNAT = 128
|
||||
XT_CONNTRACK_STATE_INVALID = 1
|
||||
XT_CONNTRACK_STATE_SNAT = 64
|
||||
XT_CONNTRACK_STATE_UNTRACKED = 256
|
||||
XT_CONNTRACK_STATUS = 64
|
||||
XT_DCCP_DEST_PORTS = 2
|
||||
XT_DCCP_OPTION = 8
|
||||
XT_DCCP_SRC_PORTS = 1
|
||||
XT_DCCP_TYPE = 4
|
||||
XT_DEVGROUP_INVERT_DST = 8
|
||||
XT_DEVGROUP_INVERT_SRC = 2
|
||||
XT_DEVGROUP_MATCH_DST = 4
|
||||
XT_DEVGROUP_MATCH_SRC = 1
|
||||
XT_ECN_OP_MATCH_CWR = 32
|
||||
XT_ECN_OP_MATCH_ECE = 16
|
||||
XT_ECN_OP_MATCH_IP = 1
|
||||
XT_ESP_INV_MASK = 1
|
||||
XT_ESP_INV_SPI = 1
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_TABLE_MAXNAMELEN = 32
|
||||
__NR_setsockopt = 339
|
||||
XT_HASHLIMIT_BYTES = 32
|
||||
XT_HASHLIMIT_HASH_DIP = 1
|
||||
XT_HASHLIMIT_HASH_DPT = 2
|
||||
XT_HASHLIMIT_HASH_SIP = 4
|
||||
XT_HASHLIMIT_HASH_SPT = 8
|
||||
XT_HASHLIMIT_INVERT = 16
|
||||
XT_HASHLIMIT_RATE_MATCH = 64
|
||||
XT_IPCOMP_INV_MASK = 1
|
||||
XT_IPCOMP_INV_SPI = 1
|
||||
XT_IPVS_DIR = 16
|
||||
XT_IPVS_IPVS_PROPERTY = 1
|
||||
XT_IPVS_METHOD = 32
|
||||
XT_IPVS_PROTO = 2
|
||||
XT_IPVS_VADDR = 4
|
||||
XT_IPVS_VPORT = 8
|
||||
XT_L2TP_SID = 2
|
||||
XT_L2TP_TID = 1
|
||||
XT_L2TP_TYPE = 8
|
||||
XT_L2TP_TYPE_CONTROL = 0
|
||||
XT_L2TP_TYPE_DATA = 1
|
||||
XT_L2TP_VERSION = 4
|
||||
XT_MAX_COMMENT_LEN = 256
|
||||
XT_MULTI_PORTS = 15
|
||||
XT_NUM_SCTP_FLAGS = 4
|
||||
XT_OWNER_GID = 2
|
||||
XT_OWNER_SOCKET = 4
|
||||
XT_OWNER_UID = 1
|
||||
XT_PHYSDEV_OP_BRIDGED = 4
|
||||
XT_PHYSDEV_OP_IN = 1
|
||||
XT_PHYSDEV_OP_ISIN = 8
|
||||
XT_PHYSDEV_OP_ISOUT = 16
|
||||
XT_PHYSDEV_OP_OUT = 2
|
||||
XT_POLICY_MATCH_IN = 1
|
||||
XT_POLICY_MATCH_NONE = 4
|
||||
XT_POLICY_MATCH_OUT = 2
|
||||
XT_POLICY_MATCH_STRICT = 8
|
||||
XT_POLICY_MAX_ELEM = 4
|
||||
XT_POLICY_MODE_TRANSPORT = 0
|
||||
XT_POLICY_MODE_TUNNEL = 1
|
||||
XT_RATEEST_MATCH_ABS = 2
|
||||
XT_RATEEST_MATCH_BPS = 16
|
||||
XT_RATEEST_MATCH_DELTA = 8
|
||||
XT_RATEEST_MATCH_EQ = 1
|
||||
XT_RATEEST_MATCH_GT = 3
|
||||
XT_RATEEST_MATCH_INVERT = 1
|
||||
XT_RATEEST_MATCH_LT = 2
|
||||
XT_RATEEST_MATCH_NONE = 0
|
||||
XT_RATEEST_MATCH_PPS = 32
|
||||
XT_RATEEST_MATCH_REL = 4
|
||||
XT_RECENT_CHECK = 1
|
||||
XT_RECENT_DEST = 1
|
||||
XT_RECENT_NAME_LEN = 200
|
||||
XT_RECENT_REAP = 32
|
||||
XT_RECENT_REMOVE = 8
|
||||
XT_RECENT_SET = 2
|
||||
XT_RECENT_SOURCE = 0
|
||||
XT_RECENT_TTL = 16
|
||||
XT_RECENT_UPDATE = 4
|
||||
XT_RPFILTER_ACCEPT_LOCAL = 4
|
||||
XT_RPFILTER_INVERT = 8
|
||||
XT_RPFILTER_LOOSE = 1
|
||||
XT_RPFILTER_VALID_MARK = 2
|
||||
XT_SCTP_CHUNK_TYPES = 4
|
||||
XT_SCTP_DEST_PORTS = 2
|
||||
XT_SCTP_SRC_PORTS = 1
|
||||
XT_SOCKET_NOWILDCARD = 2
|
||||
XT_SOCKET_RESTORESKMARK = 4
|
||||
XT_SOCKET_TRANSPARENT = 1
|
||||
XT_STRING_FLAG_IGNORECASE = 2
|
||||
XT_STRING_FLAG_INVERT = 1
|
||||
XT_STRING_MAX_ALGO_NAME_SIZE = 16
|
||||
XT_STRING_MAX_PATTERN_SIZE = 128
|
||||
XT_TCP_INV_DSTPT = 2
|
||||
XT_TCP_INV_FLAGS = 4
|
||||
XT_TCP_INV_OPTION = 8
|
||||
XT_TCP_INV_SRCPT = 1
|
||||
XT_TIME_CONTIGUOUS = 2
|
||||
XT_TIME_LOCAL_TZ = 1
|
||||
XT_TIME_MAX_DAYTIME = 86399
|
||||
XT_U32_AND = 0
|
||||
XT_U32_AT = 3
|
||||
XT_U32_LEFTSH = 1
|
||||
XT_U32_REAL_MAXSIZE = 11
|
||||
XT_U32_RIGHTSH = 2
|
||||
XT_UDP_INV_DSTPT = 2
|
||||
XT_UDP_INV_SRCPT = 1
|
||||
|
345
sys/linux/netfilter_targets.txt
Normal file
345
sys/linux/netfilter_targets.txt
Normal file
@ -0,0 +1,345 @@
|
||||
# Copyright 2018 syzkaller project authors. All rights reserved.
|
||||
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
# Netfilter targets shared between ipv6/ipv6.
|
||||
|
||||
include <linux/socket.h>
|
||||
include <uapi/linux/netfilter/ipset/ip_set.h>
|
||||
include <uapi/linux/netfilter/x_tables.h>
|
||||
include <uapi/linux/netfilter/xt_connmark.h>
|
||||
include <uapi/linux/netfilter/nf_nat.h>
|
||||
include <uapi/linux/netfilter/xt_set.h>
|
||||
include <uapi/linux/netfilter/xt_mark.h>
|
||||
include <uapi/linux/netfilter/xt_TEE.h>
|
||||
include <uapi/linux/netfilter/xt_LED.h>
|
||||
include <uapi/linux/netfilter/xt_TCPMSS.h>
|
||||
include <uapi/linux/netfilter/xt_RATEEST.h>
|
||||
include <uapi/linux/netfilter/xt_DSCP.h>
|
||||
include <uapi/linux/netfilter/xt_CLASSIFY.h>
|
||||
include <uapi/linux/netfilter/xt_IDLETIMER.h>
|
||||
include <uapi/linux/netfilter/xt_TCPOPTSTRIP.h>
|
||||
include <uapi/linux/netfilter/xt_NFQUEUE.h>
|
||||
include <uapi/linux/netfilter/xt_CT.h>
|
||||
include <uapi/linux/netfilter/xt_AUDIT.h>
|
||||
include <uapi/linux/netfilter/xt_HMARK.h>
|
||||
include <uapi/linux/netfilter/xt_TPROXY.h>
|
||||
include <uapi/linux/netfilter/xt_CHECKSUM.h>
|
||||
include <uapi/linux/netfilter/xt_CONNSECMARK.h>
|
||||
include <uapi/linux/netfilter/xt_SECMARK.h>
|
||||
include <uapi/linux/netfilter/xt_NFLOG.h>
|
||||
include <uapi/linux/netfilter/xt_LOG.h>
|
||||
include <uapi/linux/netfilter/xt_SYNPROXY.h>
|
||||
|
||||
type xt_target_t[NAME, DATA, REV] {
|
||||
target_size len[parent, int16]
|
||||
name string[NAME, XT_EXTENSION_MAXNAMELEN]
|
||||
revision const[REV, int8]
|
||||
data DATA
|
||||
} [align_ptr]
|
||||
|
||||
xt_unspec_targets [
|
||||
STANDARD xt_target_t["", flags[nf_verdicts, int32], 0]
|
||||
ERROR xt_target_t["ERROR", array[int8, XT_FUNCTION_MAXNAMELEN], 0]
|
||||
TEE xt_target_t["TEE", xt_tee_tginfo, 1]
|
||||
LED xt_target_t["LED", xt_led_info, 0]
|
||||
TCPMSS xt_target_t["TCPMSS", xt_tcpmss_info, 0]
|
||||
RATEEST xt_target_t["RATEEST", xt_rateest_target_info, 0]
|
||||
NFQUEUE0 xt_target_t["NFQUEUE", xt_NFQ_info, 0]
|
||||
NFQUEUE1 xt_target_t["NFQUEUE", xt_NFQ_info_v1, 1]
|
||||
NFQUEUE2 xt_target_t["NFQUEUE", xt_NFQ_info_v3, 2]
|
||||
NFQUEUE3 xt_target_t["NFQUEUE", xt_NFQ_info_v3, 3]
|
||||
CLASSIFY xt_target_t["CLASSIFY", xt_classify_target_info, 0]
|
||||
IDLETIMER xt_target_t["IDLETIMER", idletimer_tg_info, 0]
|
||||
TCPOPTSTRIP xt_target_t["TCPOPTSTRIP", xt_tcpoptstrip_target_info, 0]
|
||||
AUDIT xt_target_t["AUDIT", xt_audit_info, 0]
|
||||
HMARK xt_target_t["HMARK", xt_hmark_info, 0]
|
||||
SET1 xt_target_t["SET", xt_set_info_target_v1, 1]
|
||||
SET2 xt_target_t["SET", xt_set_info_target_v2, 2]
|
||||
SET3 xt_target_t["SET", xt_set_info_target_v3, 3]
|
||||
MARK xt_target_t["MARK", xt_mark_tginfo2, 2]
|
||||
LOG xt_target_t["LOG", xt_log_info, 0]
|
||||
CONNSECMARK xt_target_t["CONNSECMARK", xt_connsecmark_target_info, 0]
|
||||
SECMARK xt_target_t["SECMARK", xt_secmark_target_info, 0]
|
||||
NFLOG xt_target_t["NFLOG", xt_nflog_info, 0]
|
||||
CONNMARK xt_target_t["CONNMARK", xt_connmark_tginfo1, 1]
|
||||
SYNPROXY xt_target_t["SYNPROXY", xt_synproxy_info, 0]
|
||||
] [varlen]
|
||||
|
||||
nf_verdicts = 0, NF_DROP_VERDICT, NF_ACCEPT_VERDICT, NF_STOLEN_VERDICT, NF_QUEUE_VERDICT, NF_REPEAT_VERDICT
|
||||
|
||||
define NF_DROP_VERDICT -NF_DROP - 1
|
||||
define NF_ACCEPT_VERDICT -NF_ACCEPT - 1
|
||||
define NF_STOLEN_VERDICT -NF_STOLEN - 1
|
||||
define NF_QUEUE_VERDICT -NF_QUEUE - 1
|
||||
define NF_REPEAT_VERDICT -NF_REPEAT - 1
|
||||
|
||||
xt_unspec_mangle_targets [
|
||||
DSCP xt_target_t["DSCP", xt_DSCP_info, 0]
|
||||
TOS xt_target_t["TOS", xt_tos_target_info, 0]
|
||||
TPROXY1 xt_target_t["TPROXY", xt_tproxy_target_info_v1, 1]
|
||||
CHECKSUM xt_target_t["CHECKSUM", xt_CHECKSUM_info, 0]
|
||||
] [varlen]
|
||||
|
||||
xt_unspec_raw_targets [
|
||||
TRACE xt_target_t["TRACE", void, 0]
|
||||
CT0 xt_target_t["CT", xt_ct_target_info, 0]
|
||||
CT1 xt_target_t["CT", xt_ct_target_info_v1, 1]
|
||||
CT2 xt_target_t["CT", xt_ct_target_info_v1, 2]
|
||||
NOTRACK xt_target_t["NOTRACK", void, 0]
|
||||
] [varlen]
|
||||
|
||||
xt_tee_tginfo {
|
||||
gw nf_inet_addr
|
||||
# TODO: make it possible to mark strings as opt (empty string), this must be opt:
|
||||
oif devname
|
||||
priv intptr
|
||||
}
|
||||
|
||||
xt_led_info {
|
||||
id string[xt_led_names, 27]
|
||||
always_blink bool8
|
||||
delay int32
|
||||
internal_data intptr
|
||||
}
|
||||
|
||||
xt_led_names = "syz0", "syz1"
|
||||
|
||||
xt_tcpmss_info {
|
||||
mss int16
|
||||
}
|
||||
|
||||
xt_rateest_target_info {
|
||||
name string[xt_rateest_names, IFNAMSIZ]
|
||||
interval int8
|
||||
ewma_log int8
|
||||
est intptr
|
||||
}
|
||||
|
||||
xt_rateest_names = "syz0", "syz1"
|
||||
|
||||
nf_nat_range {
|
||||
flags flags[nf_nat_flags, int32]
|
||||
min_addr nf_inet_addr
|
||||
max_addr nf_inet_addr
|
||||
min_proto nf_conntrack_man_proto
|
||||
max_proto nf_conntrack_man_proto
|
||||
}
|
||||
|
||||
nf_nat_ipv4_multi_range_compat {
|
||||
rangesize const[1, int32]
|
||||
range nf_nat_ipv4_range
|
||||
}
|
||||
|
||||
nf_nat_ipv4_range {
|
||||
flags flags[nf_nat_flags, int32]
|
||||
min_ip ipv4_addr
|
||||
max_ip ipv4_addr
|
||||
min nf_conntrack_man_proto
|
||||
max nf_conntrack_man_proto
|
||||
}
|
||||
|
||||
nf_nat_flags = NF_NAT_RANGE_MAP_IPS, NF_NAT_RANGE_PROTO_SPECIFIED, NF_NAT_RANGE_PROTO_RANDOM, NF_NAT_RANGE_PERSISTENT, NF_NAT_RANGE_PROTO_RANDOM_FULLY
|
||||
|
||||
xt_NFQ_info {
|
||||
queuenum int16
|
||||
}
|
||||
|
||||
xt_NFQ_info_v1 {
|
||||
queuenum int16
|
||||
queues_total int16
|
||||
}
|
||||
|
||||
xt_NFQ_info_v3 {
|
||||
queuenum int16
|
||||
queues_total int16
|
||||
flags flags[xt_NFQ_flags, int16]
|
||||
}
|
||||
|
||||
xt_NFQ_flags = NFQ_FLAG_BYPASS, NFQ_FLAG_CPU_FANOUT
|
||||
|
||||
xt_DSCP_info {
|
||||
dscp int8[0:XT_DSCP_MAX]
|
||||
}
|
||||
|
||||
xt_tos_target_info {
|
||||
tos_value int8
|
||||
tos_mask int8
|
||||
}
|
||||
|
||||
xt_classify_target_info {
|
||||
priority int32
|
||||
}
|
||||
|
||||
idletimer_tg_info {
|
||||
timeout int32
|
||||
label string[idletimer_tg_names, MAX_IDLETIMER_LABEL_SIZE]
|
||||
timer intptr
|
||||
}
|
||||
|
||||
idletimer_tg_names = "syz0", "syz1"
|
||||
|
||||
xt_tcpoptstrip_target_info {
|
||||
strip_bmap array[int32, 8]
|
||||
}
|
||||
|
||||
xt_ct_target_info {
|
||||
flags bool16
|
||||
zone int16
|
||||
ct_events int32
|
||||
exp_events int32
|
||||
helper string[xt_ct_helpers, 16]
|
||||
ct intptr
|
||||
}
|
||||
|
||||
xt_ct_target_info_v1 {
|
||||
flags flags[xt_ct_flags, int16]
|
||||
zone int16
|
||||
ct_events int32
|
||||
exp_events int32
|
||||
helper string[xt_ct_helpers, 16]
|
||||
# TODO: these names must be registered somewhere from netlink.
|
||||
timeout string[xt_ct_timeouts, 32]
|
||||
ct intptr
|
||||
}
|
||||
|
||||
xt_ct_flags = XT_CT_NOTRACK, XT_CT_NOTRACK_ALIAS, XT_CT_ZONE_DIR_ORIG, XT_CT_ZONE_DIR_REPL, XT_CT_ZONE_MARK
|
||||
xt_ct_helpers = "", "snmp_trap", "netbios-ns", "pptp", "snmp"
|
||||
xt_ct_timeouts = "syz0", "syz1"
|
||||
|
||||
xt_audit_info {
|
||||
type flags[xt_audit_flags, int8]
|
||||
}
|
||||
|
||||
xt_audit_flags = XT_AUDIT_TYPE_ACCEPT, XT_AUDIT_TYPE_DROP, XT_AUDIT_TYPE_REJECT
|
||||
|
||||
xt_hmark_info {
|
||||
src_mask nf_inet_addr
|
||||
dst_mask ipv6_addr_mask
|
||||
src_port_mask sock_port
|
||||
dst_port_mask sock_port
|
||||
src_port_set sock_port
|
||||
dst_port_set sock_port
|
||||
flags int32
|
||||
proto_mask int16
|
||||
hashrnd int32
|
||||
hmodulus int32
|
||||
hoffset int32
|
||||
}
|
||||
|
||||
xt_tproxy_target_info {
|
||||
mark_mask int32
|
||||
mark_value int32
|
||||
laddr ipv4_addr
|
||||
lport sock_port
|
||||
}
|
||||
|
||||
xt_tproxy_target_info_v1 {
|
||||
mark_mask int32
|
||||
mark_value int32
|
||||
laddr nf_inet_addr
|
||||
lport sock_port
|
||||
}
|
||||
|
||||
xt_set_info_target_v0 {
|
||||
add_set xt_set_info_v0
|
||||
del_set xt_set_info_v0
|
||||
}
|
||||
|
||||
xt_set_info_target_v1 {
|
||||
add_set xt_set_info
|
||||
del_set xt_set_info
|
||||
}
|
||||
|
||||
xt_set_info_target_v2 {
|
||||
add_set xt_set_info
|
||||
del_set xt_set_info
|
||||
flags int32
|
||||
timeout int32
|
||||
}
|
||||
|
||||
xt_set_info_target_v3 {
|
||||
add_set xt_set_info
|
||||
del_set xt_set_info
|
||||
map_set xt_set_info
|
||||
flags int32
|
||||
timeout int32
|
||||
}
|
||||
|
||||
type ip_set_id_t int16
|
||||
|
||||
xt_set_info_v0 {
|
||||
index ip_set_id_t
|
||||
flags array[int32, IPSET_DIM_MAX]
|
||||
dim int8
|
||||
flags2 int8
|
||||
pad int16
|
||||
}
|
||||
|
||||
xt_set_info {
|
||||
index ip_set_id_t
|
||||
dim int8
|
||||
flags int8
|
||||
}
|
||||
|
||||
ip_set_counter_match0 {
|
||||
op int8
|
||||
value int64
|
||||
}
|
||||
|
||||
ip_set_counter_match {
|
||||
value int64
|
||||
op int8
|
||||
}
|
||||
|
||||
xt_mark_tginfo2 {
|
||||
mark int32
|
||||
mask int32
|
||||
}
|
||||
|
||||
xt_CHECKSUM_info {
|
||||
operation const[XT_CHECKSUM_OP_FILL, int8]
|
||||
}
|
||||
|
||||
xt_log_info {
|
||||
level int8
|
||||
logflags flags[xt_log_flags, int8]
|
||||
prefix array[int8, 30]
|
||||
}
|
||||
|
||||
xt_log_flags = XT_LOG_TCPSEQ, XT_LOG_TCPOPT, XT_LOG_IPOPT, XT_LOG_UID, XT_LOG_NFLOG, XT_LOG_MACDECODE
|
||||
|
||||
xt_connsecmark_target_info {
|
||||
mode int8[1:2]
|
||||
}
|
||||
|
||||
xt_secmark_target_info {
|
||||
mode int8[1:1]
|
||||
secid int32
|
||||
secctx string[selinux_security_context, SECMARK_SECCTX_MAX]
|
||||
}
|
||||
|
||||
xt_nflog_info {
|
||||
len int32
|
||||
group int16
|
||||
threshold int16
|
||||
flags bool16
|
||||
pad const[0, int16]
|
||||
prefix array[int8, 64]
|
||||
}
|
||||
|
||||
xt_connmark_tginfo1 {
|
||||
ctmark int32
|
||||
ctmask int32
|
||||
nfmask int32
|
||||
mode flags[xt_connmark_mode, int8]
|
||||
}
|
||||
|
||||
xt_connmark_mode = XT_CONNMARK_SET, XT_CONNMARK_SAVE, XT_CONNMARK_RESTORE
|
||||
|
||||
xt_synproxy_info {
|
||||
options flags[xt_synproxy_options, int8]
|
||||
wscale int8
|
||||
mss int16
|
||||
}
|
||||
|
||||
xt_synproxy_options = XT_SYNPROXY_OPT_MSS, XT_SYNPROXY_OPT_WSCALE, XT_SYNPROXY_OPT_SACK_PERM, XT_SYNPROXY_OPT_TIMESTAMP, XT_SYNPROXY_OPT_ECN
|
43
sys/linux/netfilter_targets_386.const
Normal file
43
sys/linux/netfilter_targets_386.const
Normal file
@ -0,0 +1,43 @@
|
||||
# AUTOGENERATED FILE
|
||||
IFNAMSIZ = 16
|
||||
IPSET_DIM_MAX = 6
|
||||
MAX_IDLETIMER_LABEL_SIZE = 28
|
||||
NFQ_FLAG_BYPASS = 1
|
||||
NFQ_FLAG_CPU_FANOUT = 2
|
||||
NF_ACCEPT_VERDICT = 18446744073709551614
|
||||
NF_DROP_VERDICT = 18446744073709551615
|
||||
NF_NAT_RANGE_MAP_IPS = 1
|
||||
NF_NAT_RANGE_PERSISTENT = 8
|
||||
NF_NAT_RANGE_PROTO_RANDOM = 4
|
||||
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 16
|
||||
NF_NAT_RANGE_PROTO_SPECIFIED = 2
|
||||
NF_QUEUE_VERDICT = 18446744073709551612
|
||||
NF_REPEAT_VERDICT = 18446744073709551611
|
||||
NF_STOLEN_VERDICT = 18446744073709551613
|
||||
SECMARK_SECCTX_MAX = 256
|
||||
XT_AUDIT_TYPE_ACCEPT = 0
|
||||
XT_AUDIT_TYPE_DROP = 1
|
||||
XT_AUDIT_TYPE_REJECT = 2
|
||||
XT_CHECKSUM_OP_FILL = 1
|
||||
XT_CONNMARK_RESTORE = 2
|
||||
XT_CONNMARK_SAVE = 1
|
||||
XT_CONNMARK_SET = 0
|
||||
XT_CT_NOTRACK = 1
|
||||
XT_CT_NOTRACK_ALIAS = 2
|
||||
XT_CT_ZONE_DIR_ORIG = 4
|
||||
XT_CT_ZONE_DIR_REPL = 8
|
||||
XT_CT_ZONE_MARK = 16
|
||||
XT_DSCP_MAX = 63
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_FUNCTION_MAXNAMELEN = 30
|
||||
XT_LOG_IPOPT = 4
|
||||
XT_LOG_MACDECODE = 32
|
||||
XT_LOG_NFLOG = 16
|
||||
XT_LOG_TCPOPT = 2
|
||||
XT_LOG_TCPSEQ = 1
|
||||
XT_LOG_UID = 8
|
||||
XT_SYNPROXY_OPT_ECN = 16
|
||||
XT_SYNPROXY_OPT_MSS = 1
|
||||
XT_SYNPROXY_OPT_SACK_PERM = 4
|
||||
XT_SYNPROXY_OPT_TIMESTAMP = 8
|
||||
XT_SYNPROXY_OPT_WSCALE = 2
|
43
sys/linux/netfilter_targets_amd64.const
Normal file
43
sys/linux/netfilter_targets_amd64.const
Normal file
@ -0,0 +1,43 @@
|
||||
# AUTOGENERATED FILE
|
||||
IFNAMSIZ = 16
|
||||
IPSET_DIM_MAX = 6
|
||||
MAX_IDLETIMER_LABEL_SIZE = 28
|
||||
NFQ_FLAG_BYPASS = 1
|
||||
NFQ_FLAG_CPU_FANOUT = 2
|
||||
NF_ACCEPT_VERDICT = 18446744073709551614
|
||||
NF_DROP_VERDICT = 18446744073709551615
|
||||
NF_NAT_RANGE_MAP_IPS = 1
|
||||
NF_NAT_RANGE_PERSISTENT = 8
|
||||
NF_NAT_RANGE_PROTO_RANDOM = 4
|
||||
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 16
|
||||
NF_NAT_RANGE_PROTO_SPECIFIED = 2
|
||||
NF_QUEUE_VERDICT = 18446744073709551612
|
||||
NF_REPEAT_VERDICT = 18446744073709551611
|
||||
NF_STOLEN_VERDICT = 18446744073709551613
|
||||
SECMARK_SECCTX_MAX = 256
|
||||
XT_AUDIT_TYPE_ACCEPT = 0
|
||||
XT_AUDIT_TYPE_DROP = 1
|
||||
XT_AUDIT_TYPE_REJECT = 2
|
||||
XT_CHECKSUM_OP_FILL = 1
|
||||
XT_CONNMARK_RESTORE = 2
|
||||
XT_CONNMARK_SAVE = 1
|
||||
XT_CONNMARK_SET = 0
|
||||
XT_CT_NOTRACK = 1
|
||||
XT_CT_NOTRACK_ALIAS = 2
|
||||
XT_CT_ZONE_DIR_ORIG = 4
|
||||
XT_CT_ZONE_DIR_REPL = 8
|
||||
XT_CT_ZONE_MARK = 16
|
||||
XT_DSCP_MAX = 63
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_FUNCTION_MAXNAMELEN = 30
|
||||
XT_LOG_IPOPT = 4
|
||||
XT_LOG_MACDECODE = 32
|
||||
XT_LOG_NFLOG = 16
|
||||
XT_LOG_TCPOPT = 2
|
||||
XT_LOG_TCPSEQ = 1
|
||||
XT_LOG_UID = 8
|
||||
XT_SYNPROXY_OPT_ECN = 16
|
||||
XT_SYNPROXY_OPT_MSS = 1
|
||||
XT_SYNPROXY_OPT_SACK_PERM = 4
|
||||
XT_SYNPROXY_OPT_TIMESTAMP = 8
|
||||
XT_SYNPROXY_OPT_WSCALE = 2
|
43
sys/linux/netfilter_targets_arm.const
Normal file
43
sys/linux/netfilter_targets_arm.const
Normal file
@ -0,0 +1,43 @@
|
||||
# AUTOGENERATED FILE
|
||||
IFNAMSIZ = 16
|
||||
IPSET_DIM_MAX = 6
|
||||
MAX_IDLETIMER_LABEL_SIZE = 28
|
||||
NFQ_FLAG_BYPASS = 1
|
||||
NFQ_FLAG_CPU_FANOUT = 2
|
||||
NF_ACCEPT_VERDICT = 18446744073709551614
|
||||
NF_DROP_VERDICT = 18446744073709551615
|
||||
NF_NAT_RANGE_MAP_IPS = 1
|
||||
NF_NAT_RANGE_PERSISTENT = 8
|
||||
NF_NAT_RANGE_PROTO_RANDOM = 4
|
||||
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 16
|
||||
NF_NAT_RANGE_PROTO_SPECIFIED = 2
|
||||
NF_QUEUE_VERDICT = 18446744073709551612
|
||||
NF_REPEAT_VERDICT = 18446744073709551611
|
||||
NF_STOLEN_VERDICT = 18446744073709551613
|
||||
SECMARK_SECCTX_MAX = 256
|
||||
XT_AUDIT_TYPE_ACCEPT = 0
|
||||
XT_AUDIT_TYPE_DROP = 1
|
||||
XT_AUDIT_TYPE_REJECT = 2
|
||||
XT_CHECKSUM_OP_FILL = 1
|
||||
XT_CONNMARK_RESTORE = 2
|
||||
XT_CONNMARK_SAVE = 1
|
||||
XT_CONNMARK_SET = 0
|
||||
XT_CT_NOTRACK = 1
|
||||
XT_CT_NOTRACK_ALIAS = 2
|
||||
XT_CT_ZONE_DIR_ORIG = 4
|
||||
XT_CT_ZONE_DIR_REPL = 8
|
||||
XT_CT_ZONE_MARK = 16
|
||||
XT_DSCP_MAX = 63
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_FUNCTION_MAXNAMELEN = 30
|
||||
XT_LOG_IPOPT = 4
|
||||
XT_LOG_MACDECODE = 32
|
||||
XT_LOG_NFLOG = 16
|
||||
XT_LOG_TCPOPT = 2
|
||||
XT_LOG_TCPSEQ = 1
|
||||
XT_LOG_UID = 8
|
||||
XT_SYNPROXY_OPT_ECN = 16
|
||||
XT_SYNPROXY_OPT_MSS = 1
|
||||
XT_SYNPROXY_OPT_SACK_PERM = 4
|
||||
XT_SYNPROXY_OPT_TIMESTAMP = 8
|
||||
XT_SYNPROXY_OPT_WSCALE = 2
|
43
sys/linux/netfilter_targets_arm64.const
Normal file
43
sys/linux/netfilter_targets_arm64.const
Normal file
@ -0,0 +1,43 @@
|
||||
# AUTOGENERATED FILE
|
||||
IFNAMSIZ = 16
|
||||
IPSET_DIM_MAX = 6
|
||||
MAX_IDLETIMER_LABEL_SIZE = 28
|
||||
NFQ_FLAG_BYPASS = 1
|
||||
NFQ_FLAG_CPU_FANOUT = 2
|
||||
NF_ACCEPT_VERDICT = 18446744073709551614
|
||||
NF_DROP_VERDICT = 18446744073709551615
|
||||
NF_NAT_RANGE_MAP_IPS = 1
|
||||
NF_NAT_RANGE_PERSISTENT = 8
|
||||
NF_NAT_RANGE_PROTO_RANDOM = 4
|
||||
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 16
|
||||
NF_NAT_RANGE_PROTO_SPECIFIED = 2
|
||||
NF_QUEUE_VERDICT = 18446744073709551612
|
||||
NF_REPEAT_VERDICT = 18446744073709551611
|
||||
NF_STOLEN_VERDICT = 18446744073709551613
|
||||
SECMARK_SECCTX_MAX = 256
|
||||
XT_AUDIT_TYPE_ACCEPT = 0
|
||||
XT_AUDIT_TYPE_DROP = 1
|
||||
XT_AUDIT_TYPE_REJECT = 2
|
||||
XT_CHECKSUM_OP_FILL = 1
|
||||
XT_CONNMARK_RESTORE = 2
|
||||
XT_CONNMARK_SAVE = 1
|
||||
XT_CONNMARK_SET = 0
|
||||
XT_CT_NOTRACK = 1
|
||||
XT_CT_NOTRACK_ALIAS = 2
|
||||
XT_CT_ZONE_DIR_ORIG = 4
|
||||
XT_CT_ZONE_DIR_REPL = 8
|
||||
XT_CT_ZONE_MARK = 16
|
||||
XT_DSCP_MAX = 63
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_FUNCTION_MAXNAMELEN = 30
|
||||
XT_LOG_IPOPT = 4
|
||||
XT_LOG_MACDECODE = 32
|
||||
XT_LOG_NFLOG = 16
|
||||
XT_LOG_TCPOPT = 2
|
||||
XT_LOG_TCPSEQ = 1
|
||||
XT_LOG_UID = 8
|
||||
XT_SYNPROXY_OPT_ECN = 16
|
||||
XT_SYNPROXY_OPT_MSS = 1
|
||||
XT_SYNPROXY_OPT_SACK_PERM = 4
|
||||
XT_SYNPROXY_OPT_TIMESTAMP = 8
|
||||
XT_SYNPROXY_OPT_WSCALE = 2
|
43
sys/linux/netfilter_targets_ppc64le.const
Normal file
43
sys/linux/netfilter_targets_ppc64le.const
Normal file
@ -0,0 +1,43 @@
|
||||
# AUTOGENERATED FILE
|
||||
IFNAMSIZ = 16
|
||||
IPSET_DIM_MAX = 6
|
||||
MAX_IDLETIMER_LABEL_SIZE = 28
|
||||
NFQ_FLAG_BYPASS = 1
|
||||
NFQ_FLAG_CPU_FANOUT = 2
|
||||
NF_ACCEPT_VERDICT = 18446744073709551614
|
||||
NF_DROP_VERDICT = 18446744073709551615
|
||||
NF_NAT_RANGE_MAP_IPS = 1
|
||||
NF_NAT_RANGE_PERSISTENT = 8
|
||||
NF_NAT_RANGE_PROTO_RANDOM = 4
|
||||
NF_NAT_RANGE_PROTO_RANDOM_FULLY = 16
|
||||
NF_NAT_RANGE_PROTO_SPECIFIED = 2
|
||||
NF_QUEUE_VERDICT = 18446744073709551612
|
||||
NF_REPEAT_VERDICT = 18446744073709551611
|
||||
NF_STOLEN_VERDICT = 18446744073709551613
|
||||
SECMARK_SECCTX_MAX = 256
|
||||
XT_AUDIT_TYPE_ACCEPT = 0
|
||||
XT_AUDIT_TYPE_DROP = 1
|
||||
XT_AUDIT_TYPE_REJECT = 2
|
||||
XT_CHECKSUM_OP_FILL = 1
|
||||
XT_CONNMARK_RESTORE = 2
|
||||
XT_CONNMARK_SAVE = 1
|
||||
XT_CONNMARK_SET = 0
|
||||
XT_CT_NOTRACK = 1
|
||||
XT_CT_NOTRACK_ALIAS = 2
|
||||
XT_CT_ZONE_DIR_ORIG = 4
|
||||
XT_CT_ZONE_DIR_REPL = 8
|
||||
XT_CT_ZONE_MARK = 16
|
||||
XT_DSCP_MAX = 63
|
||||
XT_EXTENSION_MAXNAMELEN = 29
|
||||
XT_FUNCTION_MAXNAMELEN = 30
|
||||
XT_LOG_IPOPT = 4
|
||||
XT_LOG_MACDECODE = 32
|
||||
XT_LOG_NFLOG = 16
|
||||
XT_LOG_TCPOPT = 2
|
||||
XT_LOG_TCPSEQ = 1
|
||||
XT_LOG_UID = 8
|
||||
XT_SYNPROXY_OPT_ECN = 16
|
||||
XT_SYNPROXY_OPT_MSS = 1
|
||||
XT_SYNPROXY_OPT_SACK_PERM = 4
|
||||
XT_SYNPROXY_OPT_TIMESTAMP = 8
|
||||
XT_SYNPROXY_OPT_WSCALE = 2
|
3455
sys/linux/ppc64le.go
3455
sys/linux/ppc64le.go
File diff suppressed because one or more lines are too long
@ -12,6 +12,7 @@ include <uapi/linux/ipsec.h>
|
||||
resource sock_nl_xfrm[sock_netlink]
|
||||
type xfrm_req_id proc[13567, 8, int32, opt]
|
||||
type xfrm_policy_index proc[7236528, 16, int32, opt]
|
||||
type xfrm_spi proc[1234, 4, int32be]
|
||||
|
||||
socket$nl_xfrm(domain const[AF_NETLINK], type const[SOCK_RAW], proto const[NETLINK_XFRM]) sock_nl_xfrm
|
||||
|
||||
@ -63,7 +64,7 @@ xfrm_usersa_info {
|
||||
|
||||
xfrm_usersa_id {
|
||||
daddr xfrm_address
|
||||
spi proc[1234, 4, int32be]
|
||||
spi xfrm_spi
|
||||
family flags[xfrm_family, int16]
|
||||
proto flags[xfrm_proto, int8]
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ type ipv6_addr_t[LAST] {
|
||||
ipv6_addr_loopback {
|
||||
a0 const[0, int64be]
|
||||
a1 const[1, int64be]
|
||||
} [packed]
|
||||
} [packed, align_4]
|
||||
|
||||
ipv6_addr_ipv4 {
|
||||
a0 array[const[0x0, int8], 10]
|
||||
@ -522,6 +522,8 @@ ipv6_addr [
|
||||
mcast2 ipv6_addr_multicast2
|
||||
]
|
||||
|
||||
type ipv6_addr_mask array[flags[ipv4_addr_mask_vals, int32be], 4]
|
||||
|
||||
# TODO: Describe more types of headers
|
||||
# NEXTHDR_HOP, NEXTHDR_TCP, NEXTHDR_UDP, NEXTHDR_IPV6, NEXTHDR_FRAGMENT, NEXTHDR_GRE, NEXTHDR_ESP, NEXTHDR_AUTH, NEXTHDR_ICMP, NEXTHDR_NONE, NEXTHDR_DEST, NEXTHDR_SCTP, NEXTHDR_MOBILITY
|
||||
# https://tools.ietf.org/html/rfc2402
|
||||
@ -643,6 +645,8 @@ ipv6_tlv_enc_lim {
|
||||
encap_limit int8
|
||||
} [packed]
|
||||
|
||||
# TODO: add ipv6_rt_hdr header.
|
||||
|
||||
ipv6_packet {
|
||||
priority int8:4
|
||||
version const[6, int8:4]
|
||||
@ -885,7 +889,7 @@ icmp_ipv4_header {
|
||||
ecn int8:2
|
||||
dscp int8:6
|
||||
total_len int16be
|
||||
id proc[100, 4, int16be]
|
||||
id icmp_id
|
||||
frag_off int16be
|
||||
ttl int8
|
||||
protocol flags[ipv4_types, int8]
|
||||
@ -899,11 +903,13 @@ icmp_echo_reply_packet {
|
||||
type const[ICMP_ECHOREPLY, int8]
|
||||
code const[0, int8]
|
||||
csum csum[parent, inet, int16be]
|
||||
id int16be
|
||||
id icmp_id
|
||||
seq_num int16be
|
||||
data array[int8]
|
||||
} [packed]
|
||||
|
||||
type icmp_id proc[100, 4, int16be]
|
||||
|
||||
icmp_dest_unreach_codes = ICMP_NET_UNREACH, ICMP_HOST_UNREACH, ICMP_PROT_UNREACH, ICMP_PORT_UNREACH, ICMP_FRAG_NEEDED, ICMP_SR_FAILED, ICMP_NET_UNKNOWN, ICMP_HOST_UNKNOWN, ICMP_HOST_ISOLATED, ICMP_NET_ANO, ICMP_HOST_ANO, ICMP_NET_UNR_TOS, ICMP_HOST_UNR_TOS, ICMP_PKT_FILTERED, ICMP_PREC_VIOLATION, ICMP_PREC_CUTOFF
|
||||
|
||||
icmp_dest_unreach_packet {
|
||||
|
Loading…
Reference in New Issue
Block a user