aboutgitcodelistschat:MatrixIRC
path: root/debug/build.c
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-03-24 16:08:46 +0100
committerAlice Frosi <afrosi@redhat.com>2023-03-24 16:08:46 +0100
commite6562db0423e6019154baf05beb02ff3da02f3bb (patch)
tree07c17ea7d3c193c7cdf6b591422a1e6b7ba22a99 /debug/build.c
parent2e4cab1ff7c9d8db278427d9dca6ccb62619ca18 (diff)
downloadseitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar.gz
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar.bz2
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar.lz
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar.xz
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.tar.zst
seitan-e6562db0423e6019154baf05beb02ff3da02f3bb.zip
Re-arrange repository structure
Diffstat (limited to 'debug/build.c')
-rw-r--r--debug/build.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/debug/build.c b/debug/build.c
new file mode 100644
index 0000000..93ce97b
--- /dev/null
+++ b/debug/build.c
@@ -0,0 +1,33 @@
+#define _GNU_SOURCE
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "filter.h"
+
+struct bpf_call calls[] = {
+ {
+ .name = "connect",
+ .args = { 0, 111, 0, 0, 0, 0 },
+ .check_arg = { false, false, false, false, false, false },
+ },
+};
+
+int main(int argc, char **argv)
+{
+ int ret;
+ if (argc < 2) {
+ perror("missing input file");
+ exit(EXIT_FAILURE);
+ }
+ ret = convert_bpf(argv[1], calls, sizeof(calls) / sizeof(calls[0]),
+ true);
+ if (ret < 0) {
+ perror("converting bpf program");
+ exit(EXIT_FAILURE);
+ }
+ return 0;
+}