1 // SPDX-License-Identifier: GPL-2.0 2 #include <vmlinux.h> 3 #include <bpf/bpf_helpers.h> 4 #include "bpf_experimental.h" 5 6 SEC("?fentry") pfentry(void * ctx)7int pfentry(void *ctx) 8 { 9 return 0; 10 } 11 12 SEC("?fentry") throwing_fentry(void * ctx)13int throwing_fentry(void *ctx) 14 { 15 bpf_throw(0); 16 return 0; 17 } 18 exception_cb(u64 cookie)19__noinline int exception_cb(u64 cookie) 20 { 21 return cookie + 64; 22 } 23 24 SEC("?freplace") extension(struct __sk_buff * ctx)25int extension(struct __sk_buff *ctx) 26 { 27 return 0; 28 } 29 30 SEC("?freplace") __exception_cb(exception_cb)31__exception_cb(exception_cb) 32 int throwing_exception_cb_extension(u64 cookie) 33 { 34 bpf_throw(32); 35 return 0; 36 } 37 38 SEC("?freplace") __exception_cb(exception_cb)39__exception_cb(exception_cb) 40 int throwing_extension(struct __sk_buff *ctx) 41 { 42 bpf_throw(64); 43 return 0; 44 } 45 46 SEC("?fexit") pfexit(void * ctx)47int pfexit(void *ctx) 48 { 49 return 0; 50 } 51 52 SEC("?fexit") throwing_fexit(void * ctx)53int throwing_fexit(void *ctx) 54 { 55 bpf_throw(0); 56 return 0; 57 } 58 59 SEC("?fmod_ret") pfmod_ret(void * ctx)60int pfmod_ret(void *ctx) 61 { 62 return 0; 63 } 64 65 SEC("?fmod_ret") throwing_fmod_ret(void * ctx)66int throwing_fmod_ret(void *ctx) 67 { 68 bpf_throw(0); 69 return 0; 70 } 71 72 char _license[] SEC("license") = "GPL"; 73