1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2024 Google LLC */
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
#include "../bpf_testmod/bpf_testmod_kfunc.h"
SEC("syscall")
int init_sock(struct init_sock_args *args)
{
bpf_kfunc_init_sock(args);
return 0;
}
SEC("syscall")
int close_sock(void *ctx)
{
bpf_kfunc_close_sock();
return 0;
}
SEC("syscall")
int kernel_connect(struct addr_args *args)
{
return bpf_kfunc_call_kernel_connect(args);
}
SEC("syscall")
int kernel_bind(struct addr_args *args)
{
return bpf_kfunc_call_kernel_bind(args);
}
SEC("syscall")
int kernel_listen(struct addr_args *args)
{
return bpf_kfunc_call_kernel_listen();
}
SEC("syscall")
int kernel_sendmsg(struct sendmsg_args *args)
{
return bpf_kfunc_call_kernel_sendmsg(args);
}
SEC("syscall")
int sock_sendmsg(struct sendmsg_args *args)
{
return bpf_kfunc_call_sock_sendmsg(args);
}
SEC("syscall")
int kernel_getsockname(struct addr_args *args)
{
return bpf_kfunc_call_kernel_getsockname(args);
}
SEC("syscall")
int kernel_getpeername(struct addr_args *args)
{
return bpf_kfunc_call_kernel_getpeername(args);
}
char _license[] SEC("license") = "GPL";
|