forked from OISF/suricata
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add XDP Syncookie program to enable Suricata in af-packet IDS mode to stop host from SYN flooding attack. Signed-off-by: Vincent Li <[email protected]>
- Loading branch information
1 parent
c3b3c11
commit 121fdd2
Showing
8 changed files
with
927 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __VMLINUX_COMMON_H__ | ||
#define __VMLINUX_COMMON_H__ | ||
|
||
enum { | ||
false = 0, | ||
true = 1, | ||
}; | ||
|
||
typedef _Bool bool; | ||
|
||
#endif /* __VMLINUX_COMMON_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef __VMLINUX_NET_H__ | ||
#define __VMLINUX_NET_H__ | ||
|
||
typedef __u32 __wsum; | ||
|
||
struct nf_conn { | ||
unsigned long status; | ||
}; | ||
|
||
enum ip_conntrack_status { | ||
/* Connection is confirmed: originating packet has left box */ | ||
IPS_CONFIRMED_BIT = 3, | ||
IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT), | ||
}; | ||
|
||
#endif /* __VMLINUX_NET_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef __VMLINUX_TYPES_H__ | ||
#define __VMLINUX_TYPES_H__ | ||
|
||
typedef __u8 u8; | ||
typedef __s16 s16; | ||
typedef __u16 u16; | ||
typedef __s32 s32; | ||
typedef __u32 u32; | ||
typedef __s64 s64; | ||
typedef __u64 u64; | ||
|
||
typedef s64 ktime_t; | ||
|
||
#endif /* __VMLINUX_TYPES_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* WARNING: This file shadow vmlinux.h that you can generate yourself | ||
* | ||
* Cmdline to generate vmlinux.h | ||
* bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h | ||
* | ||
* This vmlinux.h shadow contains kernel headers reduced to that were | ||
* needed in this project. | ||
*/ | ||
#ifndef __VMLINUX_H__ | ||
#define __VMLINUX_H__ | ||
|
||
#include <linux/types.h> /* Needed for __uNN in vmlinux/vmlinux_types.h */ | ||
|
||
#ifndef BPF_NO_PRESERVE_ACCESS_INDEX | ||
#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record) | ||
#endif | ||
|
||
#include "vmlinux/vmlinux_types.h" | ||
#include "vmlinux/vmlinux_common.h" | ||
#include "vmlinux/vmlinux_net.h" | ||
|
||
#ifndef BPF_NO_PRESERVE_ACCESS_INDEX | ||
#pragma clang attribute pop | ||
#endif | ||
|
||
#endif /* __VMLINUX_H__ */ |
Oops, something went wrong.