3 [ -n "$INCLUDE_ONLY" ] || {
5 . /lib/functions/network.sh
14 local tunlink ifid mtu zone
15 json_get_vars tunlink ifid mtu zone
17 proto_init_update "$cfg" 1
20 json_add_string mode "$mode"
21 json_add_int mtu "${mtu:-1280}"
23 [ -z "$tunlink" ] && {
24 proto_notify_error "$cfg" NO_TUNLINK
25 proto_block_restart "$cfg"
28 json_add_string link "$tunlink"
31 proto_notify_error "$cfg" NO_IFID
32 proto_block_restart "$cfg"
35 json_add_object 'data'
36 [ -n "$ifid" ] && json_add_int ifid "$ifid"
42 [ -n "$zone" ] && json_add_string zone "$zone"
45 proto_send_update "$cfg"
48 proto_xfrm_teardown() {
52 proto_xfrm_init_config() {
56 proto_config_add_int "mtu"
57 proto_config_add_string "tunlink"
58 proto_config_add_string "zone"
59 proto_config_add_int "ifid"
63 [ -n "$INCLUDE_ONLY" ] || {
64 [ -f /lib/modules/$(uname -r)/xfrm_interface.ko -o -d /sys/module/xfrm_interface ] && add_protocol xfrm