mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
update app
This commit is contained in:
parent
b8ec680e11
commit
8836ce80c2
255 changed files with 9752 additions and 23582 deletions
5
6in4/Makefile
Executable file → Normal file
5
6in4/Makefile
Executable file → Normal file
|
@ -1,7 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2010-2015 OpenWrt.org
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# - Added gateway setting
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
@ -10,8 +8,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=6in4
|
||||
PKG_VERSION:=270
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=28
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
|
|
@ -9,6 +9,20 @@
|
|||
init_proto "$@"
|
||||
}
|
||||
|
||||
# Function taken from 6to4 package (6to4.sh), flipped returns
|
||||
test_6in4_rfc1918()
|
||||
{
|
||||
local oIFS="$IFS"; IFS="."; set -- $1; IFS="$oIFS"
|
||||
[ $1 -eq 10 ] && return 1
|
||||
[ $1 -eq 192 ] && [ $2 -eq 168 ] && return 1
|
||||
[ $1 -eq 172 ] && [ $2 -ge 16 ] && [ $2 -le 31 ] && return 1
|
||||
|
||||
# RFC 6598
|
||||
[ $1 -eq 100 ] && [ $2 -ge 64 ] && [ $2 -le 127 ] && return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
proto_6in4_update() {
|
||||
sh -c '
|
||||
timeout=5
|
||||
|
@ -31,8 +45,8 @@ proto_6in4_setup() {
|
|||
local iface="$2"
|
||||
local link="6in4-$cfg"
|
||||
|
||||
local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey gateway
|
||||
json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey gateway
|
||||
local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey
|
||||
json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey
|
||||
json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
|
||||
|
||||
[ -z "$peeraddr" ] && {
|
||||
|
@ -41,7 +55,7 @@ proto_6in4_setup() {
|
|||
return
|
||||
}
|
||||
|
||||
[ -n "$tunlink" ] && ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
|
||||
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
|
||||
|
||||
[ -z "$ipaddr" ] && {
|
||||
local wanif="$tunlink"
|
||||
|
@ -61,15 +75,11 @@ proto_6in4_setup() {
|
|||
[ -n "$ip6addr" ] && {
|
||||
local local6="${ip6addr%%/*}"
|
||||
local mask6="${ip6addr##*/}"
|
||||
[[ "$local6" = "$mask6" ]] && mask6=
|
||||
[ "$local6" = "$mask6" ] && mask6=
|
||||
proto_add_ipv6_address "$local6" "$mask6"
|
||||
proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
|
||||
}
|
||||
|
||||
[ -n "$gateway" ] && {
|
||||
proto_add_ipv6_route "::" 0 "$gateway"
|
||||
}
|
||||
|
||||
for ip6prefix in $ip6prefixes; do
|
||||
proto_add_ipv6_prefix "$ip6prefix"
|
||||
proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
|
||||
|
@ -101,6 +111,11 @@ proto_6in4_setup() {
|
|||
}
|
||||
|
||||
local url="$http://ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid"
|
||||
|
||||
test_6in4_rfc1918 "$ipaddr" && {
|
||||
local url="${url}&myip=${ipaddr}"
|
||||
}
|
||||
|
||||
local try=0
|
||||
local max=3
|
||||
|
||||
|
@ -138,7 +153,6 @@ proto_6in4_init_config() {
|
|||
proto_config_add_string "username"
|
||||
proto_config_add_string "password"
|
||||
proto_config_add_string "updatekey"
|
||||
proto_config_add_string "gateway"
|
||||
proto_config_add_int "mtu"
|
||||
proto_config_add_int "ttl"
|
||||
proto_config_add_string "tos"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue