# Settings for the VPNaaS devstack plugin

# Plugin
VPN_PLUGIN=${VPN_PLUGIN:-"vpnaas"}

# Device driver
IPSEC_PACKAGE=${IPSEC_PACKAGE:-"strongswan"}
NEUTRON_VPNAAS_DEVICE_DRIVER=${NEUTRON_VPNAAS_DEVICE_DRIVER:-"neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec:StrongSwanDriver"}

function _get_service_provider {
     local ipsec_package=$1
     local name driver

     driver="neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver"
     if [ "$ipsec_package" = "libreswan" ]; then
         name="openswan"
     else
         name="strongswan"
     fi
     echo "VPN:${name}:${driver}:default"
}

# Service Driver, default value depends on IPSEC_PACKAGE.
if [ -z "$NEUTRON_VPNAAS_SERVICE_PROVIDER" ]; then
    NEUTRON_VPNAAS_SERVICE_PROVIDER=$(_get_service_provider $IPSEC_PACKAGE)
fi

# Config files
NEUTRON_CONF_DIR=${NEUTRON_CONF_DIR:-"/etc/neutron"}
NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas

NEUTRON_VPNAAS_CONF_FILE=neutron_vpnaas.conf
NEUTRON_VPNAAS_CONF=$NEUTRON_CONF_DIR/$NEUTRON_VPNAAS_CONF_FILE
