Linux Audio

Check our new training course

Loading...
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0
 2#include "vmlinux.h"
 3#include <bpf/bpf_helpers.h>
 4
 5struct {
 6	__uint(type, BPF_MAP_TYPE_SOCKMAP);
 7	__uint(max_entries, 1);
 8	__type(key, __u32);
 9	__type(value, __u64);
10} sock_map SEC(".maps");
11
12SEC("sk_skb")
13int prog_skb_verdict(struct __sk_buff *skb)
14{
15	return SK_PASS;
16}
17
18SEC("sk_msg")
19int prog_skmsg_verdict(struct sk_msg_md *msg)
20{
21	return SK_PASS;
22}
23
24char _license[] SEC("license") = "GPL";
v6.8
 1// SPDX-License-Identifier: GPL-2.0
 2#include "vmlinux.h"
 3#include <bpf/bpf_helpers.h>
 4
 5struct {
 6	__uint(type, BPF_MAP_TYPE_SOCKMAP);
 7	__uint(max_entries, 1);
 8	__type(key, __u32);
 9	__type(value, __u64);
10} sock_map SEC(".maps");
11
12SEC("sk_skb")
13int prog_skb_verdict(struct __sk_buff *skb)
14{
15	return SK_PASS;
16}
17
18SEC("sk_msg")
19int prog_skmsg_verdict(struct sk_msg_md *msg)
20{
21	return SK_PASS;
22}
23
24char _license[] SEC("license") = "GPL";