-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
135 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rules.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
all: compile | ||
|
||
compile: | ||
python3 ../tools/gen.py rules.default > rules.h | ||
clang -O2 -Wall -Werror -g -target bpf -c funnel.c -o tc_funnel.o | ||
clang -O2 -Wall -Werror -g -target bpf -c unfunnel.c -o tc_unfunnel.o | ||
|
||
clean: | ||
rm -rf *.o || true | ||
rm -rf rules.h || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ip udp dport 2055 actions funnel tcp dport 179 sport 540 | ||
ip udp dport 4739 actions funnel tcp dport 179 sport 540 | ||
ip udp dport 6343 actions funnel tcp dport 179 sport 540 | ||
ip tcp dport 4739 actions funnel tcp dport 179 sport 541 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
ip saddr 192.168.0.2/32 daddr != 10.0.0.2 tcp dport != 179 actions dnat | ||
ip saddr 192.168.0.2/24 daddr 10.0.0.2 udp actions funnel test | ||
ip saddr 192.168.0.2/32 daddr != 10.0.0.2 tcp dport != 179 actions dnat 172.16.0.1 | ||
ip saddr 192.168.0.2/24 daddr 10.0.0.2 udp actions funnel tcp dport 80 sport 70 | ||
ip saddr 192.168.0.2/24 daddr 10.0.0.2 udp actions funnel udp sport 80 dport 70 | ||
ip saddr 192.168.0.2/24 daddr 10.0.0.2 udp actions drop | ||
ip saddr 192.168.1.2/24 daddr 10.0.0.2 udp actions unfunnel tcp |