3 [ -n "$INCLUDE_ONLY" ] || {
5 . /lib/functions/network.sh
14 local tunlink ifid mtu zone
15 json_get_vars tunlink ifid mtu zone
17 [ -z "$tunlink" ] && {
18 proto_notify_error "$cfg" NO_TUNLINK
19 proto_block_restart "$cfg"
24 proto_notify_error "$cfg" NO_IFID
25 proto_block_restart "$cfg"
29 ( proto_add_host_dependency "$cfg" '' "$tunlink" )
31 proto_init_update "$cfg" 1
34 json_add_string mode "$mode"
35 json_add_int mtu "${mtu:-1280}"
37 json_add_string link "$tunlink"
39 json_add_object 'data'
40 [ -n "$ifid" ] && json_add_int ifid "$ifid"
46 [ -n "$zone" ] && json_add_string zone "$zone"
49 proto_send_update "$cfg"
52 proto_xfrm_teardown() {
56 proto_xfrm_init_config() {
60 proto_config_add_int "mtu"
61 proto_config_add_string "tunlink"
62 proto_config_add_string "zone"
63 proto_config_add_int "ifid"
67 [ -n "$INCLUDE_ONLY" ] || {
68 [ -f /lib/modules/$(uname -r)/xfrm_interface.ko -o -d /sys/module/xfrm_interface ] && add_protocol xfrm