Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce compiler for pcap filters/cBPF programs to XDP programs #356

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ endif

include version.mk

UTILS := xdp-filter xdp-loader xdp-dump xdp-bench xdp-monitor xdp-trafficgen
UTILS := xdp-filter xdp-loader xdp-dump xdp-bench xdp-monitor xdp-trafficgen \
filterc
SUBDIRS := lib $(UTILS)
.PHONY: check_submodule help clobber distclean clean install test libxdp $(SUBDIRS)

Expand Down
2 changes: 2 additions & 0 deletions filterc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
filterc
tests/test_bpfc
19 changes: 19 additions & 0 deletions filterc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
TOOL_NAME := filterc
USER_TARGETS := filterc
# Just needed for tests
XDP_TARGETS := tests/wrapper_prog
TEST_TARGETS := tests/test_bpfc
TEST_FILE := tests/test-filterc.sh

EXTRA_BUILD := bpfc.o
USER_GEN := $(EXTRA_BUILD)
EXTRA_USER_DEPS := $(USER_GEN)

LIB_DIR = ../lib
USER_LIBS = $(EXTRA_BUILD) -lpcap -lelf

include $(LIB_DIR)/common.mk

$(EXTRA_BUILD): %.o: %.c %.h
$(QUIET_CC)$(CC) -Wall $(CFLAGS) -c $< -o $@
Loading