mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-26 23:50:56 +07:00
e39ec7fc05
* refactor(/docs): rework documentation structure layout * refactor(/docs): update file reference paths * feat(/docs): add English version of other-proxy-protocol.md * refacotr: move docs/templates/ docs/sync/ to hack/ * fix(example.dae|readme): update ref link to adopt new file structure * refactor: rename other-proxy-protocol.md -> proxy-protocols.md * docs(readme): add ref to proxy-protocols.md * feat(/docs): add English version of how-it-works.md * refactor: rename how-it-works; add nav links * fix: fix linting errors * fix: fix linting errors --------- Co-authored-by: earrmouth <43926351+earrmouth@users.noreply.github.com>
30 lines
1.0 KiB
Bash
Executable File
30 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
lan=docker0
|
|
wan=ens192
|
|
|
|
sudo tc qdisc add dev $lan clsact > /dev/null 2>&1
|
|
sudo tc qdisc add dev $wan clsact > /dev/null 2>&1
|
|
|
|
set -ex
|
|
|
|
sudo rm -rf /sys/fs/bpf/tc/globals/*
|
|
|
|
# clang -fno-stack-protector -O2 -g -emit-llvm -c ../../control/kern/tproxy.c -o - | llc -march=bpf -mcpu=v3 -mattr=+alu32 -filetype=obj -o foo.o
|
|
clang -O2 -g -Wall -Werror -c ../../control/kern/tproxy.c -target bpf -D__TARGET_ARCH_x86 -o foo.o
|
|
sudo tc filter del dev $lan ingress
|
|
sudo tc filter del dev $lan egress
|
|
sudo tc filter del dev $wan ingress
|
|
sudo tc filter del dev $wan egress
|
|
|
|
sudo tc filter add dev $lan ingress bpf direct-action obj foo.o sec tc/ingress
|
|
sudo tc filter add dev $lan egress bpf direct-action obj foo.o sec tc/egress
|
|
sudo tc filter add dev $wan ingress bpf direct-action obj foo.o sec tc/wan_ingress
|
|
sudo tc filter add dev $wan egress bpf direct-action obj foo.o sec tc/wan_egress
|
|
|
|
sudo tc filter del dev $lan ingress
|
|
sudo tc filter del dev $lan egress
|
|
sudo tc filter del dev $wan ingress
|
|
sudo tc filter del dev $wan egress
|
|
|
|
exit 0
|