File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,9 @@ always-y += hbm_edt_kern.o
178178always-y += xdpsock_kern.o
179179# CONFIG_XDP_LUA
180180always-y += xdplua_map_kern.o
181+ always-y += xdp_ssl_sni_drop_all.o
182+ always-y += xdp_ssl_sni_drop_ebpf.o
183+ always-y += xdp_ssl_sni_drop_lua.o
181184
182185ifeq ($(ARCH ) , arm)
183186# Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
@@ -221,6 +224,7 @@ OPT ?= opt
221224LLVM_DIS ?= llvm-dis
222225LLVM_OBJCOPY ?= llvm-objcopy
223226BTF_PAHOLE ?= pahole
227+ LLVM_READELF ?= llvm-readelf
224228
225229# Detect that we're cross compiling and use the cross compiler
226230ifdef CROSS_COMPILE
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2019-2021 Victor Nogueira <victor.nogueira@ring-0.io>
3+ *
4+ * This program is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU General Public License as
6+ * published by the Free Software Foundation version 2.
7+ *
8+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9+ * kind, whether express or implied; without even the implied warranty
10+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ */
13+ struct sslsni_wrapper {
14+ char sslsni [100 ];
15+ };
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2019-2021 Victor Nogueira <victor.nogueira@ring-0.io>
3+ *
4+ * This program is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU General Public License as
6+ * published by the Free Software Foundation version 2.
7+ *
8+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9+ * kind, whether express or implied; without even the implied warranty
10+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ */
13+ #define KBUILD_MODNAME "foo"
14+
15+ #include <uapi/linux/bpf.h>
16+ #include "bpf_helpers.h"
17+ #include "bpf_endian.h"
18+
19+ struct bpf_map_def SEC ("maps" ) rx_cnt = {
20+ .type = BPF_MAP_TYPE_PERCPU_ARRAY ,
21+ .key_size = sizeof (u32 ),
22+ .value_size = sizeof (long ),
23+ .max_entries = 1 ,
24+ };
25+
26+ SEC ("sslparser" )
27+ int handle_ingress (struct xdp_md * ctx )
28+ {
29+ u32 key_rx = 0 ;
30+ long * cnt ;
31+
32+ cnt = bpf_map_lookup_elem (& rx_cnt , & key_rx );
33+ if (!cnt )
34+ return XDP_PASS ;
35+
36+ (* cnt )++ ;
37+
38+ return XDP_DROP ;
39+ }
40+ char _license [] SEC ("license" ) = "GPL" ;
You can’t perform that action at this time.
0 commit comments