mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Merge branch 'test' into qsdk
This commit is contained in:
commit
c307e7cd9f
5 changed files with 114 additions and 44 deletions
|
@ -167,6 +167,7 @@ function wizard_add()
|
||||||
ucic:set("network","wan" .. i .. "_dev","mode","vepa")
|
ucic:set("network","wan" .. i .. "_dev","mode","vepa")
|
||||||
ucic:set("network","wan" .. i .. "_dev","ifname",defif)
|
ucic:set("network","wan" .. i .. "_dev","ifname",defif)
|
||||||
ucic:set("network","wan" .. i .. "_dev","name","wan" .. i)
|
ucic:set("network","wan" .. i .. "_dev","name","wan" .. i)
|
||||||
|
ucic:set("network","wan" .. i .. "_dev","txqueuelen","20")
|
||||||
end
|
end
|
||||||
ucic:set("network","wan" .. i,"ip4table","wan")
|
ucic:set("network","wan" .. i,"ip4table","wan")
|
||||||
if multipath_master then
|
if multipath_master then
|
||||||
|
|
|
@ -250,7 +250,7 @@
|
||||||
<input type="checkbox" name="disableserverhttptest" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disableserverhttptest") == "1" then %>checked<% end %>>
|
<input type="checkbox" name="disableserverhttptest" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disableserverhttptest") == "1" then %>checked<% end %>>
|
||||||
<br />
|
<br />
|
||||||
<div class="cbi-value-description">
|
<div class="cbi-value-description">
|
||||||
<%:Disable HTTP test on Server API in status page%>
|
<%:Disable HTTP test on Server API%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -158,7 +158,7 @@ start_service() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(uci -q get openmptcprouter.settings.sfe_enabled)" = "1" ]; then
|
if [ "$(uci -q get openmptcprouter.settings.sfe_enabled)" = "1" ]; then
|
||||||
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe fast_classifier 2>&1 >/dev/null
|
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe -q fast_classifier 2>&1 >/dev/null
|
||||||
if [ "$(uci -q get openmptcprouter.settings.sfe_bridge)" = "1" ]; then
|
if [ "$(uci -q get openmptcprouter.settings.sfe_bridge)" = "1" ]; then
|
||||||
echo 1 >/sys/fast_classifier/skip_to_bridge_ingress
|
echo 1 >/sys/fast_classifier/skip_to_bridge_ingress
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,15 +6,12 @@
|
||||||
# Released under GPL 3 or later
|
# Released under GPL 3 or later
|
||||||
|
|
||||||
if [ -d "/proc/sys/net/mptcp" ]; then
|
if [ -d "/proc/sys/net/mptcp" ]; then
|
||||||
if [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]; then
|
if ([ -f /proc/sys/net/mptcp/mptcp_enabled ] && [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]) || ([ -f /proc/sys/net/mptcp/enabled ] && [ `cat /proc/sys/net/mptcp/enabled` = 0 ]); then
|
||||||
echo "MPTCP is disabled!"
|
echo "MPTCP is disabled!"
|
||||||
echo "Please set net.mptcp.mptcp_enabled = 1"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Your device don't support multipath-TCP."
|
echo "Your device don't support multipath-TCP."
|
||||||
echo "You have to install the pached kernel to use MPTCP."
|
|
||||||
echo "See http://multipath-tcp.org/ for details"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -23,34 +20,68 @@ case $1 in
|
||||||
echo " Multipath-TCP configuration tool"
|
echo " Multipath-TCP configuration tool"
|
||||||
echo "show/update flags:"
|
echo "show/update flags:"
|
||||||
echo " multipath [device]"
|
echo " multipath [device]"
|
||||||
echo " multipath device {on | off | backup | handover}"
|
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
|
echo " multipath device {on | off | backup }"
|
||||||
|
else
|
||||||
|
echo " multipath device {on | off | signal | backup }"
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
echo "show established conections: -c"
|
echo "show established conections: -c"
|
||||||
echo "show fullmesh info: -f"
|
echo "show fullmesh info: -f"
|
||||||
echo "show kernel config: -k"
|
echo "show kernel config: -k"
|
||||||
|
echo "show MPTCP info: -m"
|
||||||
echo
|
echo
|
||||||
echo "Flag on the device, to enable/disable MPTCP for this interface. The backup-flag"
|
echo "Flag on the device, to enable/disable MPTCP for this interface. The backup-flag"
|
||||||
echo "will allow a subflow to be established across this interface, but only be used"
|
echo "will allow a subflow to be established across this interface, but only be used"
|
||||||
echo "as backup. Handover-flag indicates that his interface is not used at all (even "
|
echo "as backup. Handover-flag indicates that his interface is not used at all (even "
|
||||||
echo "no subflow being established), as long as there are other interfaces available."
|
echo "no subflow being established), as long as there are other interfaces available."
|
||||||
echo "See http://multipath-tcp.org/ for details"
|
|
||||||
echo
|
echo
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
"-c")
|
"-c")
|
||||||
cat /proc/net/mptcp_net/mptcp
|
if [ -f /proc/net/mptcp_net/mptcp ]; then
|
||||||
|
cat /proc/net/mptcp_net/mptcp
|
||||||
|
else
|
||||||
|
ss -M
|
||||||
|
fi
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"-f")
|
"-f")
|
||||||
cat /proc/net/mptcp_fullmesh
|
if [ -f /proc/net/mptcp_fullmesh ]; then
|
||||||
|
cat /proc/net/mptcp_fullmesh
|
||||||
|
else
|
||||||
|
ip mptcp endpoint | grep fullmesh
|
||||||
|
fi
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"-k")
|
"-k")
|
||||||
echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled`
|
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager`
|
echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled`
|
||||||
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum`
|
elif [ -f /proc/sys/net/mptcp/enabled ]; then
|
||||||
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler`
|
echo Enabled: `cat /proc/sys/net/mptcp/enabled`
|
||||||
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries`
|
fi
|
||||||
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug`
|
if [ -f /proc/sys/net/mptcp/mptcp_path_manager ]; then
|
||||||
|
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager`
|
||||||
|
fi
|
||||||
|
if [ -f /proc/sys/net/mptcp/mptcp_checksum ]; then
|
||||||
|
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum`
|
||||||
|
else
|
||||||
|
echo Use checksum: `cat /proc/sys/net/mptcp/checksum_enabled`
|
||||||
|
fi
|
||||||
|
if [ -f /proc/sys/net/mptcp/mptcp_scheduler ]; then
|
||||||
|
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler`
|
||||||
|
fi
|
||||||
|
if [ -f /proc/sys/net/mptcp/mptcp_syn_retries ]; then
|
||||||
|
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries`
|
||||||
|
fi
|
||||||
|
if [ -f /proc/sys/net/mptcp/mptcp_debug ]; then
|
||||||
|
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug`
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
echo See http://multipath-tcp.org/ for details
|
exit 0 ;;
|
||||||
|
"-m")
|
||||||
|
if [ -f /proc/net/mptcp_net/snmp ]; then
|
||||||
|
cat /proc/net/mptcp_net/snmp
|
||||||
|
else
|
||||||
|
nstat -z | grep -i mptcp
|
||||||
|
fi
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
"")
|
"")
|
||||||
for ifpath in /sys/class/net/*; do
|
for ifpath in /sys/class/net/*; do
|
||||||
|
@ -70,33 +101,71 @@ TYPE="$2"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
FLAG_PATH="/sys/class/net/$DEVICE/flags"
|
if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
IFF=`cat $FLAG_PATH`
|
FLAG_PATH="/sys/class/net/$DEVICE/flags"
|
||||||
|
IFF=`cat $FLAG_PATH`
|
||||||
|
|
||||||
IFF_OFF="0x80000"
|
IFF_OFF="0x80000"
|
||||||
IFF_ON="0x00"
|
IFF_ON="0x00"
|
||||||
IFF_BACKUP="0x100000"
|
IFF_BACKUP="0x100000"
|
||||||
IFF_HANDOVER="0x200000"
|
IFF_HANDOVER="0x200000"
|
||||||
IFF_MASK="0x380000"
|
IFF_MASK="0x380000"
|
||||||
|
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
"off") FLAG=$IFF_OFF;;
|
"off") FLAG=$IFF_OFF;;
|
||||||
"on") FLAG=$IFF_ON;;
|
"on") FLAG=$IFF_ON;;
|
||||||
"backup") FLAG=$IFF_BACKUP;;
|
"backup") FLAG=$IFF_BACKUP;;
|
||||||
"handover") FLAG=$IFF_HANDOVER;;
|
"handover") FLAG=$IFF_HANDOVER;;
|
||||||
"")
|
"")
|
||||||
IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))`
|
IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))`
|
||||||
case "$IFF" in
|
case "$IFF" in
|
||||||
$IFF_OFF) echo $DEVICE is deactivated;;
|
$IFF_OFF) echo $DEVICE is deactivated;;
|
||||||
$IFF_ON) echo $DEVICE is in default mode;;
|
$IFF_ON) echo $DEVICE is in default mode;;
|
||||||
$IFF_BACKUP) echo $DEVICE is in backup mode;;
|
$IFF_BACKUP) echo $DEVICE is in backup mode;;
|
||||||
$IFF_HANDOVER) echo $DEVICE is in handover mode;;
|
$IFF_HANDOVER) echo $DEVICE is in handover mode;;
|
||||||
*) echo "Unkown state!" && exit 1;;
|
*) echo "Unkown state!" && exit 1;;
|
||||||
esac
|
esac
|
||||||
exit 0;;
|
exit 0;;
|
||||||
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
||||||
|
else
|
||||||
|
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
|
||||||
|
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
|
||||||
|
IP=$(ifconfig $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||||
|
[ -z "$ID" ] && ID=$(ip mptcp endpoint show | grep "$IP" | awk '{print $3}')
|
||||||
|
RMID=$(ip mptcp endpoint show | grep '::ffff' | awk '{ print $3 }')
|
||||||
|
[ -n "$RMID" ] && ip mptcp endpoint delete id $RMID 2>&1 >/dev/null
|
||||||
|
case $TYPE in
|
||||||
|
"off")
|
||||||
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
|
exit 0;;
|
||||||
|
"on")
|
||||||
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
|
ip mptcp endpoint add $IP dev $DEVICE subflow fullmesh
|
||||||
|
exit 0;;
|
||||||
|
"signal")
|
||||||
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
|
#ip mptcp endpoint add $IP dev $DEVICE signal subflow fullmesh
|
||||||
|
ip mptcp endpoint add $IP dev $DEVICE signal
|
||||||
|
exit 0;;
|
||||||
|
"backup")
|
||||||
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
|
ip mptcp endpoint add $IP dev $DEVICE backup fullmesh
|
||||||
|
exit 0;;
|
||||||
|
"")
|
||||||
|
case "$IFF" in
|
||||||
|
"") echo $DEVICE is deactivated;;
|
||||||
|
"subflow") echo $DEVICE is in default mode;;
|
||||||
|
"backup") echo $DEVICE is in backup mode;;
|
||||||
|
"signal") echo $DEVICE is in signal mode;;
|
||||||
|
"fullmesh") echo $DEVICE is in fullmesh mode;;
|
||||||
|
*) echo "$DEVICE Unkown state!" && exit 1;;
|
||||||
|
esac
|
||||||
|
exit 0;;
|
||||||
|
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ while true; do
|
||||||
config_load openmptcprouter
|
config_load openmptcprouter
|
||||||
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
|
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
|
||||||
if [ "$serverip_ping" = false ]; then
|
if [ "$serverip_ping" = false ]; then
|
||||||
OMR_TRACKER_STATUS="ERROR"
|
#OMR_TRACKER_STATUS="ERROR"
|
||||||
OMR_TRACKER_STATUS_MSG="No access to server API"
|
OMR_TRACKER_STATUS_MSG="No access to server API"
|
||||||
else
|
else
|
||||||
OMR_TRACKER_STATUS_MSG=""
|
OMR_TRACKER_STATUS_MSG=""
|
||||||
|
@ -485,7 +485,7 @@ while true; do
|
||||||
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
|
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
|
||||||
if [ "$serverip_ping" = false ]; then
|
if [ "$serverip_ping" = false ]; then
|
||||||
OMR_TRACKER_STATUS_MSG="No access to server API"
|
OMR_TRACKER_STATUS_MSG="No access to server API"
|
||||||
OMR_TRACKER_STATUS="ERROR"
|
#OMR_TRACKER_STATUS="ERROR"
|
||||||
else
|
else
|
||||||
OMR_TRACKER_STATUS_MSG=""
|
OMR_TRACKER_STATUS_MSG=""
|
||||||
OMR_TRACKER_STATUS="OK"
|
OMR_TRACKER_STATUS="OK"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue