Commit 8d930450 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Alexei Starovoitov

samples: bpf: rename libbpf.h to bpf_insn.h

The libbpf.h file in samples is clashing with libbpf's header.
Since it only includes a subset of filter.h instruction helpers
rename it to bpf_insn.h.  Drop the unnecessary include of bpf/bpf.h.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 2bf3e2ef
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* eBPF mini library */ /* eBPF instruction mini library */
#ifndef __LIBBPF_H #ifndef __BPF_INSN_H
#define __LIBBPF_H #define __BPF_INSN_H
#include <bpf/bpf.h>
struct bpf_insn; struct bpf_insn;
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <bpf/bpf.h> #include <bpf/bpf.h>
#include "libbpf.h" #include "bpf_insn.h"
#define PORT 8888 #define PORT 8888
......
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <bpf/bpf.h>
#include "bpf_insn.h"
#include "bpf_load.h" #include "bpf_load.h"
#include "libbpf.h"
#include "sock_example.h" #include "sock_example.h"
#define BPF_F_PIN (1 << 0) #define BPF_F_PIN (1 << 0)
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/ip.h> #include <linux/ip.h>
#include <stddef.h> #include <stddef.h>
#include "libbpf.h" #include <bpf/bpf.h>
#include "bpf_insn.h"
#include "sock_example.h" #include "sock_example.h"
char bpf_log_buf[BPF_LOG_BUF_SIZE]; char bpf_log_buf[BPF_LOG_BUF_SIZE];
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf.h>
#include "libbpf.h" #include "bpf_insn.h"
enum { enum {
MAP_KEY_PACKETS, MAP_KEY_PACKETS,
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
#include <unistd.h> #include <unistd.h>
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf.h>
#include "libbpf.h" #include "bpf_insn.h"
#include "cgroup_helpers.h" #include "cgroup_helpers.h"
#define FOO "/foo" #define FOO "/foo"
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include <net/if.h> #include <net/if.h>
#include <inttypes.h> #include <inttypes.h>
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf.h>
#include "libbpf.h" #include "bpf_insn.h"
char bpf_log_buf[BPF_LOG_BUF_SIZE]; char bpf_log_buf[BPF_LOG_BUF_SIZE];
......
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <net/if.h> #include <net/if.h>
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf.h>
#include "libbpf.h" #include "bpf_insn.h"
#include "bpf_load.h" #include "bpf_load.h"
static int usage(const char *argv0) static int usage(const char *argv0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment