aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/fib_lookup.c
blob: c4514dd58c62788c5905595befe2f81dd97bc215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */

#include <linux/types.h>
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include "bpf_tracing_net.h"

struct bpf_fib_lookup fib_params = {};
int fib_lookup_ret = 0;
int lookup_flags = 0;

SEC("tc")
int fib_lookup(struct __sk_buff *skb)
{
	fib_lookup_ret = bpf_fib_lookup(skb, &fib_params, sizeof(fib_params),
					lookup_flags);

	return TC_ACT_SHOT;
}

char _license[] SEC("license") = "GPL";