-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/bpf: Refactor some net macros to bpf_tracing_net.h
Refactor bpf_iter_ipv6_route.c and bpf_iter_netlink.c so net macros, originally from various include/linux header files, are moved to a new header file bpf_tracing_net.h. The goal is to improve reuse so networking tracing programs do not need to copy these macros every time they use them. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20200623230817.3988962-1-yhs@fb.com
- Loading branch information
Yonghong Song
authored and
Alexei Starovoitov
committed
Jun 25, 2020
1 parent
84544f5
commit 647b502
Showing
3 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ | ||
#ifndef __BPF_TRACING_NET_H__ | ||
#define __BPF_TRACING_NET_H__ | ||
|
||
#define IFNAMSIZ 16 | ||
|
||
#define RTF_GATEWAY 0x0002 | ||
|
||
#define fib_nh_dev nh_common.nhc_dev | ||
#define fib_nh_gw_family nh_common.nhc_gw_family | ||
#define fib_nh_gw6 nh_common.nhc_gw.ipv6 | ||
|
||
#define sk_rmem_alloc sk_backlog.rmem_alloc | ||
#define sk_refcnt __sk_common.skc_refcnt | ||
|
||
#endif |