mirror of https://github.com/aya-rs/aya
integration-test: clang-format C files
parent
bcbb7e08fa
commit
72afd877b5
@ -1,10 +1,9 @@
|
|||||||
|
// clang-format off
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <bpf/bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
SEC("xdp")
|
SEC("xdp")
|
||||||
int xdp_drop(struct xdp_md *ctx)
|
int xdp_drop(struct xdp_md *ctx) { return XDP_DROP; }
|
||||||
{
|
|
||||||
return XDP_DROP;
|
|
||||||
}
|
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
// clang-format off
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <bpf/bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
SEC("xdp")
|
SEC("xdp")
|
||||||
int xdp_pass(struct xdp_md *ctx)
|
int xdp_pass(struct xdp_md *ctx) { return XDP_PASS; }
|
||||||
{
|
|
||||||
return XDP_PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
|
// clang-format off
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <bpf/bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||||
__type(key, __u32);
|
__type(key, __u32);
|
||||||
__type(value, __u64);
|
__type(value, __u64);
|
||||||
__uint(max_entries, 1);
|
__uint(max_entries, 1);
|
||||||
} map_1 SEC(".maps");
|
} map_1 SEC(".maps");
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
__uint(type, BPF_MAP_TYPE_ARRAY);
|
__uint(type, BPF_MAP_TYPE_ARRAY);
|
||||||
__type(key, __u32);
|
__type(key, __u32);
|
||||||
__type(value, __u64);
|
__type(value, __u64);
|
||||||
__uint(max_entries, 1);
|
__uint(max_entries, 1);
|
||||||
} map_2 SEC(".maps");
|
} map_2 SEC(".maps");
|
||||||
|
|
||||||
|
|
||||||
SEC("tracepoint")
|
SEC("tracepoint")
|
||||||
int bpf_prog(void *ctx)
|
int bpf_prog(void *ctx) {
|
||||||
{
|
__u32 key = 0;
|
||||||
__u32 key = 0;
|
__u64 twenty_four = 24;
|
||||||
__u64 twenty_four = 24;
|
__u64 forty_two = 42;
|
||||||
__u64 forty_two = 42;
|
bpf_map_update_elem(&map_1, &key, &twenty_four, BPF_ANY);
|
||||||
bpf_map_update_elem(&map_1, &key, &twenty_four, BPF_ANY);
|
bpf_map_update_elem(&map_2, &key, &forty_two, BPF_ANY);
|
||||||
bpf_map_update_elem(&map_2, &key, &forty_two, BPF_ANY);
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
Loading…
Reference in New Issue