[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200910211344.3562-25-colomar.6.4.3@gmail.com>
Date: Thu, 10 Sep 2020 23:13:45 +0200
From: Alejandro Colomar <colomar.6.4.3@...il.com>
To: mtk.manpages@...il.com
Cc: linux-man@...r.kernel.org, linux-kernel@...r.kernel.org,
Alejandro Colomar <colomar.6.4.3@...il.com>
Subject: [PATCH 24/24] bpf.2: Add missing headers
I added some headers to reduce the number of warnings.
I found the needed headers by using grep, but maybe some of them
shouldn't be included directly.
The example still has many problems to compile.
Signed-off-by: Alejandro Colomar <colomar.6.4.3@...il.com>
---
man2/bpf.2 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/man2/bpf.2 b/man2/bpf.2
index b45acde76..d26d6a43d 100644
--- a/man2/bpf.2
+++ b/man2/bpf.2
@@ -981,6 +981,18 @@ ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);
* 3. attach prog_fd to raw socket via setsockopt()
* 4. print number of received TCP/UDP packets every second
*/
+#include <assert.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#include <linux/bpf.h>
+#include <linux/if_ether.h>
+#include <linux/in.h>
+#include <linux/ip.h>
+
int
main(int argc, char **argv)
{
--
2.28.0
Powered by blists - more mailing lists