3 [ -n "$INCLUDE_ONLY" ] || {
5 . /lib/functions/network.sh
13 local df ipaddr peeraddr tunlink ttl tos zone mtu
14 json_get_vars df ipaddr peeraddr tunlink ttl tos zone mtu
16 [ -z "$peeraddr" ] && {
17 proto_notify_error "$cfg" "MISSING_ADDRESS"
18 proto_block_restart "$cfg"
22 ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
25 local wanif="$tunlink"
26 if [ -z $wanif ] && ! network_find_wan wanif; then
27 proto_notify_error "$cfg" "NO_WAN_LINK"
31 if ! network_get_ipaddr ipaddr "$wanif"; then
32 proto_notify_error "$cfg" "NO_WAN_LINK"
37 [ -z "$zone" ] && zone="wan"
39 proto_init_update "ipip-$cfg" 1
42 json_add_string mode "ipip"
43 json_add_int mtu "${mtu:-1280}"
44 json_add_int ttl "${ttl:-64}"
45 [ -n "$tos" ] && json_add_string tos "$tos"
46 json_add_string local "$ipaddr"
47 json_add_string remote "$peeraddr"
48 [ -n "$tunlink" ] && json_add_string link "$tunlink"
49 json_add_boolean df "${df:-1}"
54 [ -n "$zone" ] && json_add_string zone "$zone"
57 proto_send_update "$cfg"
60 proto_ipip_teardown() {
64 proto_ipip_init_config() {
68 proto_config_add_int "mtu"
69 proto_config_add_int "ttl"
70 proto_config_add_string "tos"
71 proto_config_add_string "tunlink"
72 proto_config_add_string "zone"
73 proto_config_add_string "ipaddr"
74 proto_config_add_string "peeraddr"
75 proto_config_add_boolean "df"
78 [ -n "$INCLUDE_ONLY" ] || {