From 5722c47aa3402f1458da9eec332153a454a540b7 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 23 Jul 2018 15:48:44 +0200 Subject: Initial version Working ping back and forth with specified data, and data arrives at the other party. Currently, the server uses nflog to get the pings, which: 1. requires iptables settings to work; 2. buffers and collects messages for a second. Both are suboptimal, and I believe raw sockets can improve on this. --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..84683dd --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +CC = gcc +CFLAGS = -Wall -Wextra -O2 -g -std=c11 -fwrapv + +TARGETS = server client + +SOURCES = $(filter-out $(patsubst %,%.c,$(TARGETS)),$(wildcard *.c)) +OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) + +.PHONY: all clean + +all: $(TARGETS) + +clean: + rm -f $(TARGETS) *.o + + +server: server.o $(OBJECTS) + $(CC) $(CFLAGS) $^ -o $@ -lnetfilter_log + +client: client.o $(OBJECTS) + $(CC) $(CFLAGS) $^ -o $@ + +%.o: %.c $(wildcard *.h) + $(CC) $(CFLAGS) -c -o $@ $< -- cgit v1.2.3-70-g09d2