1*168de023SMartin KaFai Lau // SPDX-License-Identifier: GPL-2.0 2*168de023SMartin KaFai Lau /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ 3*168de023SMartin KaFai Lau 4*168de023SMartin KaFai Lau #include <linux/types.h> 5*168de023SMartin KaFai Lau #include <linux/bpf.h> 6*168de023SMartin KaFai Lau #include <bpf/bpf_helpers.h> 7*168de023SMartin KaFai Lau #include "bpf_tracing_net.h" 8*168de023SMartin KaFai Lau 9*168de023SMartin KaFai Lau struct bpf_fib_lookup fib_params = {}; 10*168de023SMartin KaFai Lau int fib_lookup_ret = 0; 11*168de023SMartin KaFai Lau int lookup_flags = 0; 12*168de023SMartin KaFai Lau 13*168de023SMartin KaFai Lau SEC("tc") fib_lookup(struct __sk_buff * skb)14*168de023SMartin KaFai Lauint fib_lookup(struct __sk_buff *skb) 15*168de023SMartin KaFai Lau { 16*168de023SMartin KaFai Lau fib_lookup_ret = bpf_fib_lookup(skb, &fib_params, sizeof(fib_params), 17*168de023SMartin KaFai Lau lookup_flags); 18*168de023SMartin KaFai Lau 19*168de023SMartin KaFai Lau return TC_ACT_SHOT; 20*168de023SMartin KaFai Lau } 21*168de023SMartin KaFai Lau 22*168de023SMartin KaFai Lau char _license[] SEC("license") = "GPL"; 23