Add files for swift over UDP.
[swifty.git] / src / libswift_udp / mfold / netclean.default.sh
diff --git a/src/libswift_udp/mfold/netclean.default.sh b/src/libswift_udp/mfold/netclean.default.sh
new file mode 100644 (file)
index 0000000..33d08cc
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Cleans configuration made with netem script.
+if [ ! $EMIF ] ; then
+    exit
+fi
+
+if [ ! $SWFTPORT ]; then
+    exit
+fi
+
+TC="sudo tc "
+CLASSID=$(($SWFTPORT - 9900))
+
+echo cleaning filter and class id 1:$CLASSID from ifb0
+$TC filter del dev ifb0 protocol ip prio 1 handle 800::$CLASSID u32 \
+    flowid 1:$CLASSID
+$TC class del dev ifb0 classid 1:$CLASSID
+
+echo cleaning filter and class id 1:$CLASSID from lo
+$TC filter del dev lo protocol ip prio 1 handle 800::$CLASSID u32 \
+    flowid 1:$CLASSID
+$TC class del dev lo classid 1:$CLASSID
+
+echo cleaning filter and class id 1:$CLASSID from $EMIF
+$TC filter del dev $EMIF protocol ip prio 1 handle 800::$CLASSID u32 \
+    flowid 1:$CLASSID
+$TC class del dev $EMIF classid 1:$CLASSID