X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=install.sh;fp=install.sh;h=d93664c4146c92015f0d6b07b40e5a6e3467fd34;hb=fd5a4615a8c2684076a66389fc747be49f3e0b6c;hp=0000000000000000000000000000000000000000;hpb=66e2db182f749072cac361b873dcc35d6377468e;p=flowspec-xdp diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..d93664c --- /dev/null +++ b/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +RULES="$(birdc show route table flowspec4) +$(birdc show route table flowspec6)" + +echo "$RULES" | ./genrules.py --8021q=drop-vlan --v6frag=ignore-parse-if-rule --ihl=drop-options +clang -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -Os -emit-llvm -c xdp.c -o - | llc -march=bpf -filetype=obj -o xdp + +echo "Before unload drop count was:" +./dropcount.sh || echo "Not loaded" + +ip link set "$1" xdp off +ip link set "$1" xdpgeneric off +# Note that sometimes the automated fallback does not work properly so we have to || generic here +ip link set "$1" xdp obj xdp sec xdp_drop || ip link set "$1" xdpgeneric obj xdp sec xdp_drop